// File: /workspace/github_cpp_makefile_star2_O3/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, 0x30(%rsp)
leaq 0x78(%rdi), %rax
movq %rax, 0x38(%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 0x282d3(%rip), %rsi     # 0x40c46
movq %rdx, %rdi
callq 0x8eb2
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x91f2
leaq 0x8(%rbx), %rdi
leaq 0x20(%rsp), %r15
movq -0x10(%r15), %r14
movq %r14, %rsi
callq 0x5360
cmpq %r15, %r14
je 0x189b2
movq 0x20(%rsp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x53a0
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x189c0
movq %rax, 0x38(%rbx)
movq 0x78(%rbx), %rax
cmpq %rax, 0x80(%rbx)
je 0x189d4
movq %rax, 0x80(%rbx)
movq 0x48(%rbx), %rax
cmpq %rax, 0x50(%rbx)
je 0x189e2
movq %rax, 0x50(%rbx)
leaq 0x27ea7(%rip), %rsi     # 0x40890
movq %r13, %rdi
callq 0x8eb2
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xdf5b
movl 0x10(%rsp), %eax
movl %eax, 0x28(%rbx)
testl %eax, %eax
je 0x18ae5
xorl %ebp, %ebp
leaq 0x25bae(%rip), %r15     # 0x3e5c4
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r12
movq %r13, %rdi
movq %r15, %rsi
callq 0x8eb2
movq %rax, %rdi
movq %rbp, %rsi
callq 0x9240
movq %rax, %rdi
movq %r14, %rsi
callq 0x1ccf7
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rbx), %rsi
cmpq 0x40(%rbx), %rsi
je 0x18a5f
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rbx)
jmp 0x18a6c
movq 0x40(%rsp), %rdi
movq %r12, %rdx
callq 0x1ca80
incq %rbp
movl 0x28(%rbx), %eax
cmpq %rax, %rbp
jb 0x18a20
testl %eax, %eax
je 0x18ae5
xorl %ebp, %ebp
leaq 0x27e14(%rip), %r15     # 0x40898
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r12
movq %r13, %rdi
movq %r15, %rsi
callq 0x8eb2
movq %rax, %rdi
movq %rbp, %rsi
callq 0x9240
movq %rax, %rdi
movq %r14, %rsi
callq 0x1ccf7
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x50(%rbx), %rsi
cmpq 0x58(%rbx), %rsi
je 0x18acd
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x50(%rbx)
jmp 0x18ada
movq 0x30(%rsp), %rdi
movq %r12, %rdx
callq 0x1ca80
incq %rbp
movl 0x28(%rbx), %eax
cmpq %rax, %rbp
jb 0x18a8e
leaq 0x27db3(%rip), %rsi     # 0x4089f
movq %r13, %rdi
callq 0x8eb2
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xdf5b
movl 0x10(%rsp), %eax
movl %eax, 0x60(%rbx)
leaq 0x27d99(%rip), %rsi     # 0x408a8
movq %r13, %rdi
callq 0x8eb2
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xdf5b
movl 0x10(%rsp), %eax
movl %eax, 0x64(%rbx)
leaq 0x27d80(%rip), %rsi     # 0x408b2
movq %r13, %rdi
callq 0x8eb2
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xdf5b
movl 0x10(%rsp), %eax
movl %eax, 0x68(%rbx)
leaq 0x27d6b(%rip), %rsi     # 0x408c0
movq %r13, %rdi
callq 0x8eb2
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0xdf5b
movzwl 0x10(%rsp), %eax
movw %ax, 0x6c(%rbx)
cmpl $0x0, 0x28(%rbx)
je 0x18bec
xorl %ebp, %ebp
leaq 0x28063(%rip), %r15     # 0x40be5
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r12
movq %r13, %rdi
movq %r15, %rsi
callq 0x8eb2
movq %rax, %rdi
movq %rbp, %rsi
callq 0x9240
movq %rax, %rdi
movq %r14, %rsi
callq 0x1ce3a
movl 0x10(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x80(%rbx), %rsi
cmpq 0x88(%rbx), %rsi
je 0x18bd4
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x80(%rbx)
jmp 0x18be1
movq 0x38(%rsp), %rdi
movq %r12, %rdx
callq 0x1cf6e
incq %rbp
movl 0x28(%rbx), %eax
cmpq %rax, %rbp
jb 0x18b8c
movl $0xffffffff, 0x74(%rbx) # imm = 0xFFFFFFFF
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x18c0a
jmp 0x18c0a
jmp 0x18c0a
jmp 0x18c0a
movq %rax, %r14
movq 0x38(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x18c29
movq 0x88(%rbx), %rsi
subq %rdi, %rsi
callq 0x53a0
movq 0x30(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x18c42
movq 0x58(%rbx), %rsi
subq %rdi, %rsi
callq 0x53a0
movq 0x40(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x18c5b
movq 0x40(%rbx), %rsi
subq %rdi, %rsi
callq 0x53a0
movq %r14, %rdi
callq 0x56e0
nop