LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::json_sax_dom_callback_parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::end_array()
bool end_array()
    {
        bool keep = true;

        if (ref_stack.back())
        {
            keep = callback(static_cast<int>(ref_stack.size()) - 1, parse_event_t::array_end, *ref_stack.back());
            if (not keep)
            {
                // discard array
                *ref_stack.back() = discarded;
            }
        }

        assert(not ref_stack.empty());
        assert(not keep_stack.empty());
        ref_stack.pop_back();
        keep_stack.pop_back();

        // remove discarded value
        if (not keep and not ref_stack.empty() and ref_stack.back()->is_array())
        {
            ref_stack.back()->m_value.array->pop_back();
        }

        return true;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rsi
movq -0x8(%rsi), %rcx
movb $0x1, %bpl
testq %rcx, %rcx
je 0x10f3c
leaq 0x80(%rbx), %rdi
subq 0x8(%rbx), %rsi
shrq $0x3, %rsi
decl %esi
pushq $0x3
popq %rdx
callq 0x1112e
testb %al, %al
jne 0x10f3c
leaq 0xa8(%rbx), %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x80e2
movq 0x10(%rbx), %rax
movq -0x8(%rax), %rdi
movq %r14, %rsi
callq 0x7da0
movq %r14, %rdi
callq 0x7de0
xorl %ebp, %ebp
movq 0x10(%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x10f93
movq 0x20(%rbx), %rcx
cmpq 0x30(%rbx), %rcx
jne 0x10f56
cmpl $0x0, 0x38(%rbx)
je 0x10fb2
leaq 0x30(%rbx), %rdi
addq $-0x8, %rax
movq %rax, 0x10(%rbx)
callq 0x1085a
testb %bpl, %bpl
jne 0x10f88
movq 0x10(%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x10f88
movq -0x8(%rax), %rax
cmpb $0x2, (%rax)
jne 0x10f88
movq 0x8(%rax), %rdi
callq 0xc094
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x24c68(%rip), %rdi     # 0x35c02
leaq 0x22859(%rip), %rsi     # 0x337fa
leaq 0x250a2(%rip), %rcx     # 0x3604a
movl $0x12b8, %edx           # imm = 0x12B8
callq 0x52c0
leaq 0x24af2(%rip), %rdi     # 0x35aab
leaq 0x2283a(%rip), %rsi     # 0x337fa
leaq 0x25083(%rip), %rcx     # 0x3604a
movl $0x12b9, %edx           # imm = 0x12B9
callq 0x52c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::iter_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::operator->() const
pointer operator->() const
    {
        assert(m_object != nullptr);

        switch (m_object->m_type)
        {
            case value_t::object:
            {
                assert(m_it.object_iterator != m_object->m_value.object->end());
                return &(m_it.object_iterator->second);
            }

            case value_t::array:
            {
                assert(m_it.array_iterator != m_object->m_value.array->end());
                return &*m_it.array_iterator;
            }

            default:
            {
                if (JSON_HEDLEY_LIKELY(m_it.primitive_iterator.is_begin()))
                {
                    return m_object;
                }

                JSON_THROW(invalid_iterator::create(214, "cannot get value"));
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq (%rdi), %rax
testq %rax, %rax
je 0x11639
movzbl (%rax), %ecx
cmpl $0x2, %ecx
je 0x115ae
cmpl $0x1, %ecx
jne 0x115db
movq 0x8(%rax), %rcx
addq $0x8, %rcx
movq 0x8(%rdi), %rax
cmpq %rcx, %rax
je 0x11658
addq $0x40, %rax
jmp 0x115e2
movq 0x8(%rax), %rcx
movq 0x10(%rdi), %rax
cmpq 0x8(%rcx), %rax
jne 0x115e2
leaq 0x24951(%rip), %rdi     # 0x35f14
leaq 0x22230(%rip), %rsi     # 0x337fa
leaq 0x24892(%rip), %rcx     # 0x35e63
movl $0x257d, %edx           # imm = 0x257D
callq 0x52c0
cmpq $0x0, 0x18(%rdi)
jne 0x115eb
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x5240
movq %rax, %rbx
leaq 0x2494d(%rip), %rsi     # 0x35f4a
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x84b8
movb $0x1, %bpl
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0xd6, %esi
callq 0x11a32
xorl %ebp, %ebp
leaq 0x3e42e(%rip), %rsi     # 0x4fa58
leaq -0x1cc9(%rip), %rdx     # 0xf968
movq %rbx, %rdi
callq 0x56c0
leaq 0x2465b(%rip), %rdi     # 0x35c9b
leaq 0x221b3(%rip), %rsi     # 0x337fa
leaq 0x24815(%rip), %rcx     # 0x35e63
movl $0x2571, %edx           # imm = 0x2571
callq 0x52c0
leaq 0x2487d(%rip), %rdi     # 0x35edc
leaq 0x22194(%rip), %rsi     # 0x337fa
leaq 0x247f6(%rip), %rcx     # 0x35e63
movl $0x2577, %edx           # imm = 0x2577
callq 0x52c0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x5200
testb %bpl, %bpl
jne 0x1168e
jmp 0x11696
movq %rax, %r14
movq %rbx, %rdi
callq 0x5300
movq %r14, %rdi
callq 0x56f0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::iter_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::operator++()
iter_impl& operator++()
    {
        assert(m_object != nullptr);

        switch (m_object->m_type)
        {
            case value_t::object:
            {
                std::advance(m_it.object_iterator, 1);
                break;
            }

            case value_t::array:
            {
                std::advance(m_it.array_iterator, 1);
                break;
            }

            default:
            {
                ++m_it.primitive_iterator;
                break;
            }
        }

        return *this;
    }

// Assembly:
pushq %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x118cf
movq %rdi, %rbx
movzbl (%rax), %eax
cmpl $0x2, %eax
je 0x118bf
cmpl $0x1, %eax
jne 0x118c6
leaq 0x8(%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x11c65
jmp 0x118ca
addq $0x10, 0x10(%rbx)
jmp 0x118ca
incq 0x18(%rbx)
movq %rbx, %rax
popq %rbx
retq
leaq 0x243c5(%rip), %rdi     # 0x35c9b
leaq 0x21f1d(%rip), %rsi     # 0x337fa
leaq 0x246ca(%rip), %rcx     # 0x35fae
movl $0x259e, %edx           # imm = 0x259E
callq 0x52c0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::iter_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::operator==(nlohmann::detail::iter_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>> const&) const
bool operator==(const iter_impl& other) const
    {
        // if objects are not the same, the comparison is undefined
        if (JSON_HEDLEY_UNLIKELY(m_object != other.m_object))
        {
            JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers"));
        }

        assert(m_object != nullptr);

        switch (m_object->m_type)
        {
            case value_t::object:
                return (m_it.object_iterator == other.m_it.object_iterator);

            case value_t::array:
                return (m_it.array_iterator == other.m_it.array_iterator);

            default:
                return (m_it.primitive_iterator == other.m_it.primitive_iterator);
        }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq (%rdi), %rax
cmpq (%rsi), %rax
jne 0x1199e
testq %rax, %rax
je 0x119ec
movzbl (%rax), %eax
cmpl $0x2, %eax
je 0x11980
cmpl $0x1, %eax
jne 0x1198a
movq 0x8(%rdi), %rax
cmpq 0x8(%rsi), %rax
jmp 0x11992
movq 0x10(%rdi), %rax
cmpq 0x10(%rsi), %rax
jmp 0x11992
movq 0x18(%rdi), %rax
cmpq 0x18(%rsi), %rax
sete %al
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x5240
movq %rax, %rbx
leaq 0x2436e(%rip), %rsi     # 0x35d1e
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x84b8
movb $0x1, %bpl
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
movl $0xd4, %esi
callq 0x11a32
xorl %ebp, %ebp
leaq 0x3e07b(%rip), %rsi     # 0x4fa58
leaq -0x207c(%rip), %rdx     # 0xf968
movq %rbx, %rdi
callq 0x56c0
leaq 0x242a8(%rip), %rdi     # 0x35c9b
leaq 0x21e00(%rip), %rsi     # 0x337fa
leaq 0x2434e(%rip), %rcx     # 0x35d4f
movl $0x25ef, %edx           # imm = 0x25EF
callq 0x52c0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x5200
testb %bpl, %bpl
jne 0x11a22
jmp 0x11a2a
movq %rax, %r14
movq %rbx, %rdi
callq 0x5300
movq %r14, %rdi
callq 0x56f0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::iter_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::set_end()
void set_end() noexcept
    {
        assert(m_object != nullptr);

        switch (m_object->m_type)
        {
            case value_t::object:
            {
                m_it.object_iterator = m_object->m_value.object->end();
                break;
            }

            case value_t::array:
            {
                m_it.array_iterator = m_object->m_value.array->end();
                break;
            }

            default:
            {
                m_it.primitive_iterator.set_end();
                break;
            }
        }
    }

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x11b4c
movzbl (%rax), %ecx
cmpl $0x2, %ecx
je 0x11b36
cmpl $0x1, %ecx
jne 0x11b43
movq 0x8(%rax), %rax
addq $0x8, %rax
movq %rax, 0x8(%rdi)
retq
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rdi)
retq
movq $0x1, 0x18(%rdi)
retq
pushq %rax
leaq 0x24147(%rip), %rdi     # 0x35c9b
leaq 0x21c9f(%rip), %rsi     # 0x337fa
leaq 0x24294(%rip), %rcx     # 0x35df6
movl $0x252d, %edx           # imm = 0x252D
callq 0x52c0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::json_sax_dom_parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::start_object(unsigned long)
bool start_object(std::size_t len)
    {
        ref_stack.push_back(handle_value(BasicJsonType::value_t::object));

        if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size()))
        {
            JSON_THROW(out_of_range::create(408,
                                            "excessive object size: " + std::to_string(len)));
        }

        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
leaq 0x8(%rsp), %rsi
movb $0x1, (%rsi)
callq 0x13006
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x130e8
cmpq $-0x1, %r14
je 0x12dfb
movq 0x10(%rbx), %rax
movq -0x8(%rax), %rdi
callq 0x11382
cmpq %r14, %rax
jb 0x12e08
movb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x5240
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xaaa3
leaq 0x22c6c(%rip), %rsi     # 0x35a93
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xaa7f
movb $0x1, %bpl
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
movl $0x198, %esi            # imm = 0x198
callq 0x10fd2
xorl %ebp, %ebp
leaq 0x3cbec(%rip), %rsi     # 0x4fa40
leaq -0x34f3(%rip), %rdx     # 0xf968
movq %rbx, %rdi
callq 0x56c0
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x5200
jmp 0x12e78
movq %rax, %r14
movb $0x1, %bpl
leaq 0x8(%rsp), %rdi
callq 0x5200
testb %bpl, %bpl
jne 0x12e8c
jmp 0x12e94
movq %rax, %r14
movq %rbx, %rdi
callq 0x5300
movq %r14, %rdi
callq 0x56f0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::json_sax_dom_parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::start_array(unsigned long)
bool start_array(std::size_t len)
    {
        ref_stack.push_back(handle_value(BasicJsonType::value_t::array));

        if (JSON_HEDLEY_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size()))
        {
            JSON_THROW(out_of_range::create(408,
                                            "excessive array size: " + std::to_string(len)));
        }

        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
leaq 0x8(%rsp), %rsi
movb $0x2, (%rsi)
callq 0x13006
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x130e8
cmpq $-0x1, %r14
je 0x12f03
movq 0x10(%rbx), %rax
movq -0x8(%rax), %rdi
callq 0x11382
cmpq %r14, %rax
jb 0x12f10
movb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x5240
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xaaa3
leaq 0x23104(%rip), %rsi     # 0x36033
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xaa7f
movb $0x1, %bpl
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
movl $0x198, %esi            # imm = 0x198
callq 0x10fd2
xorl %ebp, %ebp
leaq 0x3cae4(%rip), %rsi     # 0x4fa40
leaq -0x35fb(%rip), %rdx     # 0xf968
movq %rbx, %rdi
callq 0x56c0
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x5200
jmp 0x12f80
movq %rax, %r14
movb $0x1, %bpl
leaq 0x8(%rsp), %rdi
callq 0x5200
testb %bpl, %bpl
jne 0x12f94
jmp 0x12f9c
movq %rax, %r14
movq %rbx, %rdi
callq 0x5300
movq %r14, %rdi
callq 0x56f0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>* nlohmann::detail::json_sax_dom_parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::handle_value<nlohmann::detail::value_t>(nlohmann::detail::value_t&&)
JSON_HEDLEY_RETURNS_NON_NULL
    BasicJsonType* handle_value(Value&& v)
    {
        if (ref_stack.empty())
        {
            root = BasicJsonType(std::forward<Value>(v));
            return &root;
        }

        assert(ref_stack.back()->is_array() or ref_stack.back()->is_object());

        if (ref_stack.back()->is_array())
        {
            ref_stack.back()->m_value.array->emplace_back(std::forward<Value>(v));
            return &(ref_stack.back()->m_value.array->back());
        }

        assert(ref_stack.back()->is_object());
        assert(object_element);
        *object_element = BasicJsonType(std::forward<Value>(v));
        return object_element;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rax
cmpq %rax, 0x8(%rdi)
je 0x1304a
movq -0x8(%rax), %rax
movzbl (%rax), %ecx
cmpl $0x1, %ecx
je 0x13072
cmpl $0x2, %ecx
jne 0x130a9
movq 0x8(%rax), %rdi
callq 0x131e4
movq 0x10(%rbx), %rax
movq -0x8(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
addq $-0x10, %rax
jmp 0x130a1
movzbl (%rsi), %esi
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0xf988
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x7da0
movq %r14, %rdi
callq 0x7de0
movq (%rbx), %rax
jmp 0x130a1
cmpq $0x0, 0x20(%rbx)
je 0x130c8
movzbl (%rsi), %esi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0xf988
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x7da0
movq %r14, %rdi
callq 0x7de0
movq 0x20(%rbx), %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x22aea(%rip), %rdi     # 0x35b9a
leaq 0x20743(%rip), %rsi     # 0x337fa
leaq 0x23787(%rip), %rcx     # 0x36845
movl $0x1201, %edx           # imm = 0x1201
callq 0x52c0
leaq 0x22b24(%rip), %rdi     # 0x35bf3
leaq 0x20724(%rip), %rsi     # 0x337fa
leaq 0x23768(%rip), %rcx     # 0x36845
movl $0x120a, %edx           # imm = 0x120A
callq 0x52c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./json.hpp
// Function: nlohmann::detail::input_buffer_adapter::get_character()
std::char_traits<char>::int_type get_character() noexcept override
    {
        if (JSON_HEDLEY_LIKELY(cursor < limit))
        {
            assert(cursor != nullptr and limit != nullptr);
            return std::char_traits<char>::to_int_type(*(cursor++));
        }

        return std::char_traits<char>::eof();
    }

// Assembly:
movq 0x8(%rdi), %rax
cmpq 0x10(%rdi), %rax
jae 0x14049
testq %rax, %rax
je 0x1404d
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %eax
retq
pushq $-0x1
popq %rax
retq
pushq %rax
leaq 0x22d31(%rip), %rdi     # 0x36d86
leaq 0x1f79e(%rip), %rsi     # 0x337fa
leaq 0x22d4a(%rip), %rcx     # 0x36dad
movl $0xfac, %edx            # imm = 0xFAC
callq 0x52c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: FileManager::closeFile(int)
bool FileManager::closeFile(int fileID) {
    setFlag(fileID, 0);
    bpm->closeFile(fileID);
    close(fd[fileID]);
    return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movzbl %bl, %edx
pushq $-0x1
popq %rdi
movq %rdi, %rsi
callq 0x5640
addq %rax, 0x200(%r14)
adcq %rdx, 0x208(%r14)
movq 0x210(%r14), %rdi
movl %ebx, %esi
callq 0x5e3c
movslq %ebx, %rax
movl (%r14,%rax,4), %edi
callq 0x57e0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: FileManager::createFile(char const*)
bool FileManager::createFile(const char* name) {
    FILE* f = fopen(name, "a+");
    if (f == NULL) return false;
    fclose(f);
    return true;
}

// Assembly:
pushq %rbx
movq %rsi, %rdi
leaq 0x23478(%rip), %rsi     # 0x37b45
callq 0x54a0
movq %rax, %rbx
testq %rax, %rax
je 0x146e2
movq %rbx, %rdi
callq 0x53d0
testq %rbx, %rbx
setne %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: FileManager::openFile(char const*, int&)
bool FileManager::openFile(const char* name, int& fileID) {
    int f = open(name, O_RDWR);
    if (f == -1) return false;
    fileID = alloc();
    setFlag(fileID, 1);
    fd[fileID] = f;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %rbx
pushq $0x2
popq %rsi
movq %rax, %rdi
xorl %eax, %eax
callq 0x5310
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x1473e
movq %rbx, %rdi
callq 0x14c5a
movl %eax, %r15d
movl %eax, (%r14)
movzbl %r15b, %edx
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x5640
orq %rax, 0x200(%rbx)
orq %rdx, 0x208(%rbx)
movslq %r15d, %rax
movl %ebp, (%rbx,%rax,4)
cmpl $-0x1, %ebp
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: FileManager::readPage(int, int, unsigned char*)
int FileManager::readPage(int fileID, int pageID, BufType buf) {
    int f = fd[fileID];
    off_t offset = pageID << PAGE_SIZE_INDEX;
    off_t error = lseek(f, offset, SEEK_SET);
    if (error != offset) return -1;
    read(f, buf, PAGE_SIZE);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movslq %esi, %rax
movl (%rdi,%rax,4), %r14d
shll $0xd, %edx
movslq %edx, %r15
xorl %ebp, %ebp
movl %r14d, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5750
cmpq %r15, %rax
jne 0x14795
movl $0x2000, %edx           # imm = 0x2000
movl %r14d, %edi
movq %rbx, %rsi
callq 0x5580
jmp 0x14798
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: FileManager::writePage(int, int, unsigned char*)
int FileManager::writePage(int fileID, int pageID, BufType buf) {
    int f = fd[fileID];
    off_t offset = pageID << PAGE_SIZE_INDEX;
    off_t error = lseek(f, offset, SEEK_SET);
    if (error != offset) return -1;
    write(f, buf, PAGE_SIZE);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movslq %esi, %rax
movl (%rdi,%rax,4), %r14d
shll $0xd, %edx
movslq %edx, %r15
xorl %ebp, %ebp
movl %r14d, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5750
cmpq %r15, %rax
jne 0x147e3
movl $0x2000, %edx           # imm = 0x2000
movl %r14d, %edi
movq %rbx, %rsi
callq 0x5170
jmp 0x147e6
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: readFile(char const*)
char* readFile(const char* path) {
    int length;
    FILE* file = fopen(path, "rb");
    if (file == nullptr) {
        return nullptr;
    }
    fseek(file, 0, SEEK_END);
    length = ftell(file);
    char* data = new char[length + 1];
    rewind(file);
    length = fread(data, 1, length, file);
    data[length] = '\0';
    fclose(file);
    return data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x23340(%rip), %rsi     # 0x37b48
callq 0x54a0
testq %rax, %rax
je 0x14864
movq %rax, %rbx
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x5450
movq %rbx, %rdi
callq 0x5030
movq %rax, %r15
incl %eax
movslq %eax, %rdi
callq 0x5040
movq %rax, %r14
movq %rbx, %rdi
callq 0x5090
movslq %r15d, %rdx
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %rbx, %rcx
callq 0x55b0
cltq
movb $0x0, (%r14,%rax)
movq %rbx, %rdi
callq 0x53d0
jmp 0x14867
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: dirPath(char const*)
char* dirPath(const char* dir) { // get str "db/dir"
    int length = 3 + strlen(dir);
    char* data = new char[length + 1];
    strcpy(data, "db/");
    strcpy(data + 3, dir);
    return data;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x51e0
addl $0x4, %eax
movslq %eax, %rdi
callq 0x5040
movq %rax, %r14
movl $0x2f6264, (%rax)       # imm = 0x2F6264
leaq 0x3(%rax), %rdi
movq %rbx, %rsi
callq 0x53b0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: dirPath(char const*, char const*)
char* dirPath(const char* dir, const char* path) { // get str "db/dir/path"
    int length = 3 + strlen(dir) + 1 + strlen(path);
    char* data = new char[length + 1];
    strcpy(data, "db/");
    strcpy(data + 3, dir);
    strcpy(data + 3 + strlen(dir), "/");
    strcpy(data + 3 + strlen(dir) + 1, path);
    return data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x51e0
movq %rax, %r15
movq %rbx, %rdi
callq 0x51e0
addl %r15d, %eax
addl $0x5, %eax
movslq %eax, %rdi
callq 0x5040
movq %rax, %r12
movl $0x2f6264, (%rax)       # imm = 0x2F6264
leaq 0x3(%rax), %rdi
movq %r14, %rsi
callq 0x53b0
leaq (%r12,%r15), %rdi
addq $0x4, %rdi
movw $0x2f, -0x1(%rdi)
movq %rbx, %rsi
callq 0x53b0
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: dirPath(char const*, char const*, char const*)
char* dirPath(const char* dir, const char* filename, const char* filetype) { // get str "db/dir/filename.filetype"
    int length = 3 + strlen(dir) + 1 + strlen(filename) + 1 + strlen(filetype);
    char* data = new char[length + 1];
    strcpy(data, "db/");
    strcpy(data + 3, dir);
    strcpy(data + 3 + strlen(dir), "/");
    strcpy(data + 3 + strlen(dir) + 1, filename);
    strcpy(data + 3 + strlen(dir) + 1 + strlen(filename), ".");
    strcpy(data + 3 + strlen(dir) + 1 + strlen(filename) + 1, filetype);
    return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
callq 0x51e0
movq %rax, %r13
movq %r14, %rdi
callq 0x51e0
movq %rax, %r15
movq %rbx, %rdi
callq 0x51e0
leal (%r15,%r13), %ecx
addl %ecx, %eax
addl $0x6, %eax
movslq %eax, %rdi
callq 0x5040
movq %rax, %rbp
movl $0x2f6264, (%rax)       # imm = 0x2F6264
leaq 0x3(%rax), %rdi
movq %r12, %rsi
callq 0x53b0
leaq 0x3(,%r13), %r12
addq %rbp, %r12
leaq 0x4(,%r13), %rdi
addq %rbp, %rdi
movw $0x2f, -0x1(%rdi)
movq %r14, %rsi
callq 0x53b0
leaq (%r15,%r12), %rdi
addq $0x2, %rdi
movw $0x2e, -0x1(%rdi)
movq %rbx, %rsi
callq 0x53b0
movq %rbp, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: dirPath(char const*, char const*, char const*, char const*)
char* dirPath(const char* dir, const char* filename, const char* subname, const char* filetype) { // get str "db/dir/filename_subname.filetype"
    int length = 3 + strlen(dir) + 1 + strlen(filename) + 1 + strlen(subname) + 1 + strlen(filetype);
    char* data = new char[length + 1];
    strcpy(data, "db/");
    strcpy(data + 3, dir);
    strcpy(data + 3 + strlen(dir), "/");
    strcpy(data + 3 + strlen(dir) + 1, filename);
    strcpy(data + 3 + strlen(dir) + 1 + strlen(filename), "_");
    strcpy(data + 3 + strlen(dir) + 1 + strlen(filename) + 1, subname);
    strcpy(data + 3 + strlen(dir) + 1 + strlen(filename) + 1 + strlen(subname), ".");
    strcpy(data + 3 + strlen(dir) + 1 + strlen(filename) + 1 + strlen(subname) + 1, filetype);
    return data;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rcx, 0x10(%rsp)
movq %rdx, %r12
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, %rbp
callq 0x51e0
movq %rax, %rbx
movq %r15, %rdi
callq 0x51e0
movq %rax, %r13
movq %r12, %rdi
callq 0x51e0
movq %rax, %r12
movq %r14, %rdi
callq 0x51e0
leal (%rbx,%r13), %ecx
addl %r12d, %ecx
addl %ecx, %eax
addl $0x7, %eax
movslq %eax, %rdi
callq 0x5040
movq %rax, %r14
movl $0x2f6264, (%rax)       # imm = 0x2F6264
leaq 0x3(%rax), %rdi
movq %rbp, %rsi
callq 0x53b0
leaq (%r14,%rbx), %rbp
addq $0x3, %rbp
leaq (%r14,%rbx), %rdi
addq $0x4, %rdi
movw $0x2f, -0x1(%rdi)
movq %r15, %rsi
callq 0x53b0
leaq 0x1(,%rbp), %rbx
addq %r13, %rbx
leaq 0x2(,%rbp), %rdi
addq %r13, %rdi
movw $0x5f, -0x1(%rdi)
movq 0x8(%rsp), %rsi
callq 0x53b0
leaq (%r12,%rbx), %rdi
addq $0x2, %rdi
movw $0x2e, -0x1(%rdi)
movq 0x10(%rsp), %rsi
callq 0x53b0
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: cleanFiles(char const*)
int cleanFiles(const char *dir) { // clean file(s)
    char dir_name[512];
    DIR *dirp;
    struct dirent *dp;
    struct stat dir_stat;
    int tmp;

    // if can't access, nothing to do
    if ( 0 != access(dir, F_OK) ) {
        return 0;
    }

    // if can't get direcrtory stat, fail
    if ( 0 > stat(dir, &dir_stat) ) {
        perror("get directory stat error");
        return -1;
    }

    if ( S_ISREG(dir_stat.st_mode) ) { // files
        remove(dir);
    } else if ( S_ISDIR(dir_stat.st_mode) ) { // folder
        dirp = opendir(dir);
        while ( (dp=readdir(dirp)) != NULL ) {
            if ( (0 == strcmp(".", dp->d_name)) || (0 == strcmp("..", dp->d_name)) ) { // Ignore . & ..
                continue;
            }
            sprintf(dir_name, "%s/%s", dir, dp->d_name);
            if ((tmp = cleanFiles(dir_name)) != 0) {
                return tmp;
            }
        }
        closedir(dirp);
        rmdir(dir); // remove empty folder
    } else {
        perror("unknow file type!");
        return -1;    
    }
    
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, %r14
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x56a0
testl %eax, %eax
jne 0x14bcb
movq %rsp, %rsi
movq %r14, %rdi
callq 0x53a0
testl %eax, %eax
js 0x14bb3
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rsp), %eax
cmpw $0x4000, %ax            # imm = 0x4000
je 0x14b25
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x14bbc
movq %r14, %rdi
callq 0x5710
jmp 0x14bcb
movq %r14, %rdi
callq 0x55c0
movq %rax, %r15
leaq 0x23030(%rip), %r12     # 0x37b67
leaq 0x90(%rsp), %r13
pushq $-0x1
popq %rbx
pushq $0x2e
popq %rbp
movq %r15, %rdi
callq 0x55d0
testq %rax, %rax
je 0x14b9f
movzbl 0x13(%rax), %edx
cmpl $0x2e, %edx
jne 0x14b72
cmpb $0x0, 0x14(%rax)
je 0x14b45
movzbl 0x14(%rax), %ecx
subl $0x2e, %ecx
jne 0x14b6e
movzbl 0x15(%rax), %ecx
negl %ecx
jmp 0x14b76
movl %ebp, %ecx
subl %edx, %ecx
testl %ecx, %ecx
je 0x14b45
addq $0x13, %rax
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x50e0
movq %r13, %rdi
callq 0x14ac6
testl %eax, %eax
je 0x14b45
jmp 0x14bcb
movq %r15, %rdi
callq 0x5650
movq %r14, %rdi
callq 0x51c0
xorl %ebx, %ebx
jmp 0x14bcb
leaq 0x22f94(%rip), %rdi     # 0x37b4e
jmp 0x14bc3
leaq 0x22faa(%rip), %rdi     # 0x37b6d
callq 0x5360
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: checkFile(char const*)
int checkFile(const char *filename) { // file exists? 1: exist, 0: null, -1: error
    struct stat dir_stat;
    if ( 0 != access(filename, F_OK) ) return 0;
    if ( 0 > stat(filename, &dir_stat) ) return -1;
    if ( S_ISREG(dir_stat.st_mode) ) return 1;
    return -1;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %r14
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x56a0
testl %eax, %eax
jne 0x14c4d
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x53a0
testl %eax, %eax
js 0x14c4a
movl $0xf000, %eax           # imm = 0xF000
andl 0x20(%rsp), %eax
xorl %ecx, %ecx
cmpl $0x8000, %eax           # imm = 0x8000
sete %cl
leal -0x1(,%rcx,2), %ebx
jmp 0x14c4d
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/FileManager.cpp
// Function: FileManager::alloc()
inline int FileManager::alloc() { // 0 means no flag, so find lowest 0 bit
    int wh = 0;
    __uint128_t flag_tmp = flag;
    for (int i = MAX_FILE_NUM_INDEX - 1; i >= 0; i--) {
        if ((PREFIX_128(1 << i) & flag_tmp) == PREFIX_128(1 << i)) {
            wh += 1 << i;
            flag_tmp >>= 1 << i;
        }
    }
    if (flag_tmp & 1) return -1; // all bits are 1
    return wh;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x200(%rdi), %rbx
movq 0x208(%rdi), %r15
pushq $0x6
popq %rbp
xorl %r13d, %r13d
movl $0xff, %r14d
testl %ebp, %ebp
js 0x14cd1
pushq $0x1
popq %r12
movl %ebp, %ecx
shll %cl, %r12d
movl %r12d, %edx
andl %r14d, %edx
pushq $-0x1
popq %rdi
movq %rdi, %rsi
callq 0x5640
orq %r15, %rdx
orq %rbx, %rax
andq %rdx, %rax
cmpq $-0x1, %rax
movl $0x0, %eax
cmovnel %eax, %r12d
addl %r12d, %r13d
andl %r14d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0x5340
movq %rax, %rbx
movq %rdx, %r15
decl %ebp
jmp 0x14c7f
andl $0x1, %ebx
xorl %eax, %eax
negq %rbx
sbbl %eax, %eax
orl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Hash.cpp
// Function: Hash::find(int, int)
int Hash::find(int fileID, int pageID) {
    int id = hash(fileID, pageID);
    while (flag[id] && bpm->check(fileID, pageID, table[id]) == false) {
        id++;
    }
    if (flag[id] == false) return -1;
    return table[id];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movl $0x40000, %ecx          # imm = 0x40000
movl %edx, %eax
cltd
idivl %ecx
imull $0x83, %edx, %eax
addl %esi, %eax
cltd
idivl %ecx
movslq %edx, %rcx
movq %rcx, %r15
movb 0x80000(%rbx,%rcx), %al
cmpb $0x1, %al
jne 0x14d4a
movq 0xc0000(%rbx), %rdi
movzwl (%rbx,%r15,2), %ecx
movl %r14d, %esi
movl %ebp, %edx
callq 0x5e22
leaq 0x1(%r15), %rcx
testb %al, %al
je 0x14d17
movb 0x7ffff(%rbx,%rcx), %al
testb %al, %al
je 0x14d55
movzwl (%rbx,%r15,2), %eax
jmp 0x14d58
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Hash.cpp
// Function: Hash::add(int, int, int)
void Hash::add(int fileID, int pageID, int index) {
    int id = hash(fileID, pageID);
    while (flag[id]) id++;
    flag[id] = true;
    table[id] = (uint16_t)index;
}

// Assembly:
movl %edx, %eax
movl $0x40000, %r8d          # imm = 0x40000
cltd
idivl %r8d
imull $0x83, %edx, %eax
addl %esi, %eax
cltd
idivl %r8d
movslq %edx, %rax
cmpb $0x0, 0x80000(%rdi,%rax)
leaq 0x1(%rax), %rax
jne 0x14d7f
movb $0x1, 0x7ffff(%rdi,%rax)
movw %cx, -0x2(%rdi,%rax,2)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Hash.cpp
// Function: Hash::del(int, int)
void Hash::del(int fileID, int pageID) {
    int id = hash(fileID, pageID);
    while (flag[id] && bpm->check(fileID, pageID, table[id]) == false) {
        id++;
    }
    if (flag[id]) flag[id] = false, table[id] = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl $0x40000, %ecx          # imm = 0x40000
movl %edx, %eax
cltd
idivl %ecx
imull $0x83, %edx, %eax
addl %esi, %eax
cltd
idivl %ecx
movslq %edx, %rax
leaq (%rdi,%rax,2), %rcx
leaq (%rax,%rdi), %r15
addq $0x80000, %r15          # imm = 0x80000
movq %rcx, %r12
movb (%r15), %al
cmpb $0x1, %al
jne 0x14e04
movq 0xc0000(%r14), %rdi
movzwl (%r12), %ecx
movl %ebp, %esi
movl %ebx, %edx
callq 0x5e22
leaq 0x2(%r12), %rcx
incq %r15
testb %al, %al
je 0x14dd2
movb -0x1(%r15), %al
decq %r15
testb $0x1, %al
je 0x14e12
movb $0x0, (%r15)
andw $0x0, (%r12)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Index.cpp
// Function: Index::debug(int)
void Index::debug(int now) {
    BtreeNode* node = convert_buf_to_BtreeNode(now);
    cout << "node " << node->index << " fa " << node->fa_index << " isleaf " << node->is_leaf <<endl;
    cout << node->record_cnt << endl;
    printf("val:\n");
    for (auto a: node->record) {
        cout << a.record_id << " " <<*a.key[0].anyCast<int>() << endl;
    }
    printf("son:\n");
    for (auto a: node->child) {
        cout << a << endl;
    }
    for (auto a: node->child) {
        if (a >= 0) debug(a);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x10(%rsp)
callq 0x1586c
movq %rax, %rbx
movq 0x3a8c2(%rip), %r14     # 0x4ffb8
leaq 0x225bf(%rip), %rsi     # 0x37cbc
movq %r14, %rdi
callq 0x53c0
movl 0x18(%rbx), %esi
movq %rax, %rdi
callq 0x56d0
leaq 0x225ab(%rip), %rsi     # 0x37cc2
movq %rax, %rdi
callq 0x53c0
movl 0x6c(%rbx), %esi
movq %rax, %rdi
callq 0x56d0
leaq 0x22596(%rip), %rsi     # 0x37cc7
movq %rax, %rdi
callq 0x53c0
movzbl 0x68(%rbx), %esi
movq %rax, %rdi
callq 0x5690
movq %rax, %rdi
callq 0x5230
movl 0x1c(%rbx), %esi
movq %r14, %rdi
callq 0x56d0
movq %rax, %rdi
callq 0x5230
leaq 0x22569(%rip), %rdi     # 0x37cd0
callq 0x55f0
movq 0x50(%rbx), %r13
movq %rbx, 0x8(%rsp)
movq 0x58(%rbx), %r15
leaq 0x20(%rsp), %r12
leaq 0x18(%rsp), %rbp
leaq 0x20f25(%rip), %r14     # 0x366af
cmpq %r15, %r13
je 0x157e2
movq %rbp, %rdi
movq %r13, %rsi
callq 0x18028
movl 0x18(%rsp), %esi
movq 0x3a813(%rip), %rdi     # 0x4ffb8
callq 0x56d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x53c0
movq %rax, %rbx
movq 0x20(%rsp), %rdi
callq 0x9410
movl (%rax), %esi
movq %rbx, %rdi
callq 0x56d0
movq %rax, %rdi
callq 0x5230
movq %r12, %rdi
callq 0x9268
addq $0x20, %r13
jmp 0x1578a
leaq 0x224ec(%rip), %rdi     # 0x37cd5
callq 0x55f0
movq 0x8(%rsp), %r12
movq 0x20(%r12), %rbx
movq 0x28(%r12), %r15
movq 0x3a7b4(%rip), %r14     # 0x4ffb8
cmpq %r15, %rbx
je 0x15821
movl (%rbx), %esi
movq %r14, %rdi
callq 0x56d0
movq %rax, %rdi
callq 0x5230
addq $0x4, %rbx
jmp 0x15804
movq 0x20(%r12), %rbx
movq 0x28(%r12), %r14
movq 0x10(%rsp), %r15
cmpq %r14, %rbx
je 0x15849
movl (%rbx), %esi
testl %esi, %esi
js 0x15843
movq %r15, %rdi
callq 0x156d4
addq $0x4, %rbx
jmp 0x15830
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r12, %rdi
callq 0x9268
movq %rbx, %rdi
callq 0x56f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Index.cpp
// Function: Index::insertRecord(Anys*, int, int)
void Index::insertRecord(Anys* info, int record_id, int now_index) {

    BtreeNode* now = Index::convert_buf_to_BtreeNode(now_index);

    //BtreeNode *now = Index::convert_buf_to_BtreeNode(index);
    //cout << "insert" << now->index << " "  << now->record_cnt;
    //cout << " " << (*info)[0].anyCast<int>() << " " << record_id << endl;
    int i = 0;
    vector<BtreeRecord>::iterator it;
    for (it = now->record.begin(); it!=now->record.end(); it++)
    {
        if (it->key > *info) {
            break;
        }
        if (it->key == *info && it->record_id > record_id) {
            break;
        }
        i ++;
    }

    if (now->is_leaf) {
        now->record.insert(it, BtreeRecord(record_id, *info));
        now->record_cnt++;
        now->child.push_back(-1);
        Index::convert_BtreeNode_to_buf(now);
        overflow_upstream(now->index);
        return;
    }
    else {
        Index::convert_BtreeNode_to_buf(now);
        Index::insertRecord(info, record_id, now->child[i]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
movq %rdi, 0x8(%rsp)
movq %r12, %rdi
movl %ecx, %esi
callq 0x1586c
movq %rax, %r14
movq 0x50(%rax), %r12
xorl %ebx, %ebx
cmpq 0x58(%r14), %r12
je 0x167ff
leaq 0x8(%r12), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x8700
testb %al, %al
jne 0x167ff
movq %r13, %rdi
movq %r15, %rsi
callq 0x85ea
testb %al, %al
je 0x167f5
cmpl %ebp, (%r12)
jg 0x167ff
addq $0x20, %r12
addq $0x4, %rbx
jmp 0x167c6
cmpb $0x1, 0x68(%r14)
je 0x1681f
movq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x15bec
movq 0x20(%r14), %rax
movl (%rax,%rbx), %ecx
jmp 0x167b3
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x9158
leaq 0x30(%rsp), %r15
movl %ebp, -0x8(%r15)
movq %r15, %rdi
movq %r13, %rsi
callq 0x9158
leaq 0x50(%r14), %rdi
leaq 0x28(%rsp), %rdx
movq %r12, %rsi
callq 0x192f8
movq %r15, %rdi
callq 0x9268
leaq 0x10(%rsp), %rdi
callq 0x9268
incl 0x1c(%r14)
movq %r14, %rdi
addq $0x20, %rdi
leaq 0x28(%rsp), %rsi
orl $-0x1, (%rsi)
callq 0x18774
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x15bec
movl 0x18(%r14), %esi
movq %rbx, %rdi
callq 0x164bc
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x9268
jmp 0x168b9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9268
movq %rbx, %rdi
callq 0x56f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./BtreeNode.h
// Function: BtreeNode::BtreeNode()
BtreeNode() {
        this->is_leaf = true;
        this->fa_index = -1;
        this->record_cnt = 0;
        this->record.clear();
        this->child.clear();
        this->child.push_back(-1);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
andq $0x0, 0x60(%rdi)
movb $0x1, 0x68(%rdi)
orl $-0x1, 0x6c(%rdi)
leaq 0x50(%rdi), %r15
andl $0x0, 0x1c(%rdi)
movq %r15, %rdi
callq 0x180ca
movq 0x20(%r14), %rax
cmpq %rax, 0x28(%r14)
je 0x18087
movq %rax, 0x28(%r14)
leaq 0x4(%rsp), %rsi
orl $-0x1, (%rsi)
movq %rbx, %rdi
callq 0x18774
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r12
addq $0x38, %r14
movq %r15, %rdi
callq 0x18236
movq %r14, %rdi
callq 0x182b2
movq %rbx, %rdi
callq 0x8c8c
movq %r12, %rdi
callq 0x56f0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./Any.h
// Function: Any::operator=(Any const&)
Any& operator=(const Any& any) {
        _pValue = nullptr;
        if (any._pValue) {
            _pValue = any._pValue->clone();
        }
        return *this;
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
andq $0x0, (%rdi)
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x184a5
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, (%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Key.cpp
// Function: ForeignKey::toJson[abi:cxx11]()
json ForeignKey::toJson() {
    json j;
    j["data"] = Key::toJson();
    j["sid"] = p->table->table_id;
    return j;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
callq 0x7c48
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x196ac
leaq 0x1e7de(%rip), %rsi     # 0x37cda
movq %rbx, %rdi
callq 0x7c7e
leaq 0x10(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x7da0
movq %r15, %rdi
callq 0x7de0
movq 0x50(%r14), %rax
movq 0x48(%rax), %rsi
addq $0x50, %rsi
movq %rsp, %rdi
callq 0x7dfa
leaq 0x1a1b8(%rip), %rsi     # 0x336ef
movq %rbx, %rdi
callq 0x7c7e
movq %rsp, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x7da0
movq %r14, %rdi
callq 0x7de0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rsp, %rdi
jmp 0x19572
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x7de0
jmp 0x1957c
movq %rax, %r14
movq %rbx, %rdi
callq 0x7de0
movq %r14, %rdi
callq 0x56f0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./Key.h
// Function: Key::toJson[abi:cxx11]()
json toJson() {
        json j;
        j["name"] = name.c_str();
        for (uint i = 0; i < v_size; i++) j["cols"].push_back(v[i]);
        return j;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
callq 0x7c48
movq 0x10(%r14), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x18(%rsp), %rdi
callq 0x197ec
leaq 0x1e94a(%rip), %rsi     # 0x3802e
movq %rbx, %rdi
callq 0x7c7e
leaq 0x18(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x7da0
movq %r15, %rdi
callq 0x7de0
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
xorl %r15d, %r15d
movl 0x8(%r14), %eax
cmpq %rax, %r15
jae 0x19754
movq %rbx, %rdi
leaq 0x1e5be(%rip), %rsi     # 0x37cdf
callq 0x7c7e
movq %rax, %r13
movq 0x30(%r14), %rsi
addq %rbp, %rsi
movq %r12, %rdi
callq 0x7dfa
movq %r13, %rdi
movq %r12, %rsi
callq 0x7e2e
movq %r12, %rdi
callq 0x7de0
incq %r15
addq $0x4, %rbp
jmp 0x1970e
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x18(%rsp), %rdi
jmp 0x1977a
jmp 0x19781
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x7de0
jmp 0x19784
movq %rax, %r14
movq %rbx, %rdi
callq 0x7de0
movq %r14, %rdi
callq 0x56f0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/MemPool.cpp
// Function: MemPool::access(int)
void MemPool::access(int index) {

    if (index == head) {
        return;
    } else if (index == tail) {
        tail = pool[index].pre;
    } else {
        link(pool[index].pre, pool[index].next);
    }
    link(index, head);
    head = index;
}

// Assembly:
movl 0x80004(%rdi), %eax
cmpl %esi, %eax
je 0x19ad0
movslq %eax, %rcx
movslq %esi, %rdx
movl (%rdi,%rdx,8), %r8d
cmpl %esi, 0x80008(%rdi)
jne 0x19aaf
leaq 0x80008(%rdi), %r9
jmp 0x19ac0
movslq %r8d, %r9
movslq 0x4(%rdi,%rdx,8), %r10
movl %r10d, 0x4(%rdi,%r9,8)
leaq (%rdi,%r10,8), %r9
movl %r8d, (%r9)
movl %eax, 0x4(%rdi,%rdx,8)
movl %esi, (%rdi,%rcx,8)
movl %esi, 0x80004(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/MemPool.cpp
// Function: MemPool::alloc()
int MemPool::alloc() {
    if (num == 0) {
        head = tail = num;
        return num++;
    } 
    if (num < MAX_BUF_NUM) {
        link(num, head);
        head = num;
        return num++;
    }
    access(tail);
    return head;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movslq 0x80000(%rdi), %rax
testq %rax, %rax
je 0x19b08
cmpl $0xffff, %eax           # imm = 0xFFFF
jg 0x19b1e
movslq 0x80004(%rbx), %rcx
movl %ecx, 0x4(%rbx,%rax,8)
movl %eax, (%rbx,%rcx,8)
movl %eax, 0x80004(%rbx)
leal 0x1(%rax), %ecx
movl %ecx, 0x80000(%rbx)
jmp 0x19b32
andl $0x0, 0x80008(%rbx)
movq $0x1, 0x80000(%rbx)
xorl %eax, %eax
jmp 0x19b32
movl 0x80008(%rbx), %esi
movq %rbx, %rdi
callq 0x19a8a
movl 0x80004(%rbx), %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Print.cpp
// Function: lenLimit(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
string lenLimit(string str, uint len) {
    if (str.length() > len) 
        return str.substr(0, len-2) + ".."; 
    else 
        return str + string(len - str.length(), ' ');
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %esi
subq 0x8(%r14), %rsi
jae 0x19b74
movl %edx, %ecx
addl $-0x2, %ecx
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5410
leaq 0x1e359(%rip), %rdx     # 0x37ec0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xaa60
jmp 0x19b96
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rsp, %rdi
pushq $0x20
popq %rdx
callq 0x5490
movq %rsp, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a49e
movq %rsp, %rdi
callq 0x5200
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x19bb2
movq %rax, %rbx
jmp 0x19bbd
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5200
movq %rbx, %rdi
callq 0x56f0
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Print.cpp
// Function: Type2Str[abi:cxx11](enumType)
string Type2Str(enumType ty) {
    switch (ty) {
    case INT: return "INT";
    case CHAR: return "CHAR";
    case VARCHAR: return "VARCHAR";
    case DATE: return "DATE";
    case DECIMAL: return "DECIMAL";
    default: return "";
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x4, %esi
ja 0x19c2a
movl %esi, %eax
leaq 0x1e2bd(%rip), %rcx     # 0x37e98
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1e2d8(%rip), %rsi     # 0x37ec3
leaq 0xf(%rsp), %rdx
jmp 0x19c36
leaq 0x1e2d6(%rip), %rsi     # 0x37ecf
leaq 0xb(%rsp), %rdx
jmp 0x19c36
leaq 0x1e2c0(%rip), %rsi     # 0x37ec7
leaq 0xd(%rsp), %rdx
jmp 0x19c36
leaq 0x1ebcb(%rip), %rsi     # 0x387e0
leaq 0xc(%rsp), %rdx
jmp 0x19c36
leaq 0x1e2a7(%rip), %rsi     # 0x37eca
leaq 0xe(%rsp), %rdx
jmp 0x19c36
leaq 0x20ca3(%rip), %rsi     # 0x3a8d4
leaq 0xa(%rsp), %rdx
movq %rbx, %rdi
callq 0x84b8
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/Print.cpp
// Function: Aggr2Str[abi:cxx11](enumAggr)
string Aggr2Str(enumAggr ty) {
    switch (ty) {
    case AG_COUNT: return "COUNT()";
    case AG_MIN: return "MIN()";
    case AG_MAX: return "MAX()";
    case AG_SUM: return "SUM()";
    case AG_AVG: return "AVG()";
    default: return "";
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x4, %esi
ja 0x19cac
movl %esi, %eax
leaq 0x1e24f(%rip), %rcx     # 0x37eac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1e26a(%rip), %rsi     # 0x37ed7
leaq 0xf(%rsp), %rdx
jmp 0x19cb8
leaq 0x1e276(%rip), %rsi     # 0x37ef1
leaq 0xb(%rsp), %rdx
jmp 0x19cb8
leaq 0x1e25c(%rip), %rsi     # 0x37ee5
leaq 0xd(%rsp), %rdx
jmp 0x19cb8
leaq 0x1e254(%rip), %rsi     # 0x37eeb
leaq 0xc(%rsp), %rdx
jmp 0x19cb8
leaq 0x1e23a(%rip), %rsi     # 0x37edf
leaq 0xe(%rsp), %rdx
jmp 0x19cb8
leaq 0x20c21(%rip), %rsi     # 0x3a8d4
leaq 0xa(%rsp), %rdx
movq %rbx, %rdi
callq 0x84b8
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq