// File: /workspace/github_cpp_makefile_star2_O1/SeanChao[P]KV-Store/kvstore.cc
// Function: KVStore::loadSsTable()
void KVStore::loadSsTable() {
    // checks existing ss-table
    int lv = 0;
    int count = 0;
    std::string level = resolvePath(lv);
    while (std::filesystem::exists(level)) {
        // std::string filename = "sstable-" + std::to_string(count);
        // std::clog << "see lv " << lv << std::endl;
        std::string filename = resolvePath(lv, count);
        if ((int)fileNum.size() < lv + 1) fileNum.push_back(0);
        while (std::filesystem::exists(filename)) {
            // std::clog << "see file " << filename << std::endl;
            // parse the file
            readSsTable(filename);
            fileNum[lv]++;
            filename = resolvePath(lv, ++count);
        }
        count = 0;
        level = resolvePath(++lv);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x78(%rsp), %rdi
xorl %r15d, %r15d
movq %rbx, %rsi
xorl %edx, %edx
callq 0x6646
leaq 0x60(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0x50(%rsp), %r12
leaq 0x20(%rsp), %r13
movq %r12, %rdi
leaq 0x78(%rsp), %rsi
movl $0x2, %edx
callq 0x8f3a
movq %r12, %rdi
callq 0x3120
movq %rax, %r14
movq %r12, %rdi
callq 0x8fba
testb %r14b, %r14b
je 0x5219
movzbl %r14b, %eax
cmpl $0xff, %eax
je 0x5219
movq %r13, %rdi
movq %rbx, %rsi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x5ea6
movq 0x68(%rbx), %rsi
movq %rsi, %rax
subq 0x60(%rbx), %rax
shrq $0x2, %rax
cltq
cmpq %rax, %r15
jl 0x50df
movl $0x0, 0x50(%rsp)
cmpq 0x70(%rbx), %rsi
je 0x50d2
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rbx)
jmp 0x50df
movq 0x40(%rsp), %rdi
movq %r12, %rdx
callq 0x9766
leaq 0x1(%r15), %rax
movq %rax, 0x48(%rsp)
movl $0x1, %r14d
movq %r12, %rdi
movq %r13, %rsi
movl $0x2, %edx
callq 0x8f3a
movq %r12, %rdi
callq 0x3120
movq %rax, %rbp
movq %r12, %rdi
callq 0x8fba
testb %bpl, %bpl
je 0x51b8
movzbl %bpl, %eax
cmpl $0xff, %eax
je 0x51b8
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %rsp, %rbp
movq %rbp, %rdi
callq 0x9582
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x7822
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x5170
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x60(%rbx), %rax
incl (%rax,%r15,4)
movq %r12, %rdi
movq %rbx, %rsi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x5ea6
movq %r13, %rdi
movq %r12, %rsi
callq 0x32e0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x51b0
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3280
incl %r14d
jmp 0x50ee
movq %r12, %rdi
movq %rbx, %rsi
movq 0x48(%rsp), %r15
movl %r15d, %edx
callq 0x6646
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
callq 0x32e0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x51f4
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x5051
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x5051
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x523a
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5299
jmp 0x5299
jmp 0x5252
movq %rax, %rbx
jmp 0x52b8
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x8fba
jmp 0x52b8
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x529c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x529c
jmp 0x5299
jmp 0x5299
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x8fba
jmp 0x529c
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x52b8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x52d9
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x33f0
nop