// File: /workspace/github_cpp_makefile_star2_O1/zimpha[P]MiniSQL/indexManager.cc
// Function: IndexManager::load()
void IndexManager::load() {
    mp.clear();
    if (currentFile.empty()) return;
    FILE *file = fopen(currentFile.c_str(), "rb");
    int n = 0;
    element lhs;
    long rhs;
    fread(&n, sizeof(int), 1, file);
    for (int i = 0; i < n; i++) {
        int type;
        fread(&type, sizeof(type), 1, file);
        if (type == 0) {
            int tmp;
            fread(&tmp, sizeof(tmp), 1, file);
            lhs = element(tmp);
        } else if (type == 1) {
            float tmp;
            fread(&tmp, sizeof(tmp), 1, file);
            lhs = element(tmp);
        } else if (type == 2) {
            string s;
            for (char c;;) {
                fread(&c, sizeof(c), 1, file);
                if (c == 0) break;
                s += c;
            }
            lhs = element(s);
        } else {
            lhs.type = -1;
        }
        fread(&rhs, sizeof(rhs), 1, file);
        mp[lhs] = rhs;
    }
    fclose(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %r14
addq $0x8, %rdi
movq %rdi, -0xb8(%rbp)
callq 0xccba
cmpq $0x0, 0x40(%r14)
je 0xc176
movq 0x38(%r14), %rdi
leaq 0x8358(%rip), %rsi      # 0x14297
callq 0x3330
movq %rax, %r14
leaq -0xe4(%rbp), %r15
movl $0x0, (%r15)
leaq -0xb0(%rbp), %rdi
callq 0x13164
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x33d0
movl (%r15), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
jle 0xc159
xorl %ebx, %ebx
leaq -0x80(%rbp), %r12
leaq -0xd8(%rbp), %r13
leaq -0x50(%rbp), %r15
movl $0x4, %esi
movl $0x1, %edx
leaq -0x30(%rbp), %rdi
movq %r14, %rcx
callq 0x33d0
movl -0x30(%rbp), %eax
cmpl $0x2, %eax
je 0xc039
cmpl $0x1, %eax
je 0xbfe6
testl %eax, %eax
jne 0xc076
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x33d0
movl -0x50(%rbp), %esi
movq %r12, %rdi
callq 0x13186
jmp 0xc008
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x33d0
movss -0x50(%rbp), %xmm0
movq %r12, %rdi
callq 0x131aa
movq -0x80(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3340
movl -0x58(%rbp), %eax
movl %eax, -0x88(%rbp)
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
jmp 0xc107
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movl $0x1, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x33d0
movb -0x80(%rbp), %al
testb %al, %al
je 0xc085
movsbl %al, %esi
movq %r15, %rdi
callq 0x3230
jmp 0xc04d
movl $0xffffffff, -0x88(%rbp) # imm = 0xFFFFFFFF
jmp 0xc111
leaq -0xc8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x8766
movq %r12, %rdi
movq %r13, %rsi
callq 0x131fa
movq -0x80(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3340
movl -0x58(%rbp), %eax
movl %eax, -0x88(%rbp)
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xc0e7
callq 0x3270
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xc0ff
callq 0x3270
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xc111
callq 0x3270
movl $0x8, %esi
movl $0x1, %edx
leaq -0xe0(%rbp), %rdi
movq %r14, %rcx
callq 0x33d0
movq -0xe0(%rbp), %r13
movq -0xb8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xc894
movq %r13, (%rax)
incl %ebx
cmpl -0x2c(%rbp), %ebx
leaq -0xd8(%rbp), %r13
jne 0xbf95
movq %r14, %rdi
callq 0x3290
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc176
callq 0x3270
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc1ab
jmp 0xc1b0
jmp 0xc1ab
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xc1b3
callq 0x3270
jmp 0xc1b3
movq %rax, %rbx
jmp 0xc1c5
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xc1c5
callq 0x3270
leaq -0x98(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc1da
callq 0x3270
movq %rbx, %rdi
callq 0x3480