// File: /workspace/github_cpp_makefile_star2_O1/SeanChao[P]KV-Store/kvstore.cc
// Function: KVStore::reset()
void KVStore::reset() {
    // reset memTable
    resetMemTable();
    // Removes all existing ss-table
    int lv = 0;
    std::string level = resolvePath(lv);
    while (std::filesystem::exists(level)) {
        // std::clog << "remove " << level << std::endl;
        uintmax_t count = std::filesystem::remove_all(level);
        std::clog << "removed " << count << " file or directories" << std::endl;
        level = resolvePath(++lv);
        // std::clog << level << std::endl;
    }
    level = resolvePath(-1);
    if (std::filesystem::exists(level)) std::filesystem::remove_all(level);
    indexTableList.clear();
    fileNum.clear();
    fileNum.push_back(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
callq 0x59ae
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x6646
movl $0x1, %ebp
movq %rsp, %r15
movq 0x8ba5(%rip), %r12      # 0xefa8
movq %r15, %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x8f3a
movq %r15, %rdi
callq 0x3120
movq %rax, %r13
movq %r15, %rdi
callq 0x8fba
testb %r13b, %r13b
je 0x64f9
movzbl %r13b, %eax
cmpl $0xff, %eax
je 0x64f9
movq %r15, %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x8f3a
movq %r15, %rdi
callq 0x3420
movq %rax, %r13
movq %r15, %rdi
callq 0x8fba
movl $0x8, %edx
movq %r12, %rdi
leaq 0x4e9d(%rip), %rsi      # 0xb30d
callq 0x32b0
movq %r12, %rdi
movq %r13, %rsi
callq 0x31a0
movq %rax, %r13
movl $0x14, %edx
movq %rax, %rdi
leaq 0x4e84(%rip), %rsi      # 0xb316
callq 0x32b0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x6646
movq %r14, %rdi
movq %r15, %rsi
callq 0x32e0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x64f2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
incl %ebp
jmp 0x6403
movq %rsp, %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6646
leaq 0x28(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x32e0
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6533
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
movl $0x2, %edx
callq 0x8f3a
movq %rsp, %rdi
callq 0x3120
movq %rax, %r14
movq %rsp, %rdi
callq 0x8fba
testb %r14b, %r14b
je 0x658a
movzbl %r14b, %eax
cmpl $0xff, %eax
je 0x658a
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
movl $0x2, %edx
callq 0x8f3a
movq %rsp, %rdi
callq 0x3420
movq %rsp, %rdi
callq 0x8fba
leaq 0x40(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0xa106
movq 0x60(%rbx), %rax
cmpq %rax, 0x68(%rbx)
je 0x65a5
movq %rax, 0x68(%rbx)
movl $0x0, (%rsp)
movq 0x68(%rbx), %rsi
cmpq 0x70(%rbx), %rsi
je 0x65c6
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rbx)
jmp 0x65d5
addq $0x60, %rbx
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x9766
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x65f0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6611
jmp 0x6620
jmp 0x6620
jmp 0x6611
jmp 0x6620
jmp 0x6620
jmp 0x6611
jmp 0x6620
jmp 0x6620
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8fba
jmp 0x6623
jmp 0x6620
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x663e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x33f0