// File: benjibc[P]json-universal-container/jsonUnitTest.cpp
// Function: main
int main()
{
    JSON data;
    populate(data);
    int ID = (int)data["id"];
    assert(((int)data["id"]) == ID);
    assert(((string)data["person"][0]["name"]) == "Benny");
    assert(((int)data["secondID"]) == 1);
    std::cout << data.json_encode() << std::endl;
    JSON decoded;
    JSONDecode(data.json_encode(), decoded);
    std::cout << decoded.json_encode() << std::endl;
    std::string test_data = "{ \"glossary\": { \"title\": \"example glossary\","
		"\"GlossDiv\": { \"title\": \"S\", \"GlossList\": { \"GlossEntry\": {"
        "\"ID\": \"SGML\",\"SortAs\": \"SGML\","
	    "\"GlossTerm\": \"Standard Generalized Markup Language\","
        "\"Acronym\": \"SGML\",\"Abbrev\": \"ISO 8879:1986\","
        "\"GlossDef\": {\"para\": \"A meta-markup language, "
        "used to create markup languages such as DocBook.\","
        "\"GlossSeeAlso\": [\"GML\", \"XML\"]},\"GlossSee\": \"markup\""
        "} } } } }";
    JSON decoded2;
    JSONDecode(test_data, decoded2);
    std::cout << decoded2.json_encode() << std::endl;
    return 0;
}

// Assembly:
subq $0x1e8, %rsp            # imm = 0x1E8
movl $0x0, 0x1e4(%rsp)
leaq 0x1b0(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x5890
movq 0x70(%rsp), %rdi
callq 0x50b0
jmp 0x5390
leaq 0xe108(%rip), %rsi      # 0x1349f
leaq 0x1b0(%rsp), %rdi
callq 0x6180
movq %rax, 0x68(%rsp)
jmp 0x53ab
movq 0x68(%rsp), %rdi
callq 0x67b0
movl %eax, 0x64(%rsp)
jmp 0x53bb
movl 0x64(%rsp), %eax
movl %eax, 0x1a0(%rsp)
leaq 0xe0d2(%rip), %rsi      # 0x1349f
leaq 0x1b0(%rsp), %rdi
callq 0x6180
movq %rax, 0x58(%rsp)
jmp 0x53e1
movq 0x58(%rsp), %rdi
callq 0x67b0
movl %eax, 0x54(%rsp)
jmp 0x53f1
movl 0x54(%rsp), %eax
cmpl 0x1a0(%rsp), %eax
jne 0x5400
jmp 0x5438
leaq 0xcdc2(%rip), %rdi      # 0x121c9
leaq 0xcdd3(%rip), %rsi      # 0x121e1
movl $0x1d, %edx
leaq 0xcdd8(%rip), %rcx      # 0x121f2
callq 0x3160
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x5875
leaq 0xcd7d(%rip), %rsi      # 0x121bc
leaq 0x1b0(%rsp), %rdi
callq 0x6180
movq %rax, 0x48(%rsp)
jmp 0x5453
movq 0x48(%rsp), %rdi
xorl %esi, %esi
callq 0x66a0
movq %rax, 0x40(%rsp)
jmp 0x5466
movq 0x40(%rsp), %rdi
leaq 0xcd3f(%rip), %rsi      # 0x121b1
callq 0x6180
movq %rax, 0x38(%rsp)
jmp 0x547e
movq 0x38(%rsp), %rsi
leaq 0x180(%rsp), %rdi
callq 0x6900
jmp 0x5492
leaq 0xcd1d(%rip), %rsi      # 0x121b6
leaq 0x180(%rsp), %rdi
callq 0x68d0
movb %al, 0x37(%rsp)
jmp 0x54ac
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x54b6
jmp 0x54b8
jmp 0x54fd
leaq 0xcd3e(%rip), %rdi      # 0x121fd
leaq 0xcd1b(%rip), %rsi      # 0x121e1
movl $0x1e, %edx
leaq 0xcd20(%rip), %rcx      # 0x121f2
callq 0x3160
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x180(%rsp), %rdi
callq 0x3150
jmp 0x5875
leaq 0x180(%rsp), %rdi
callq 0x3150
leaq 0xcc97(%rip), %rsi      # 0x121a8
leaq 0x1b0(%rsp), %rdi
callq 0x6180
movq %rax, 0x28(%rsp)
jmp 0x5525
movq 0x28(%rsp), %rdi
callq 0x67b0
movl %eax, 0x24(%rsp)
jmp 0x5535
movl 0x24(%rsp), %eax
cmpl $0x1, %eax
jne 0x5540
jmp 0x555f
leaq 0xcce5(%rip), %rdi      # 0x1222c
leaq 0xcc93(%rip), %rsi      # 0x121e1
movl $0x1f, %edx
leaq 0xcc98(%rip), %rcx      # 0x121f2
callq 0x3160
leaq 0x160(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x6a60
jmp 0x557a
movq 0x14a57(%rip), %rdi     # 0x19fd8
leaq 0x160(%rsp), %rsi
callq 0x3220
movq %rax, 0x18(%rsp)
jmp 0x5595
movq 0x18(%rsp), %rdi
movq 0x14a17(%rip), %rsi     # 0x19fb8
callq 0x3290
jmp 0x55a8
leaq 0x160(%rsp), %rdi
callq 0x3150
leaq 0x130(%rsp), %rdi
callq 0x5890
jmp 0x55c4
leaq 0x110(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x6a60
jmp 0x55df
leaq 0x110(%rsp), %rdi
leaq 0x130(%rsp), %rsi
xorl %edx, %edx
callq 0x36d0
jmp 0x55f8
leaq 0x110(%rsp), %rdi
callq 0x3150
leaq 0xf0(%rsp), %rdi
leaq 0x130(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x6a60
jmp 0x5620
movq 0x149b1(%rip), %rdi     # 0x19fd8
leaq 0xf0(%rsp), %rsi
callq 0x3220
movq %rax, 0x10(%rsp)
jmp 0x563b
movq 0x10(%rsp), %rdi
movq 0x14971(%rip), %rsi     # 0x19fb8
callq 0x3290
jmp 0x564e
leaq 0xf0(%rsp), %rdi
callq 0x3150
leaq 0xcf(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x33f0
movq 0x8(%rsp), %rdx
leaq 0xcbd0(%rip), %rsi      # 0x12249
leaq 0xd0(%rsp), %rdi
callq 0x3340
jmp 0x5688
leaq 0xcf(%rsp), %rdi
callq 0x32c0
leaq 0x98(%rsp), %rdi
callq 0x5890
jmp 0x56a4
leaq 0xd0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
xorl %edx, %edx
callq 0x36d0
jmp 0x56bd
leaq 0x78(%rsp), %rdi
leaq 0x98(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x6a60
jmp 0x56d5
movq 0x148fc(%rip), %rdi     # 0x19fd8
leaq 0x78(%rsp), %rsi
callq 0x3220
movq %rax, (%rsp)
jmp 0x56ec
movq (%rsp), %rdi
movq 0x148c1(%rip), %rsi     # 0x19fb8
callq 0x3290
jmp 0x56fe
leaq 0x78(%rsp), %rdi
callq 0x3150
movl $0x0, 0x1e4(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x5c80
leaq 0xd0(%rsp), %rdi
callq 0x3150
leaq 0x130(%rsp), %rdi
callq 0x5c80
leaq 0x1b0(%rsp), %rdi
callq 0x5c80
movl 0x1e4(%rsp), %eax
addq $0x1e8, %rsp            # imm = 0x1E8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x3150
jmp 0x5875
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x5868
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x3150
jmp 0x5868
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x3150
jmp 0x5868
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0xcf(%rsp), %rdi
callq 0x32c0
jmp 0x5868
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x585b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x584e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x3150
leaq 0x98(%rsp), %rdi
callq 0x5c80
leaq 0xd0(%rsp), %rdi
callq 0x3150
leaq 0x130(%rsp), %rdi
callq 0x5c80
leaq 0x1b0(%rsp), %rdi
callq 0x5c80
movq 0x1a8(%rsp), %rdi
callq 0x33e0
nop