{
  "contractName": "Buffer",
  "abi": [],
  "metadata": "{\"compiler\":{\"version\":\"0.5.8+commit.23d335f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"A library for working with mutable byte buffers in Solidity. * Byte buffers are mutable and expandable, and provide a variety of primitives for writing to them. At any time you can fetch a bytes object containing the current contents of the buffer. The bytes object should not be stored between operations, as it may change due to resizing of the buffer.\",\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@ensdomains/buffer/contracts/Buffer.sol\":\"Buffer\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@ensdomains/buffer/contracts/Buffer.sol\":{\"keccak256\":\"0x1264adbd06f6e05b04539bb225063a988b7fa90343d068de60cdde6cfb6fa92d\",\"urls\":[\"bzzr://8f1cb39e242b73bb7fac1f48bf0380ccccad14f06aae9cf4f87329cc78186122\"]}},\"version\":1}",
  "bytecode": "0x604c6023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a72305820d9bf989cef3ee27766e4a228ac26960245aa7cc6dda309c2c6a6e6bcfa67d6580029",
  "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a72305820d9bf989cef3ee27766e4a228ac26960245aa7cc6dda309c2c6a6e6bcfa67d6580029",
  "sourceMap": "403:10156:21:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24",
  "deployedSourceMap": "403:10156:21:-;;;;;;;;",
  "source": "pragma solidity >0.4.18;\n\n/**\n* @dev A library for working with mutable byte buffers in Solidity.\n*\n* Byte buffers are mutable and expandable, and provide a variety of primitives\n* for writing to them. At any time you can fetch a bytes object containing the\n* current contents of the buffer. The bytes object should not be stored between\n* operations, as it may change due to resizing of the buffer.\n*/\nlibrary Buffer {\n    /**\n    * @dev Represents a mutable buffer. Buffers have a current value (buf) and\n    *      a capacity. The capacity may be longer than the current value, in\n    *      which case it can be extended without the need to allocate more memory.\n    */\n    struct buffer {\n        bytes buf;\n        uint capacity;\n    }\n\n    /**\n    * @dev Initializes a buffer with an initial capacity.\n    * @param buf The buffer to initialize.\n    * @param capacity The number of bytes of space to allocate the buffer.\n    * @return The buffer, for chaining.\n    */\n    function init(buffer memory buf, uint capacity) internal pure returns(buffer memory) {\n        if (capacity % 32 != 0) {\n            capacity += 32 - (capacity % 32);\n        }\n        // Allocate space for the buffer data\n        buf.capacity = capacity;\n        assembly {\n            let ptr := mload(0x40)\n            mstore(buf, ptr)\n            mstore(ptr, 0)\n            mstore(0x40, add(32, add(ptr, capacity)))\n        }\n        return buf;\n    }\n\n    /**\n    * @dev Initializes a new buffer from an existing bytes object.\n    *      Changes to the buffer may mutate the original value.\n    * @param b The bytes object to initialize the buffer with.\n    * @return A new buffer.\n    */\n    function fromBytes(bytes memory b) internal pure returns(buffer memory) {\n        buffer memory buf;\n        buf.buf = b;\n        buf.capacity = b.length;\n        return buf;\n    }\n\n    function resize(buffer memory buf, uint capacity) private pure {\n        bytes memory oldbuf = buf.buf;\n        init(buf, capacity);\n        append(buf, oldbuf);\n    }\n\n    function max(uint a, uint b) private pure returns(uint) {\n        if (a > b) {\n            return a;\n        }\n        return b;\n    }\n\n    /**\n    * @dev Sets buffer length to 0.\n    * @param buf The buffer to truncate.\n    * @return The original buffer, for chaining..\n    */\n    function truncate(buffer memory buf) internal pure returns (buffer memory) {\n        assembly {\n            let bufptr := mload(buf)\n            mstore(bufptr, 0)\n        }\n        return buf;\n    }\n\n    /**\n    * @dev Writes a byte string to a buffer. Resizes if doing so would exceed\n    *      the capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param off The start offset to write to.\n    * @param data The data to append.\n    * @param len The number of bytes to copy.\n    * @return The original buffer, for chaining.\n    */\n    function write(buffer memory buf, uint off, bytes memory data, uint len) internal pure returns(buffer memory) {\n        require(len <= data.length);\n\n        if (off + len > buf.capacity) {\n            resize(buf, max(buf.capacity, len + off) * 2);\n        }\n\n        uint dest;\n        uint src;\n        assembly {\n            // Memory address of the buffer data\n            let bufptr := mload(buf)\n            // Length of existing buffer data\n            let buflen := mload(bufptr)\n            // Start address = buffer address + offset + sizeof(buffer length)\n            dest := add(add(bufptr, 32), off)\n            // Update buffer length if we're extending it\n            if gt(add(len, off), buflen) {\n                mstore(bufptr, add(len, off))\n            }\n            src := add(data, 32)\n        }\n\n        // Copy word-length chunks while possible\n        for (; len >= 32; len -= 32) {\n            assembly {\n                mstore(dest, mload(src))\n            }\n            dest += 32;\n            src += 32;\n        }\n\n        // Copy remaining bytes\n        uint mask = 256 ** (32 - len) - 1;\n        assembly {\n            let srcpart := and(mload(src), not(mask))\n            let destpart := and(mload(dest), mask)\n            mstore(dest, or(destpart, srcpart))\n        }\n\n        return buf;\n    }\n\n    /**\n    * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n    *      the capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param data The data to append.\n    * @param len The number of bytes to copy.\n    * @return The original buffer, for chaining.\n    */\n    function append(buffer memory buf, bytes memory data, uint len) internal pure returns (buffer memory) {\n        return write(buf, buf.buf.length, data, len);\n    }\n\n    /**\n    * @dev Appends a byte string to a buffer. Resizes if doing so would exceed\n    *      the capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param data The data to append.\n    * @return The original buffer, for chaining.\n    */\n    function append(buffer memory buf, bytes memory data) internal pure returns (buffer memory) {\n        return write(buf, buf.buf.length, data, data.length);\n    }\n\n    /**\n    * @dev Writes a byte to the buffer. Resizes if doing so would exceed the\n    *      capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param off The offset to write the byte at.\n    * @param data The data to append.\n    * @return The original buffer, for chaining.\n    */\n    function writeUint8(buffer memory buf, uint off, uint8 data) internal pure returns(buffer memory) {\n        if (off >= buf.capacity) {\n            resize(buf, buf.capacity * 2);\n        }\n\n        assembly {\n            // Memory address of the buffer data\n            let bufptr := mload(buf)\n            // Length of existing buffer data\n            let buflen := mload(bufptr)\n            // Address = buffer address + sizeof(buffer length) + off\n            let dest := add(add(bufptr, off), 32)\n            mstore8(dest, data)\n            // Update buffer length if we extended it\n            if eq(off, buflen) {\n                mstore(bufptr, add(buflen, 1))\n            }\n        }\n        return buf;\n    }\n\n    /**\n    * @dev Appends a byte to the buffer. Resizes if doing so would exceed the\n    *      capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param data The data to append.\n    * @return The original buffer, for chaining.\n    */\n    function appendUint8(buffer memory buf, uint8 data) internal pure returns(buffer memory) {\n        return writeUint8(buf, buf.buf.length, data);\n    }\n\n    /**\n    * @dev Writes up to 32 bytes to the buffer. Resizes if doing so would\n    *      exceed the capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param off The offset to write at.\n    * @param data The data to append.\n    * @param len The number of bytes to write (left-aligned).\n    * @return The original buffer, for chaining.\n    */\n    function write(buffer memory buf, uint off, bytes32 data, uint len) private pure returns(buffer memory) {\n        if (len + off > buf.capacity) {\n            resize(buf, (len + off) * 2);\n        }\n\n        uint mask = 256 ** len - 1;\n        // Right-align data\n        data = data >> (8 * (32 - len));\n        assembly {\n            // Memory address of the buffer data\n            let bufptr := mload(buf)\n            // Address = buffer address + sizeof(buffer length) + off + len\n            let dest := add(add(bufptr, off), len)\n            mstore(dest, or(and(mload(dest), not(mask)), data))\n            // Update buffer length if we extended it\n            if gt(add(off, len), mload(bufptr)) {\n                mstore(bufptr, add(off, len))\n            }\n        }\n        return buf;\n    }\n\n    /**\n    * @dev Writes a bytes20 to the buffer. Resizes if doing so would exceed the\n    *      capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param off The offset to write at.\n    * @param data The data to append.\n    * @return The original buffer, for chaining.\n    */\n    function writeBytes20(buffer memory buf, uint off, bytes20 data) internal pure returns (buffer memory) {\n        return write(buf, off, bytes32(data), 20);\n    }\n\n    /**\n    * @dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n    *      the capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param data The data to append.\n    * @return The original buffer, for chhaining.\n    */\n    function appendBytes20(buffer memory buf, bytes20 data) internal pure returns (buffer memory) {\n        return write(buf, buf.buf.length, bytes32(data), 20);\n    }\n\n    /**\n    * @dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n    *      the capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param data The data to append.\n    * @return The original buffer, for chaining.\n    */\n    function appendBytes32(buffer memory buf, bytes32 data) internal pure returns (buffer memory) {\n        return write(buf, buf.buf.length, data, 32);\n    }\n\n    /**\n    * @dev Writes an integer to the buffer. Resizes if doing so would exceed\n    *      the capacity of the buffer.\n    * @param buf The buffer to append to.\n    * @param off The offset to write at.\n    * @param data The data to append.\n    * @param len The number of bytes to write (right-aligned).\n    * @return The original buffer, for chaining.\n    */\n    function writeInt(buffer memory buf, uint off, uint data, uint len) private pure returns(buffer memory) {\n        if (len + off > buf.capacity) {\n            resize(buf, (len + off) * 2);\n        }\n\n        uint mask = 256 ** len - 1;\n        assembly {\n            // Memory address of the buffer data\n            let bufptr := mload(buf)\n            // Address = buffer address + off + sizeof(buffer length) + len\n            let dest := add(add(bufptr, off), len)\n            mstore(dest, or(and(mload(dest), not(mask)), data))\n            // Update buffer length if we extended it\n            if gt(add(off, len), mload(bufptr)) {\n                mstore(bufptr, add(off, len))\n            }\n        }\n        return buf;\n    }\n\n    /**\n     * @dev Appends a byte to the end of the buffer. Resizes if doing so would\n     * exceed the capacity of the buffer.\n     * @param buf The buffer to append to.\n     * @param data The data to append.\n     * @return The original buffer.\n     */\n    function appendInt(buffer memory buf, uint data, uint len) internal pure returns(buffer memory) {\n        return writeInt(buf, buf.buf.length, data, len);\n    }\n}\n",
  "sourcePath": "@ensdomains/buffer/contracts/Buffer.sol",
  "ast": {
    "absolutePath": "@ensdomains/buffer/contracts/Buffer.sol",
    "exportedSymbols": {
      "Buffer": [
        4982
      ]
    },
    "id": 4983,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 4513,
        "literals": [
          "solidity",
          ">",
          "0.4",
          ".18"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:21"
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "library",
        "documentation": "@dev A library for working with mutable byte buffers in Solidity.\n* Byte buffers are mutable and expandable, and provide a variety of primitives\nfor writing to them. At any time you can fetch a bytes object containing the\ncurrent contents of the buffer. The bytes object should not be stored between\noperations, as it may change due to resizing of the buffer.",
        "fullyImplemented": true,
        "id": 4982,
        "linearizedBaseContracts": [
          4982
        ],
        "name": "Buffer",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "canonicalName": "Buffer.buffer",
            "id": 4518,
            "members": [
              {
                "constant": false,
                "id": 4515,
                "name": "buf",
                "nodeType": "VariableDeclaration",
                "scope": 4518,
                "src": "702:9:21",
                "stateVariable": false,
                "storageLocation": "default",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes_storage_ptr",
                  "typeString": "bytes"
                },
                "typeName": {
                  "id": 4514,
                  "name": "bytes",
                  "nodeType": "ElementaryTypeName",
                  "src": "702:5:21",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_storage_ptr",
                    "typeString": "bytes"
                  }
                },
                "value": null,
                "visibility": "internal"
              },
              {
                "constant": false,
                "id": 4517,
                "name": "capacity",
                "nodeType": "VariableDeclaration",
                "scope": 4518,
                "src": "721:13:21",
                "stateVariable": false,
                "storageLocation": "default",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                },
                "typeName": {
                  "id": 4516,
                  "name": "uint",
                  "nodeType": "ElementaryTypeName",
                  "src": "721:4:21",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  }
                },
                "value": null,
                "visibility": "internal"
              }
            ],
            "name": "buffer",
            "nodeType": "StructDefinition",
            "scope": 4982,
            "src": "678:63:21",
            "visibility": "public"
          },
          {
            "body": {
              "id": 4552,
              "nodeType": "Block",
              "src": "1063:370:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4531,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4529,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4527,
                        "name": "capacity",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4522,
                        "src": "1077:8:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "%",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 4528,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1088:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      },
                      "src": "1077:13:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 4530,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "1094:1:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "1077:18:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4542,
                  "nodeType": "IfStatement",
                  "src": "1073:81:21",
                  "trueBody": {
                    "id": 4541,
                    "nodeType": "Block",
                    "src": "1097:57:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 4539,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 4532,
                            "name": "capacity",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4522,
                            "src": "1111:8:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 4538,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "3332",
                              "id": 4533,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "1123:2:21",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_32_by_1",
                                "typeString": "int_const 32"
                              },
                              "value": "32"
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "components": [
                                {
                                  "argumentTypes": null,
                                  "commonType": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  },
                                  "id": 4536,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "id": 4534,
                                    "name": "capacity",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 4522,
                                    "src": "1129:8:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "%",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "hexValue": "3332",
                                    "id": 4535,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "1140:2:21",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_32_by_1",
                                      "typeString": "int_const 32"
                                    },
                                    "value": "32"
                                  },
                                  "src": "1129:13:21",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                }
                              ],
                              "id": 4537,
                              "isConstant": false,
                              "isInlineArray": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "TupleExpression",
                              "src": "1128:15:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "1123:20:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "1111:32:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 4540,
                        "nodeType": "ExpressionStatement",
                        "src": "1111:32:21"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4547,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4543,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4520,
                        "src": "1209:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4545,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "1209:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 4546,
                      "name": "capacity",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4522,
                      "src": "1224:8:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1209:23:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 4548,
                  "nodeType": "ExpressionStatement",
                  "src": "1209:23:21"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4520,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1307:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "capacity": {
                        "declaration": 4522,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1386:8:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4549,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let ptr := mload(0x40)\n    mstore(buf, ptr)\n    mstore(ptr, 0)\n    mstore(0x40, add(32, add(ptr, capacity)))\n}",
                  "src": "1242:165:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4550,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4520,
                    "src": "1423:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4526,
                  "id": 4551,
                  "nodeType": "Return",
                  "src": "1416:10:21"
                }
              ]
            },
            "documentation": "@dev Initializes a buffer with an initial capacity.\n@param buf The buffer to initialize.\n@param capacity The number of bytes of space to allocate the buffer.\n@return The buffer, for chaining.",
            "id": 4553,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "init",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4523,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4520,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4553,
                  "src": "992:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4519,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "992:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4522,
                  "name": "capacity",
                  "nodeType": "VariableDeclaration",
                  "scope": 4553,
                  "src": "1011:13:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4521,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1011:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "991:34:21"
            },
            "returnParameters": {
              "id": 4526,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4525,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4553,
                  "src": "1048:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4524,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "1048:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1047:15:21"
            },
            "scope": 4982,
            "src": "978:455:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4578,
              "nodeType": "Block",
              "src": "1748:108:21",
              "statements": [
                {
                  "assignments": [
                    4561
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4561,
                      "name": "buf",
                      "nodeType": "VariableDeclaration",
                      "scope": 4578,
                      "src": "1758:17:21",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                        "typeString": "struct Buffer.buffer"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 4560,
                        "name": "buffer",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 4518,
                        "src": "1758:6:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                          "typeString": "struct Buffer.buffer"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4562,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1758:17:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4567,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4563,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4561,
                        "src": "1785:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4565,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "buf",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4515,
                      "src": "1785:7:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory",
                        "typeString": "bytes memory"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 4566,
                      "name": "b",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4555,
                      "src": "1795:1:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes memory"
                      }
                    },
                    "src": "1785:11:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory",
                      "typeString": "bytes memory"
                    }
                  },
                  "id": 4568,
                  "nodeType": "ExpressionStatement",
                  "src": "1785:11:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4574,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4569,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4561,
                        "src": "1806:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4571,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "1806:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4572,
                        "name": "b",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4555,
                        "src": "1821:1:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 4573,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1821:8:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1806:23:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 4575,
                  "nodeType": "ExpressionStatement",
                  "src": "1806:23:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4576,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4561,
                    "src": "1846:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4559,
                  "id": 4577,
                  "nodeType": "Return",
                  "src": "1839:10:21"
                }
              ]
            },
            "documentation": "@dev Initializes a new buffer from an existing bytes object.\n     Changes to the buffer may mutate the original value.\n@param b The bytes object to initialize the buffer with.\n@return A new buffer.",
            "id": 4579,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "fromBytes",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4556,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4555,
                  "name": "b",
                  "nodeType": "VariableDeclaration",
                  "scope": 4579,
                  "src": "1695:14:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 4554,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1695:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1694:16:21"
            },
            "returnParameters": {
              "id": 4559,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4558,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4579,
                  "src": "1733:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4557,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "1733:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1732:15:21"
            },
            "scope": 4982,
            "src": "1676:180:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4601,
              "nodeType": "Block",
              "src": "1925:104:21",
              "statements": [
                {
                  "assignments": [
                    4587
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4587,
                      "name": "oldbuf",
                      "nodeType": "VariableDeclaration",
                      "scope": 4601,
                      "src": "1935:19:21",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 4586,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "1935:5:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4590,
                  "initialValue": {
                    "argumentTypes": null,
                    "expression": {
                      "argumentTypes": null,
                      "id": 4588,
                      "name": "buf",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4581,
                      "src": "1957:3:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                        "typeString": "struct Buffer.buffer memory"
                      }
                    },
                    "id": 4589,
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "memberName": "buf",
                    "nodeType": "MemberAccess",
                    "referencedDeclaration": 4515,
                    "src": "1957:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1935:29:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4592,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4581,
                        "src": "1979:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4593,
                        "name": "capacity",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4583,
                        "src": "1984:8:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 4591,
                      "name": "init",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4553,
                      "src": "1974:4:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4594,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1974:19:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "id": 4595,
                  "nodeType": "ExpressionStatement",
                  "src": "1974:19:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4597,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4581,
                        "src": "2010:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4598,
                        "name": "oldbuf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4587,
                        "src": "2015:6:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      ],
                      "id": 4596,
                      "name": "append",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4734,
                        4754
                      ],
                      "referencedDeclaration": 4754,
                      "src": "2003:6:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,bytes memory) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4599,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2003:19:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "id": 4600,
                  "nodeType": "ExpressionStatement",
                  "src": "2003:19:21"
                }
              ]
            },
            "documentation": null,
            "id": 4602,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "resize",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4584,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4581,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4602,
                  "src": "1878:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4580,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "1878:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4583,
                  "name": "capacity",
                  "nodeType": "VariableDeclaration",
                  "scope": 4602,
                  "src": "1897:13:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4582,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1897:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1877:34:21"
            },
            "returnParameters": {
              "id": 4585,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1925:0:21"
            },
            "scope": 4982,
            "src": "1862:167:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 4620,
              "nodeType": "Block",
              "src": "2091:78:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4613,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 4611,
                      "name": "a",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4604,
                      "src": "2105:1:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 4612,
                      "name": "b",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4606,
                      "src": "2109:1:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2105:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4617,
                  "nodeType": "IfStatement",
                  "src": "2101:44:21",
                  "trueBody": {
                    "id": 4616,
                    "nodeType": "Block",
                    "src": "2112:33:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 4614,
                          "name": "a",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4604,
                          "src": "2133:1:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "functionReturnParameters": 4610,
                        "id": 4615,
                        "nodeType": "Return",
                        "src": "2126:8:21"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4618,
                    "name": "b",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4606,
                    "src": "2161:1:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 4610,
                  "id": 4619,
                  "nodeType": "Return",
                  "src": "2154:8:21"
                }
              ]
            },
            "documentation": null,
            "id": 4621,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "max",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4607,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4604,
                  "name": "a",
                  "nodeType": "VariableDeclaration",
                  "scope": 4621,
                  "src": "2048:6:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4603,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2048:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4606,
                  "name": "b",
                  "nodeType": "VariableDeclaration",
                  "scope": 4621,
                  "src": "2056:6:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4605,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2056:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2047:16:21"
            },
            "returnParameters": {
              "id": 4610,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4609,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4621,
                  "src": "2085:4:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4608,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2085:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2084:6:21"
            },
            "scope": 4982,
            "src": "2035:134:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 4631,
              "nodeType": "Block",
              "src": "2392:123:21",
              "statements": [
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4623,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "2445:3:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4628,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    mstore(bufptr, 0)\n}",
                  "src": "2402:87:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4629,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4623,
                    "src": "2505:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4627,
                  "id": 4630,
                  "nodeType": "Return",
                  "src": "2498:10:21"
                }
              ]
            },
            "documentation": "@dev Sets buffer length to 0.\n@param buf The buffer to truncate.\n@return The original buffer, for chaining..",
            "id": 4632,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "truncate",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4624,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4623,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4632,
                  "src": "2335:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4622,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "2335:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2334:19:21"
            },
            "returnParameters": {
              "id": 4627,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4626,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4632,
                  "src": "2377:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4625,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "2377:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2376:15:21"
            },
            "scope": 4982,
            "src": "2317:198:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4712,
              "nodeType": "Block",
              "src": "2985:1216:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 4649,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 4646,
                          "name": "len",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4640,
                          "src": "3003:3:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "<=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4647,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4638,
                            "src": "3010:4:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 4648,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "3010:11:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "3003:18:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 4645,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        12911,
                        12912
                      ],
                      "referencedDeclaration": 12911,
                      "src": "2995:7:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 4650,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2995:27:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 4651,
                  "nodeType": "ExpressionStatement",
                  "src": "2995:27:21"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4657,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4654,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4652,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4636,
                        "src": "3037:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4653,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4640,
                        "src": "3043:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3037:9:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4655,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4634,
                        "src": "3049:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4656,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "3049:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3037:24:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4672,
                  "nodeType": "IfStatement",
                  "src": "3033:100:21",
                  "trueBody": {
                    "id": 4671,
                    "nodeType": "Block",
                    "src": "3063:70:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 4659,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4634,
                              "src": "3084:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 4668,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 4661,
                                      "name": "buf",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4634,
                                      "src": "3093:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                        "typeString": "struct Buffer.buffer memory"
                                      }
                                    },
                                    "id": 4662,
                                    "isConstant": false,
                                    "isLValue": true,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "memberName": "capacity",
                                    "nodeType": "MemberAccess",
                                    "referencedDeclaration": 4517,
                                    "src": "3093:12:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 4665,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 4663,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4640,
                                      "src": "3107:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 4664,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4636,
                                      "src": "3113:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "3107:9:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 4660,
                                  "name": "max",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 4621,
                                  "src": "3089:3:21",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 4666,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "3089:28:21",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 4667,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "3120:1:21",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "3089:32:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 4658,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4602,
                            "src": "3077:6:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 4669,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3077:45:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 4670,
                        "nodeType": "ExpressionStatement",
                        "src": "3077:45:21"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    4674
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4674,
                      "name": "dest",
                      "nodeType": "VariableDeclaration",
                      "scope": 4712,
                      "src": "3143:9:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4673,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3143:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4675,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3143:9:21"
                },
                {
                  "assignments": [
                    4677
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4677,
                      "name": "src",
                      "nodeType": "VariableDeclaration",
                      "scope": 4712,
                      "src": "3162:8:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4676,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3162:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4678,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3162:8:21"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4634,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3272:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 4674,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3454:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4640,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3568:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4636,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3573:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4636,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3483:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "src": {
                        "declaration": 4677,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3661:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4640,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3624:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4636,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3629:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 4638,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3672:4:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4679,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    let buflen := mload(bufptr)\n    dest := add(add(bufptr, 32), off)\n    if gt(add(len, off), buflen)\n    {\n        mstore(bufptr, add(len, off))\n    }\n    src := add(data, 32)\n}",
                  "src": "3180:511:21"
                },
                {
                  "body": {
                    "id": 4696,
                    "nodeType": "Block",
                    "src": "3780:136:21",
                    "statements": [
                      {
                        "externalReferences": [
                          {
                            "src": {
                              "declaration": 4677,
                              "isOffset": false,
                              "isSlot": false,
                              "src": "3840:3:21",
                              "valueSize": 1
                            }
                          },
                          {
                            "dest": {
                              "declaration": 4674,
                              "isOffset": false,
                              "isSlot": false,
                              "src": "3828:4:21",
                              "valueSize": 1
                            }
                          }
                        ],
                        "id": 4687,
                        "nodeType": "InlineAssembly",
                        "operations": "{\n    mstore(dest, mload(src))\n}",
                        "src": "3794:65:21"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 4690,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 4688,
                            "name": "dest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4674,
                            "src": "3872:4:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "hexValue": "3332",
                            "id": 4689,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3880:2:21",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_32_by_1",
                              "typeString": "int_const 32"
                            },
                            "value": "32"
                          },
                          "src": "3872:10:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 4691,
                        "nodeType": "ExpressionStatement",
                        "src": "3872:10:21"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 4694,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 4692,
                            "name": "src",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4677,
                            "src": "3896:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "hexValue": "3332",
                            "id": 4693,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3903:2:21",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_32_by_1",
                              "typeString": "int_const 32"
                            },
                            "value": "32"
                          },
                          "src": "3896:9:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 4695,
                        "nodeType": "ExpressionStatement",
                        "src": "3896:9:21"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4682,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 4680,
                      "name": "len",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4640,
                      "src": "3758:3:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "3332",
                      "id": 4681,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "3765:2:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_32_by_1",
                        "typeString": "int_const 32"
                      },
                      "value": "32"
                    },
                    "src": "3758:9:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 4697,
                  "initializationExpression": null,
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 4685,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 4683,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4640,
                        "src": "3769:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "-=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 4684,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3776:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      },
                      "src": "3769:9:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 4686,
                    "nodeType": "ExpressionStatement",
                    "src": "3769:9:21"
                  },
                  "nodeType": "ForStatement",
                  "src": "3751:165:21"
                },
                {
                  "assignments": [
                    4699
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4699,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 4712,
                      "src": "3958:9:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4698,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3958:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4708,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4707,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4705,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 4700,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3970:3:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "components": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 4703,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "3332",
                              "id": 4701,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "3978:2:21",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_32_by_1",
                                "typeString": "int_const 32"
                              },
                              "value": "32"
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 4702,
                              "name": "len",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4640,
                              "src": "3983:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "3978:8:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "id": 4704,
                        "isConstant": false,
                        "isInlineArray": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "TupleExpression",
                        "src": "3977:10:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3970:17:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 4706,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "3990:1:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "3970:21:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3958:33:21"
                },
                {
                  "externalReferences": [
                    {
                      "src": {
                        "declaration": 4677,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4049:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 4699,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4059:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 4674,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4104:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 4699,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4111:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 4674,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4136:4:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4709,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let srcpart := and(mload(src), not(mask))\n    let destpart := and(mload(dest), mask)\n    mstore(dest, or(destpart, srcpart))\n}",
                  "src": "4001:173:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4710,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4634,
                    "src": "4191:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4644,
                  "id": 4711,
                  "nodeType": "Return",
                  "src": "4184:10:21"
                }
              ]
            },
            "documentation": "@dev Writes a byte string to a buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param off The start offset to write to.\n@param data The data to append.\n@param len The number of bytes to copy.\n@return The original buffer, for chaining.",
            "id": 4713,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "write",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4641,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4634,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2890:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4633,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "2890:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4636,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2909:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4635,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2909:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4638,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2919:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 4637,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "2919:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4640,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2938:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4639,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2938:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2889:58:21"
            },
            "returnParameters": {
              "id": 4644,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4643,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2970:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4642,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "2970:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2969:15:21"
            },
            "scope": 4982,
            "src": "2875:1326:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4733,
              "nodeType": "Block",
              "src": "4617:61:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4725,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4715,
                        "src": "4640:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4726,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4715,
                            "src": "4645:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4727,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "4645:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4728,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4645:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4729,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4717,
                        "src": "4661:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4730,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4719,
                        "src": "4667:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 4724,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4713,
                      "src": "4634:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4731,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4634:37:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4723,
                  "id": 4732,
                  "nodeType": "Return",
                  "src": "4627:44:21"
                }
              ]
            },
            "documentation": "@dev Appends a byte string to a buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@param len The number of bytes to copy.\n@return The original buffer, for chaining.",
            "id": 4734,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "append",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4720,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4715,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4734,
                  "src": "4531:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4714,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "4531:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4717,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4734,
                  "src": "4550:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 4716,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4550:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4719,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4734,
                  "src": "4569:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4718,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4569:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4530:48:21"
            },
            "returnParameters": {
              "id": 4723,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4722,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4734,
                  "src": "4602:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4721,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "4602:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4601:15:21"
            },
            "scope": 4982,
            "src": "4515:163:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4753,
              "nodeType": "Block",
              "src": "5038:69:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4744,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4736,
                        "src": "5061:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4745,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4736,
                            "src": "5066:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4746,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "5066:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4747,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5066:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4748,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4738,
                        "src": "5082:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 4749,
                          "name": "data",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4738,
                          "src": "5088:4:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4750,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5088:11:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 4743,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4713,
                      "src": "5055:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4751,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5055:45:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4742,
                  "id": 4752,
                  "nodeType": "Return",
                  "src": "5048:52:21"
                }
              ]
            },
            "documentation": "@dev Appends a byte string to a buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4754,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "append",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4739,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4736,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4754,
                  "src": "4962:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4735,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "4962:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4738,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4754,
                  "src": "4981:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 4737,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4981:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4961:38:21"
            },
            "returnParameters": {
              "id": 4742,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4741,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4754,
                  "src": "5023:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4740,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "5023:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5022:15:21"
            },
            "scope": 4982,
            "src": "4946:161:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4782,
              "nodeType": "Block",
              "src": "5517:617:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4768,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 4765,
                      "name": "off",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4758,
                      "src": "5531:3:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4766,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4756,
                        "src": "5538:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4767,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "5538:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "5531:19:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4778,
                  "nodeType": "IfStatement",
                  "src": "5527:79:21",
                  "trueBody": {
                    "id": 4777,
                    "nodeType": "Block",
                    "src": "5552:54:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 4770,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4756,
                              "src": "5573:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 4774,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 4771,
                                  "name": "buf",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 4756,
                                  "src": "5578:3:21",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                    "typeString": "struct Buffer.buffer memory"
                                  }
                                },
                                "id": 4772,
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "capacity",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 4517,
                                "src": "5578:12:21",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 4773,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "5593:1:21",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "5578:16:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 4769,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4602,
                            "src": "5566:6:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 4775,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5566:29:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 4776,
                        "nodeType": "ExpressionStatement",
                        "src": "5566:29:21"
                      }
                    ]
                  }
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4756,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5708:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4758,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "6023:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4758,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5909:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 4760,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5945:4:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4779,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    let buflen := mload(bufptr)\n    let dest := add(add(bufptr, off), 32)\n    mstore8(dest, data)\n    if eq(off, buflen)\n    {\n        mstore(bufptr, add(buflen, 1))\n    }\n}",
                  "src": "5616:492:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4780,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4756,
                    "src": "6124:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4764,
                  "id": 4781,
                  "nodeType": "Return",
                  "src": "6117:10:21"
                }
              ]
            },
            "documentation": "@dev Writes a byte to the buffer. Resizes if doing so would exceed the\n     capacity of the buffer.\n@param buf The buffer to append to.\n@param off The offset to write the byte at.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4783,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeUint8",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4761,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4756,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4783,
                  "src": "5439:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4755,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "5439:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4758,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4783,
                  "src": "5458:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4757,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5458:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4760,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4783,
                  "src": "5468:10:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 4759,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "5468:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5438:41:21"
            },
            "returnParameters": {
              "id": 4764,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4763,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4783,
                  "src": "5502:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4762,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "5502:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5501:15:21"
            },
            "scope": 4982,
            "src": "5419:715:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4800,
              "nodeType": "Block",
              "src": "6486:61:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4793,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4785,
                        "src": "6514:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4794,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4785,
                            "src": "6519:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4795,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "6519:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4796,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6519:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4797,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4787,
                        "src": "6535:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      ],
                      "id": 4792,
                      "name": "writeUint8",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4783,
                      "src": "6503:10:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_uint8_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,uint8) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4798,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6503:37:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4791,
                  "id": 4799,
                  "nodeType": "Return",
                  "src": "6496:44:21"
                }
              ]
            },
            "documentation": "@dev Appends a byte to the buffer. Resizes if doing so would exceed the\n     capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4801,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendUint8",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4788,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4785,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4801,
                  "src": "6418:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4784,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "6418:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4787,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4801,
                  "src": "6437:10:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 4786,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6437:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6417:31:21"
            },
            "returnParameters": {
              "id": 4791,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4790,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4801,
                  "src": "6471:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4789,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "6471:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6470:15:21"
            },
            "scope": 4982,
            "src": "6397:150:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4855,
              "nodeType": "Block",
              "src": "7024:695:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4819,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4816,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4814,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4809,
                        "src": "7038:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4815,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4805,
                        "src": "7044:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7038:9:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4817,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4803,
                        "src": "7050:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4818,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "7050:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7038:24:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4831,
                  "nodeType": "IfStatement",
                  "src": "7034:83:21",
                  "trueBody": {
                    "id": 4830,
                    "nodeType": "Block",
                    "src": "7064:53:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 4821,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4803,
                              "src": "7085:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 4827,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "components": [
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 4824,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 4822,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4809,
                                      "src": "7091:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 4823,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4805,
                                      "src": "7097:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "7091:9:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "id": 4825,
                                "isConstant": false,
                                "isInlineArray": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "TupleExpression",
                                "src": "7090:11:21",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 4826,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "7104:1:21",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "7090:15:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 4820,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4602,
                            "src": "7078:6:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 4828,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "7078:28:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 4829,
                        "nodeType": "ExpressionStatement",
                        "src": "7078:28:21"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    4833
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4833,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 4855,
                      "src": "7127:9:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4832,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7127:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4839,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4838,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4836,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 4834,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "7139:3:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4835,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4809,
                        "src": "7146:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7139:10:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 4837,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "7152:1:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "7139:14:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7127:26:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4850,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 4840,
                      "name": "data",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4807,
                      "src": "7191:4:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "id": 4849,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4841,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4807,
                        "src": "7198:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": ">>",
                      "rightExpression": {
                        "argumentTypes": null,
                        "components": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 4847,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "38",
                              "id": 4842,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "7207:1:21",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_8_by_1",
                                "typeString": "int_const 8"
                              },
                              "value": "8"
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "*",
                            "rightExpression": {
                              "argumentTypes": null,
                              "components": [
                                {
                                  "argumentTypes": null,
                                  "commonType": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  },
                                  "id": 4845,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "hexValue": "3332",
                                    "id": 4843,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "7212:2:21",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_32_by_1",
                                      "typeString": "int_const 32"
                                    },
                                    "value": "32"
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "-",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "id": 4844,
                                    "name": "len",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 4809,
                                    "src": "7217:3:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "src": "7212:8:21",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                }
                              ],
                              "id": 4846,
                              "isConstant": false,
                              "isInlineArray": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "TupleExpression",
                              "src": "7211:10:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "7207:14:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "id": 4848,
                        "isConstant": false,
                        "isInlineArray": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "TupleExpression",
                        "src": "7206:16:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7198:24:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "7191:31:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 4851,
                  "nodeType": "ExpressionStatement",
                  "src": "7191:31:21"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4803,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7324:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 4833,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7505:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4805,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7445:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4809,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7451:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4805,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7596:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4809,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7601:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 4807,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7513:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4805,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7659:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4809,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7664:3:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4852,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    let dest := add(add(bufptr, off), len)\n    mstore(dest, or(and(mload(dest), not(mask)), data))\n    if gt(add(off, len), mload(bufptr))\n    {\n        mstore(bufptr, add(off, len))\n    }\n}",
                  "src": "7232:461:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4853,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4803,
                    "src": "7709:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4813,
                  "id": 4854,
                  "nodeType": "Return",
                  "src": "7702:10:21"
                }
              ]
            },
            "documentation": "@dev Writes up to 32 bytes to the buffer. Resizes if doing so would\n     exceed the capacity of the buffer.\n@param buf The buffer to append to.\n@param off The offset to write at.\n@param data The data to append.\n@param len The number of bytes to write (left-aligned).\n@return The original buffer, for chaining.",
            "id": 4856,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "write",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4810,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4803,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "6935:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4802,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "6935:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4805,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "6954:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4804,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6954:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4807,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "6964:12:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 4806,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "6964:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4809,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "6978:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4808,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6978:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6934:53:21"
            },
            "returnParameters": {
              "id": 4813,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4812,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "7009:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4811,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "7009:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7008:15:21"
            },
            "scope": 4982,
            "src": "6920:799:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 4876,
              "nodeType": "Block",
              "src": "8128:58:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4868,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4858,
                        "src": "8151:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4869,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4860,
                        "src": "8156:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 4871,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4862,
                            "src": "8169:4:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          ],
                          "id": 4870,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "8161:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_bytes32_$",
                            "typeString": "type(bytes32)"
                          },
                          "typeName": "bytes32"
                        },
                        "id": 4872,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8161:13:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3230",
                        "id": 4873,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8176:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        },
                        "value": "20"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        }
                      ],
                      "id": 4867,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4856,
                      "src": "8145:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4874,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8145:34:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4866,
                  "id": 4875,
                  "nodeType": "Return",
                  "src": "8138:41:21"
                }
              ]
            },
            "documentation": "@dev Writes a bytes20 to the buffer. Resizes if doing so would exceed the\n     capacity of the buffer.\n@param buf The buffer to append to.\n@param off The offset to write at.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4877,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeBytes20",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4863,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4858,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4877,
                  "src": "8047:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4857,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8047:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4860,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4877,
                  "src": "8066:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4859,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "8066:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4862,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4877,
                  "src": "8076:12:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes20",
                    "typeString": "bytes20"
                  },
                  "typeName": {
                    "id": 4861,
                    "name": "bytes20",
                    "nodeType": "ElementaryTypeName",
                    "src": "8076:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes20",
                      "typeString": "bytes20"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8046:43:21"
            },
            "returnParameters": {
              "id": 4866,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4865,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4877,
                  "src": "8113:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4864,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8113:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8112:15:21"
            },
            "scope": 4982,
            "src": "8025:161:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4897,
              "nodeType": "Block",
              "src": "8547:69:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4887,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4879,
                        "src": "8570:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4888,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4879,
                            "src": "8575:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4889,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "8575:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4890,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "8575:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 4892,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4881,
                            "src": "8599:4:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          ],
                          "id": 4891,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "8591:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_bytes32_$",
                            "typeString": "type(bytes32)"
                          },
                          "typeName": "bytes32"
                        },
                        "id": 4893,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8591:13:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3230",
                        "id": 4894,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8606:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        },
                        "value": "20"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        }
                      ],
                      "id": 4886,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4856,
                      "src": "8564:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4895,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8564:45:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4885,
                  "id": 4896,
                  "nodeType": "Return",
                  "src": "8557:52:21"
                }
              ]
            },
            "documentation": "@dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer, for chhaining.",
            "id": 4898,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendBytes20",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4882,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4879,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4898,
                  "src": "8476:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4878,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8476:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4881,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4898,
                  "src": "8495:12:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes20",
                    "typeString": "bytes20"
                  },
                  "typeName": {
                    "id": 4880,
                    "name": "bytes20",
                    "nodeType": "ElementaryTypeName",
                    "src": "8495:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes20",
                      "typeString": "bytes20"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8475:33:21"
            },
            "returnParameters": {
              "id": 4885,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4884,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4898,
                  "src": "8532:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4883,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8532:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8531:15:21"
            },
            "scope": 4982,
            "src": "8453:163:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4916,
              "nodeType": "Block",
              "src": "8976:60:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4908,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4900,
                        "src": "8999:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4909,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4900,
                            "src": "9004:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4910,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "9004:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4911,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "9004:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4912,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4902,
                        "src": "9020:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 4913,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9026:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        }
                      ],
                      "id": 4907,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4856,
                      "src": "8993:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4914,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8993:36:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4906,
                  "id": 4915,
                  "nodeType": "Return",
                  "src": "8986:43:21"
                }
              ]
            },
            "documentation": "@dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4917,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendBytes32",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4903,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4900,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4917,
                  "src": "8905:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4899,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8905:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4902,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4917,
                  "src": "8924:12:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 4901,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "8924:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8904:33:21"
            },
            "returnParameters": {
              "id": 4906,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4905,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4917,
                  "src": "8961:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4904,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8961:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8960:15:21"
            },
            "scope": 4982,
            "src": "8882:154:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4959,
              "nodeType": "Block",
              "src": "9510:626:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4935,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4932,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4930,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4925,
                        "src": "9524:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4931,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4921,
                        "src": "9530:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "9524:9:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4933,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4919,
                        "src": "9536:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4934,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "9536:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "9524:24:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4947,
                  "nodeType": "IfStatement",
                  "src": "9520:83:21",
                  "trueBody": {
                    "id": 4946,
                    "nodeType": "Block",
                    "src": "9550:53:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 4937,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4919,
                              "src": "9571:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 4943,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "components": [
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 4940,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 4938,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4925,
                                      "src": "9577:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 4939,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4921,
                                      "src": "9583:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "9577:9:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "id": 4941,
                                "isConstant": false,
                                "isInlineArray": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "TupleExpression",
                                "src": "9576:11:21",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 4942,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "9590:1:21",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "9576:15:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 4936,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4602,
                            "src": "9564:6:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 4944,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9564:28:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 4945,
                        "nodeType": "ExpressionStatement",
                        "src": "9564:28:21"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    4949
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4949,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 4959,
                      "src": "9613:9:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4948,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "9613:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4955,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4954,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4952,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 4950,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9625:3:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4951,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4925,
                        "src": "9632:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "9625:10:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 4953,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "9638:1:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "9625:14:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9613:26:21"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4919,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9741:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 4949,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9922:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4921,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9862:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4925,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9868:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4921,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10013:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4925,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10018:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 4923,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9930:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4921,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10076:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4925,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10081:3:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4956,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    let dest := add(add(bufptr, off), len)\n    mstore(dest, or(and(mload(dest), not(mask)), data))\n    if gt(add(off, len), mload(bufptr))\n    {\n        mstore(bufptr, add(off, len))\n    }\n}",
                  "src": "9649:461:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4957,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4919,
                    "src": "10126:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4929,
                  "id": 4958,
                  "nodeType": "Return",
                  "src": "10119:10:21"
                }
              ]
            },
            "documentation": "@dev Writes an integer to the buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param off The offset to write at.\n@param data The data to append.\n@param len The number of bytes to write (right-aligned).\n@return The original buffer, for chaining.",
            "id": 4960,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeInt",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4926,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4919,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9424:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4918,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "9424:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4921,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9443:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4920,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9443:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4923,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9453:9:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4922,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9453:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4925,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9464:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4924,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9464:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9423:50:21"
            },
            "returnParameters": {
              "id": 4929,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4928,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9495:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4927,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "9495:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9494:15:21"
            },
            "scope": 4982,
            "src": "9406:730:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 4980,
              "nodeType": "Block",
              "src": "10493:64:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4972,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4962,
                        "src": "10519:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4973,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4962,
                            "src": "10524:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4974,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "10524:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4975,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "10524:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4976,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4964,
                        "src": "10540:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4977,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4966,
                        "src": "10546:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 4971,
                      "name": "writeInt",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4960,
                      "src": "10510:8:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,uint256,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4978,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10510:40:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4970,
                  "id": 4979,
                  "nodeType": "Return",
                  "src": "10503:47:21"
                }
              ]
            },
            "documentation": "@dev Appends a byte to the end of the buffer. Resizes if doing so would\nexceed the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer.",
            "id": 4981,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendInt",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4967,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4962,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4981,
                  "src": "10416:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4961,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "10416:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4964,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4981,
                  "src": "10435:9:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4963,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "10435:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4966,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4981,
                  "src": "10446:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4965,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "10446:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10415:40:21"
            },
            "returnParameters": {
              "id": 4970,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4969,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4981,
                  "src": "10478:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4968,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "10478:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10477:15:21"
            },
            "scope": 4982,
            "src": "10397:160:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          }
        ],
        "scope": 4983,
        "src": "403:10156:21"
      }
    ],
    "src": "0:10560:21"
  },
  "legacyAST": {
    "absolutePath": "@ensdomains/buffer/contracts/Buffer.sol",
    "exportedSymbols": {
      "Buffer": [
        4982
      ]
    },
    "id": 4983,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 4513,
        "literals": [
          "solidity",
          ">",
          "0.4",
          ".18"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:21"
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "library",
        "documentation": "@dev A library for working with mutable byte buffers in Solidity.\n* Byte buffers are mutable and expandable, and provide a variety of primitives\nfor writing to them. At any time you can fetch a bytes object containing the\ncurrent contents of the buffer. The bytes object should not be stored between\noperations, as it may change due to resizing of the buffer.",
        "fullyImplemented": true,
        "id": 4982,
        "linearizedBaseContracts": [
          4982
        ],
        "name": "Buffer",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "canonicalName": "Buffer.buffer",
            "id": 4518,
            "members": [
              {
                "constant": false,
                "id": 4515,
                "name": "buf",
                "nodeType": "VariableDeclaration",
                "scope": 4518,
                "src": "702:9:21",
                "stateVariable": false,
                "storageLocation": "default",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes_storage_ptr",
                  "typeString": "bytes"
                },
                "typeName": {
                  "id": 4514,
                  "name": "bytes",
                  "nodeType": "ElementaryTypeName",
                  "src": "702:5:21",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_storage_ptr",
                    "typeString": "bytes"
                  }
                },
                "value": null,
                "visibility": "internal"
              },
              {
                "constant": false,
                "id": 4517,
                "name": "capacity",
                "nodeType": "VariableDeclaration",
                "scope": 4518,
                "src": "721:13:21",
                "stateVariable": false,
                "storageLocation": "default",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                },
                "typeName": {
                  "id": 4516,
                  "name": "uint",
                  "nodeType": "ElementaryTypeName",
                  "src": "721:4:21",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  }
                },
                "value": null,
                "visibility": "internal"
              }
            ],
            "name": "buffer",
            "nodeType": "StructDefinition",
            "scope": 4982,
            "src": "678:63:21",
            "visibility": "public"
          },
          {
            "body": {
              "id": 4552,
              "nodeType": "Block",
              "src": "1063:370:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4531,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4529,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4527,
                        "name": "capacity",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4522,
                        "src": "1077:8:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "%",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 4528,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1088:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      },
                      "src": "1077:13:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 4530,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "1094:1:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "1077:18:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4542,
                  "nodeType": "IfStatement",
                  "src": "1073:81:21",
                  "trueBody": {
                    "id": 4541,
                    "nodeType": "Block",
                    "src": "1097:57:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 4539,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 4532,
                            "name": "capacity",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4522,
                            "src": "1111:8:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 4538,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "3332",
                              "id": 4533,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "1123:2:21",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_32_by_1",
                                "typeString": "int_const 32"
                              },
                              "value": "32"
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "components": [
                                {
                                  "argumentTypes": null,
                                  "commonType": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  },
                                  "id": 4536,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "id": 4534,
                                    "name": "capacity",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 4522,
                                    "src": "1129:8:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "%",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "hexValue": "3332",
                                    "id": 4535,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "1140:2:21",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_32_by_1",
                                      "typeString": "int_const 32"
                                    },
                                    "value": "32"
                                  },
                                  "src": "1129:13:21",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                }
                              ],
                              "id": 4537,
                              "isConstant": false,
                              "isInlineArray": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "TupleExpression",
                              "src": "1128:15:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "1123:20:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "1111:32:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 4540,
                        "nodeType": "ExpressionStatement",
                        "src": "1111:32:21"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4547,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4543,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4520,
                        "src": "1209:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4545,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "1209:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 4546,
                      "name": "capacity",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4522,
                      "src": "1224:8:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1209:23:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 4548,
                  "nodeType": "ExpressionStatement",
                  "src": "1209:23:21"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4520,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1307:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "capacity": {
                        "declaration": 4522,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1386:8:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4549,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let ptr := mload(0x40)\n    mstore(buf, ptr)\n    mstore(ptr, 0)\n    mstore(0x40, add(32, add(ptr, capacity)))\n}",
                  "src": "1242:165:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4550,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4520,
                    "src": "1423:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4526,
                  "id": 4551,
                  "nodeType": "Return",
                  "src": "1416:10:21"
                }
              ]
            },
            "documentation": "@dev Initializes a buffer with an initial capacity.\n@param buf The buffer to initialize.\n@param capacity The number of bytes of space to allocate the buffer.\n@return The buffer, for chaining.",
            "id": 4553,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "init",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4523,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4520,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4553,
                  "src": "992:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4519,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "992:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4522,
                  "name": "capacity",
                  "nodeType": "VariableDeclaration",
                  "scope": 4553,
                  "src": "1011:13:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4521,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1011:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "991:34:21"
            },
            "returnParameters": {
              "id": 4526,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4525,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4553,
                  "src": "1048:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4524,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "1048:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1047:15:21"
            },
            "scope": 4982,
            "src": "978:455:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4578,
              "nodeType": "Block",
              "src": "1748:108:21",
              "statements": [
                {
                  "assignments": [
                    4561
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4561,
                      "name": "buf",
                      "nodeType": "VariableDeclaration",
                      "scope": 4578,
                      "src": "1758:17:21",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                        "typeString": "struct Buffer.buffer"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 4560,
                        "name": "buffer",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 4518,
                        "src": "1758:6:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                          "typeString": "struct Buffer.buffer"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4562,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1758:17:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4567,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4563,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4561,
                        "src": "1785:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4565,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "buf",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4515,
                      "src": "1785:7:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory",
                        "typeString": "bytes memory"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 4566,
                      "name": "b",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4555,
                      "src": "1795:1:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes memory"
                      }
                    },
                    "src": "1785:11:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory",
                      "typeString": "bytes memory"
                    }
                  },
                  "id": 4568,
                  "nodeType": "ExpressionStatement",
                  "src": "1785:11:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4574,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4569,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4561,
                        "src": "1806:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4571,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "1806:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4572,
                        "name": "b",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4555,
                        "src": "1821:1:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 4573,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1821:8:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1806:23:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 4575,
                  "nodeType": "ExpressionStatement",
                  "src": "1806:23:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4576,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4561,
                    "src": "1846:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4559,
                  "id": 4577,
                  "nodeType": "Return",
                  "src": "1839:10:21"
                }
              ]
            },
            "documentation": "@dev Initializes a new buffer from an existing bytes object.\n     Changes to the buffer may mutate the original value.\n@param b The bytes object to initialize the buffer with.\n@return A new buffer.",
            "id": 4579,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "fromBytes",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4556,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4555,
                  "name": "b",
                  "nodeType": "VariableDeclaration",
                  "scope": 4579,
                  "src": "1695:14:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 4554,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1695:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1694:16:21"
            },
            "returnParameters": {
              "id": 4559,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4558,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4579,
                  "src": "1733:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4557,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "1733:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1732:15:21"
            },
            "scope": 4982,
            "src": "1676:180:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4601,
              "nodeType": "Block",
              "src": "1925:104:21",
              "statements": [
                {
                  "assignments": [
                    4587
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4587,
                      "name": "oldbuf",
                      "nodeType": "VariableDeclaration",
                      "scope": 4601,
                      "src": "1935:19:21",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 4586,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "1935:5:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4590,
                  "initialValue": {
                    "argumentTypes": null,
                    "expression": {
                      "argumentTypes": null,
                      "id": 4588,
                      "name": "buf",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4581,
                      "src": "1957:3:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                        "typeString": "struct Buffer.buffer memory"
                      }
                    },
                    "id": 4589,
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "memberName": "buf",
                    "nodeType": "MemberAccess",
                    "referencedDeclaration": 4515,
                    "src": "1957:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1935:29:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4592,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4581,
                        "src": "1979:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4593,
                        "name": "capacity",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4583,
                        "src": "1984:8:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 4591,
                      "name": "init",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4553,
                      "src": "1974:4:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4594,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1974:19:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "id": 4595,
                  "nodeType": "ExpressionStatement",
                  "src": "1974:19:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4597,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4581,
                        "src": "2010:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4598,
                        "name": "oldbuf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4587,
                        "src": "2015:6:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      ],
                      "id": 4596,
                      "name": "append",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4734,
                        4754
                      ],
                      "referencedDeclaration": 4754,
                      "src": "2003:6:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,bytes memory) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4599,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2003:19:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "id": 4600,
                  "nodeType": "ExpressionStatement",
                  "src": "2003:19:21"
                }
              ]
            },
            "documentation": null,
            "id": 4602,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "resize",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4584,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4581,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4602,
                  "src": "1878:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4580,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "1878:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4583,
                  "name": "capacity",
                  "nodeType": "VariableDeclaration",
                  "scope": 4602,
                  "src": "1897:13:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4582,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1897:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1877:34:21"
            },
            "returnParameters": {
              "id": 4585,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1925:0:21"
            },
            "scope": 4982,
            "src": "1862:167:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 4620,
              "nodeType": "Block",
              "src": "2091:78:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4613,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 4611,
                      "name": "a",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4604,
                      "src": "2105:1:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 4612,
                      "name": "b",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4606,
                      "src": "2109:1:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2105:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4617,
                  "nodeType": "IfStatement",
                  "src": "2101:44:21",
                  "trueBody": {
                    "id": 4616,
                    "nodeType": "Block",
                    "src": "2112:33:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 4614,
                          "name": "a",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4604,
                          "src": "2133:1:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "functionReturnParameters": 4610,
                        "id": 4615,
                        "nodeType": "Return",
                        "src": "2126:8:21"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4618,
                    "name": "b",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4606,
                    "src": "2161:1:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 4610,
                  "id": 4619,
                  "nodeType": "Return",
                  "src": "2154:8:21"
                }
              ]
            },
            "documentation": null,
            "id": 4621,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "max",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4607,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4604,
                  "name": "a",
                  "nodeType": "VariableDeclaration",
                  "scope": 4621,
                  "src": "2048:6:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4603,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2048:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4606,
                  "name": "b",
                  "nodeType": "VariableDeclaration",
                  "scope": 4621,
                  "src": "2056:6:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4605,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2056:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2047:16:21"
            },
            "returnParameters": {
              "id": 4610,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4609,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4621,
                  "src": "2085:4:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4608,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2085:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2084:6:21"
            },
            "scope": 4982,
            "src": "2035:134:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 4631,
              "nodeType": "Block",
              "src": "2392:123:21",
              "statements": [
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4623,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "2445:3:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4628,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    mstore(bufptr, 0)\n}",
                  "src": "2402:87:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4629,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4623,
                    "src": "2505:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4627,
                  "id": 4630,
                  "nodeType": "Return",
                  "src": "2498:10:21"
                }
              ]
            },
            "documentation": "@dev Sets buffer length to 0.\n@param buf The buffer to truncate.\n@return The original buffer, for chaining..",
            "id": 4632,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "truncate",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4624,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4623,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4632,
                  "src": "2335:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4622,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "2335:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2334:19:21"
            },
            "returnParameters": {
              "id": 4627,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4626,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4632,
                  "src": "2377:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4625,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "2377:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2376:15:21"
            },
            "scope": 4982,
            "src": "2317:198:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4712,
              "nodeType": "Block",
              "src": "2985:1216:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 4649,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 4646,
                          "name": "len",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4640,
                          "src": "3003:3:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "<=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4647,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4638,
                            "src": "3010:4:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 4648,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "3010:11:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "3003:18:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 4645,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        12911,
                        12912
                      ],
                      "referencedDeclaration": 12911,
                      "src": "2995:7:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 4650,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2995:27:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 4651,
                  "nodeType": "ExpressionStatement",
                  "src": "2995:27:21"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4657,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4654,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4652,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4636,
                        "src": "3037:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4653,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4640,
                        "src": "3043:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3037:9:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4655,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4634,
                        "src": "3049:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4656,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "3049:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3037:24:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4672,
                  "nodeType": "IfStatement",
                  "src": "3033:100:21",
                  "trueBody": {
                    "id": 4671,
                    "nodeType": "Block",
                    "src": "3063:70:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 4659,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4634,
                              "src": "3084:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 4668,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 4661,
                                      "name": "buf",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4634,
                                      "src": "3093:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                        "typeString": "struct Buffer.buffer memory"
                                      }
                                    },
                                    "id": 4662,
                                    "isConstant": false,
                                    "isLValue": true,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "memberName": "capacity",
                                    "nodeType": "MemberAccess",
                                    "referencedDeclaration": 4517,
                                    "src": "3093:12:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 4665,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 4663,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4640,
                                      "src": "3107:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 4664,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4636,
                                      "src": "3113:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "3107:9:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 4660,
                                  "name": "max",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 4621,
                                  "src": "3089:3:21",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 4666,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "3089:28:21",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 4667,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "3120:1:21",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "3089:32:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 4658,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4602,
                            "src": "3077:6:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 4669,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3077:45:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 4670,
                        "nodeType": "ExpressionStatement",
                        "src": "3077:45:21"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    4674
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4674,
                      "name": "dest",
                      "nodeType": "VariableDeclaration",
                      "scope": 4712,
                      "src": "3143:9:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4673,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3143:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4675,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3143:9:21"
                },
                {
                  "assignments": [
                    4677
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4677,
                      "name": "src",
                      "nodeType": "VariableDeclaration",
                      "scope": 4712,
                      "src": "3162:8:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4676,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3162:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4678,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3162:8:21"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4634,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3272:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 4674,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3454:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4640,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3568:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4636,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3573:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4636,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3483:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "src": {
                        "declaration": 4677,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3661:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4640,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3624:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4636,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3629:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 4638,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3672:4:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4679,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    let buflen := mload(bufptr)\n    dest := add(add(bufptr, 32), off)\n    if gt(add(len, off), buflen)\n    {\n        mstore(bufptr, add(len, off))\n    }\n    src := add(data, 32)\n}",
                  "src": "3180:511:21"
                },
                {
                  "body": {
                    "id": 4696,
                    "nodeType": "Block",
                    "src": "3780:136:21",
                    "statements": [
                      {
                        "externalReferences": [
                          {
                            "src": {
                              "declaration": 4677,
                              "isOffset": false,
                              "isSlot": false,
                              "src": "3840:3:21",
                              "valueSize": 1
                            }
                          },
                          {
                            "dest": {
                              "declaration": 4674,
                              "isOffset": false,
                              "isSlot": false,
                              "src": "3828:4:21",
                              "valueSize": 1
                            }
                          }
                        ],
                        "id": 4687,
                        "nodeType": "InlineAssembly",
                        "operations": "{\n    mstore(dest, mload(src))\n}",
                        "src": "3794:65:21"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 4690,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 4688,
                            "name": "dest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4674,
                            "src": "3872:4:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "hexValue": "3332",
                            "id": 4689,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3880:2:21",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_32_by_1",
                              "typeString": "int_const 32"
                            },
                            "value": "32"
                          },
                          "src": "3872:10:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 4691,
                        "nodeType": "ExpressionStatement",
                        "src": "3872:10:21"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 4694,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 4692,
                            "name": "src",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4677,
                            "src": "3896:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "hexValue": "3332",
                            "id": 4693,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3903:2:21",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_32_by_1",
                              "typeString": "int_const 32"
                            },
                            "value": "32"
                          },
                          "src": "3896:9:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 4695,
                        "nodeType": "ExpressionStatement",
                        "src": "3896:9:21"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4682,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 4680,
                      "name": "len",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4640,
                      "src": "3758:3:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "3332",
                      "id": 4681,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "3765:2:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_32_by_1",
                        "typeString": "int_const 32"
                      },
                      "value": "32"
                    },
                    "src": "3758:9:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 4697,
                  "initializationExpression": null,
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 4685,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 4683,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4640,
                        "src": "3769:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "-=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 4684,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3776:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      },
                      "src": "3769:9:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 4686,
                    "nodeType": "ExpressionStatement",
                    "src": "3769:9:21"
                  },
                  "nodeType": "ForStatement",
                  "src": "3751:165:21"
                },
                {
                  "assignments": [
                    4699
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4699,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 4712,
                      "src": "3958:9:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4698,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3958:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4708,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4707,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4705,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 4700,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3970:3:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "components": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 4703,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "3332",
                              "id": 4701,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "3978:2:21",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_32_by_1",
                                "typeString": "int_const 32"
                              },
                              "value": "32"
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 4702,
                              "name": "len",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4640,
                              "src": "3983:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "3978:8:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "id": 4704,
                        "isConstant": false,
                        "isInlineArray": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "TupleExpression",
                        "src": "3977:10:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3970:17:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 4706,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "3990:1:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "3970:21:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3958:33:21"
                },
                {
                  "externalReferences": [
                    {
                      "src": {
                        "declaration": 4677,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4049:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 4699,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4059:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 4674,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4104:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 4699,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4111:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 4674,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4136:4:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4709,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let srcpart := and(mload(src), not(mask))\n    let destpart := and(mload(dest), mask)\n    mstore(dest, or(destpart, srcpart))\n}",
                  "src": "4001:173:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4710,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4634,
                    "src": "4191:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4644,
                  "id": 4711,
                  "nodeType": "Return",
                  "src": "4184:10:21"
                }
              ]
            },
            "documentation": "@dev Writes a byte string to a buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param off The start offset to write to.\n@param data The data to append.\n@param len The number of bytes to copy.\n@return The original buffer, for chaining.",
            "id": 4713,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "write",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4641,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4634,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2890:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4633,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "2890:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4636,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2909:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4635,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2909:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4638,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2919:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 4637,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "2919:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4640,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2938:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4639,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2938:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2889:58:21"
            },
            "returnParameters": {
              "id": 4644,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4643,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4713,
                  "src": "2970:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4642,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "2970:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2969:15:21"
            },
            "scope": 4982,
            "src": "2875:1326:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4733,
              "nodeType": "Block",
              "src": "4617:61:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4725,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4715,
                        "src": "4640:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4726,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4715,
                            "src": "4645:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4727,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "4645:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4728,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4645:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4729,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4717,
                        "src": "4661:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4730,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4719,
                        "src": "4667:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 4724,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4713,
                      "src": "4634:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4731,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4634:37:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4723,
                  "id": 4732,
                  "nodeType": "Return",
                  "src": "4627:44:21"
                }
              ]
            },
            "documentation": "@dev Appends a byte string to a buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@param len The number of bytes to copy.\n@return The original buffer, for chaining.",
            "id": 4734,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "append",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4720,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4715,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4734,
                  "src": "4531:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4714,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "4531:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4717,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4734,
                  "src": "4550:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 4716,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4550:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4719,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4734,
                  "src": "4569:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4718,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4569:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4530:48:21"
            },
            "returnParameters": {
              "id": 4723,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4722,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4734,
                  "src": "4602:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4721,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "4602:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4601:15:21"
            },
            "scope": 4982,
            "src": "4515:163:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4753,
              "nodeType": "Block",
              "src": "5038:69:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4744,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4736,
                        "src": "5061:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4745,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4736,
                            "src": "5066:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4746,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "5066:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4747,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5066:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4748,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4738,
                        "src": "5082:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 4749,
                          "name": "data",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 4738,
                          "src": "5088:4:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4750,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5088:11:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 4743,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4713,
                      "src": "5055:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4751,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5055:45:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4742,
                  "id": 4752,
                  "nodeType": "Return",
                  "src": "5048:52:21"
                }
              ]
            },
            "documentation": "@dev Appends a byte string to a buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4754,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "append",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4739,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4736,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4754,
                  "src": "4962:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4735,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "4962:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4738,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4754,
                  "src": "4981:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 4737,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4981:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4961:38:21"
            },
            "returnParameters": {
              "id": 4742,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4741,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4754,
                  "src": "5023:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4740,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "5023:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5022:15:21"
            },
            "scope": 4982,
            "src": "4946:161:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4782,
              "nodeType": "Block",
              "src": "5517:617:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4768,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 4765,
                      "name": "off",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4758,
                      "src": "5531:3:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4766,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4756,
                        "src": "5538:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4767,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "5538:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "5531:19:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4778,
                  "nodeType": "IfStatement",
                  "src": "5527:79:21",
                  "trueBody": {
                    "id": 4777,
                    "nodeType": "Block",
                    "src": "5552:54:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 4770,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4756,
                              "src": "5573:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 4774,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 4771,
                                  "name": "buf",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 4756,
                                  "src": "5578:3:21",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                    "typeString": "struct Buffer.buffer memory"
                                  }
                                },
                                "id": 4772,
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "capacity",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 4517,
                                "src": "5578:12:21",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 4773,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "5593:1:21",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "5578:16:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 4769,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4602,
                            "src": "5566:6:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 4775,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5566:29:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 4776,
                        "nodeType": "ExpressionStatement",
                        "src": "5566:29:21"
                      }
                    ]
                  }
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4756,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5708:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4758,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "6023:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4758,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5909:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 4760,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5945:4:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4779,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    let buflen := mload(bufptr)\n    let dest := add(add(bufptr, off), 32)\n    mstore8(dest, data)\n    if eq(off, buflen)\n    {\n        mstore(bufptr, add(buflen, 1))\n    }\n}",
                  "src": "5616:492:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4780,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4756,
                    "src": "6124:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4764,
                  "id": 4781,
                  "nodeType": "Return",
                  "src": "6117:10:21"
                }
              ]
            },
            "documentation": "@dev Writes a byte to the buffer. Resizes if doing so would exceed the\n     capacity of the buffer.\n@param buf The buffer to append to.\n@param off The offset to write the byte at.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4783,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeUint8",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4761,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4756,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4783,
                  "src": "5439:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4755,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "5439:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4758,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4783,
                  "src": "5458:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4757,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5458:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4760,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4783,
                  "src": "5468:10:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 4759,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "5468:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5438:41:21"
            },
            "returnParameters": {
              "id": 4764,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4763,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4783,
                  "src": "5502:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4762,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "5502:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5501:15:21"
            },
            "scope": 4982,
            "src": "5419:715:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4800,
              "nodeType": "Block",
              "src": "6486:61:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4793,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4785,
                        "src": "6514:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4794,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4785,
                            "src": "6519:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4795,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "6519:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4796,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6519:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4797,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4787,
                        "src": "6535:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      ],
                      "id": 4792,
                      "name": "writeUint8",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4783,
                      "src": "6503:10:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_uint8_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,uint8) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4798,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6503:37:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4791,
                  "id": 4799,
                  "nodeType": "Return",
                  "src": "6496:44:21"
                }
              ]
            },
            "documentation": "@dev Appends a byte to the buffer. Resizes if doing so would exceed the\n     capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4801,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendUint8",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4788,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4785,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4801,
                  "src": "6418:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4784,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "6418:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4787,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4801,
                  "src": "6437:10:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 4786,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6437:5:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6417:31:21"
            },
            "returnParameters": {
              "id": 4791,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4790,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4801,
                  "src": "6471:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4789,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "6471:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6470:15:21"
            },
            "scope": 4982,
            "src": "6397:150:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4855,
              "nodeType": "Block",
              "src": "7024:695:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4819,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4816,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4814,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4809,
                        "src": "7038:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4815,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4805,
                        "src": "7044:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7038:9:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4817,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4803,
                        "src": "7050:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4818,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "7050:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7038:24:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4831,
                  "nodeType": "IfStatement",
                  "src": "7034:83:21",
                  "trueBody": {
                    "id": 4830,
                    "nodeType": "Block",
                    "src": "7064:53:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 4821,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4803,
                              "src": "7085:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 4827,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "components": [
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 4824,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 4822,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4809,
                                      "src": "7091:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 4823,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4805,
                                      "src": "7097:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "7091:9:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "id": 4825,
                                "isConstant": false,
                                "isInlineArray": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "TupleExpression",
                                "src": "7090:11:21",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 4826,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "7104:1:21",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "7090:15:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 4820,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4602,
                            "src": "7078:6:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 4828,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "7078:28:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 4829,
                        "nodeType": "ExpressionStatement",
                        "src": "7078:28:21"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    4833
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4833,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 4855,
                      "src": "7127:9:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4832,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7127:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4839,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4838,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4836,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 4834,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "7139:3:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4835,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4809,
                        "src": "7146:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7139:10:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 4837,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "7152:1:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "7139:14:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7127:26:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4850,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 4840,
                      "name": "data",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4807,
                      "src": "7191:4:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "id": 4849,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4841,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4807,
                        "src": "7198:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": ">>",
                      "rightExpression": {
                        "argumentTypes": null,
                        "components": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 4847,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "38",
                              "id": 4842,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "7207:1:21",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_8_by_1",
                                "typeString": "int_const 8"
                              },
                              "value": "8"
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "*",
                            "rightExpression": {
                              "argumentTypes": null,
                              "components": [
                                {
                                  "argumentTypes": null,
                                  "commonType": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  },
                                  "id": 4845,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "hexValue": "3332",
                                    "id": 4843,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "7212:2:21",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_32_by_1",
                                      "typeString": "int_const 32"
                                    },
                                    "value": "32"
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "-",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "id": 4844,
                                    "name": "len",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 4809,
                                    "src": "7217:3:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "src": "7212:8:21",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                }
                              ],
                              "id": 4846,
                              "isConstant": false,
                              "isInlineArray": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "TupleExpression",
                              "src": "7211:10:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "7207:14:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "id": 4848,
                        "isConstant": false,
                        "isInlineArray": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "TupleExpression",
                        "src": "7206:16:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7198:24:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "7191:31:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 4851,
                  "nodeType": "ExpressionStatement",
                  "src": "7191:31:21"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4803,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7324:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 4833,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7505:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4805,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7445:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4809,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7451:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4805,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7596:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4809,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7601:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 4807,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7513:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4805,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7659:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4809,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7664:3:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4852,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    let dest := add(add(bufptr, off), len)\n    mstore(dest, or(and(mload(dest), not(mask)), data))\n    if gt(add(off, len), mload(bufptr))\n    {\n        mstore(bufptr, add(off, len))\n    }\n}",
                  "src": "7232:461:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4853,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4803,
                    "src": "7709:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4813,
                  "id": 4854,
                  "nodeType": "Return",
                  "src": "7702:10:21"
                }
              ]
            },
            "documentation": "@dev Writes up to 32 bytes to the buffer. Resizes if doing so would\n     exceed the capacity of the buffer.\n@param buf The buffer to append to.\n@param off The offset to write at.\n@param data The data to append.\n@param len The number of bytes to write (left-aligned).\n@return The original buffer, for chaining.",
            "id": 4856,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "write",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4810,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4803,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "6935:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4802,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "6935:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4805,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "6954:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4804,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6954:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4807,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "6964:12:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 4806,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "6964:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4809,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "6978:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4808,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6978:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6934:53:21"
            },
            "returnParameters": {
              "id": 4813,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4812,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4856,
                  "src": "7009:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4811,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "7009:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7008:15:21"
            },
            "scope": 4982,
            "src": "6920:799:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 4876,
              "nodeType": "Block",
              "src": "8128:58:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4868,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4858,
                        "src": "8151:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4869,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4860,
                        "src": "8156:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 4871,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4862,
                            "src": "8169:4:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          ],
                          "id": 4870,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "8161:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_bytes32_$",
                            "typeString": "type(bytes32)"
                          },
                          "typeName": "bytes32"
                        },
                        "id": 4872,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8161:13:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3230",
                        "id": 4873,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8176:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        },
                        "value": "20"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        }
                      ],
                      "id": 4867,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4856,
                      "src": "8145:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4874,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8145:34:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4866,
                  "id": 4875,
                  "nodeType": "Return",
                  "src": "8138:41:21"
                }
              ]
            },
            "documentation": "@dev Writes a bytes20 to the buffer. Resizes if doing so would exceed the\n     capacity of the buffer.\n@param buf The buffer to append to.\n@param off The offset to write at.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4877,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeBytes20",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4863,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4858,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4877,
                  "src": "8047:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4857,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8047:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4860,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4877,
                  "src": "8066:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4859,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "8066:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4862,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4877,
                  "src": "8076:12:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes20",
                    "typeString": "bytes20"
                  },
                  "typeName": {
                    "id": 4861,
                    "name": "bytes20",
                    "nodeType": "ElementaryTypeName",
                    "src": "8076:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes20",
                      "typeString": "bytes20"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8046:43:21"
            },
            "returnParameters": {
              "id": 4866,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4865,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4877,
                  "src": "8113:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4864,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8113:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8112:15:21"
            },
            "scope": 4982,
            "src": "8025:161:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4897,
              "nodeType": "Block",
              "src": "8547:69:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4887,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4879,
                        "src": "8570:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4888,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4879,
                            "src": "8575:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4889,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "8575:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4890,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "8575:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 4892,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4881,
                            "src": "8599:4:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          ],
                          "id": 4891,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "8591:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_bytes32_$",
                            "typeString": "type(bytes32)"
                          },
                          "typeName": "bytes32"
                        },
                        "id": 4893,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8591:13:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3230",
                        "id": 4894,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8606:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        },
                        "value": "20"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        }
                      ],
                      "id": 4886,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4856,
                      "src": "8564:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4895,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8564:45:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4885,
                  "id": 4896,
                  "nodeType": "Return",
                  "src": "8557:52:21"
                }
              ]
            },
            "documentation": "@dev Appends a bytes20 to the buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer, for chhaining.",
            "id": 4898,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendBytes20",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4882,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4879,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4898,
                  "src": "8476:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4878,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8476:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4881,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4898,
                  "src": "8495:12:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes20",
                    "typeString": "bytes20"
                  },
                  "typeName": {
                    "id": 4880,
                    "name": "bytes20",
                    "nodeType": "ElementaryTypeName",
                    "src": "8495:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes20",
                      "typeString": "bytes20"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8475:33:21"
            },
            "returnParameters": {
              "id": 4885,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4884,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4898,
                  "src": "8532:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4883,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8532:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8531:15:21"
            },
            "scope": 4982,
            "src": "8453:163:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4916,
              "nodeType": "Block",
              "src": "8976:60:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4908,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4900,
                        "src": "8999:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4909,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4900,
                            "src": "9004:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4910,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "9004:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4911,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "9004:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4912,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4902,
                        "src": "9020:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 4913,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9026:2:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        }
                      ],
                      "id": 4907,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        4713,
                        4856
                      ],
                      "referencedDeclaration": 4856,
                      "src": "8993:5:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4914,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8993:36:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4906,
                  "id": 4915,
                  "nodeType": "Return",
                  "src": "8986:43:21"
                }
              ]
            },
            "documentation": "@dev Appends a bytes32 to the buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer, for chaining.",
            "id": 4917,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendBytes32",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4903,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4900,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4917,
                  "src": "8905:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4899,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8905:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4902,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4917,
                  "src": "8924:12:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 4901,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "8924:7:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8904:33:21"
            },
            "returnParameters": {
              "id": 4906,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4905,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4917,
                  "src": "8961:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4904,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "8961:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8960:15:21"
            },
            "scope": 4982,
            "src": "8882:154:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 4959,
              "nodeType": "Block",
              "src": "9510:626:21",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4935,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4932,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 4930,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4925,
                        "src": "9524:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4931,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4921,
                        "src": "9530:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "9524:9:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 4933,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4919,
                        "src": "9536:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 4934,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4517,
                      "src": "9536:12:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "9524:24:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 4947,
                  "nodeType": "IfStatement",
                  "src": "9520:83:21",
                  "trueBody": {
                    "id": 4946,
                    "nodeType": "Block",
                    "src": "9550:53:21",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 4937,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 4919,
                              "src": "9571:3:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 4943,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "components": [
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 4940,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 4938,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4925,
                                      "src": "9577:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 4939,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 4921,
                                      "src": "9583:3:21",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "9577:9:21",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "id": 4941,
                                "isConstant": false,
                                "isInlineArray": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "TupleExpression",
                                "src": "9576:11:21",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 4942,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "9590:1:21",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "9576:15:21",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 4936,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4602,
                            "src": "9564:6:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 4944,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9564:28:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 4945,
                        "nodeType": "ExpressionStatement",
                        "src": "9564:28:21"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    4949
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 4949,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 4959,
                      "src": "9613:9:21",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 4948,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "9613:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 4955,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 4954,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 4952,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 4950,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9625:3:21",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 4951,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4925,
                        "src": "9632:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "9625:10:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 4953,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "9638:1:21",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "9625:14:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9613:26:21"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 4919,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9741:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 4949,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9922:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4921,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9862:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4925,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9868:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4921,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10013:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4925,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10018:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 4923,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9930:4:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 4921,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10076:3:21",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 4925,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10081:3:21",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 4956,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    let dest := add(add(bufptr, off), len)\n    mstore(dest, or(and(mload(dest), not(mask)), data))\n    if gt(add(off, len), mload(bufptr))\n    {\n        mstore(bufptr, add(off, len))\n    }\n}",
                  "src": "9649:461:21"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 4957,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 4919,
                    "src": "10126:3:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4929,
                  "id": 4958,
                  "nodeType": "Return",
                  "src": "10119:10:21"
                }
              ]
            },
            "documentation": "@dev Writes an integer to the buffer. Resizes if doing so would exceed\n     the capacity of the buffer.\n@param buf The buffer to append to.\n@param off The offset to write at.\n@param data The data to append.\n@param len The number of bytes to write (right-aligned).\n@return The original buffer, for chaining.",
            "id": 4960,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeInt",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4926,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4919,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9424:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4918,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "9424:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4921,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9443:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4920,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9443:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4923,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9453:9:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4922,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9453:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4925,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9464:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4924,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9464:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9423:50:21"
            },
            "returnParameters": {
              "id": 4929,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4928,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4960,
                  "src": "9495:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4927,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "9495:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9494:15:21"
            },
            "scope": 4982,
            "src": "9406:730:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 4980,
              "nodeType": "Block",
              "src": "10493:64:21",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 4972,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4962,
                        "src": "10519:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 4973,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 4962,
                            "src": "10524:3:21",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 4974,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4515,
                          "src": "10524:7:21",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 4975,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "10524:14:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4976,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4964,
                        "src": "10540:4:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 4977,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4966,
                        "src": "10546:3:21",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 4971,
                      "name": "writeInt",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 4960,
                      "src": "10510:8:21",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$4518_memory_ptr_$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_struct$_buffer_$4518_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,uint256,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 4978,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10510:40:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 4970,
                  "id": 4979,
                  "nodeType": "Return",
                  "src": "10503:47:21"
                }
              ]
            },
            "documentation": "@dev Appends a byte to the end of the buffer. Resizes if doing so would\nexceed the capacity of the buffer.\n@param buf The buffer to append to.\n@param data The data to append.\n@return The original buffer.",
            "id": 4981,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendInt",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 4967,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4962,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 4981,
                  "src": "10416:17:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4961,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "10416:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4964,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 4981,
                  "src": "10435:9:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4963,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "10435:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 4966,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 4981,
                  "src": "10446:8:21",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 4965,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "10446:4:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10415:40:21"
            },
            "returnParameters": {
              "id": 4970,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 4969,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 4981,
                  "src": "10478:13:21",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$4518_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 4968,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 4518,
                    "src": "10478:6:21",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$4518_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10477:15:21"
            },
            "scope": 4982,
            "src": "10397:160:21",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          }
        ],
        "scope": 4983,
        "src": "403:10156:21"
      }
    ],
    "src": "0:10560:21"
  },
  "compiler": {
    "name": "solc",
    "version": "0.5.8+commit.23d335f2.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "3.0.13",
  "updatedAt": "2020-03-31T16:16:11.924Z",
  "devdoc": {
    "details": "A library for working with mutable byte buffers in Solidity. * Byte buffers are mutable and expandable, and provide a variety of primitives for writing to them. At any time you can fetch a bytes object containing the current contents of the buffer. The bytes object should not be stored between operations, as it may change due to resizing of the buffer.",
    "methods": {}
  },
  "userdoc": {
    "methods": {}
  }
}