// File: Konano[P]UselessDatabase/Table.cpp
// Function: Table::toJson[abi:cxx11]()
json Table::toJson() { // assemble to JSON
    json j;
    j["name"] = name;
    j["table_id"] = table_id;
    j["col_num"] = col_num;
    for (uint i = 0; i < col_num; i++) j["col_ty"].push_back(col_ty[i].toJson());
    j["record_num"] = record_num;
    j["record_size"] = record_size;
    j["record_onepg"] = record_onepg;
    j["index_num"] = index_num;
    for (uint i = 0; i < index_num; i++) j["index"].push_back(index[i].toJson());
    if (p_key) j["primary"] = p_key->toJson();
    for (auto it: f_key) j["foreign"].push_back(it->toJson());
    j["p_key_index"] = p_key_index;
    for (uint i = 0; i < f_key.size(); i++) j["f_key_index"].push_back(f_key_index[i]);
    return j;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x148(%rbp)
movq %rdi, %rax
movq %rax, -0x140(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x138(%rbp)
movb $0x0, -0x11(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0xadd0
movq -0x138(%rbp), %rsi
addq $0x18, %rsi
leaq -0x28(%rbp), %rdi
callq 0xae10
jmp 0x47422
movq -0x148(%rbp), %rdi
leaq 0x3c7e6(%rip), %rsi     # 0x83c16
callq 0xae60
movq %rax, -0x150(%rbp)
jmp 0x4743e
movq -0x150(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movq %rsi, -0x160(%rbp)
callq 0xb0a0
movq -0x160(%rbp), %rdi
callq 0xb110
movq -0x138(%rbp), %rsi
addq $0x50, %rsi
leaq -0x48(%rbp), %rdi
callq 0xb150
movq -0x148(%rbp), %rdi
leaq 0x3c71d(%rip), %rsi     # 0x83ba0
callq 0xae60
movq %rax, -0x158(%rbp)
jmp 0x47491
movq -0x158(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movq %rsi, -0x170(%rbp)
callq 0xb0a0
movq -0x170(%rbp), %rdi
callq 0xb110
movq -0x138(%rbp), %rsi
addq $0x54, %rsi
leaq -0x58(%rbp), %rdi
callq 0xb150
movq -0x148(%rbp), %rdi
leaq 0x3c6d3(%rip), %rsi     # 0x83ba9
callq 0xae60
movq %rax, -0x168(%rbp)
jmp 0x474e4
movq -0x168(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xb0a0
leaq -0x58(%rbp), %rdi
callq 0xb110
movl $0x0, -0x5c(%rbp)
movq -0x138(%rbp), %rcx
movl -0x5c(%rbp), %eax
cmpl 0x54(%rcx), %eax
jae 0x475f0
movq -0x148(%rbp), %rdi
leaq 0x3c68c(%rip), %rsi     # 0x83bb1
callq 0xae60
movq %rax, -0x178(%rbp)
jmp 0x47533
movq -0x138(%rbp), %rax
movl -0x5c(%rbp), %ecx
imulq $0x38, %rcx, %rcx
leaq 0x58(%rax,%rcx), %rsi
leaq -0x70(%rbp), %rdi
callq 0x52190
jmp 0x47551
movq -0x178(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xb1f0
jmp 0x47563
leaq -0x70(%rbp), %rdi
callq 0xb110
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x47504
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x47b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq -0x138(%rbp), %rsi
addq $0x9fa0, %rsi           # imm = 0x9FA0
leaq -0x80(%rbp), %rdi
callq 0xb150
movq -0x148(%rbp), %rdi
leaq 0x3c5a3(%rip), %rsi     # 0x83bb8
callq 0xae60
movq %rax, -0x180(%rbp)
jmp 0x47623
movq -0x180(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movq %rsi, -0x190(%rbp)
callq 0xb0a0
movq -0x190(%rbp), %rdi
callq 0xb110
movq -0x138(%rbp), %rsi
addq $0x9fa8, %rsi           # imm = 0x9FA8
leaq -0x90(%rbp), %rdi
callq 0xb150
movq -0x148(%rbp), %rdi
leaq 0x3c252(%rip), %rsi     # 0x838c0
callq 0xae60
movq %rax, -0x188(%rbp)
jmp 0x4767c
movq -0x188(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movq %rsi, -0x1a0(%rbp)
callq 0xb0a0
movq -0x1a0(%rbp), %rdi
callq 0xb110
movq -0x138(%rbp), %rsi
addq $0x9fac, %rsi           # imm = 0x9FAC
leaq -0xa0(%rbp), %rdi
callq 0xb150
movq -0x148(%rbp), %rdi
leaq 0x3c4f9(%rip), %rsi     # 0x83bc3
callq 0xae60
movq %rax, -0x198(%rbp)
jmp 0x476d8
movq -0x198(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movq %rsi, -0x1b0(%rbp)
callq 0xb0a0
movq -0x1b0(%rbp), %rdi
callq 0xb110
movq -0x138(%rbp), %rsi
addq $0x798, %rsi            # imm = 0x798
leaq -0xb0(%rbp), %rdi
callq 0xb150
movq -0x148(%rbp), %rdi
leaq 0x3c4aa(%rip), %rsi     # 0x83bd0
callq 0xae60
movq %rax, -0x1a8(%rbp)
jmp 0x47734
movq -0x1a8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xb0a0
leaq -0xb0(%rbp), %rdi
callq 0xb110
movl $0x0, -0xb4(%rbp)
movq -0x138(%rbp), %rcx
movl -0xb4(%rbp), %eax
cmpl 0x798(%rcx), %eax
jae 0x4787f
movq -0x148(%rbp), %rdi
leaq 0x3c478(%rip), %rsi     # 0x83bfc
callq 0xae60
movq %rax, -0x1b8(%rbp)
jmp 0x47792
movq -0x138(%rbp), %rax
movl -0xb4(%rbp), %ecx
imulq $0x98, %rcx, %rcx
leaq 0x7a0(%rax,%rcx), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x35cb0
jmp 0x477bc
movq -0x1b8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xb1f0
jmp 0x477d1
leaq -0xc8(%rbp), %rdi
callq 0xb110
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x4775d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq -0x138(%rbp), %rax
cmpq $0x0, 0x758(%rax)
je 0x47906
movq -0x138(%rbp), %rax
movq 0x758(%rax), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x43920
jmp 0x478ac
movq -0x148(%rbp), %rdi
leaq 0x3c320(%rip), %rsi     # 0x83bda
callq 0xae60
movq %rax, -0x1c0(%rbp)
jmp 0x478c8
movq -0x1c0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xb0a0
leaq -0xd8(%rbp), %rdi
callq 0xb110
jmp 0x47906
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq -0x138(%rbp), %rax
addq $0x760, %rax            # imm = 0x760
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rdi
callq 0x446e0
movq %rax, -0xe8(%rbp)
movq -0xe0(%rbp), %rdi
callq 0x44530
movq %rax, -0xf0(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x525a0
testb $0x1, %al
jne 0x4795c
jmp 0x479f2
leaq -0xe8(%rbp), %rdi
callq 0x44ab0
movq -0x148(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xf8(%rbp)
leaq 0x3c262(%rip), %rsi     # 0x83be2
callq 0xae60
movq %rax, -0x1c8(%rbp)
jmp 0x4798e
movq -0xf8(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x43620
jmp 0x479a3
movq -0x1c8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0xb1f0
jmp 0x479b8
leaq -0x108(%rbp), %rdi
callq 0xb110
leaq -0xe8(%rbp), %rdi
callq 0x525e0
jmp 0x47940
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq -0x138(%rbp), %rsi
addq $0x778, %rsi            # imm = 0x778
leaq -0x118(%rbp), %rdi
callq 0x52600
movq -0x148(%rbp), %rdi
leaq 0x3c1d0(%rip), %rsi     # 0x83bea
callq 0xae60
movq %rax, -0x1d0(%rbp)
jmp 0x47a28
movq -0x1d0(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0xb0a0
leaq -0x118(%rbp), %rdi
callq 0xb110
movl $0x0, -0x11c(%rbp)
movq -0x138(%rbp), %rdi
movl -0x11c(%rbp), %eax
movq %rax, -0x1d8(%rbp)
addq $0x760, %rdi            # imm = 0x760
callq 0x447e0
movq %rax, %rcx
movq -0x1d8(%rbp), %rax
cmpq %rcx, %rax
jae 0x47b3a
movq -0x148(%rbp), %rdi
leaq 0x3c164(%rip), %rsi     # 0x83bf6
callq 0xae60
movq %rax, -0x1e0(%rbp)
jmp 0x47aa0
movq -0x138(%rbp), %rdi
addq $0x780, %rdi            # imm = 0x780
movl -0x11c(%rbp), %eax
movl %eax, %esi
callq 0x3d6f0
movq %rax, %rsi
leaq -0x130(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x52600
movq -0x1e0(%rbp), %rdi
movq -0x1e8(%rbp), %rsi
callq 0xb1f0
jmp 0x47ae6
leaq -0x130(%rbp), %rdi
callq 0xb110
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x47a51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x118(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x130(%rbp), %rdi
callq 0xb110
jmp 0x47b60
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x47b50
movq -0x148(%rbp), %rdi
callq 0xb110
movq -0x140(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x148(%rbp), %rdi
callq 0xb110
movq -0x30(%rbp), %rdi
callq 0x6890
nopw %cs:(%rax,%rax)