LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tyhsu[P]Ewn/game.cpp
// Function: Game::create_movable_chs_map()
Movable_chs_map Game::create_movable_chs_map()
{
	Movable_chs_map movable_chs_map_;
	for(int exist_=0; exist_<(1<<6); exist_++) { // each exist status
		for(int dice=0; dice<6; dice++) {
			int former_chs_index = -1, latter_chs_index = -1;
			for(int i=dice-1; i>=0; i--) {
				if((exist_%(1<<(i+1)))/(1<<i) == true) {
					former_chs_index = i;
					break;
				}
			}
			for(int i=dice+1; i<6; i++) {
				if((exist_>>i)%2 == true) {
					latter_chs_index = i;
					break;
				}
			}
			former_chs_index = (former_chs_index == -1) ? latter_chs_index : former_chs_index;
			latter_chs_index = (latter_chs_index == -1) ? former_chs_index : latter_chs_index;
			pair<int, int> fir(dice, exist_), sec(former_chs_index, latter_chs_index);
			movable_chs_map_.insert(make_pair(fir, sec));
		}
	}
	return movable_chs_map_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
xorl %r14d, %r14d
pushq $0x1
popq %r13
cmpq $0x40, %r14
je 0x6e47
movq %r14, %r12
shlq $0x20, %r12
xorl %r15d, %r15d
cmpq $0x6, %r15
je 0x6e3f
movl %r15d, %edi
movl %r15d, %ecx
testl %ecx, %ecx
jle 0x6df4
leal -0x1(%rcx), %esi
movl %r13d, %r8d
shll %cl, %r8d
movl %r14d, %eax
cltd
idivl %r8d
movl %esi, %ecx
shrl %cl, %edx
movl %esi, %ecx
cmpl $0x1, %edx
jne 0x6dd3
jmp 0x6df7
pushq $-0x1
popq %rsi
cmpl $0x4, %edi
ja 0x6e15
movl %r14d, %edx
movl %edi, %ecx
shrl %cl, %edx
leal 0x1(%rdi), %eax
movl %eax, %edi
testb $0x2, %dl
je 0x6df7
cmpl $-0x1, %esi
cmovel %eax, %esi
jmp 0x6e17
movl %esi, %eax
movq %r12, %rcx
orq %r15, %rcx
shlq $0x20, %rax
movl %esi, %edx
orq %rax, %rdx
movq %rcx, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
movq %rbx, %rdi
leaq -0x38(%rbp), %rsi
callq 0x6e6c
incq %r15
jmp 0x6dc7
incq %r14
jmp 0x6db3
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x26d8
movq %r14, %rdi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/aligned_allocator.hpp
// Function: cpp::aligned_allocator<float, 32ul>::allocate(unsigned long) const
T* allocate(const std::size_t n) const {
        // The return value of allocate(0) is unspecified.
        // Mallocator returns nullptr in order to avoid depending
        // on malloc(0)'s implementation-defined behavior
        // (the implementation can define malloc(0) to return nullptr,
        // in which case the bad_alloc check below would fire).
        // All allocators can return nullptr in this case.
        if (n == 0) {
            return nullptr;
        }

        // All allocators should contain an integer overflow check.
        // The Standardization Committee recommends that std::length_error
        // be thrown in the case of integer overflow.
        if (n > max_size()) {
            throw std::length_error("aligned_allocator<T>::allocate() - Integer overflow.");
        }

        void* pv = aligned_allocate(n);

        // Allocators should throw std::bad_alloc in the case of memory allocation failure.
        if (!pv) {
            throw std::bad_alloc();
        }

        return static_cast<T*>(pv);
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x15283
movq %rsi, %rax
shrq $0x3e, %rax
jne 0x1528d
movq %rsi, %rdi
callq 0x152d0
testq %rax, %rax
jne 0x15285
pushq $0x8
popq %rdi
callq 0x8230
movq 0x66d02(%rip), %rcx     # 0x7bf68
movq 0x66d33(%rip), %rsi     # 0x7bfa0
movq 0x66cd4(%rip), %rdx     # 0x7bf48
movq %rax, %rdi
addq $0x10, %rcx
movq %rcx, (%rax)
callq 0x8780
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x10
popq %rdi
callq 0x8230
movq %rax, %rbx
leaq 0x3e2d9(%rip), %rsi     # 0x53578
movq %rax, %rdi
callq 0x8570
movq 0x66d02(%rip), %rsi     # 0x7bfb0
movq 0x66cbb(%rip), %rdx     # 0x7bf70
movq %rbx, %rdi
callq 0x8780
movq %rbx, %rdi
movq %rax, %r14
callq 0x8360
movq %r14, %rdi
callq 0x87c0
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/aligned_allocator.hpp
// Function: cpp::aligned_allocator<double, 48ul>::aligned_allocate(unsigned long)
static T* aligned_allocate(std::size_t size) {
        auto required_bytes = sizeof(T) * size;
        auto offset         = (A - 1) + sizeof(uintptr_t);
        auto orig           = malloc(required_bytes + offset);

        if (!orig) {
            return nullptr;
        }

        if ((reinterpret_cast<size_t>(orig) + sizeof(uintptr_t)) % A == 0) {
            auto aligned = reinterpret_cast<void**>((reinterpret_cast<size_t>(orig) + sizeof(uintptr_t)));
            aligned[-1] = orig;
            return reinterpret_cast<T*>(aligned);
        } else {
            auto diff    = (reinterpret_cast<size_t>(orig) + sizeof(uintptr_t)) % A;
            auto offset  = A - diff;
            auto aligned = reinterpret_cast<void**>((reinterpret_cast<size_t>(orig) + sizeof(uintptr_t) + offset));
            aligned[-1] = orig;
            return reinterpret_cast<T*>(aligned);
        }
    }

// Assembly:
pushq %rax
leaq 0x37(,%rdi,8), %rdi
callq 0x8620
testq %rax, %rax
je 0x154c4
movq %rax, %rcx
leaq 0x8(%rax), %rsi
pushq $0x30
popq %rdi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movq %rcx, %rax
subq %rdx, %rax
addq $0x38, %rax
testq %rdx, %rdx
cmoveq %rsi, %rax
movq %rcx, -0x8(%rax)
jmp 0x154c6
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/assert.hpp
// Function: void cpp::assertion::detail::assertion_failed_msg<char>(char const*, char const*, char const*, char const*, unsigned long)
void assertion_failed_msg(const CharT* expr, const char* msg, const char* function, const char* file, size_t line) {
    std::cerr
        << "***** Internal Program Error - assertion (" << expr << ") failed in "
        << function << ":\n"
        << file << '(' << line << "): " << msg << std::endl;
    std::abort();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r13
movq 0x65e95(%rip), %rdi     # 0x7bfe8
movq %rsi, %rbx
leaq 0x3d662(%rip), %rsi     # 0x537bf
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
callq 0x84e0
movq %rax, %rdi
movq %r13, %rsi
callq 0x84e0
leaq 0x3d66d(%rip), %rsi     # 0x537ea
movq %rax, %rdi
callq 0x84e0
movq %rax, %rdi
movq %r12, %rsi
callq 0x84e0
leaq 0x43b29(%rip), %rsi     # 0x59cc0
movq %rax, %rdi
callq 0x84e0
movq %rax, %rdi
movq %r15, %rsi
callq 0x84e0
pushq $0x28
popq %rsi
movq %rax, %rdi
callq 0x8580
movq %rax, %rdi
movq %r14, %rsi
callq 0x8320
leaq 0x3d630(%rip), %rsi     # 0x537f7
movq %rax, %rdi
callq 0x84e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x84e0
movq %rax, %rdi
callq 0x8220
callq 0x15d3c
nop
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/data.hpp
// Function: double cpp::stddev<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, double)
double stddev(Iterator first, Iterator last, double mean) {
    double std = 0.0;
    for (auto it = first; it != last; ++it) {
        std += (*it - mean) * (*it - mean);
    }
    return std::sqrt(std / std::distance(first, last));
}

// Assembly:
vxorpd %xmm1, %xmm1, %xmm1
movq %rdi, %rax
cmpq %rsi, %rax
je 0x189bb
vcvtsi2sdl (%rax), %xmm3, %xmm2
addq $0x4, %rax
vsubsd %xmm0, %xmm2, %xmm2
vfmadd231sd %xmm2, %xmm2, %xmm1 # xmm1 = (xmm2 * xmm2) + xmm1
jmp 0x189a3
subq %rdi, %rsi
sarq $0x2, %rsi
vcvtsi2sd %rsi, %xmm3, %xmm0
vdivsd %xmm0, %xmm1, %xmm0
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm1, %xmm0
jb 0x83e0
vsqrtsd %xmm0, %xmm0, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/data.hpp
// Function: void cpp::normalize<std::vector<double, std::allocator<double>>>(std::vector<double, std::allocator<double>>&)
void normalize(Container& container) {
    //normalize to zero-mean
    auto m = cpp::mean(container);
    for (auto& v : container) {
        v -= m;
    }

    //normalize to unit variance
    if (auto s = cpp::stddev(container, 0.0); s != 0.0) {
        for (auto& v : container) {
            v /= s;
        }
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x186c8
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x18ada
vmovsd (%rax), %xmm1
vsubsd %xmm0, %xmm1, %xmm1
vmovsd %xmm1, (%rax)
addq $0x8, %rax
jmp 0x18ac3
vxorpd %xmm0, %xmm0, %xmm0
movq %rbx, %rdi
callq 0x18a20
vucomisd 0x3ad8a(%rip), %xmm0    # 0x53878
jne 0x18af2
jnp 0x18b10
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x18b10
vmovsd (%rax), %xmm1
vdivsd %xmm0, %xmm1, %xmm1
vmovsd %xmm1, (%rax)
addq $0x8, %rax
jmp 0x18af9
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/doctest/doctest/doctest.h
// Function: doctest::detail::Expression_lhs<bool&>::operator doctest::detail::Result()
DOCTEST_NOINLINE operator Result() {
// this is needed only for MSVC 2015
DOCTEST_MSVC_SUPPRESS_WARNING_WITH_PUSH(4800) // 'int': forcing value to bool
            bool res = static_cast<bool>(lhs);
DOCTEST_MSVC_SUPPRESS_WARNING_POP
            if(m_at & assertType::is_false) { //!OCLINT bitwise operator in conditional
                res = !res;
            }

            if(!res || getContextOptions()->success) {
                return { res, (DOCTEST_STRINGIFY(lhs)) };
            }
            return { res };
        }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq (%rsi), %rax
movb 0x9(%rsi), %bpl
movq %rdi, %rbx
movb (%rax), %al
xorb %al, %bpl
testb $0x1, %bpl
je 0x1ac24
movq %rsi, %r14
callq 0x398f8
cmpb $0x1, 0x6c(%rax)
jne 0x1ac4b
movq (%r14), %rax
movb (%rax), %al
movzbl %al, %esi
leaq 0x8(%rsp), %r14
andl $0x1, %esi
movq %r14, %rdi
callq 0x399c8
movzbl %bpl, %esi
movq %rbx, %rdi
movq %r14, %rdx
andl $0x1, %esi
callq 0x3a348
jmp 0x1ac66
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x38d3e
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3a348
leaq 0x8(%rsp), %rdi
callq 0x38d46
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x1ac7e
leaq 0x8(%rsp), %rdi
movq %rax, %rbx
callq 0x38d46
movq %rbx, %rdi
callq 0x87c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/thread_pool.hpp
// Function: void cpp::default_thread_pool<std::deque>::do_task<DOCTEST_ANON_FUNC_2()::$_0, int>(DOCTEST_ANON_FUNC_2()::$_0, int)
void do_task(Functor fun, Args... args) {
        with_lock(main_lock, [fun, args..., this] () mutable {
            if (stop_flag) {
#ifndef CPP_UTILS_NO_EXCEPT
                throw std::runtime_error("cpp_utils: enqueue on stopped ThreadPool");
#else
                std::cerr << "cpp_utils: enqueue on stopped ThreadPool (exceptions disabled)" << std::endl;
                std::abort();
#endif
            }

            //Execute the task
            tasks.emplace_back([fun, args...] () mutable {
                fun(args...);
            });
        });

        condition.notify_one();
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x80(%rdi), %rsi
leaq 0x8(%rsp), %rdi
movl %edx, %ebp
callq 0x22d74
movb 0x108(%rbx), %al
cmpb $0x1, %al
je 0x21b91
movq 0x70(%rbx), %rcx
movq 0x60(%rbx), %rax
addq $-0x20, %rcx
cmpq %rcx, %rax
je 0x21aeb
leaq 0x129(%rip), %rcx       # 0x21bf0
leaq 0x130(%rip), %rdx       # 0x21bfe
andq $0x0, 0x8(%rax)
movq %r14, (%rax)
movl %ebp, 0x8(%rax)
movq %rcx, 0x18(%rax)
movq %rdx, 0x10(%rax)
movq 0x60(%rbx), %rax
addq $0x20, %rax
jmp 0x21b69
leaq 0x30(%rbx), %r15
movq %r15, %rdi
callq 0x23820
movabsq $0x7ffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFF
cmpq %rcx, %rax
je 0x21bc1
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x23830
movq %r15, %rdi
callq 0x230d4
movq 0x78(%rbx), %rcx
leaq 0xd6(%rip), %rdx        # 0x21bfe
movq %rax, 0x8(%rcx)
leaq 0xbd(%rip), %rcx        # 0x21bf0
movq 0x60(%rbx), %rax
andq $0x0, 0x8(%rax)
movq %r14, (%rax)
movl %ebp, 0x8(%rax)
movq %rcx, 0x18(%rax)
movq %rdx, 0x10(%rax)
movq 0x78(%rbx), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x78(%rbx)
movq 0x8(%rax), %rax
leaq 0x200(%rax), %rcx
movq %rax, 0x68(%rbx)
movq %rcx, 0x70(%rbx)
leaq 0x8(%rsp), %rdi
movq %rax, 0x60(%rbx)
callq 0x22dc6
addq $0xa8, %rbx
movq %rbx, %rdi
callq 0x8240
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x8230
movq %rax, %rbx
leaq 0x330af(%rip), %rsi     # 0x54c52
movq %rax, %rdi
callq 0x81c0
movq 0x5a43e(%rip), %rsi     # 0x7bff0
movq 0x5a3bf(%rip), %rdx     # 0x7bf78
movq %rbx, %rdi
callq 0x8780
leaq 0x330b3(%rip), %rdi     # 0x54c7b
callq 0x8280
movq %rbx, %rdi
movq %rax, %r14
callq 0x8360
jmp 0x21bdd
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x22dc6
movq %r14, %rdi
callq 0x87c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/thread_pool.hpp
// Function: cpp::default_thread_pool<std::deque>::~default_thread_pool()
~default_thread_pool() {
        with_lock(main_lock, [this] { stop_flag = true; });

        condition.notify_all();

        for (auto& thread : threads) {
            thread.join();
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x80, %rdi
movq %rbx, %rsi
callq 0x23a5c
leaq 0xa8(%rbx), %r14
movq %r14, %rdi
callq 0x8770
movq (%rbx), %r15
movq 0x8(%rbx), %r12
cmpq %r12, %r15
je 0x22af9
movq %r15, %rdi
callq 0x8880
addq $0x8, %r15
jmp 0x22ae6
leaq 0xd8(%rbx), %rdi
callq 0x87e0
movq %r14, %rdi
callq 0x87e0
leaq 0x30(%rbx), %rdi
callq 0x22ddc
leaq 0x18(%rbx), %rdi
callq 0x22e6e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x22e20
jmp 0x22b34
movq %rax, %rdi
callq 0x11be2
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/thread_pool.hpp
// Function: cpp::default_thread_pool<std::deque>::default_thread_pool(unsigned long)
explicit default_thread_pool(std::size_t n) : status(n, thread_status::WAITING) {
        // The thread pool is of fixed size, avoid any possible reallocation
        threads.reserve(n);

        // Lets all the threads start at the same time and avoid any possible race conditions
        std::unique_lock<std::mutex> ulock(main_lock);

        for (std::size_t t = 0; t < n; ++t) {
            threads.emplace_back([this, t] {
                while (true) {
                    std::function<void()> task;

                    {
                        std::unique_lock<std::mutex> ulock(main_lock);

                        status[t] = thread_status::WAITING;

                        wait_condition.notify_one();

                        condition.wait(ulock, [this] {
                            return stop_flag || !tasks.empty();
                        });

                        if (stop_flag && tasks.empty()) {
                            return;
                        }

                        task = std::move(tasks.front());
                        tasks.pop_front();

                        status[t] = thread_status::WORKING;
                    }

                    task();
                }
            });
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
vxorps %xmm0, %xmm0, %xmm0
leaq 0x28(%rsp), %rdx
andq $0x0, 0x10(%rdi)
leaq 0x18(%rdi), %r14
movq %rsi, %r13
movq %rdi, %rbx
vmovups %xmm0, (%rdi)
andl $0x0, (%rdx)
leaq 0x18(%rsp), %rcx
movq %r14, %rdi
callq 0x22c8a
leaq 0x30(%rbx), %r15
movq %r15, %rdi
movq %r14, 0x10(%rsp)
callq 0x22f2c
andq $0x0, 0xa0(%rbx)
vxorps %xmm0, %xmm0, %xmm0
leaq 0xa8(%rbx), %r12
movq %r12, %rdi
vmovups %ymm0, 0x80(%rbx)
vzeroupper
callq 0x8660
leaq 0xd8(%rbx), %rbp
movq %rbp, %rdi
callq 0x8660
movb $0x0, 0x108(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, 0x8(%rsp)
callq 0x22ce2
leaq 0x80(%rbx), %rsi
leaq 0x28(%rsp), %rdi
callq 0x22d74
leaq 0x18(%rsp), %r14
xorl %r15d, %r15d
cmpq %r15, %r13
je 0x22c1f
movq %rbx, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x22d8a
incq %r15
jmp 0x22c00
leaq 0x28(%rsp), %rdi
callq 0x22dc6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x22c3a
movq %rax, %r13
jmp 0x22c56
movq %rax, %r13
jmp 0x22c70
movq %rax, %r13
jmp 0x22c7a
leaq 0x28(%rsp), %rdi
movq %rax, %r13
callq 0x22dc6
movq %rbp, %rdi
callq 0x87e0
movq %r12, %rdi
callq 0x87e0
movq 0x8(%rsp), %rdi
callq 0x22ddc
movq 0x10(%rsp), %rdi
callq 0x22e6e
movq %rbx, %rdi
callq 0x22e20
movq %r13, %rdi
callq 0x87c0
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/thread_pool.hpp
// Function: cpp::default_thread_pool<std::deque>::wait()
void wait() {
        while (true) {
            std::unique_lock<std::mutex> ulock(main_lock);

            if (tasks.empty() && std::find(status.begin(), status.end(), thread_status::WORKING) == status.end()) {
                return;
            }

            //At this point, there are still some threads working, we wait for
            //one of them to notify a change of status
            wait_condition.wait(ulock, [this] {
                return tasks.empty();
            });
        }
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
leaq 0x80(%rdi), %r14
leaq 0xd8(%rdi), %r15
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %rdi, %rbx
movq %r12, %rdi
movq %r14, %rsi
callq 0x22d74
movq 0x60(%rbx), %rax
cmpq 0x40(%rbx), %rax
jne 0x237d9
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rsi
movl $0x1, 0xc(%rsp)
movq %r13, %rdx
callq 0x239d5
cmpq 0x20(%rbx), %rax
je 0x237f1
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x239aa
movq %r12, %rdi
callq 0x22dc6
jmp 0x237a6
leaq 0x10(%rsp), %rdi
callq 0x22dc6
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x2380b
leaq 0x10(%rsp), %rdi
movq %rax, %rbx
callq 0x22dc6
movq %rbx, %rdi
callq 0x87c0
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/streams.hpp
// Function: std::ostream& cpp::operator<<<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>(std::ostream&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
std::ostream& operator<<(std::ostream& os, const std::vector<T, A>& vec) {
    os << "[";
    std::string comma;
    for (auto& v : vec) {
        os << comma << v;
        comma = ", ";
    }
    os << "]";
    return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r15
leaq 0x21ad3(%rip), %rsi     # 0x576ff
movq %rdi, %rbx
callq 0x84e0
leaq 0x10(%rsp), %rax
leaq 0x22de9(%rip), %r12     # 0x58a29
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r15), %r14
movq 0x8(%r15), %r13
movq %rsp, %r15
cmpq %r13, %r14
je 0x35c82
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8440
movq %rax, %rdi
movq %r14, %rsi
callq 0x8440
movq %r15, %rdi
movq %r12, %rsi
callq 0x35fbc
addq $0x20, %r14
jmp 0x35c56
leaq 0x21ab8(%rip), %rsi     # 0x57741
movq %rbx, %rdi
callq 0x84e0
movq %rsp, %rdi
callq 0x16130
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x35cac
movq %rsp, %rdi
movq %rax, %rbx
callq 0x16130
movq %rbx, %rdi
callq 0x87c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/string.hpp
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>& cpp::ltrim<char, std::char_traits<char>, std::allocator<char>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
std::basic_string<CharT, Traits, Allocator>& ltrim(std::basic_string<CharT, Traits, Allocator>& s) {
    s.erase(s.begin(), std::find_if(s.begin(), s.end(),
									[](CharT c) {
										return !std::isspace(c);
									}));
    return s;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %r14
movq 0x8(%rdi), %rsi
movq %rdi, %rbx
addq %r14, %rsi
movq %r14, %rdi
callq 0x3840d
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x38368
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/include/cpp_utils/string.hpp
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>& cpp::rtrim<char, std::char_traits<char>, std::allocator<char>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
std::basic_string<CharT, Traits, Allocator>& rtrim(std::basic_string<CharT, Traits, Allocator>& s) {
    s.erase(std::find_if(s.rbegin(), s.rend(),
						 [](CharT c) {
							 return !std::isspace(c);
						 }).base(), s.end());
    return s;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
leaq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %r14
movq %rdi, %rbx
movq %rsp, %rdx
movq %r14, %rdi
addq %rax, %rcx
movq %rax, (%rdx)
movq %rcx, (%rsi)
callq 0x3892f
movq (%rbx), %rdx
movq (%r14), %rsi
movq %rbx, %rdi
addq 0x8(%rbx), %rdx
callq 0x38368
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/doctest/doctest/doctest.h
// Function: doctest::skipPathFromFilename(char const*)
const char* skipPathFromFilename(const char* file) {
#ifndef DOCTEST_CONFIG_DISABLE
    if(getContextOptions()->no_path_in_filenames) {
        auto back    = std::strrchr(file, '\\');
        auto forward = std::strrchr(file, '/');
        if(back || forward) {
            if(back > forward)
                forward = back;
            return forward + 1;
        }
    }
#endif // DOCTEST_CONFIG_DISABLE
    return file;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x42da2(%rip), %rax     # 0x7c658
movq %rdi, %rbx
cmpb $0x1, 0x7c(%rax)
jne 0x398ed
pushq $0x5c
popq %rsi
movq %rbx, %rdi
callq 0x8550
movq %rax, %r14
pushq $0x2f
popq %rsi
movq %rbx, %rdi
callq 0x8550
cmpq %rax, %r14
movq %rax, %rcx
cmovaq %r14, %rcx
orq %rax, %r14
je 0x398ed
incq %rcx
movq %rcx, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/wichtounet[P]cpp_utils_test/doctest/doctest/doctest.h
// Function: doctest::SubcaseSignature::operator<(doctest::SubcaseSignature const&) const
bool SubcaseSignature::operator<(const SubcaseSignature& other) const {
    if(m_line != other.m_line)
        return m_line < other.m_line;
    if(std::strcmp(m_file, other.m_file) != 0)
        return std::strcmp(m_file, other.m_file) < 0;
    return m_name.compare(other.m_name) < 0;
}

// Assembly:
movl 0x20(%rsi), %eax
cmpl %eax, 0x20(%rdi)
jne 0x3997b
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
movq 0x18(%rsi), %rsi
callq 0x8650
testl %eax, %eax
jne 0x39970
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x391aa
shrl $0x1f, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
setl %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/persistence.cc
// Function: usage(char const*, char const*, char const*)
void usage(const char *prog, const char *verb, const char *mode)
{
	std::cout << "Usage: " << prog  << " [-t] [-v]" << std::endl;
	std::cout << "  -t: test mode for persistence test,"
		" if -t is not given, the program only prepares data for test."
		" [currently " << mode << "]" << std::endl;
	std::cout << "  -v: print extra info for failed tests [currently ";
	std::cout << verb << "]" << std::endl;
	std::cout << std::endl;
	std::cout << " NOTE: A normal usage is as follows:" << std::endl;
	std::cout << "    1. invoke `" << prog << "`;" << std::endl;
	std::cout << "    2. terminate (kill) the program when data is ready;";
	std::cout << std::endl;
	std::cout << "    3. invoke `" << prog << "-t ` to test." << std::endl;
	std::cout << std::endl;
	std::cout.flush();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
movq 0xb9fc(%rip), %rbx      # 0xefd0
leaq 0x6a49(%rip), %rsi      # 0xa024
movq %rbx, %rdi
callq 0x3270
movq %rax, %rdi
movq %r14, %rsi
callq 0x3270
leaq 0x6a37(%rip), %rsi      # 0xa02c
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3160
leaq 0x6a2b(%rip), %rsi      # 0xa037
movq %rbx, %rdi
callq 0x3270
movq %rax, %rdi
movq %r12, %rsi
callq 0x3270
leaq 0x6c1f(%rip), %r12      # 0xa245
movq %rax, %rdi
movq %r12, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3160
leaq 0x6a66(%rip), %rsi      # 0xa0a6
movq %rbx, %rdi
callq 0x3270
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3270
movq %rax, %rdi
movq %r12, %rsi
callq 0x3270
movq %rax, %rdi
callq 0x3160
movq %rbx, %rdi
callq 0x3160
leaq 0x6a65(%rip), %rsi      # 0xa0da
movq %rbx, %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3160
leaq 0x6a73(%rip), %rsi      # 0xa0ff
movq %rbx, %rdi
callq 0x3270
movq %rax, %rdi
movq %r14, %rsi
callq 0x3270
leaq 0x6a69(%rip), %rsi      # 0xa10f
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3160
leaq 0x6a55(%rip), %rsi      # 0xa112
movq %rbx, %rdi
callq 0x3270
movq %rbx, %rdi
callq 0x3160
leaq 0x6a76(%rip), %rsi      # 0xa14a
movq %rbx, %rdi
callq 0x3270
movq %rax, %rdi
movq %r14, %rsi
callq 0x3270
leaq 0x6a6c(%rip), %rsi      # 0xa15a
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3160
movq %rbx, %rdi
callq 0x3160
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x31c0
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/persistence.cc
// Function: PersistenceTest::start_test(void*)
void start_test(void *args = NULL) override
	{
		bool testmode = (args && *static_cast<bool *>(args));

		std::cout << "KVStore Persistence Test" << std::endl;

		if (testmode) {
			std::cout << "<<Test Mode>>" << std::endl;
			test(TEST_MAX);
		} else {
			std::cout << "<<Preparation Mode>>" << std::endl;
			prepare(TEST_MAX);
		}
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x3a59
movb (%rsi), %bpl
movq 0xb5c1(%rip), %rdi      # 0xefd0
leaq 0x67ad(%rip), %rsi      # 0xa1c3
callq 0x3270
movq %rax, %rdi
callq 0x3160
cmpb $0x1, %bpl
jne 0x3a74
movq 0xb5a0(%rip), %rdi      # 0xefd0
leaq 0x67a5(%rip), %rsi      # 0xa1dc
callq 0x3270
movq %rax, %rdi
callq 0x3160
movq 0xa8(%rbx), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3b0e
movq 0xb570(%rip), %rdi      # 0xefd0
leaq 0x675c(%rip), %rsi      # 0xa1c3
callq 0x3270
movq %rax, %rdi
callq 0x3160
movq 0xb555(%rip), %rdi      # 0xefd0
leaq 0x6768(%rip), %rsi      # 0xa1ea
callq 0x3270
movq %rax, %rdi
callq 0x3160
movq 0xa8(%rbx), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x3d44
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/persistence.cc
// Function: PersistenceTest::test(unsigned long)
void test(uint64_t max)
	{
		uint64_t i;
		// Test data
		for (i = 0; i < max; ++i) {
			switch (i & 3) {
			case 0:
				EXPECT(std::string(i+1, 't'), store.get(i));
				break;
			case 1:
				EXPECT(std::string(i+1, 't'), store.get(i));
				break;
			case 2:
				EXPECT(not_found, store.get(i));
				break;
			case 3:
				EXPECT(std::string(i+1, 's'), store.get(i));
				break;
			default:
				assert(0);
			}
		}

		phase();

		report();
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, 0x30(%rsp)
movq %rdi, %rbx
leaq 0x28(%rdi), %rax
movq %rax, 0x8(%rsp)
xorl %r15d, %r15d
leaq 0x10(%rsp), %r12
leaq 0x38(%rsp), %r13
leaq 0x58(%rsp), %rbp
cmpq 0x30(%rsp), %r15
je 0x3cd9
movl %r15d, %eax
andl $0x3, %eax
leaq 0x64ad(%rip), %rcx      # 0xa004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1(%r15), %r14
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdi
movq %r14, %rsi
pushq $0x74
popq %rdx
callq 0x32a0
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x4e82
movq %rbp, %rdi
leaq 0x6669(%rip), %rsi      # 0xa1ff
leaq 0x7(%rsp), %rdx
callq 0x3992
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x63
popq %r8
callq 0x4330
jmp 0x3cb9
movq %r12, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x4e82
movq %r13, %rdi
leaq 0x662b(%rip), %rsi      # 0xa1ff
movq %rbp, %rdx
callq 0x3992
movq %rbx, %rdi
leaq 0xb65a(%rip), %rsi      # 0xf240
movq %r12, %rdx
movq %r13, %rcx
pushq $0x69
popq %r8
callq 0x4330
movq %r13, %rdi
callq 0x3438
movq %r12, %rdi
callq 0x3438
incq %r15
jmp 0x3b3f
leaq 0x1(%r15), %r14
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdi
movq %r14, %rsi
pushq $0x73
popq %rdx
callq 0x32a0
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x4e82
movq %rbp, %rdi
leaq 0x65bc(%rip), %rsi      # 0xa1ff
leaq 0x7(%rsp), %rdx
callq 0x3992
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x6c
popq %r8
callq 0x4330
jmp 0x3cb9
leaq 0x1(%r15), %r14
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdi
movq %r14, %rsi
pushq $0x74
popq %rdx
callq 0x32a0
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x4e82
movq %rbp, %rdi
leaq 0x6565(%rip), %rsi      # 0xa1ff
leaq 0x7(%rsp), %rdx
callq 0x3992
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
pushq $0x66
popq %r8
callq 0x4330
movq %rbp, %rdi
callq 0x3438
movq %r13, %rdi
callq 0x3438
movq %r12, %rdi
callq 0x3438
movq %r14, %r15
jmp 0x3b3f
movq %rbx, %rdi
callq 0x43f4
movq %rbx, %rdi
callq 0x44ba
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3d1b
jmp 0x3d0c
jmp 0x3d39
jmp 0x3d20
jmp 0x3d1b
jmp 0x3d39
jmp 0x3d20
jmp 0x3d0c
jmp 0x3d1b
jmp 0x3d20
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3438
jmp 0x3d23
movq %rax, %rbx
jmp 0x3d2d
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3438
leaq 0x10(%rsp), %rdi
callq 0x3438
jmp 0x3d3c
movq %rax, %rbx
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/./test.h
// Function: void Test::expect<bool>(bool const&, bool const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
void expect(const T &exp, const T &got,
		    const std::string &file, int line)
	{
		++nr_tests;
		if (exp == got) {
			++nr_passed_tests;
			return;
		}
		if (verbose) {
			std::cerr << "TEST Error @" << file << ":" << line;
			std::cerr << ", expected " << exp;
			std::cerr << ", got " << got << std::endl;
		}
	}

// Assembly:
incq 0x8(%rdi)
movb (%rsi), %al
cmpb (%rdx), %al
jne 0x456d
incq 0x10(%rdi)
retq
cmpb $0x1, 0xa0(%rdi)
jne 0x460d
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq 0xaa5b(%rip), %r15      # 0xeff0
leaq 0x5c72(%rip), %rsi      # 0xa20e
movq %r15, %rdi
callq 0x3270
movq %rax, %rdi
movq %r12, %rsi
callq 0x3240
leaq 0x5b47(%rip), %rsi      # 0xa0fd
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
movl %ebp, %esi
callq 0x33c0
leaq 0x5c4c(%rip), %rsi      # 0xa21b
movq %r15, %rdi
callq 0x3270
movzbl (%r14), %esi
movq %rax, %rdi
callq 0x33a0
leaq 0x5c3d(%rip), %rsi      # 0xa227
movq %r15, %rdi
callq 0x3270
movzbl (%rbx), %esi
movq %rax, %rdi
callq 0x33a0
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3160
retq
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/./test.h
// Function: Test::phase()
void phase(void)
	{
		// Report
		std::cout << "  Phase " << (nr_phases+1) << ": ";
		std::cout << nr_passed_tests << "/" << nr_tests << " ";

		// Count
		++nr_phases;
		if (nr_tests == nr_passed_tests) {
			++nr_passed_phases;
			std::cout << "[PASS]" << std::endl;
		} else
			std::cout << "[FAIL]" << std::endl;

		std::cout.flush();

		// Reset
		nr_tests = 0;
		nr_passed_tests = 0;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xabce(%rip), %r14      # 0xefd0
leaq 0x5e25(%rip), %rsi      # 0xa22e
movq %r14, %rdi
callq 0x3270
movq 0x18(%rbx), %rsi
incq %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x5c02(%rip), %rsi      # 0xa029
movq %rax, %rdi
callq 0x3270
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x31b0
leaq 0x5df5(%rip), %rsi      # 0xa237
movq %rax, %rdi
callq 0x3270
leaq 0x8(%rbx), %r14
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x5e90(%rip), %rsi      # 0xa2f1
movq %rax, %rdi
callq 0x3270
incq 0x18(%rbx)
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jne 0x4484
incq 0x20(%rbx)
leaq 0x5db7(%rip), %rsi      # 0xa239
jmp 0x448b
leaq 0x5db5(%rip), %rsi      # 0xa240
movq 0xab3e(%rip), %rbx      # 0xefd0
movq %rbx, %rdi
callq 0x3270
movq %rax, %rdi
callq 0x3160
movq %rbx, %rdi
callq 0x31c0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/./test.h
// Function: Test::report()
void report(void)
	{
		std::cout << nr_passed_phases << "/" << nr_phases << " passed.";
		std::cout << std::endl;
		std::cout.flush();

		nr_phases = 0;
		nr_passed_phases = 0;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rsi
movq 0xab04(%rip), %r14      # 0xefd0
movq %r14, %rdi
callq 0x31b0
leaq 0x5d5c(%rip), %rsi      # 0xa237
movq %rax, %rdi
callq 0x3270
movq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x31b0
leaq 0x5d51(%rip), %rsi      # 0xa247
movq %rax, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3160
movq %r14, %rdi
callq 0x31c0
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/kvstore.cc
// Function: KVStore::KVStore(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
KVStore::KVStore(const std::string &dir)
    : KVStoreAPI(dir), dir(dir), verbose(false), memTableSize(0), level(0) {
    memTable = std::unique_ptr<SkipList<uint64_t, std::string>>(
        new SkipList<uint64_t, std::string>());
    // this->dir = dir;
    // root = std::filesystem::path(dir);
    fileNum.push_back(0);
    loadSsTable();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0xa5cc(%rip), %rax      # 0xec88
movq %rax, (%rdi)
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x3340
movb $0x0, 0x28(%r14)
leaq 0x38(%r14), %r15
leaq 0x60(%r14), %r12
xorps %xmm0, %xmm0
andq $0x0, 0x70(%r14)
movups %xmm0, 0x60(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x40(%r14)
movups %xmm0, 0x4c(%r14)
pushq $0x28
popq %rdi
callq 0x3280
movq %rax, %rbp
movq %rax, %rdi
callq 0x6b86
leaq 0x10(%rsp), %r13
andq $0x0, (%r13)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x7766
movq %r13, %rdi
callq 0x6ca2
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
movq %r12, %rdi
callq 0x7bee
movq %r14, %rdi
callq 0x478e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x475f
jmp 0x475f
movq %rax, %r13
pushq $0x28
popq %rsi
movq %rbp, %rdi
callq 0x3290
jmp 0x4762
movq %rax, %r13
addq $0x40, %r14
movq %r12, %rdi
callq 0x7a9e
movq %r14, %rdi
callq 0x6cbc
movq %r15, %rdi
callq 0x6ca2
movq %rbx, %rdi
callq 0x3438
movq %r13, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x10(%rsp), %r15
xorl %r14d, %r14d
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x5694
leaq 0x60(%rbx), %rax
movq %rax, (%rsp)
leaq 0x30(%rsp), %r12
leaq 0x78(%rsp), %r13
movq %r12, %rdi
movq %r15, %rsi
pushq $0x2
popq %rdx
callq 0x73a6
movq %r12, %rdi
callq 0x738a
movl %eax, %ebp
movq %r12, %rdi
callq 0x740e
testb %bpl, %bpl
je 0x48e2
movq %r13, %rdi
movq %rbx, %rsi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x51ec
movq 0x68(%rbx), %rax
subq 0x60(%rbx), %rax
shrq $0x2, %rax
cltq
cmpq %rax, %r14
jl 0x4826
andl $0x0, 0x30(%rsp)
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x7bee
leaq 0x1(%r14), %rax
movq %rax, 0x8(%rsp)
pushq $0x1
popq %rbp
movq %r12, %rdi
movq %r13, %rsi
pushq $0x2
popq %rdx
callq 0x73a6
movq %r12, %rdi
callq 0x738a
movl %eax, %r15d
movq %r12, %rdi
callq 0x740e
testb %r15b, %r15b
je 0x48aa
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x3340
movq %rbx, %rdi
movq %r15, %rsi
callq 0x625a
movq %r15, %rdi
callq 0x3438
movq 0x60(%rbx), %rax
incl (%rax,%r14,4)
movq %r12, %rdi
movq %rbx, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x51ec
movq %r13, %rdi
movq %r12, %rsi
callq 0x32d0
movq %r12, %rdi
callq 0x3438
incl %ebp
jmp 0x4832
movq %r12, %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %r14
movl %r14d, %edx
callq 0x5694
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x32d0
movq %r12, %rdi
callq 0x3438
movq %r13, %rdi
callq 0x3438
jmp 0x47c9
leaq 0x10(%rsp), %rdi
callq 0x3438
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x493a
jmp 0x493a
jmp 0x4904
movq %rax, %rbx
jmp 0x4947
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x740e
jmp 0x4947
jmp 0x493a
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3438
jmp 0x493d
jmp 0x493a
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x740e
jmp 0x493d
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3438
leaq 0x10(%rsp), %rdi
callq 0x3438
movq %rbx, %rdi
callq 0x33e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/kvstore.cc
// Function: KVStore::put(unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void KVStore::put(uint64_t key, const std::string &s) {
    std::clog << "+ " << key << " " << std::string(s, 0, 50) << std::endl;
    memTable->put(key, s);
    memTableSize += getDataSize(s.length());
    if (verbose) {
        // std::clog << "put " << key << '\t' << s << "  done.\n";
        // std::clog << *memTable << '\n';
    }
    // if the size memTable reaches the threshold, then calls buildSsTable and
    // resets memTable
    if (this->memTableSize >= MEM_TABLE_SIZE_MAX) {
        convertMemTable();
        resetMemTable();
        // std::clog << *memTable << std::endl;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0xa5e9(%rip), %rdi      # 0xefa8
leaq 0x592a(%rip), %rsi      # 0xa2f0
callq 0x3270
movq %rax, %rdi
movq %r15, %rsi
callq 0x31b0
leaq 0x5914(%rip), %rsi      # 0xa2f1
movq %rax, %rdi
callq 0x3270
movq %rax, %r12
leaq 0x20(%rsp), %r13
pushq $0x32
popq %rcx
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3060
movq %r12, %rdi
movq %r13, %rsi
callq 0x3240
movq %rax, %rdi
callq 0x3160
leaq 0x20(%rsp), %rdi
callq 0x3438
movq 0x38(%rbx), %r12
movq %rsp, %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x3340
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x6cde
movq %rsp, %rdi
callq 0x3438
movq 0x8(%r14), %rax
movq 0x30(%rbx), %rcx
addq %rcx, %rax
addq $0x28, %rax
movq %rax, 0x30(%rbx)
cmpq $0x1fffff, %rax         # imm = 0x1FFFFF
jbe 0x4a6d
movq %rbx, %rdi
callq 0x4a98
movq %rbx, %rdi
callq 0x4e1c
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
jmp 0x4a8b
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3438
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/kvstore.cc
// Function: KVStore::resetMemTable()
void KVStore::resetMemTable() {
    // resets memTable
    memTable.release();
    memTable = std::unique_ptr<SkipList<uint64_t, std::string>>(
        new SkipList<uint64_t, std::string>());
    // reset state
    memTableSize = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
andq $0x0, 0x38(%rdi)
pushq $0x28
popq %rdi
callq 0x3280
movq %rax, %r14
movq %rax, %rdi
callq 0x6b86
leaq 0x38(%rbx), %rdi
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
movq %r14, %rsi
callq 0x7766
movq %r15, %rdi
callq 0x6ca2
andq $0x0, 0x30(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x3290
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/kvstore.cc
// Function: KVStore::get[abi:cxx11](unsigned long)
std::string KVStore::get(uint64_t key) {
    std::clog << "? " << key << std::endl;
    // looks for key in memTable
    std::string *strPointer = memTable->get(key);
    if (strPointer) {
        std::clog << "\t[m]->" << std::string(*strPointer, 0, 40) << std::endl;
        return *strPointer;
    }
    // looks for key in SsTables using indexTable
    uint64_t offset = 0;
    int count = findIndexedKey(key, &offset);
    bool found = count != -1;
    // calculate coresponding ssTable level and id
    // int back = count;
    int level = 0;
    while (count - fileNum[level] >= 0) {
        count -= fileNum[level];
        level++;
    }
    int fileId = count;
    if (found) {
        // reads value on disk according to offest
        std::clog << "\t@" << level << "-" << fileId << std::endl;
        return readPair(resolvePath(level, fileId), offset);
    }
    return "";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq 0xa10a(%rip), %rdi      # 0xefa8
leaq 0x544e(%rip), %rsi      # 0xa2f3
callq 0x3270
movq %rax, %rdi
movq %r12, %rsi
callq 0x31b0
movq %rax, %rdi
callq 0x3160
movq 0x38(%r14), %rdi
movq %r12, %rsi
callq 0x713e
testq %rax, %rax
je 0x4f29
movq %rax, %r15
movq 0xa0d0(%rip), %rdi      # 0xefa8
leaq 0x5417(%rip), %rsi      # 0xa2f6
callq 0x3270
movq %rax, %r14
leaq 0x10(%rsp), %r12
pushq $0x28
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3060
movq %r14, %rdi
movq %r12, %rsi
callq 0x3240
movq %rax, %rdi
callq 0x3160
leaq 0x10(%rsp), %rdi
callq 0x3438
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3340
jmp 0x4fde
leaq 0x10(%rsp), %rdx
andq $0x0, (%rdx)
movq %r14, %rdi
movq %r12, %rsi
callq 0x5012
movq 0x60(%r14), %rcx
xorl %r15d, %r15d
movl %eax, %ebp
movl %eax, %edx
subl (%rcx,%r15,4), %edx
jl 0x4f55
incq %r15
movl %edx, %ebp
jmp 0x4f48
cmpl $-0x1, %eax
je 0x4fca
movq 0xa047(%rip), %rdi      # 0xefa8
leaq 0x5395(%rip), %rsi      # 0xa2fd
callq 0x3270
movq %rax, %rdi
movl %r15d, %esi
callq 0x33c0
leaq 0x53c0(%rip), %rsi      # 0xa33f
movq %rax, %rdi
callq 0x3270
movq %rax, %rdi
movl %ebp, %esi
callq 0x33c0
movq %rax, %rdi
callq 0x3160
leaq 0x30(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %ebp, %ecx
callq 0x51ec
movq 0x10(%rsp), %rcx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x511c
leaq 0x30(%rsp), %rdi
callq 0x3438
jmp 0x4fde
leaq 0x5321(%rip), %rsi      # 0xa2f2
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x3992
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x500a
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x5005
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3438
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/kvstore.cc
// Function: KVStore::findIndexedKey(unsigned long, unsigned long*) const
int KVStore::findIndexedKey(uint64_t key, uint64_t *offsetDst) const {
    int count = 0;
    bool found = false;
    uint64_t offset = 0;
    for (auto table : indexTableList) {
        if (found) break;
        // binary searches in an index table
        int l = 0;
        int r = table.size() - 1;
        while (l <= r) {
            int mid = (l + r) / 2;
            if (table[mid].key == key) {
                offset = table[mid].offset;
                found = true;
                break;
            }
            if (table[mid].key < key) {
                l = mid + 1;
            } else
                r = mid - 1;
        }
        if (!found) count++;
    }
    if (found && offsetDst != nullptr) *offsetDst = offset;
    return found ? count : -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x18(%rsp)
movq %rsi, %r14
movq 0x40(%rdi), %r15
movq 0x48(%rdi), %rbx
movq $0x0, 0x10(%rsp)
leaq 0x20(%rsp), %r12
xorl %r13d, %r13d
movl $0x0, 0xc(%rsp)
cmpq %rbx, %r15
je 0x50e0
movq %r12, %rdi
movq %r15, %rsi
callq 0x7538
testb $0x1, %r13b
je 0x5068
movl %r13d, %ebp
jmp 0x50c5
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rcx
subq %rax, %rcx
shrq $0x4, %rcx
decl %ecx
xorl %edx, %edx
cmpl %ecx, %edx
jg 0x50a4
leal (%rcx,%rdx), %esi
shrl %esi
movq %rsi, %rdi
shlq $0x4, %rdi
movq (%rax,%rdi), %r8
cmpq %r14, %r8
je 0x50a9
jb 0x509e
decl %esi
movl %esi, %ecx
jmp 0x507d
incl %esi
movl %esi, %edx
jmp 0x507d
movl %r13d, %ebp
jmp 0x50b8
addq %rdi, %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movb $0x1, %bpl
movl %ebp, %eax
notb %al
andb $0x1, %al
movzbl %al, %eax
addl %eax, 0xc(%rsp)
movq %r12, %rdi
callq 0x845e
addq $0x18, %r15
testb $0x1, %r13b
movl %ebp, %r13d
je 0x5049
jmp 0x50e3
movl %r13d, %ebp
movl %ebp, %eax
notb %al
movq 0x18(%rsp), %rdx
testq %rdx, %rdx
sete %cl
orb %al, %cl
testb $0x1, %cl
jne 0x5101
movq 0x10(%rsp), %rax
movq %rax, (%rdx)
testb $0x1, %bpl
pushq $-0x1
popq %rax
cmovnel 0xc(%rsp), %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/SeanChao[P]KV-Store/kvstore.cc
// Function: KVStore::readPair(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long)
std::string KVStore::readPair(std::string path, uint64_t offset) {
    std::ifstream fs(path, std::ios::binary);
    uint64_t len = 0;
    // 16 = key + time
    fs.seekg(offset + 16);
    fs.read(reinterpret_cast<char *>(&len), sizeof(len));
    char *tmp = new char[len + 1];
    fs.read(tmp, len);
    fs.close();
    tmp[len] = '\0';
    std::string val(tmp);
    delete[] tmp;
    // std::clog << "read " << len << " byte: " << val << std::endl;
    return val;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rcx, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
pushq $0x4
popq %rax
movq %r15, %rdi
movq %rdx, %rsi
movl %eax, %edx
callq 0x3370
andq $0x0, 0x10(%rsp)
addq $0x10, %r14
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x32f0
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x32e0
movq 0x10(%rsp), %r15
leaq 0x1(%r15), %rdi
callq 0x3030
movq %rax, %r14
leaq 0x18(%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x32e0
leaq 0x18(%rsp), %rdi
callq 0x3050
movq 0x10(%rsp), %rax
movb $0x0, (%r14,%rax)
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3992
movq %r14, %rdi
callq 0x3300
leaq 0x18(%rsp), %rdi
callq 0x30b0
movq %rbx, %rax
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r14
popq %r15
retq
jmp 0x51d7
jmp 0x51d7
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x30b0
movq %rbx, %rdi
callq 0x33e0