// File: /workspace/github_cpp_makefile_star2_O3/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 0x5a46
leaq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x66b8
movl $0x1, %ebp
movq %rsp, %r15
movq 0x8b35(%rip), %r12      # 0xefa8
movq %r15, %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x8f64
movq %r15, %rdi
callq 0x3120
movq %rax, %r13
movq %r15, %rdi
callq 0x8fe4
testb %r13b, %r13b
je 0x6569
movzbl %r13b, %eax
cmpl $0xff, %eax
je 0x6569
movq %r15, %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x8f64
movq %r15, %rdi
callq 0x3420
movq %rax, %r13
movq %r15, %rdi
callq 0x8fe4
movl $0x8, %edx
movq %r12, %rdi
leaq 0x4e2d(%rip), %rsi      # 0xb30d
callq 0x32b0
movq %r12, %rdi
movq %r13, %rsi
callq 0x31a0
movq %rax, %r13
movl $0x14, %edx
movq %rax, %rdi
leaq 0x4e14(%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 0x66b8
movq %r14, %rdi
movq %r15, %rsi
callq 0x32e0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x6562
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
incl %ebp
jmp 0x6473
movq %rsp, %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x66b8
leaq 0x28(%rsp), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x32e0
movq (%r14), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x65a3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
movl $0x2, %edx
callq 0x8f64
movq %rsp, %rdi
callq 0x3120
movq %rax, %r14
movq %rsp, %rdi
callq 0x8fe4
testb %r14b, %r14b
je 0x65fa
movzbl %r14b, %eax
cmpl $0xff, %eax
je 0x65fa
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
movl $0x2, %edx
callq 0x8f64
movq %rsp, %rdi
callq 0x3420
movq %rsp, %rdi
callq 0x8fe4
leaq 0x40(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0xa16a
movq 0x60(%rbx), %rax
movq 0x68(%rbx), %rsi
cmpq %rax, %rsi
je 0x661b
movq %rax, 0x68(%rbx)
movq %rax, %rsi
movl $0x0, (%rsp)
cmpq 0x70(%rbx), %rsi
je 0x6638
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x68(%rbx)
jmp 0x6647
addq $0x60, %rbx
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x97a2
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6662
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 0x6683
jmp 0x6692
jmp 0x6692
jmp 0x6683
jmp 0x6692
jmp 0x6692
jmp 0x6683
jmp 0x6692
jmp 0x6692
movq %rax, %rbx
movq %rsp, %rdi
callq 0x8fe4
jmp 0x6695
jmp 0x6692
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x66b0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x33f0