// File: Heptagon196[P]Gos/Reflection/JSON.cpp
// Function: parse(Tokenizer&)
SharedObject parse(Tokenizer& tk) {
    auto token = tk.getToken();
    if (token == Tokenizer::symbol('{')) {
        auto obj = std::unordered_map<std::string, JSON>();
        token = tk.getToken();
        while (token != Tokenizer::symbol('}')) {
            auto key = token.second;
            token = tk.getToken();
            tk.expectSymbol(token, ":");
            obj[(std::string)key] = JSON{parse(tk)};
            token = tk.getToken();
            if (token != Tokenizer::symbol(',')) {
                tk.expectSymbol(token, "}");
                continue;
            }
            token = tk.getToken();
        }
        return SharedObject::New<decltype(obj)>(obj);
    } else if (token == Tokenizer::symbol('[')) {
        auto vec = std::vector<JSON>();
        token = tk.getToken();
        while (token != Tokenizer::symbol(']')) {
            tk.backToken(token);
            vec.push_back(JSON{parse(tk)});
            token = tk.getToken();
            if (token != Tokenizer::symbol(',')) {
                tk.expectSymbol(token, "]");
                continue;
            }
            token = tk.getToken();
        }
        return SharedObject::New<decltype(vec)>(vec);
    } else if (token.first == TypeID::get<int>()) {
        return SharedObject::New<int>(ConvertTo<int>(token.second));
    } else if (token.first == TypeID::get<float>()) {
        return SharedObject::New<float>(ConvertTo<float>(token.second));
    } else if (token.first == TypeID::get<std::string>()) {
        return SharedObject::New<std::string>(token.second);
    } else {
        std::cerr << "Error when parsing JSON: unknown token: type = " << token.first.getName() << ", content = " << token.second << std::endl;
    }
    return SharedObject::Null;
}

// Assembly:
subq $0x7e8, %rsp            # imm = 0x7E8
movq %rdi, 0xd0(%rsp)
movq %rdi, %rax
movq %rax, 0xd8(%rsp)
movq %rdi, 0x7e0(%rsp)
movq %rsi, 0x7d8(%rsp)
movq 0x7d8(%rsp), %rsi
leaq 0x798(%rsp), %rdi
callq 0x163d80
leaq 0x758(%rsp), %rdi
movl $0x7b, %esi
callq 0x164380
jmp 0x28a43
leaq 0x798(%rsp), %rdi
leaq 0x758(%rsp), %rsi
callq 0x164320
movb %al, 0xcf(%rsp)
jmp 0x28a61
leaq 0x758(%rsp), %rdi
callq 0x164420
movb 0xcf(%rsp), %al
testb $0x1, %al
jne 0x28a7e
jmp 0x29009
xorps %xmm0, %xmm0
movaps %xmm0, 0x730(%rsp)
movaps %xmm0, 0x720(%rsp)
movaps %xmm0, 0x710(%rsp)
movq $0x0, 0x740(%rsp)
leaq 0x710(%rsp), %rdi
callq 0x164440
movq 0x7d8(%rsp), %rsi
leaq 0x6d0(%rsp), %rdi
callq 0x163d80
jmp 0x28ac9
leaq 0x798(%rsp), %rdi
leaq 0x6d0(%rsp), %rsi
callq 0x164450
leaq 0x6d0(%rsp), %rdi
callq 0x164420
leaq 0x690(%rsp), %rdi
movl $0x7d, %esi
callq 0x164380
jmp 0x28aff
leaq 0x798(%rsp), %rdi
leaq 0x690(%rsp), %rsi
callq 0x164320
movb %al, 0xce(%rsp)
jmp 0x28b1d
movb 0xce(%rsp), %al
xorb $-0x1, %al
movb %al, 0xcd(%rsp)
leaq 0x690(%rsp), %rdi
callq 0x164420
movb 0xcd(%rsp), %al
testb $0x1, %al
jne 0x28b4a
jmp 0x28fc3
leaq 0x7b8(%rsp), %rsi
leaq 0x670(%rsp), %rdi
callq 0x6f070
jmp 0x28b61
movq 0x7d8(%rsp), %rsi
leaq 0x630(%rsp), %rdi
callq 0x163d80
jmp 0x28b78
leaq 0x798(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
leaq 0x630(%rsp), %rsi
movq %rsi, 0xb0(%rsp)
callq 0x164450
movq 0xb0(%rsp), %rdi
callq 0x164420
movq 0xb8(%rsp), %rsi
movq 0x7d8(%rsp), %rax
movq %rax, 0xc0(%rsp)
leaq 0x5f0(%rsp), %rdi
callq 0x1645e0
jmp 0x28bd1
leaq 0x1e2a85(%rip), %rsi    # 0x20b65d
leaq 0x5e0(%rsp), %rdi
callq 0x53460
movq 0xc0(%rsp), %rdi
movq 0x5e0(%rsp), %rdx
movq 0x5e8(%rsp), %rcx
leaq 0x5f0(%rsp), %rsi
callq 0x1644b0
jmp 0x28c0c
leaq 0x5f0(%rsp), %rdi
callq 0x164420
movq 0x7d8(%rsp), %rsi
leaq 0x570(%rsp), %rdi
callq 0x289f0
jmp 0x28c30
leaq 0x5a8(%rsp), %rdi
leaq 0x570(%rsp), %rsi
callq 0x287b0
jmp 0x28c47
leaq 0x550(%rsp), %rdi
leaq 0x670(%rsp), %rsi
callq 0x6f070
jmp 0x28c5e
leaq 0x710(%rsp), %rdi
leaq 0x550(%rsp), %rsi
callq 0x164630
movq %rax, 0xa8(%rsp)
jmp 0x28c7d
movq 0xa8(%rsp), %rdi
leaq 0x5a8(%rsp), %rsi
callq 0x29780
jmp 0x28c94
leaq 0x550(%rsp), %rdi
callq 0x52f50
leaq 0x5a8(%rsp), %rdi
callq 0x163580
leaq 0x570(%rsp), %rdi
callq 0x23b00
movq 0x7d8(%rsp), %rsi
leaq 0x510(%rsp), %rdi
callq 0x163d80
jmp 0x28cd2
leaq 0x798(%rsp), %rdi
leaq 0x510(%rsp), %rsi
movq %rsi, 0xa0(%rsp)
callq 0x164450
movq 0xa0(%rsp), %rdi
callq 0x164420
leaq 0x4d0(%rsp), %rdi
movl $0x2c, %esi
callq 0x164380
jmp 0x28d10
leaq 0x798(%rsp), %rdi
leaq 0x4d0(%rsp), %rsi
callq 0x164320
movb %al, 0x9f(%rsp)
jmp 0x28d2e
movb 0x9f(%rsp), %al
xorb $-0x1, %al
movb %al, 0x9e(%rsp)
leaq 0x4d0(%rsp), %rdi
callq 0x164420
movb 0x9e(%rsp), %al
testb $0x1, %al
jne 0x28d5b
jmp 0x28f4c
movq 0x7d8(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x490(%rsp), %rdi
leaq 0x798(%rsp), %rsi
callq 0x1645e0
jmp 0x28d82
leaq 0x1e3cbb(%rip), %rsi    # 0x20ca44
leaq 0x480(%rsp), %rdi
callq 0x53460
movq 0x90(%rsp), %rdi
movq 0x480(%rsp), %rdx
movq 0x488(%rsp), %rcx
leaq 0x490(%rsp), %rsi
callq 0x1644b0
jmp 0x28dbd
leaq 0x490(%rsp), %rdi
callq 0x164420
movl $0x2, 0x47c(%rsp)
jmp 0x28f90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
jmp 0x29760
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x758(%rsp), %rdi
callq 0x164420
jmp 0x29760
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
jmp 0x28ff7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x690(%rsp), %rdi
callq 0x164420
jmp 0x28ff7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
jmp 0x28fb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x5f0(%rsp), %rdi
callq 0x164420
jmp 0x28fb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
jmp 0x28ef1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
jmp 0x28ee4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x550(%rsp), %rdi
callq 0x52f50
leaq 0x5a8(%rsp), %rdi
callq 0x163580
leaq 0x570(%rsp), %rdi
callq 0x23b00
jmp 0x28fb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x4d0(%rsp), %rdi
callq 0x164420
jmp 0x28fb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x490(%rsp), %rdi
callq 0x164420
jmp 0x28fb4
movq 0x7d8(%rsp), %rsi
leaq 0x438(%rsp), %rdi
callq 0x163d80
jmp 0x28f63
leaq 0x798(%rsp), %rdi
leaq 0x438(%rsp), %rsi
callq 0x164450
leaq 0x438(%rsp), %rdi
callq 0x164420
movl $0x0, 0x47c(%rsp)
leaq 0x670(%rsp), %rdi
callq 0x52f50
movl 0x47c(%rsp), %eax
testl %eax, %eax
je 0x28faf
jmp 0x28faa
jmp 0x28aeb
jmp 0x28aeb
leaq 0x670(%rsp), %rdi
callq 0x52f50
jmp 0x28ff7
movq 0xd0(%rsp), %rdi
leaq 0x710(%rsp), %rsi
callq 0x164660
jmp 0x28fda
movl $0x1, 0x47c(%rsp)
leaq 0x710(%rsp), %rdi
callq 0x164740
jmp 0x29743
leaq 0x710(%rsp), %rdi
callq 0x164740
jmp 0x29760
leaq 0x3f8(%rsp), %rdi
movl $0x5b, %esi
callq 0x164380
jmp 0x2901d
leaq 0x798(%rsp), %rdi
leaq 0x3f8(%rsp), %rsi
callq 0x164320
movb %al, 0x8f(%rsp)
jmp 0x2903b
leaq 0x3f8(%rsp), %rdi
callq 0x164420
movb 0x8f(%rsp), %al
testb $0x1, %al
jne 0x29058
jmp 0x2945b
xorps %xmm0, %xmm0
movaps %xmm0, 0x3e0(%rsp)
movq $0x0, 0x3f0(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0x164750
movq 0x7d8(%rsp), %rsi
leaq 0x3a0(%rsp), %rdi
callq 0x163d80
jmp 0x29093
leaq 0x798(%rsp), %rdi
leaq 0x3a0(%rsp), %rsi
callq 0x164450
leaq 0x3a0(%rsp), %rdi
callq 0x164420
leaq 0x360(%rsp), %rdi
movl $0x5d, %esi
callq 0x164380
jmp 0x290c9
leaq 0x798(%rsp), %rdi
leaq 0x360(%rsp), %rsi
callq 0x164320
movb %al, 0x8e(%rsp)
jmp 0x290e7
movb 0x8e(%rsp), %al
xorb $-0x1, %al
movb %al, 0x8d(%rsp)
leaq 0x360(%rsp), %rdi
callq 0x164420
movb 0x8d(%rsp), %al
testb $0x1, %al
jne 0x29114
jmp 0x29415
movq 0x7d8(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x320(%rsp), %rdi
leaq 0x798(%rsp), %rsi
callq 0x1645e0
jmp 0x2913b
movq 0x80(%rsp), %rdi
leaq 0x320(%rsp), %rsi
callq 0x164760
jmp 0x29152
leaq 0x320(%rsp), %rdi
callq 0x164420
movq 0x7d8(%rsp), %rsi
leaq 0x2b0(%rsp), %rdi
callq 0x289f0
jmp 0x29176
leaq 0x2e8(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x287b0
jmp 0x2918d
leaq 0x3e0(%rsp), %rdi
leaq 0x2e8(%rsp), %rsi
callq 0x164790
jmp 0x291a4
leaq 0x2e8(%rsp), %rdi
callq 0x163580
leaq 0x2b0(%rsp), %rdi
callq 0x23b00
movq 0x7d8(%rsp), %rsi
leaq 0x270(%rsp), %rdi
callq 0x163d80
jmp 0x291d5
leaq 0x798(%rsp), %rdi
leaq 0x270(%rsp), %rsi
movq %rsi, 0x78(%rsp)
callq 0x164450
movq 0x78(%rsp), %rdi
callq 0x164420
leaq 0x230(%rsp), %rdi
movl $0x2c, %esi
callq 0x164380
jmp 0x2920d
leaq 0x798(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x164320
movb %al, 0x77(%rsp)
jmp 0x29228
movb 0x77(%rsp), %al
xorb $-0x1, %al
movb %al, 0x76(%rsp)
leaq 0x230(%rsp), %rdi
callq 0x164420
movb 0x76(%rsp), %al
testb $0x1, %al
jne 0x2924c
jmp 0x293d7
movq 0x7d8(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x1f0(%rsp), %rdi
leaq 0x798(%rsp), %rsi
callq 0x1645e0
jmp 0x29270
leaq 0x1e309c(%rip), %rsi    # 0x20c313
leaq 0x1e0(%rsp), %rdi
callq 0x53460
movq 0x68(%rsp), %rdi
movq 0x1e0(%rsp), %rdx
movq 0x1e8(%rsp), %rcx
leaq 0x1f0(%rsp), %rsi
callq 0x1644b0
jmp 0x292a8
leaq 0x1f0(%rsp), %rdi
callq 0x164420
jmp 0x290b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x3f8(%rsp), %rdi
callq 0x164420
jmp 0x29760
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
jmp 0x29449
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x360(%rsp), %rdi
callq 0x164420
jmp 0x29449
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x320(%rsp), %rdi
callq 0x164420
jmp 0x29449
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
jmp 0x2937c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x2e8(%rsp), %rdi
callq 0x163580
leaq 0x2b0(%rsp), %rdi
callq 0x23b00
jmp 0x29449
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x230(%rsp), %rdi
callq 0x164420
jmp 0x29449
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x1f0(%rsp), %rdi
callq 0x164420
jmp 0x29449
movq 0x7d8(%rsp), %rsi
leaq 0x1a0(%rsp), %rdi
callq 0x163d80
jmp 0x293ee
leaq 0x798(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x164450
leaq 0x1a0(%rsp), %rdi
callq 0x164420
jmp 0x290b5
movq 0xd0(%rsp), %rdi
leaq 0x3e0(%rsp), %rsi
callq 0x1647c0
jmp 0x2942c
movl $0x1, 0x47c(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0x1648a0
jmp 0x29743
leaq 0x3e0(%rsp), %rdi
callq 0x1648a0
jmp 0x29760
leaq 0x798(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x180(%rsp), %rdi
callq 0x5ac80
jmp 0x29477
movq 0x60(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x2b4b0
movb %al, 0x5f(%rsp)
jmp 0x2948f
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x2949c
jmp 0x2952b
leaq 0x7b8(%rsp), %rsi
leaq 0x158(%rsp), %rdi
callq 0x6f070
jmp 0x294b3
leaq 0x158(%rsp), %rdi
callq 0x1649e0
movl %eax, 0x58(%rsp)
jmp 0x294c6
movq 0xd0(%rsp), %rdi
movl 0x58(%rsp), %eax
movl %eax, 0x17c(%rsp)
leaq 0x17c(%rsp), %rsi
callq 0x164900
jmp 0x294e8
leaq 0x158(%rsp), %rdi
callq 0x52f50
movl $0x1, 0x47c(%rsp)
jmp 0x29743
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x52f50
jmp 0x29760
leaq 0x798(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x138(%rsp), %rdi
callq 0xca580
jmp 0x29547
movq 0x50(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x2b4b0
movb %al, 0x4f(%rsp)
jmp 0x2955f
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x2956c
jmp 0x29601
leaq 0x7b8(%rsp), %rsi
leaq 0x110(%rsp), %rdi
callq 0x6f070
jmp 0x29583
leaq 0x110(%rsp), %rdi
callq 0x164b40
movss %xmm0, 0x48(%rsp)
jmp 0x29598
movq 0xd0(%rsp), %rdi
movss 0x48(%rsp), %xmm0
movss %xmm0, 0x134(%rsp)
leaq 0x134(%rsp), %rsi
callq 0x164a60
jmp 0x295be
leaq 0x110(%rsp), %rdi
callq 0x52f50
movl $0x1, 0x47c(%rsp)
jmp 0x29743
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x750(%rsp)
movl %eax, 0x74c(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x52f50
jmp 0x29760
leaq 0x798(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x54410
jmp 0x2961d
movq 0x40(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x2b4b0
movb %al, 0x3f(%rsp)
jmp 0x29635
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x2963f
jmp 0x29666
movq 0xd0(%rsp), %rdi
leaq 0x7b8(%rsp), %rsi
callq 0x164bd0
jmp 0x29656
movl $0x1, 0x47c(%rsp)
jmp 0x29743
movq 0x2d7983(%rip), %rdi    # 0x300ff0
leaq 0x1e3462(%rip), %rsi    # 0x20cad6
callq 0x13380
movq %rax, 0x30(%rsp)
jmp 0x29680
leaq 0x798(%rsp), %rdi
callq 0x2b420
movq %rdx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
jmp 0x29699
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0xe0(%rsp)
movq %rax, 0xe8(%rsp)
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
callq 0x133c10
movq %rax, 0x18(%rsp)
jmp 0x296d4
movq 0x18(%rsp), %rdi
leaq 0x1e3426(%rip), %rsi    # 0x20cb06
callq 0x13380
movq %rax, 0x10(%rsp)
jmp 0x296ec
movq 0x10(%rsp), %rdi
leaq 0x7b8(%rsp), %rsi
callq 0x131a0
movq %rax, 0x8(%rsp)
jmp 0x29705
movq 0x8(%rsp), %rdi
movq 0x2d78cf(%rip), %rsi    # 0x300fe0
callq 0x135d0
jmp 0x29718
jmp 0x2971a
jmp 0x2971c
jmp 0x2971e
jmp 0x29720
jmp 0x29722
movq 0xd0(%rsp), %rdi
leaq 0x2d7cc7(%rip), %rsi    # 0x3013f8
callq 0x1e520
jmp 0x29738
movl $0x1, 0x47c(%rsp)
leaq 0x798(%rsp), %rdi
callq 0x164420
movq 0xd8(%rsp), %rax
addq $0x7e8, %rsp            # imm = 0x7E8
retq
leaq 0x798(%rsp), %rdi
callq 0x164420
movq 0x750(%rsp), %rdi
callq 0x133f0
nopw (%rax,%rax)