{
  "contractName": "Buffer",
  "abi": [],
  "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a72305820baad10f677e0a610b6935487d2f8577c8be4a010621fafa15cf054fc19e7ba0e0029",
  "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a72305820baad10f677e0a610b6935487d2f8577c8be4a010621fafa15cf054fc19e7ba0e0029",
  "sourceMap": "403:9770:3:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24",
  "deployedSourceMap": "403:9770:3:-;;;;;;;;",
  "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(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.buf.length > 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, max(buf.capacity, len) * 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, max(buf.capacity, 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",
  "sourcePath": "@ensdomains/buffer/contracts/Buffer.sol",
  "ast": {
    "absolutePath": "@ensdomains/buffer/contracts/Buffer.sol",
    "exportedSymbols": {
      "Buffer": [
        1106
      ]
    },
    "id": 1107,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 650,
        "literals": [
          "solidity",
          ">",
          "0.4",
          ".18"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:3"
      },
      {
        "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": 1106,
        "linearizedBaseContracts": [
          1106
        ],
        "name": "Buffer",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "canonicalName": "Buffer.buffer",
            "id": 655,
            "members": [
              {
                "constant": false,
                "id": 652,
                "name": "buf",
                "nodeType": "VariableDeclaration",
                "scope": 655,
                "src": "702:9:3",
                "stateVariable": false,
                "storageLocation": "default",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes_storage_ptr",
                  "typeString": "bytes"
                },
                "typeName": {
                  "id": 651,
                  "name": "bytes",
                  "nodeType": "ElementaryTypeName",
                  "src": "702:5:3",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_storage_ptr",
                    "typeString": "bytes"
                  }
                },
                "value": null,
                "visibility": "internal"
              },
              {
                "constant": false,
                "id": 654,
                "name": "capacity",
                "nodeType": "VariableDeclaration",
                "scope": 655,
                "src": "721:13:3",
                "stateVariable": false,
                "storageLocation": "default",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                },
                "typeName": {
                  "id": 653,
                  "name": "uint",
                  "nodeType": "ElementaryTypeName",
                  "src": "721:4:3",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  }
                },
                "value": null,
                "visibility": "internal"
              }
            ],
            "name": "buffer",
            "nodeType": "StructDefinition",
            "scope": 1106,
            "src": "678:63:3",
            "visibility": "public"
          },
          {
            "body": {
              "id": 689,
              "nodeType": "Block",
              "src": "1063:361:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 668,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 666,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 664,
                        "name": "capacity",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 659,
                        "src": "1077:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "%",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 665,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1088:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      },
                      "src": "1077:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 667,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "1094:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "1077:18:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 679,
                  "nodeType": "IfStatement",
                  "src": "1073:81:3",
                  "trueBody": {
                    "id": 678,
                    "nodeType": "Block",
                    "src": "1097:57:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 676,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 669,
                            "name": "capacity",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 659,
                            "src": "1111:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 675,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "3332",
                              "id": 670,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "1123:2:3",
                              "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": 673,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "id": 671,
                                    "name": "capacity",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 659,
                                    "src": "1129:8:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "%",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "hexValue": "3332",
                                    "id": 672,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "1140:2:3",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_32_by_1",
                                      "typeString": "int_const 32"
                                    },
                                    "value": "32"
                                  },
                                  "src": "1129:13:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                }
                              ],
                              "id": 674,
                              "isConstant": false,
                              "isInlineArray": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "TupleExpression",
                              "src": "1128:15:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "1123:20:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "1111:32:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 677,
                        "nodeType": "ExpressionStatement",
                        "src": "1111:32:3"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 684,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 680,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 657,
                        "src": "1209:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 682,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "1209:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 683,
                      "name": "capacity",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 659,
                      "src": "1224:8:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1209:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 685,
                  "nodeType": "ExpressionStatement",
                  "src": "1209:23:3"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 657,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1307:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "capacity": {
                        "declaration": 659,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1378:8:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 686,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let ptr := mload(0x40)\n    mstore(buf, ptr)\n    mstore(ptr, 0)\n    mstore(0x40, add(ptr, capacity))\n}",
                  "src": "1242:171:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 687,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 657,
                    "src": "1414:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 663,
                  "id": 688,
                  "nodeType": "Return",
                  "src": "1407:10:3"
                }
              ]
            },
            "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": 690,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "init",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 660,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 657,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 690,
                  "src": "992:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 656,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "992:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 659,
                  "name": "capacity",
                  "nodeType": "VariableDeclaration",
                  "scope": 690,
                  "src": "1011:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 658,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1011:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "991:34:3"
            },
            "returnParameters": {
              "id": 663,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 662,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 690,
                  "src": "1048:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 661,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "1048:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1047:15:3"
            },
            "scope": 1106,
            "src": "978:446:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 715,
              "nodeType": "Block",
              "src": "1739:108:3",
              "statements": [
                {
                  "assignments": [
                    698
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 698,
                      "name": "buf",
                      "nodeType": "VariableDeclaration",
                      "scope": 715,
                      "src": "1749:17:3",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                        "typeString": "struct Buffer.buffer"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 697,
                        "name": "buffer",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 655,
                        "src": "1749:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                          "typeString": "struct Buffer.buffer"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 699,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1749:17:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 704,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 700,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 698,
                        "src": "1776:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 702,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "buf",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 652,
                      "src": "1776:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory",
                        "typeString": "bytes memory"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 703,
                      "name": "b",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 692,
                      "src": "1786:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes memory"
                      }
                    },
                    "src": "1776:11:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory",
                      "typeString": "bytes memory"
                    }
                  },
                  "id": 705,
                  "nodeType": "ExpressionStatement",
                  "src": "1776:11:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 711,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 706,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 698,
                        "src": "1797:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 708,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "1797:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 709,
                        "name": "b",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 692,
                        "src": "1812:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 710,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1812:8:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1797:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 712,
                  "nodeType": "ExpressionStatement",
                  "src": "1797:23:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 713,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 698,
                    "src": "1837:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 696,
                  "id": 714,
                  "nodeType": "Return",
                  "src": "1830:10:3"
                }
              ]
            },
            "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": 716,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "fromBytes",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 693,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 692,
                  "name": "b",
                  "nodeType": "VariableDeclaration",
                  "scope": 716,
                  "src": "1686:14:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 691,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1686:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1685:16:3"
            },
            "returnParameters": {
              "id": 696,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 695,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 716,
                  "src": "1724:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 694,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "1724:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1723:15:3"
            },
            "scope": 1106,
            "src": "1667:180:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 738,
              "nodeType": "Block",
              "src": "1916:104:3",
              "statements": [
                {
                  "assignments": [
                    724
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 724,
                      "name": "oldbuf",
                      "nodeType": "VariableDeclaration",
                      "scope": 738,
                      "src": "1926:19:3",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 723,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "1926:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 727,
                  "initialValue": {
                    "argumentTypes": null,
                    "expression": {
                      "argumentTypes": null,
                      "id": 725,
                      "name": "buf",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 718,
                      "src": "1948:3:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                        "typeString": "struct Buffer.buffer memory"
                      }
                    },
                    "id": 726,
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "memberName": "buf",
                    "nodeType": "MemberAccess",
                    "referencedDeclaration": 652,
                    "src": "1948:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1926:29:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 729,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 718,
                        "src": "1970:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 730,
                        "name": "capacity",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 720,
                        "src": "1975:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 728,
                      "name": "init",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 690,
                      "src": "1965:4:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 731,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1965:19:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "id": 732,
                  "nodeType": "ExpressionStatement",
                  "src": "1965:19:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 734,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 718,
                        "src": "2001:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 735,
                        "name": "oldbuf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 724,
                        "src": "2006:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      ],
                      "id": 733,
                      "name": "append",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        875,
                        895
                      ],
                      "referencedDeclaration": 895,
                      "src": "1994:6:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,bytes memory) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 736,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1994:19:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "id": 737,
                  "nodeType": "ExpressionStatement",
                  "src": "1994:19:3"
                }
              ]
            },
            "documentation": null,
            "id": 739,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "resize",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 721,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 718,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 739,
                  "src": "1869:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 717,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "1869:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 720,
                  "name": "capacity",
                  "nodeType": "VariableDeclaration",
                  "scope": 739,
                  "src": "1888:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 719,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1888:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1868:34:3"
            },
            "returnParameters": {
              "id": 722,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1916:0:3"
            },
            "scope": 1106,
            "src": "1853:167:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 757,
              "nodeType": "Block",
              "src": "2082:78:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 750,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 748,
                      "name": "a",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 741,
                      "src": "2096:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 749,
                      "name": "b",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 743,
                      "src": "2100:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2096:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 754,
                  "nodeType": "IfStatement",
                  "src": "2092:44:3",
                  "trueBody": {
                    "id": 753,
                    "nodeType": "Block",
                    "src": "2103:33:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 751,
                          "name": "a",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 741,
                          "src": "2124:1:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "functionReturnParameters": 747,
                        "id": 752,
                        "nodeType": "Return",
                        "src": "2117:8:3"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 755,
                    "name": "b",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 743,
                    "src": "2152:1:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 747,
                  "id": 756,
                  "nodeType": "Return",
                  "src": "2145:8:3"
                }
              ]
            },
            "documentation": null,
            "id": 758,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "max",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 744,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 741,
                  "name": "a",
                  "nodeType": "VariableDeclaration",
                  "scope": 758,
                  "src": "2039:6:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 740,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2039:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 743,
                  "name": "b",
                  "nodeType": "VariableDeclaration",
                  "scope": 758,
                  "src": "2047:6:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 742,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2047:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2038:16:3"
            },
            "returnParameters": {
              "id": 747,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 746,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 758,
                  "src": "2076:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 745,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2076:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2075:6:3"
            },
            "scope": 1106,
            "src": "2026:134:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 768,
              "nodeType": "Block",
              "src": "2383:123:3",
              "statements": [
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 760,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "2436:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 765,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    mstore(bufptr, 0)\n}",
                  "src": "2393:102:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 766,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 760,
                    "src": "2496:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 764,
                  "id": 767,
                  "nodeType": "Return",
                  "src": "2489:10:3"
                }
              ]
            },
            "documentation": "@dev Sets buffer length to 0.\n@param buf The buffer to truncate.\n@return The original buffer, for chaining..",
            "id": 769,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "truncate",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 761,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 760,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 769,
                  "src": "2326:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 759,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "2326:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2325:19:3"
            },
            "returnParameters": {
              "id": 764,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 763,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 769,
                  "src": "2368:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 762,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "2368:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2367:15:3"
            },
            "scope": 1106,
            "src": "2308:198:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 853,
              "nodeType": "Block",
              "src": "2976:1233:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 786,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 783,
                          "name": "len",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 777,
                          "src": "2994:3:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "<=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 784,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 775,
                            "src": "3001:4:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 785,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "3001:11:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2994:18:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 782,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        2812,
                        2813
                      ],
                      "referencedDeclaration": 2812,
                      "src": "2986:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 787,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2986:27:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 788,
                  "nodeType": "ExpressionStatement",
                  "src": "2986:27:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 798,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 795,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 791,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 789,
                          "name": "off",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 773,
                          "src": "3028:3:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "+",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 790,
                          "name": "len",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 777,
                          "src": "3034:3:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "3028:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 792,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 771,
                            "src": "3040:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 793,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "3040:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 794,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3040:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3028:26:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 796,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 771,
                        "src": "3057:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 797,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "3057:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3028:41:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 813,
                  "nodeType": "IfStatement",
                  "src": "3024:117:3",
                  "trueBody": {
                    "id": 812,
                    "nodeType": "Block",
                    "src": "3071:70:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 800,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 771,
                              "src": "3092:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 809,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 802,
                                      "name": "buf",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 771,
                                      "src": "3101:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                        "typeString": "struct Buffer.buffer memory"
                                      }
                                    },
                                    "id": 803,
                                    "isConstant": false,
                                    "isLValue": true,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "memberName": "capacity",
                                    "nodeType": "MemberAccess",
                                    "referencedDeclaration": 654,
                                    "src": "3101:12:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 806,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 804,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 777,
                                      "src": "3115:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 805,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 773,
                                      "src": "3121:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "3115:9:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 801,
                                  "name": "max",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 758,
                                  "src": "3097:3:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 807,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "3097:28:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 808,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "3128:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "3097:32:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 799,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 739,
                            "src": "3085:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 810,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3085:45:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 811,
                        "nodeType": "ExpressionStatement",
                        "src": "3085:45:3"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    815
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 815,
                      "name": "dest",
                      "nodeType": "VariableDeclaration",
                      "scope": 853,
                      "src": "3151:9:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 814,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3151:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 816,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3151:9:3"
                },
                {
                  "assignments": [
                    818
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 818,
                      "name": "src",
                      "nodeType": "VariableDeclaration",
                      "scope": 853,
                      "src": "3170:8:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 817,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3170:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 819,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3170:8:3"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 771,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3280:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 775,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3680:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 815,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3462:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "src": {
                        "declaration": 818,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3669:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 773,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3491:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 777,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3576:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 773,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3581:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 777,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3632:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 773,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3637:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 820,
                  "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": "3188:574:3"
                },
                {
                  "body": {
                    "id": 837,
                    "nodeType": "Block",
                    "src": "3788:136:3",
                    "statements": [
                      {
                        "externalReferences": [
                          {
                            "dest": {
                              "declaration": 815,
                              "isOffset": false,
                              "isSlot": false,
                              "src": "3836:4:3",
                              "valueSize": 1
                            }
                          },
                          {
                            "src": {
                              "declaration": 818,
                              "isOffset": false,
                              "isSlot": false,
                              "src": "3848:3:3",
                              "valueSize": 1
                            }
                          }
                        ],
                        "id": 828,
                        "nodeType": "InlineAssembly",
                        "operations": "{\n    mstore(dest, mload(src))\n}",
                        "src": "3802:82:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 831,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 829,
                            "name": "dest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 815,
                            "src": "3880:4:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "hexValue": "3332",
                            "id": 830,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3888:2:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_32_by_1",
                              "typeString": "int_const 32"
                            },
                            "value": "32"
                          },
                          "src": "3880:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 832,
                        "nodeType": "ExpressionStatement",
                        "src": "3880:10:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 835,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 833,
                            "name": "src",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 818,
                            "src": "3904:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "hexValue": "3332",
                            "id": 834,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3911:2:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_32_by_1",
                              "typeString": "int_const 32"
                            },
                            "value": "32"
                          },
                          "src": "3904:9:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 836,
                        "nodeType": "ExpressionStatement",
                        "src": "3904:9:3"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 823,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 821,
                      "name": "len",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 777,
                      "src": "3766:3:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "3332",
                      "id": 822,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "3773:2:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_32_by_1",
                        "typeString": "int_const 32"
                      },
                      "value": "32"
                    },
                    "src": "3766:9:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 838,
                  "initializationExpression": null,
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 826,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 824,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 777,
                        "src": "3777:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "-=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 825,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3784:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      },
                      "src": "3777:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 827,
                    "nodeType": "ExpressionStatement",
                    "src": "3777:9:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "3759:165:3"
                },
                {
                  "assignments": [
                    840
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 840,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 853,
                      "src": "3966:9:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 839,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3966:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 849,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 848,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 846,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 841,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3978:3:3",
                        "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": 844,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "3332",
                              "id": 842,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "3986:2:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_32_by_1",
                                "typeString": "int_const 32"
                              },
                              "value": "32"
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 843,
                              "name": "len",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 777,
                              "src": "3991:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "3986:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "id": 845,
                        "isConstant": false,
                        "isInlineArray": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "TupleExpression",
                        "src": "3985:10:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3978:17:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 847,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "3998:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "3978:21:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3966:33:3"
                },
                {
                  "externalReferences": [
                    {
                      "src": {
                        "declaration": 818,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4057:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 840,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4067:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 815,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4112:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 840,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4119:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 815,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4144:4:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 850,
                  "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": "4009:189:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 851,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 771,
                    "src": "4199:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 781,
                  "id": 852,
                  "nodeType": "Return",
                  "src": "4192:10:3"
                }
              ]
            },
            "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": 854,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "write",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 778,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 771,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2881:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 770,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "2881:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 773,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2900:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 772,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2900:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 775,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2910:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 774,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "2910:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 777,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2929:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 776,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2929:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2880:58:3"
            },
            "returnParameters": {
              "id": 781,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 780,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2961:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 779,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "2961:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2960:15:3"
            },
            "scope": 1106,
            "src": "2866:1343:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 874,
              "nodeType": "Block",
              "src": "4625:61:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 866,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 856,
                        "src": "4648:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 867,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 856,
                            "src": "4653:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 868,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "4653:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 869,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4653:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 870,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 858,
                        "src": "4669:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 871,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 860,
                        "src": "4675:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 865,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 854,
                      "src": "4642:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 872,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4642:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 864,
                  "id": 873,
                  "nodeType": "Return",
                  "src": "4635:44:3"
                }
              ]
            },
            "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": 875,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "append",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 861,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 856,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 875,
                  "src": "4539:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 855,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "4539:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 858,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 875,
                  "src": "4558:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 857,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4558:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 860,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 875,
                  "src": "4577:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 859,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4577:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4538:48:3"
            },
            "returnParameters": {
              "id": 864,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 863,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 875,
                  "src": "4610:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 862,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "4610:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4609:15:3"
            },
            "scope": 1106,
            "src": "4523:163:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 894,
              "nodeType": "Block",
              "src": "5046:69:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 885,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 877,
                        "src": "5069:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 886,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 877,
                            "src": "5074:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 887,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "5074:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 888,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5074:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 889,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 879,
                        "src": "5090:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 890,
                          "name": "data",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 879,
                          "src": "5096:4:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 891,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5096:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 884,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 854,
                      "src": "5063:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 892,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5063:45:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 883,
                  "id": 893,
                  "nodeType": "Return",
                  "src": "5056:52:3"
                }
              ]
            },
            "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": 895,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "append",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 880,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 877,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 895,
                  "src": "4970:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 876,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "4970:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 879,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 895,
                  "src": "4989:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 878,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4989:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4969:38:3"
            },
            "returnParameters": {
              "id": 883,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 882,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 895,
                  "src": "5031:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 881,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "5031:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5030:15:3"
            },
            "scope": 1106,
            "src": "4954:161:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 923,
              "nodeType": "Block",
              "src": "5525:616:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 909,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 906,
                      "name": "off",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 899,
                      "src": "5539:3:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 907,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 897,
                        "src": "5545:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 908,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "5545:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "5539:18:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 919,
                  "nodeType": "IfStatement",
                  "src": "5535:78:3",
                  "trueBody": {
                    "id": 918,
                    "nodeType": "Block",
                    "src": "5559:54:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 911,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 897,
                              "src": "5580:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 915,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 912,
                                  "name": "buf",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 897,
                                  "src": "5585:3:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                    "typeString": "struct Buffer.buffer memory"
                                  }
                                },
                                "id": 913,
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "capacity",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 654,
                                "src": "5585:12:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 914,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "5600:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "5585:16:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 910,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 739,
                            "src": "5573:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 916,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5573:29:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 917,
                        "nodeType": "ExpressionStatement",
                        "src": "5573:29:3"
                      }
                    ]
                  }
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 897,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5715:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 899,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "6030:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 901,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5952:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 899,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5916:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 920,
                  "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": "5623:507:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 921,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 897,
                    "src": "6131:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 905,
                  "id": 922,
                  "nodeType": "Return",
                  "src": "6124:10:3"
                }
              ]
            },
            "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": 924,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeUint8",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 902,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 897,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 924,
                  "src": "5447:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 896,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "5447:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 899,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 924,
                  "src": "5466:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 898,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5466:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 901,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 924,
                  "src": "5476:10:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 900,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "5476:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5446:41:3"
            },
            "returnParameters": {
              "id": 905,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 904,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 924,
                  "src": "5510:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 903,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "5510:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5509:15:3"
            },
            "scope": 1106,
            "src": "5427:714:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 941,
              "nodeType": "Block",
              "src": "6493:61:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 934,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 926,
                        "src": "6521:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 935,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 926,
                            "src": "6526:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 936,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "6526:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 937,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6526:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 938,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 928,
                        "src": "6542:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      ],
                      "id": 933,
                      "name": "writeUint8",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 924,
                      "src": "6510:10:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_uint8_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,uint8) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 939,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6510:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 932,
                  "id": 940,
                  "nodeType": "Return",
                  "src": "6503:44:3"
                }
              ]
            },
            "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": 942,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendUint8",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 929,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 926,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 942,
                  "src": "6425:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 925,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "6425:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 928,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 942,
                  "src": "6444:10:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 927,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6444:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6424:31:3"
            },
            "returnParameters": {
              "id": 932,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 931,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 942,
                  "src": "6478:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 930,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "6478:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6477:15:3"
            },
            "scope": 1106,
            "src": "6404:150:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 997,
              "nodeType": "Block",
              "src": "7031:706:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 960,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 957,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 955,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 950,
                        "src": "7045:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 956,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 946,
                        "src": "7051:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7045:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 958,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 944,
                        "src": "7057:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 959,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "7057:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7045:24:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 973,
                  "nodeType": "IfStatement",
                  "src": "7041:94:3",
                  "trueBody": {
                    "id": 972,
                    "nodeType": "Block",
                    "src": "7071:64:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 962,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 944,
                              "src": "7092:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 969,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 964,
                                      "name": "buf",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 944,
                                      "src": "7101:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                        "typeString": "struct Buffer.buffer memory"
                                      }
                                    },
                                    "id": 965,
                                    "isConstant": false,
                                    "isLValue": true,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "memberName": "capacity",
                                    "nodeType": "MemberAccess",
                                    "referencedDeclaration": 654,
                                    "src": "7101:12:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "id": 966,
                                    "name": "len",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 950,
                                    "src": "7115:3:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 963,
                                  "name": "max",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 758,
                                  "src": "7097:3:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 967,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "7097:22:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 968,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "7122:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "7097:26:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 961,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 739,
                            "src": "7085:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 970,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "7085:39:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 971,
                        "nodeType": "ExpressionStatement",
                        "src": "7085:39:3"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    975
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 975,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 997,
                      "src": "7145:9:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 974,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7145:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 981,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 980,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 978,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 976,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "7157:3:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 977,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 950,
                        "src": "7164:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7157:10:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 979,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "7170:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "7157:14:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7145:26:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 992,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 982,
                      "name": "data",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 948,
                      "src": "7209:4:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "id": 991,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 983,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 948,
                        "src": "7216:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": ">>",
                      "rightExpression": {
                        "argumentTypes": null,
                        "components": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 989,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "38",
                              "id": 984,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "7225:1:3",
                              "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": 987,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "hexValue": "3332",
                                    "id": 985,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "7230:2:3",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_32_by_1",
                                      "typeString": "int_const 32"
                                    },
                                    "value": "32"
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "-",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "id": 986,
                                    "name": "len",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 950,
                                    "src": "7235:3:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "src": "7230:8:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                }
                              ],
                              "id": 988,
                              "isConstant": false,
                              "isInlineArray": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "TupleExpression",
                              "src": "7229:10:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "7225:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "id": 990,
                        "isConstant": false,
                        "isInlineArray": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "TupleExpression",
                        "src": "7224:16:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7216:24:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "7209:31:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 993,
                  "nodeType": "ExpressionStatement",
                  "src": "7209:31:3"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 944,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7342:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 950,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7469:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 946,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7463:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 948,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7531:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 975,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7523:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 946,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7614:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 950,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7619:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 946,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7677:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 950,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7682:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 994,
                  "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": "7250:476:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 995,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 944,
                    "src": "7727:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 954,
                  "id": 996,
                  "nodeType": "Return",
                  "src": "7720:10:3"
                }
              ]
            },
            "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": 998,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "write",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 951,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 944,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "6942:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 943,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "6942:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 946,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "6961:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 945,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6961:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 948,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "6971:12:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 947,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "6971:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 950,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "6985:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 949,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6985:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6941:53:3"
            },
            "returnParameters": {
              "id": 954,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 953,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "7016:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 952,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "7016:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7015:15:3"
            },
            "scope": 1106,
            "src": "6927:810:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 1018,
              "nodeType": "Block",
              "src": "8146:58:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1010,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1000,
                        "src": "8169:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1011,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1002,
                        "src": "8174:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1013,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1004,
                            "src": "8187:4:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          ],
                          "id": 1012,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "8179:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_bytes32_$",
                            "typeString": "type(bytes32)"
                          },
                          "typeName": "bytes32"
                        },
                        "id": 1014,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8179:13:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3230",
                        "id": 1015,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8194:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        },
                        "value": "20"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 1009,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 998,
                      "src": "8163:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 1016,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8163:34:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 1008,
                  "id": 1017,
                  "nodeType": "Return",
                  "src": "8156:41:3"
                }
              ]
            },
            "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": 1019,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeBytes20",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1005,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1000,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 1019,
                  "src": "8065:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 999,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8065:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1002,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 1019,
                  "src": "8084:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1001,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "8084:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1004,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 1019,
                  "src": "8094:12:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes20",
                    "typeString": "bytes20"
                  },
                  "typeName": {
                    "id": 1003,
                    "name": "bytes20",
                    "nodeType": "ElementaryTypeName",
                    "src": "8094:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes20",
                      "typeString": "bytes20"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8064:43:3"
            },
            "returnParameters": {
              "id": 1008,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1007,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1019,
                  "src": "8131:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1006,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8131:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8130:15:3"
            },
            "scope": 1106,
            "src": "8043:161:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1039,
              "nodeType": "Block",
              "src": "8565:69:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1029,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1021,
                        "src": "8588:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1030,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1021,
                            "src": "8593:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 1031,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "8593:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1032,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "8593:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1034,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1023,
                            "src": "8617:4:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          ],
                          "id": 1033,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "8609:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_bytes32_$",
                            "typeString": "type(bytes32)"
                          },
                          "typeName": "bytes32"
                        },
                        "id": 1035,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8609:13:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3230",
                        "id": 1036,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8624:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        },
                        "value": "20"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 1028,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 998,
                      "src": "8582:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 1037,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8582:45:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 1027,
                  "id": 1038,
                  "nodeType": "Return",
                  "src": "8575:52:3"
                }
              ]
            },
            "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": 1040,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendBytes20",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1024,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1021,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 1040,
                  "src": "8494:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1020,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8494:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1023,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 1040,
                  "src": "8513:12:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes20",
                    "typeString": "bytes20"
                  },
                  "typeName": {
                    "id": 1022,
                    "name": "bytes20",
                    "nodeType": "ElementaryTypeName",
                    "src": "8513:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes20",
                      "typeString": "bytes20"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8493:33:3"
            },
            "returnParameters": {
              "id": 1027,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1026,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1040,
                  "src": "8550:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1025,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8550:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8549:15:3"
            },
            "scope": 1106,
            "src": "8471:163:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1058,
              "nodeType": "Block",
              "src": "8994:60:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1050,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1042,
                        "src": "9017:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1051,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1042,
                            "src": "9022:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 1052,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "9022:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1053,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "9022:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1054,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1044,
                        "src": "9038:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 1055,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9044:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 1049,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 998,
                      "src": "9011:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 1056,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9011:36:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 1048,
                  "id": 1057,
                  "nodeType": "Return",
                  "src": "9004:43:3"
                }
              ]
            },
            "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": 1059,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendBytes32",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1045,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1042,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 1059,
                  "src": "8923:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1041,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8923:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1044,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 1059,
                  "src": "8942:12:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1043,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "8942:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8922:33:3"
            },
            "returnParameters": {
              "id": 1048,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1047,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1059,
                  "src": "8979:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1046,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8979:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8978:15:3"
            },
            "scope": 1106,
            "src": "8900:154:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1104,
              "nodeType": "Block",
              "src": "9528:643:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1077,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1074,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1072,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1067,
                        "src": "9542:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1073,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1063,
                        "src": "9548:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "9542:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 1075,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1061,
                        "src": "9554:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 1076,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "9554:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "9542:24:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1092,
                  "nodeType": "IfStatement",
                  "src": "9538:100:3",
                  "trueBody": {
                    "id": 1091,
                    "nodeType": "Block",
                    "src": "9568:70:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1079,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1061,
                              "src": "9589:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 1088,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 1081,
                                      "name": "buf",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 1061,
                                      "src": "9598:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                        "typeString": "struct Buffer.buffer memory"
                                      }
                                    },
                                    "id": 1082,
                                    "isConstant": false,
                                    "isLValue": true,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "memberName": "capacity",
                                    "nodeType": "MemberAccess",
                                    "referencedDeclaration": 654,
                                    "src": "9598:12:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 1085,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 1083,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 1067,
                                      "src": "9612:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 1084,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 1063,
                                      "src": "9618:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "9612:9:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 1080,
                                  "name": "max",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 758,
                                  "src": "9594:3:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 1086,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "9594:28:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 1087,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "9625:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "9594:32:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1078,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 739,
                            "src": "9582:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 1089,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9582:45:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 1090,
                        "nodeType": "ExpressionStatement",
                        "src": "9582:45:3"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    1094
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1094,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 1104,
                      "src": "9648:9:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1093,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "9648:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1100,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1099,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1097,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 1095,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9660:3:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1096,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1067,
                        "src": "9667:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "9660:10:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 1098,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "9673:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "9660:14:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9648:26:3"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 1061,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9776:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 1067,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9903:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 1063,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9897:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 1065,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9965:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 1094,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9957:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 1063,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10048:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 1067,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10053:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 1063,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10111:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 1067,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10116:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 1101,
                  "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": "9684:476:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1102,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1061,
                    "src": "10161:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 1071,
                  "id": 1103,
                  "nodeType": "Return",
                  "src": "10154:10:3"
                }
              ]
            },
            "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": 1105,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeInt",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1068,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1061,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9442:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1060,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "9442:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1063,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9461:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1062,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9461:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1065,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9471:9:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1064,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9471:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1067,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9482:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1066,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9482:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9441:50:3"
            },
            "returnParameters": {
              "id": 1071,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1070,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9513:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1069,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "9513:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9512:15:3"
            },
            "scope": 1106,
            "src": "9424:747:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          }
        ],
        "scope": 1107,
        "src": "403:9770:3"
      }
    ],
    "src": "0:10174:3"
  },
  "legacyAST": {
    "absolutePath": "@ensdomains/buffer/contracts/Buffer.sol",
    "exportedSymbols": {
      "Buffer": [
        1106
      ]
    },
    "id": 1107,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 650,
        "literals": [
          "solidity",
          ">",
          "0.4",
          ".18"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:3"
      },
      {
        "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": 1106,
        "linearizedBaseContracts": [
          1106
        ],
        "name": "Buffer",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "canonicalName": "Buffer.buffer",
            "id": 655,
            "members": [
              {
                "constant": false,
                "id": 652,
                "name": "buf",
                "nodeType": "VariableDeclaration",
                "scope": 655,
                "src": "702:9:3",
                "stateVariable": false,
                "storageLocation": "default",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes_storage_ptr",
                  "typeString": "bytes"
                },
                "typeName": {
                  "id": 651,
                  "name": "bytes",
                  "nodeType": "ElementaryTypeName",
                  "src": "702:5:3",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_storage_ptr",
                    "typeString": "bytes"
                  }
                },
                "value": null,
                "visibility": "internal"
              },
              {
                "constant": false,
                "id": 654,
                "name": "capacity",
                "nodeType": "VariableDeclaration",
                "scope": 655,
                "src": "721:13:3",
                "stateVariable": false,
                "storageLocation": "default",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                },
                "typeName": {
                  "id": 653,
                  "name": "uint",
                  "nodeType": "ElementaryTypeName",
                  "src": "721:4:3",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  }
                },
                "value": null,
                "visibility": "internal"
              }
            ],
            "name": "buffer",
            "nodeType": "StructDefinition",
            "scope": 1106,
            "src": "678:63:3",
            "visibility": "public"
          },
          {
            "body": {
              "id": 689,
              "nodeType": "Block",
              "src": "1063:361:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 668,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 666,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 664,
                        "name": "capacity",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 659,
                        "src": "1077:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "%",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 665,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "1088:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      },
                      "src": "1077:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 667,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "1094:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "src": "1077:18:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 679,
                  "nodeType": "IfStatement",
                  "src": "1073:81:3",
                  "trueBody": {
                    "id": 678,
                    "nodeType": "Block",
                    "src": "1097:57:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 676,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 669,
                            "name": "capacity",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 659,
                            "src": "1111:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 675,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "3332",
                              "id": 670,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "1123:2:3",
                              "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": 673,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "id": 671,
                                    "name": "capacity",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 659,
                                    "src": "1129:8:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "%",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "hexValue": "3332",
                                    "id": 672,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "1140:2:3",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_32_by_1",
                                      "typeString": "int_const 32"
                                    },
                                    "value": "32"
                                  },
                                  "src": "1129:13:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                }
                              ],
                              "id": 674,
                              "isConstant": false,
                              "isInlineArray": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "TupleExpression",
                              "src": "1128:15:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "1123:20:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "1111:32:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 677,
                        "nodeType": "ExpressionStatement",
                        "src": "1111:32:3"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 684,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 680,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 657,
                        "src": "1209:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 682,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "1209:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 683,
                      "name": "capacity",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 659,
                      "src": "1224:8:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1209:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 685,
                  "nodeType": "ExpressionStatement",
                  "src": "1209:23:3"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 657,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1307:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "capacity": {
                        "declaration": 659,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "1378:8:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 686,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let ptr := mload(0x40)\n    mstore(buf, ptr)\n    mstore(ptr, 0)\n    mstore(0x40, add(ptr, capacity))\n}",
                  "src": "1242:171:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 687,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 657,
                    "src": "1414:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 663,
                  "id": 688,
                  "nodeType": "Return",
                  "src": "1407:10:3"
                }
              ]
            },
            "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": 690,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "init",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 660,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 657,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 690,
                  "src": "992:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 656,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "992:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 659,
                  "name": "capacity",
                  "nodeType": "VariableDeclaration",
                  "scope": 690,
                  "src": "1011:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 658,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1011:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "991:34:3"
            },
            "returnParameters": {
              "id": 663,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 662,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 690,
                  "src": "1048:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 661,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "1048:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1047:15:3"
            },
            "scope": 1106,
            "src": "978:446:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 715,
              "nodeType": "Block",
              "src": "1739:108:3",
              "statements": [
                {
                  "assignments": [
                    698
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 698,
                      "name": "buf",
                      "nodeType": "VariableDeclaration",
                      "scope": 715,
                      "src": "1749:17:3",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                        "typeString": "struct Buffer.buffer"
                      },
                      "typeName": {
                        "contractScope": null,
                        "id": 697,
                        "name": "buffer",
                        "nodeType": "UserDefinedTypeName",
                        "referencedDeclaration": 655,
                        "src": "1749:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                          "typeString": "struct Buffer.buffer"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 699,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1749:17:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 704,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 700,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 698,
                        "src": "1776:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 702,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "buf",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 652,
                      "src": "1776:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory",
                        "typeString": "bytes memory"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 703,
                      "name": "b",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 692,
                      "src": "1786:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes memory"
                      }
                    },
                    "src": "1776:11:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory",
                      "typeString": "bytes memory"
                    }
                  },
                  "id": 705,
                  "nodeType": "ExpressionStatement",
                  "src": "1776:11:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 711,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 706,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 698,
                        "src": "1797:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 708,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "1797:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 709,
                        "name": "b",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 692,
                        "src": "1812:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 710,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "length",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": null,
                      "src": "1812:8:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "1797:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 712,
                  "nodeType": "ExpressionStatement",
                  "src": "1797:23:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 713,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 698,
                    "src": "1837:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 696,
                  "id": 714,
                  "nodeType": "Return",
                  "src": "1830:10:3"
                }
              ]
            },
            "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": 716,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "fromBytes",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 693,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 692,
                  "name": "b",
                  "nodeType": "VariableDeclaration",
                  "scope": 716,
                  "src": "1686:14:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 691,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1686:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1685:16:3"
            },
            "returnParameters": {
              "id": 696,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 695,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 716,
                  "src": "1724:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 694,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "1724:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1723:15:3"
            },
            "scope": 1106,
            "src": "1667:180:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 738,
              "nodeType": "Block",
              "src": "1916:104:3",
              "statements": [
                {
                  "assignments": [
                    724
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 724,
                      "name": "oldbuf",
                      "nodeType": "VariableDeclaration",
                      "scope": 738,
                      "src": "1926:19:3",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 723,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "1926:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 727,
                  "initialValue": {
                    "argumentTypes": null,
                    "expression": {
                      "argumentTypes": null,
                      "id": 725,
                      "name": "buf",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 718,
                      "src": "1948:3:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                        "typeString": "struct Buffer.buffer memory"
                      }
                    },
                    "id": 726,
                    "isConstant": false,
                    "isLValue": true,
                    "isPure": false,
                    "lValueRequested": false,
                    "memberName": "buf",
                    "nodeType": "MemberAccess",
                    "referencedDeclaration": 652,
                    "src": "1948:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "1926:29:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 729,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 718,
                        "src": "1970:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 730,
                        "name": "capacity",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 720,
                        "src": "1975:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 728,
                      "name": "init",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 690,
                      "src": "1965:4:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 731,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1965:19:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "id": 732,
                  "nodeType": "ExpressionStatement",
                  "src": "1965:19:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 734,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 718,
                        "src": "2001:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 735,
                        "name": "oldbuf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 724,
                        "src": "2006:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      ],
                      "id": 733,
                      "name": "append",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        875,
                        895
                      ],
                      "referencedDeclaration": 895,
                      "src": "1994:6:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,bytes memory) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 736,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "1994:19:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "id": 737,
                  "nodeType": "ExpressionStatement",
                  "src": "1994:19:3"
                }
              ]
            },
            "documentation": null,
            "id": 739,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "resize",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 721,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 718,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 739,
                  "src": "1869:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 717,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "1869:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 720,
                  "name": "capacity",
                  "nodeType": "VariableDeclaration",
                  "scope": 739,
                  "src": "1888:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 719,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "1888:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1868:34:3"
            },
            "returnParameters": {
              "id": 722,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1916:0:3"
            },
            "scope": 1106,
            "src": "1853:167:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 757,
              "nodeType": "Block",
              "src": "2082:78:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 750,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 748,
                      "name": "a",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 741,
                      "src": "2096:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 749,
                      "name": "b",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 743,
                      "src": "2100:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "2096:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 754,
                  "nodeType": "IfStatement",
                  "src": "2092:44:3",
                  "trueBody": {
                    "id": 753,
                    "nodeType": "Block",
                    "src": "2103:33:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 751,
                          "name": "a",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 741,
                          "src": "2124:1:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "functionReturnParameters": 747,
                        "id": 752,
                        "nodeType": "Return",
                        "src": "2117:8:3"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 755,
                    "name": "b",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 743,
                    "src": "2152:1:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 747,
                  "id": 756,
                  "nodeType": "Return",
                  "src": "2145:8:3"
                }
              ]
            },
            "documentation": null,
            "id": 758,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "max",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 744,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 741,
                  "name": "a",
                  "nodeType": "VariableDeclaration",
                  "scope": 758,
                  "src": "2039:6:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 740,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2039:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 743,
                  "name": "b",
                  "nodeType": "VariableDeclaration",
                  "scope": 758,
                  "src": "2047:6:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 742,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2047:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2038:16:3"
            },
            "returnParameters": {
              "id": 747,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 746,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 758,
                  "src": "2076:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 745,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2076:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2075:6:3"
            },
            "scope": 1106,
            "src": "2026:134:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 768,
              "nodeType": "Block",
              "src": "2383:123:3",
              "statements": [
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 760,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "2436:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 765,
                  "nodeType": "InlineAssembly",
                  "operations": "{\n    let bufptr := mload(buf)\n    mstore(bufptr, 0)\n}",
                  "src": "2393:102:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 766,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 760,
                    "src": "2496:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 764,
                  "id": 767,
                  "nodeType": "Return",
                  "src": "2489:10:3"
                }
              ]
            },
            "documentation": "@dev Sets buffer length to 0.\n@param buf The buffer to truncate.\n@return The original buffer, for chaining..",
            "id": 769,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "truncate",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 761,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 760,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 769,
                  "src": "2326:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 759,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "2326:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2325:19:3"
            },
            "returnParameters": {
              "id": 764,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 763,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 769,
                  "src": "2368:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 762,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "2368:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2367:15:3"
            },
            "scope": 1106,
            "src": "2308:198:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 853,
              "nodeType": "Block",
              "src": "2976:1233:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 786,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 783,
                          "name": "len",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 777,
                          "src": "2994:3:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "<=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 784,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 775,
                            "src": "3001:4:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 785,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "3001:11:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "2994:18:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 782,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        2812,
                        2813
                      ],
                      "referencedDeclaration": 2812,
                      "src": "2986:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
                        "typeString": "function (bool) pure"
                      }
                    },
                    "id": 787,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "2986:27:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 788,
                  "nodeType": "ExpressionStatement",
                  "src": "2986:27:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 798,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 795,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 791,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 789,
                          "name": "off",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 773,
                          "src": "3028:3:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "+",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 790,
                          "name": "len",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 777,
                          "src": "3034:3:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "3028:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 792,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 771,
                            "src": "3040:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 793,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "3040:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 794,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "3040:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3028:26:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 796,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 771,
                        "src": "3057:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 797,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "3057:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3028:41:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 813,
                  "nodeType": "IfStatement",
                  "src": "3024:117:3",
                  "trueBody": {
                    "id": 812,
                    "nodeType": "Block",
                    "src": "3071:70:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 800,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 771,
                              "src": "3092:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 809,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 802,
                                      "name": "buf",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 771,
                                      "src": "3101:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                        "typeString": "struct Buffer.buffer memory"
                                      }
                                    },
                                    "id": 803,
                                    "isConstant": false,
                                    "isLValue": true,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "memberName": "capacity",
                                    "nodeType": "MemberAccess",
                                    "referencedDeclaration": 654,
                                    "src": "3101:12:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 806,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 804,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 777,
                                      "src": "3115:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 805,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 773,
                                      "src": "3121:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "3115:9:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 801,
                                  "name": "max",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 758,
                                  "src": "3097:3:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 807,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "3097:28:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 808,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "3128:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "3097:32:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 799,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 739,
                            "src": "3085:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 810,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3085:45:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 811,
                        "nodeType": "ExpressionStatement",
                        "src": "3085:45:3"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    815
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 815,
                      "name": "dest",
                      "nodeType": "VariableDeclaration",
                      "scope": 853,
                      "src": "3151:9:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 814,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3151:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 816,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3151:9:3"
                },
                {
                  "assignments": [
                    818
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 818,
                      "name": "src",
                      "nodeType": "VariableDeclaration",
                      "scope": 853,
                      "src": "3170:8:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 817,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3170:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 819,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3170:8:3"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 771,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3280:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 775,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3680:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 815,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3462:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "src": {
                        "declaration": 818,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3669:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 773,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3491:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 777,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3576:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 773,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3581:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 777,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3632:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 773,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "3637:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 820,
                  "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": "3188:574:3"
                },
                {
                  "body": {
                    "id": 837,
                    "nodeType": "Block",
                    "src": "3788:136:3",
                    "statements": [
                      {
                        "externalReferences": [
                          {
                            "dest": {
                              "declaration": 815,
                              "isOffset": false,
                              "isSlot": false,
                              "src": "3836:4:3",
                              "valueSize": 1
                            }
                          },
                          {
                            "src": {
                              "declaration": 818,
                              "isOffset": false,
                              "isSlot": false,
                              "src": "3848:3:3",
                              "valueSize": 1
                            }
                          }
                        ],
                        "id": 828,
                        "nodeType": "InlineAssembly",
                        "operations": "{\n    mstore(dest, mload(src))\n}",
                        "src": "3802:82:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 831,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 829,
                            "name": "dest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 815,
                            "src": "3880:4:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "hexValue": "3332",
                            "id": 830,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3888:2:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_32_by_1",
                              "typeString": "int_const 32"
                            },
                            "value": "32"
                          },
                          "src": "3880:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 832,
                        "nodeType": "ExpressionStatement",
                        "src": "3880:10:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 835,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 833,
                            "name": "src",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 818,
                            "src": "3904:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "+=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "hexValue": "3332",
                            "id": 834,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3911:2:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_32_by_1",
                              "typeString": "int_const 32"
                            },
                            "value": "32"
                          },
                          "src": "3904:9:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 836,
                        "nodeType": "ExpressionStatement",
                        "src": "3904:9:3"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 823,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 821,
                      "name": "len",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 777,
                      "src": "3766:3:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "3332",
                      "id": 822,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "3773:2:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_32_by_1",
                        "typeString": "int_const 32"
                      },
                      "value": "32"
                    },
                    "src": "3766:9:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 838,
                  "initializationExpression": null,
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 826,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 824,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 777,
                        "src": "3777:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "-=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 825,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3784:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      },
                      "src": "3777:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 827,
                    "nodeType": "ExpressionStatement",
                    "src": "3777:9:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "3759:165:3"
                },
                {
                  "assignments": [
                    840
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 840,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 853,
                      "src": "3966:9:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 839,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "3966:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 849,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 848,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 846,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 841,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3978:3:3",
                        "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": 844,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "3332",
                              "id": 842,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "3986:2:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_32_by_1",
                                "typeString": "int_const 32"
                              },
                              "value": "32"
                            },
                            "nodeType": "BinaryOperation",
                            "operator": "-",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 843,
                              "name": "len",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 777,
                              "src": "3991:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "3986:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "id": 845,
                        "isConstant": false,
                        "isInlineArray": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "TupleExpression",
                        "src": "3985:10:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "3978:17:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 847,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "3998:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "3978:21:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3966:33:3"
                },
                {
                  "externalReferences": [
                    {
                      "src": {
                        "declaration": 818,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4057:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 840,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4067:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 815,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4112:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 840,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4119:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "dest": {
                        "declaration": 815,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "4144:4:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 850,
                  "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": "4009:189:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 851,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 771,
                    "src": "4199:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 781,
                  "id": 852,
                  "nodeType": "Return",
                  "src": "4192:10:3"
                }
              ]
            },
            "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": 854,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "write",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 778,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 771,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2881:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 770,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "2881:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 773,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2900:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 772,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2900:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 775,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2910:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 774,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "2910:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 777,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2929:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 776,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "2929:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2880:58:3"
            },
            "returnParameters": {
              "id": 781,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 780,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 854,
                  "src": "2961:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 779,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "2961:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "2960:15:3"
            },
            "scope": 1106,
            "src": "2866:1343:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 874,
              "nodeType": "Block",
              "src": "4625:61:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 866,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 856,
                        "src": "4648:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 867,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 856,
                            "src": "4653:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 868,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "4653:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 869,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "4653:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 870,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 858,
                        "src": "4669:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 871,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 860,
                        "src": "4675:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 865,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 854,
                      "src": "4642:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 872,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4642:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 864,
                  "id": 873,
                  "nodeType": "Return",
                  "src": "4635:44:3"
                }
              ]
            },
            "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": 875,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "append",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 861,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 856,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 875,
                  "src": "4539:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 855,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "4539:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 858,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 875,
                  "src": "4558:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 857,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4558:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 860,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 875,
                  "src": "4577:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 859,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "4577:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4538:48:3"
            },
            "returnParameters": {
              "id": 864,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 863,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 875,
                  "src": "4610:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 862,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "4610:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4609:15:3"
            },
            "scope": 1106,
            "src": "4523:163:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 894,
              "nodeType": "Block",
              "src": "5046:69:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 885,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 877,
                        "src": "5069:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 886,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 877,
                            "src": "5074:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 887,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "5074:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 888,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5074:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 889,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 879,
                        "src": "5090:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 890,
                          "name": "data",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 879,
                          "src": "5096:4:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 891,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5096:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 884,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 854,
                      "src": "5063:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes memory,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 892,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "5063:45:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 883,
                  "id": 893,
                  "nodeType": "Return",
                  "src": "5056:52:3"
                }
              ]
            },
            "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": 895,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "append",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 880,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 877,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 895,
                  "src": "4970:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 876,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "4970:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 879,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 895,
                  "src": "4989:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 878,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4989:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4969:38:3"
            },
            "returnParameters": {
              "id": 883,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 882,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 895,
                  "src": "5031:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 881,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "5031:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5030:15:3"
            },
            "scope": 1106,
            "src": "4954:161:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 923,
              "nodeType": "Block",
              "src": "5525:616:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 909,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 906,
                      "name": "off",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 899,
                      "src": "5539:3:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 907,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 897,
                        "src": "5545:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 908,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "5545:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "5539:18:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 919,
                  "nodeType": "IfStatement",
                  "src": "5535:78:3",
                  "trueBody": {
                    "id": 918,
                    "nodeType": "Block",
                    "src": "5559:54:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 911,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 897,
                              "src": "5580:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 915,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 912,
                                  "name": "buf",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 897,
                                  "src": "5585:3:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                    "typeString": "struct Buffer.buffer memory"
                                  }
                                },
                                "id": 913,
                                "isConstant": false,
                                "isLValue": true,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "capacity",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 654,
                                "src": "5585:12:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 914,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "5600:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "5585:16:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 910,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 739,
                            "src": "5573:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 916,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "5573:29:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 917,
                        "nodeType": "ExpressionStatement",
                        "src": "5573:29:3"
                      }
                    ]
                  }
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 897,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5715:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 899,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "6030:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 901,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5952:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 899,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "5916:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 920,
                  "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": "5623:507:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 921,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 897,
                    "src": "6131:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 905,
                  "id": 922,
                  "nodeType": "Return",
                  "src": "6124:10:3"
                }
              ]
            },
            "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": 924,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeUint8",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 902,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 897,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 924,
                  "src": "5447:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 896,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "5447:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 899,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 924,
                  "src": "5466:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 898,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "5466:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 901,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 924,
                  "src": "5476:10:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 900,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "5476:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5446:41:3"
            },
            "returnParameters": {
              "id": 905,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 904,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 924,
                  "src": "5510:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 903,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "5510:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "5509:15:3"
            },
            "scope": 1106,
            "src": "5427:714:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 941,
              "nodeType": "Block",
              "src": "6493:61:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 934,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 926,
                        "src": "6521:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 935,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 926,
                            "src": "6526:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 936,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "6526:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 937,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "6526:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 938,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 928,
                        "src": "6542:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint8",
                          "typeString": "uint8"
                        }
                      ],
                      "id": 933,
                      "name": "writeUint8",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 924,
                      "src": "6510:10:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_uint8_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,uint8) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 939,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6510:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 932,
                  "id": 940,
                  "nodeType": "Return",
                  "src": "6503:44:3"
                }
              ]
            },
            "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": 942,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendUint8",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 929,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 926,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 942,
                  "src": "6425:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 925,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "6425:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 928,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 942,
                  "src": "6444:10:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint8",
                    "typeString": "uint8"
                  },
                  "typeName": {
                    "id": 927,
                    "name": "uint8",
                    "nodeType": "ElementaryTypeName",
                    "src": "6444:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint8",
                      "typeString": "uint8"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6424:31:3"
            },
            "returnParameters": {
              "id": 932,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 931,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 942,
                  "src": "6478:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 930,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "6478:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6477:15:3"
            },
            "scope": 1106,
            "src": "6404:150:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 997,
              "nodeType": "Block",
              "src": "7031:706:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 960,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 957,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 955,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 950,
                        "src": "7045:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 956,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 946,
                        "src": "7051:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7045:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 958,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 944,
                        "src": "7057:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 959,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "7057:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "7045:24:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 973,
                  "nodeType": "IfStatement",
                  "src": "7041:94:3",
                  "trueBody": {
                    "id": 972,
                    "nodeType": "Block",
                    "src": "7071:64:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 962,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 944,
                              "src": "7092:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 969,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 964,
                                      "name": "buf",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 944,
                                      "src": "7101:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                        "typeString": "struct Buffer.buffer memory"
                                      }
                                    },
                                    "id": 965,
                                    "isConstant": false,
                                    "isLValue": true,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "memberName": "capacity",
                                    "nodeType": "MemberAccess",
                                    "referencedDeclaration": 654,
                                    "src": "7101:12:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "id": 966,
                                    "name": "len",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 950,
                                    "src": "7115:3:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 963,
                                  "name": "max",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 758,
                                  "src": "7097:3:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 967,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "7097:22:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 968,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "7122:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "7097:26:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 961,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 739,
                            "src": "7085:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 970,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "7085:39:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 971,
                        "nodeType": "ExpressionStatement",
                        "src": "7085:39:3"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    975
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 975,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 997,
                      "src": "7145:9:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 974,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "7145:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 981,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 980,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 978,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 976,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "7157:3:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 977,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 950,
                        "src": "7164:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7157:10:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 979,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "7170:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "7157:14:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "7145:26:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 992,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 982,
                      "name": "data",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 948,
                      "src": "7209:4:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "id": 991,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 983,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 948,
                        "src": "7216:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": ">>",
                      "rightExpression": {
                        "argumentTypes": null,
                        "components": [
                          {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 989,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "hexValue": "38",
                              "id": 984,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "7225:1:3",
                              "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": 987,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "hexValue": "3332",
                                    "id": 985,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "7230:2:3",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_32_by_1",
                                      "typeString": "int_const 32"
                                    },
                                    "value": "32"
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "-",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "id": 986,
                                    "name": "len",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 950,
                                    "src": "7235:3:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "src": "7230:8:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                }
                              ],
                              "id": 988,
                              "isConstant": false,
                              "isInlineArray": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "nodeType": "TupleExpression",
                              "src": "7229:10:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "7225:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "id": 990,
                        "isConstant": false,
                        "isInlineArray": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "nodeType": "TupleExpression",
                        "src": "7224:16:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "7216:24:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "7209:31:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 993,
                  "nodeType": "ExpressionStatement",
                  "src": "7209:31:3"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 944,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7342:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 950,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7469:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 946,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7463:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 948,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7531:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 975,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7523:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 946,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7614:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 950,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7619:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 946,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7677:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 950,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "7682:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 994,
                  "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": "7250:476:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 995,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 944,
                    "src": "7727:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 954,
                  "id": 996,
                  "nodeType": "Return",
                  "src": "7720:10:3"
                }
              ]
            },
            "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": 998,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "write",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 951,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 944,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "6942:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 943,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "6942:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 946,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "6961:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 945,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6961:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 948,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "6971:12:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 947,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "6971:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 950,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "6985:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 949,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "6985:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6941:53:3"
            },
            "returnParameters": {
              "id": 954,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 953,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 998,
                  "src": "7016:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 952,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "7016:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7015:15:3"
            },
            "scope": 1106,
            "src": "6927:810:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          },
          {
            "body": {
              "id": 1018,
              "nodeType": "Block",
              "src": "8146:58:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1010,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1000,
                        "src": "8169:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1011,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1002,
                        "src": "8174:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1013,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1004,
                            "src": "8187:4:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          ],
                          "id": 1012,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "8179:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_bytes32_$",
                            "typeString": "type(bytes32)"
                          },
                          "typeName": "bytes32"
                        },
                        "id": 1014,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8179:13:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3230",
                        "id": 1015,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8194:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        },
                        "value": "20"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 1009,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 998,
                      "src": "8163:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 1016,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8163:34:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 1008,
                  "id": 1017,
                  "nodeType": "Return",
                  "src": "8156:41:3"
                }
              ]
            },
            "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": 1019,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeBytes20",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1005,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1000,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 1019,
                  "src": "8065:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 999,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8065:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1002,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 1019,
                  "src": "8084:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1001,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "8084:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1004,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 1019,
                  "src": "8094:12:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes20",
                    "typeString": "bytes20"
                  },
                  "typeName": {
                    "id": 1003,
                    "name": "bytes20",
                    "nodeType": "ElementaryTypeName",
                    "src": "8094:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes20",
                      "typeString": "bytes20"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8064:43:3"
            },
            "returnParameters": {
              "id": 1008,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1007,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1019,
                  "src": "8131:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1006,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8131:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8130:15:3"
            },
            "scope": 1106,
            "src": "8043:161:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1039,
              "nodeType": "Block",
              "src": "8565:69:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1029,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1021,
                        "src": "8588:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1030,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1021,
                            "src": "8593:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 1031,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "8593:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1032,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "8593:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1034,
                            "name": "data",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1023,
                            "src": "8617:4:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes20",
                              "typeString": "bytes20"
                            }
                          ],
                          "id": 1033,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "lValueRequested": false,
                          "nodeType": "ElementaryTypeNameExpression",
                          "src": "8609:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_type$_t_bytes32_$",
                            "typeString": "type(bytes32)"
                          },
                          "typeName": "bytes32"
                        },
                        "id": 1035,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "typeConversion",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8609:13:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3230",
                        "id": 1036,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8624:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_20_by_1",
                          "typeString": "int_const 20"
                        },
                        "value": "20"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 1028,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 998,
                      "src": "8582:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 1037,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8582:45:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 1027,
                  "id": 1038,
                  "nodeType": "Return",
                  "src": "8575:52:3"
                }
              ]
            },
            "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": 1040,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendBytes20",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1024,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1021,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 1040,
                  "src": "8494:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1020,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8494:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1023,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 1040,
                  "src": "8513:12:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes20",
                    "typeString": "bytes20"
                  },
                  "typeName": {
                    "id": 1022,
                    "name": "bytes20",
                    "nodeType": "ElementaryTypeName",
                    "src": "8513:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes20",
                      "typeString": "bytes20"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8493:33:3"
            },
            "returnParameters": {
              "id": 1027,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1026,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1040,
                  "src": "8550:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1025,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8550:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8549:15:3"
            },
            "scope": 1106,
            "src": "8471:163:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1058,
              "nodeType": "Block",
              "src": "8994:60:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1050,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1042,
                        "src": "9017:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1051,
                            "name": "buf",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1042,
                            "src": "9022:3:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                              "typeString": "struct Buffer.buffer memory"
                            }
                          },
                          "id": 1052,
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "buf",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 652,
                          "src": "9022:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1053,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "9022:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1054,
                        "name": "data",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1044,
                        "src": "9038:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3332",
                        "id": 1055,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9044:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_32_by_1",
                          "typeString": "int_const 32"
                        },
                        "value": "32"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_struct$_buffer_$655_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": 1049,
                      "name": "write",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        854,
                        998
                      ],
                      "referencedDeclaration": 998,
                      "src": "9011:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$_t_bytes32_$_t_uint256_$returns$_t_struct$_buffer_$655_memory_ptr_$",
                        "typeString": "function (struct Buffer.buffer memory,uint256,bytes32,uint256) pure returns (struct Buffer.buffer memory)"
                      }
                    },
                    "id": 1056,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9011:36:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 1048,
                  "id": 1057,
                  "nodeType": "Return",
                  "src": "9004:43:3"
                }
              ]
            },
            "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": 1059,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "appendBytes32",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1045,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1042,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 1059,
                  "src": "8923:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1041,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8923:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1044,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 1059,
                  "src": "8942:12:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1043,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "8942:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8922:33:3"
            },
            "returnParameters": {
              "id": 1048,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1047,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1059,
                  "src": "8979:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1046,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "8979:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8978:15:3"
            },
            "scope": 1106,
            "src": "8900:154:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1104,
              "nodeType": "Block",
              "src": "9528:643:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1077,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1074,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1072,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1067,
                        "src": "9542:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1073,
                        "name": "off",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1063,
                        "src": "9548:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "9542:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": ">",
                    "rightExpression": {
                      "argumentTypes": null,
                      "expression": {
                        "argumentTypes": null,
                        "id": 1075,
                        "name": "buf",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1061,
                        "src": "9554:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                          "typeString": "struct Buffer.buffer memory"
                        }
                      },
                      "id": 1076,
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "capacity",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 654,
                      "src": "9554:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "9542:24:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1092,
                  "nodeType": "IfStatement",
                  "src": "9538:100:3",
                  "trueBody": {
                    "id": 1091,
                    "nodeType": "Block",
                    "src": "9568:70:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1079,
                              "name": "buf",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1061,
                              "src": "9589:3:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 1088,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 1081,
                                      "name": "buf",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 1061,
                                      "src": "9598:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                        "typeString": "struct Buffer.buffer memory"
                                      }
                                    },
                                    "id": 1082,
                                    "isConstant": false,
                                    "isLValue": true,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "memberName": "capacity",
                                    "nodeType": "MemberAccess",
                                    "referencedDeclaration": 654,
                                    "src": "9598:12:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 1085,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 1083,
                                      "name": "len",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 1067,
                                      "src": "9612:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "+",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 1084,
                                      "name": "off",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 1063,
                                      "src": "9618:3:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "9612:9:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "id": 1080,
                                  "name": "max",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 758,
                                  "src": "9594:3:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 1086,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "9594:28:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "*",
                              "rightExpression": {
                                "argumentTypes": null,
                                "hexValue": "32",
                                "id": 1087,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "9625:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_2_by_1",
                                  "typeString": "int_const 2"
                                },
                                "value": "2"
                              },
                              "src": "9594:32:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                                "typeString": "struct Buffer.buffer memory"
                              },
                              {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            ],
                            "id": 1078,
                            "name": "resize",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 739,
                            "src": "9582:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_struct$_buffer_$655_memory_ptr_$_t_uint256_$returns$__$",
                              "typeString": "function (struct Buffer.buffer memory,uint256) pure"
                            }
                          },
                          "id": 1089,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9582:45:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 1090,
                        "nodeType": "ExpressionStatement",
                        "src": "9582:45:3"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    1094
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1094,
                      "name": "mask",
                      "nodeType": "VariableDeclaration",
                      "scope": 1104,
                      "src": "9648:9:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1093,
                        "name": "uint",
                        "nodeType": "ElementaryTypeName",
                        "src": "9648:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1100,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1099,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1097,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "hexValue": "323536",
                        "id": 1095,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9660:3:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_256_by_1",
                          "typeString": "int_const 256"
                        },
                        "value": "256"
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "**",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1096,
                        "name": "len",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1067,
                        "src": "9667:3:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "9660:10:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "-",
                    "rightExpression": {
                      "argumentTypes": null,
                      "hexValue": "31",
                      "id": 1098,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "9673:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_1_by_1",
                        "typeString": "int_const 1"
                      },
                      "value": "1"
                    },
                    "src": "9660:14:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9648:26:3"
                },
                {
                  "externalReferences": [
                    {
                      "buf": {
                        "declaration": 1061,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9776:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 1067,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9903:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 1063,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9897:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "data": {
                        "declaration": 1065,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9965:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "mask": {
                        "declaration": 1094,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "9957:4:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 1063,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10048:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 1067,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10053:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "off": {
                        "declaration": 1063,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10111:3:3",
                        "valueSize": 1
                      }
                    },
                    {
                      "len": {
                        "declaration": 1067,
                        "isOffset": false,
                        "isSlot": false,
                        "src": "10116:3:3",
                        "valueSize": 1
                      }
                    }
                  ],
                  "id": 1101,
                  "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": "9684:476:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1102,
                    "name": "buf",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1061,
                    "src": "10161:3:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                      "typeString": "struct Buffer.buffer memory"
                    }
                  },
                  "functionReturnParameters": 1071,
                  "id": 1103,
                  "nodeType": "Return",
                  "src": "10154:10:3"
                }
              ]
            },
            "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": 1105,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "writeInt",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1068,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1061,
                  "name": "buf",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9442:17:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1060,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "9442:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1063,
                  "name": "off",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9461:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1062,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9461:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1065,
                  "name": "data",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9471:9:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1064,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9471:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1067,
                  "name": "len",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9482:8:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1066,
                    "name": "uint",
                    "nodeType": "ElementaryTypeName",
                    "src": "9482:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9441:50:3"
            },
            "returnParameters": {
              "id": 1071,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1070,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1105,
                  "src": "9513:13:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_struct$_buffer_$655_memory_ptr",
                    "typeString": "struct Buffer.buffer"
                  },
                  "typeName": {
                    "contractScope": null,
                    "id": 1069,
                    "name": "buffer",
                    "nodeType": "UserDefinedTypeName",
                    "referencedDeclaration": 655,
                    "src": "9513:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_struct$_buffer_$655_storage_ptr",
                      "typeString": "struct Buffer.buffer"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "9512:15:3"
            },
            "scope": 1106,
            "src": "9424:747:3",
            "stateMutability": "pure",
            "superFunction": null,
            "visibility": "private"
          }
        ],
        "scope": 1107,
        "src": "403:9770:3"
      }
    ],
    "src": "0:10174:3"
  },
  "compiler": {
    "name": "solc",
    "version": "0.5.0+commit.1d4f565a.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "3.0.2",
  "updatedAt": "2019-04-23T16:17:13.319Z",
  "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": {}
  }
}