// File: 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
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x150(%rbp)
addq $0x8, %rdi
callq 0x15ad0
movq -0x150(%rbp), %rdi
addq $0x38, %rdi
callq 0x34b0
testb $0x1, %al
jne 0x13d19
jmp 0x13d1e
jmp 0x13fbf
movq -0x150(%rbp), %rdi
addq $0x38, %rdi
callq 0x3120
movq %rax, %rdi
leaq 0x13519(%rip), %rsi     # 0x27251
callq 0x3370
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x245f0
movq -0x10(%rbp), %rcx
leaq -0x14(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x3450
jmp 0x13d6a
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x13fab
movq -0x10(%rbp), %rcx
leaq -0x64(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x3450
jmp 0x13d96
cmpl $0x0, -0x64(%rbp)
jne 0x13df8
movq -0x10(%rbp), %rcx
leaq -0x68(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x3450
jmp 0x13db5
movl -0x68(%rbp), %esi
leaq -0x98(%rbp), %rdi
callq 0x24620
jmp 0x13dc6
leaq -0x48(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x15e80
leaq -0x98(%rbp), %rdi
callq 0x7af0
jmp 0x13f4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x13fc8
cmpl $0x1, -0x64(%rbp)
jne 0x13e51
movq -0x10(%rbp), %rcx
leaq -0x9c(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x3450
jmp 0x13e1a
movss -0x9c(%rbp), %xmm0
leaq -0xd0(%rbp), %rdi
callq 0x24660
jmp 0x13e30
leaq -0x48(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x15e80
leaq -0xd0(%rbp), %rdi
callq 0x7af0
jmp 0x13f49
cmpl $0x2, -0x64(%rbp)
jne 0x13f40
leaq -0xf0(%rbp), %rdi
callq 0x3410
movq -0x10(%rbp), %rcx
leaq -0xf1(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x3450
jmp 0x13e81
movsbl -0xf1(%rbp), %eax
cmpl $0x0, %eax
jne 0x13ea0
jmp 0x13eb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x13f2f
movsbl -0xf1(%rbp), %esi
leaq -0xf0(%rbp), %rdi
callq 0x31d0
jmp 0x13eb5
jmp 0x13e67
leaq -0x148(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x3130
jmp 0x13ecc
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x246f0
jmp 0x13ee1
leaq -0x48(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x15e80
leaq -0x128(%rbp), %rdi
callq 0x7af0
leaq -0x148(%rbp), %rdi
callq 0x35b8
leaq -0xf0(%rbp), %rdi
callq 0x35b8
jmp 0x13f47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x35b8
leaq -0xf0(%rbp), %rdi
callq 0x35b8
jmp 0x13fc8
movl $0xffffffff, -0x20(%rbp) # imm = 0xFFFFFFFF
jmp 0x13f49
jmp 0x13f4b
movq -0x10(%rbp), %rcx
leaq -0x50(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x3450
jmp 0x13f64
movq -0x150(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x160(%rbp)
addq $0x8, %rdi
leaq -0x48(%rbp), %rsi
callq 0x14dc0
movq %rax, -0x158(%rbp)
jmp 0x13f8c
movq -0x158(%rbp), %rax
movq -0x160(%rbp), %rcx
movq %rcx, (%rax)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x13d71
movq -0x10(%rbp), %rdi
callq 0x32d0
jmp 0x13fb6
leaq -0x48(%rbp), %rdi
callq 0x7af0
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x7af0
movq -0x58(%rbp), %rdi
callq 0x34f0
nopw (%rax,%rax)