// File: /workspace/github_cpp_makefile_star2_O1/Konano[P]UselessDatabase/Index.cpp
// Function: Index::Index(Table*, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>)
Index::Index(Table* table, json j) : table(table) {
    strcpy(name, j["name"].get<std::string>().c_str());
    key.clear();
    ty.clear();
    offset.clear();
    key_num = j["key_num"].get<int>();
    for (uint i = 0; i < key_num; i++) key.push_back(j["key"][i]);
    for (uint i = 0; i < key_num; i++) offset.push_back(j["offset"][i]);
    page_num = j["page_num"].get<int>();
    root_page = j["root_page"].get<int>();
    next_del_page = j["next_del_page"].get<int>();
    record_size = j["record_size"].get<int>();
    for (uint i = 0; i < key_num; i++) ty.push_back((enumType)j["ty"][i]);
    fileID = -1; // file is closed
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r13
movq %rdi, %rbx
movq %rsi, (%rdi)
leaq 0x30(%rdi), %rax
movq %rax, 0x40(%rsp)
leaq 0x48(%rdi), %rax
movq %rax, 0x38(%rsp)
leaq 0x78(%rdi), %rax
movq %rax, 0x30(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rdi)
movq $0x0, 0x88(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x50(%rdi)
leaq 0x28ac5(%rip), %rsi     # 0x41c16
movq %rdx, %rdi
callq 0x8fa0
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x92c0
leaq 0x8(%rbx), %rdi
leaq 0x20(%rsp), %r15
movq -0x10(%r15), %r14
movq %r14, %rsi
callq 0x5360
cmpq %r15, %r14
je 0x19190
movq 0x20(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x53a0
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x1919e
movq %rax, 0x38(%rbx)
movq 0x78(%rbx), %rax
cmpq %rax, 0x80(%rbx)
je 0x191b2
movq %rax, 0x80(%rbx)
movq 0x48(%rbx), %rax
cmpq %rax, 0x50(%rbx)
je 0x191c0
movq %rax, 0x50(%rbx)
leaq 0x286d9(%rip), %rsi     # 0x418a0
movq %r13, %rdi
callq 0x8fa0
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xe350
movl 0x10(%rsp), %eax
movl %eax, 0x28(%rbx)
testl %eax, %eax
je 0x19251
xorl %ebp, %ebp
leaq 0x263d7(%rip), %r14     # 0x3f5c7
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movq %r13, %rdi
movq %r14, %rsi
callq 0x8fa0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x930e
movq %rax, %rdi
movq %r15, %rsi
callq 0x1d3ef
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rbx), %rsi
cmpq 0x40(%rbx), %rsi
je 0x19239
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rbx)
jmp 0x19246
movq 0x40(%rsp), %rdi
movq %r12, %rdx
callq 0x1d178
incq %rbp
movl 0x28(%rbx), %eax
cmpq %rax, %rbp
jb 0x191fa
cmpl $0x0, 0x28(%rbx)
je 0x192c1
xorl %ebp, %ebp
leaq 0x28648(%rip), %r14     # 0x418a8
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movq %r13, %rdi
movq %r14, %rsi
callq 0x8fa0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x930e
movq %rax, %rdi
movq %r15, %rsi
callq 0x1d3ef
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x50(%rbx), %rsi
cmpq 0x58(%rbx), %rsi
je 0x192a9
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x50(%rbx)
jmp 0x192b6
movq 0x38(%rsp), %rdi
movq %r12, %rdx
callq 0x1d178
incq %rbp
movl 0x28(%rbx), %eax
cmpq %rax, %rbp
jb 0x1926a
leaq 0x285e7(%rip), %rsi     # 0x418af
movq %r13, %rdi
callq 0x8fa0
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xe350
movl 0x10(%rsp), %eax
movl %eax, 0x60(%rbx)
leaq 0x285cd(%rip), %rsi     # 0x418b8
movq %r13, %rdi
callq 0x8fa0
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xe350
movl 0x10(%rsp), %eax
movl %eax, 0x64(%rbx)
leaq 0x285b4(%rip), %rsi     # 0x418c2
movq %r13, %rdi
callq 0x8fa0
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xe350
movl 0x10(%rsp), %eax
movl %eax, 0x68(%rbx)
leaq 0x2859f(%rip), %rsi     # 0x418d0
movq %r13, %rdi
callq 0x8fa0
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xe350
movzwl 0x10(%rsp), %eax
movw %ax, 0x6c(%rbx)
cmpl $0x0, 0x28(%rbx)
je 0x193c8
xorl %ebp, %ebp
leaq 0x28857(%rip), %r14     # 0x41bb5
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movq %r13, %rdi
movq %r14, %rsi
callq 0x8fa0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x930e
movq %rax, %rdi
movq %r15, %rsi
callq 0x1d521
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x80(%rbx), %rsi
cmpq 0x88(%rbx), %rsi
je 0x193b0
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x80(%rbx)
jmp 0x193bd
movq 0x30(%rsp), %rdi
movq %r12, %rdx
callq 0x1d644
incq %rbp
movl 0x28(%rbx), %eax
cmpq %rax, %rbp
jb 0x19368
movl $0xffffffff, 0x74(%rbx) # imm = 0xFFFFFFFF
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x193e6
jmp 0x193e6
jmp 0x193e6
jmp 0x193e6
movq %rax, %r14
movq 0x30(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x19405
movq 0x88(%rbx), %rsi
subq %rdi, %rsi
callq 0x53a0
movq 0x38(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1941e
movq 0x58(%rbx), %rsi
subq %rdi, %rsi
callq 0x53a0
movq 0x40(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x19437
movq 0x40(%rbx), %rsi
subq %rdi, %rsi
callq 0x53a0
movq %r14, %rdi
callq 0x56e0
nop