LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./assignment1.hpp
// Function: assignment1::CountSplitInv(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&)
long long CountSplitInv(std::vector<int> &input, const std::vector<int>& left, const std::vector<int>& right)
    {
        std::vector<int> result;
        long long inversions = 0;
        
        size_t i = 0, j = 0;
        
        for (size_t k = 0; k < (left.size() + right.size()); k++)
        {
            if ( (i < left.size()) && (j < right.size()) && (left[i] < right[j]))
            {
                result.push_back(left[i]);
                i++;
            }
            else if ( (j < right.size()) && (i <left.size()) && (right[j] <= left[i]))
            {
                result.push_back(right[j]);
                j++;
                
                // inversion found (it's a split inversion)!
                inversions += left.size() - i;
                
                // if you want to print the inversions, uncomment this code
                //for (int o = i; o < left.size(); o++)
                //    cout << right[(j - 1)] << ", " << left[o] << endl;
            }
            else if (i < left.size())
            {
                result.push_back(left[i]);
                i++;
            }
            else if (j < right.size())
            {
                result.push_back(right[j]);
                j++;
            }
        }
        input = result;
        
        return inversions;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r13
movaps %xmm0, (%r13)
andq $0x0, 0x10(%r13)
movq $0x0, (%rsp)
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %ebx, %ebx
movq (%r12), %rcx
movq 0x8(%r12), %rsi
subq %rcx, %rsi
sarq $0x2, %rsi
movq (%r15), %rax
movq 0x8(%r15), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
leaq (%rdx,%rsi), %rdi
cmpq %rdi, %rbx
jae 0x2619
cmpq %rsi, %rbp
jae 0x25be
leaq (%rcx,%rbp,4), %rsi
cmpq %rdx, %r14
jae 0x25dd
movl (%rcx,%rbp,4), %edx
cmpl (%rax,%r14,4), %edx
jge 0x25d4
movq %r13, %rdi
callq 0x4ffc
jmp 0x25e5
cmpq %rdx, %r14
jae 0x25e8
leaq (%rax,%r14,4), %rsi
movq %r13, %rdi
callq 0x4ffc
incq %r14
jmp 0x25e8
movl (%rax,%r14,4), %edx
cmpl (%rcx,%rbp,4), %edx
jle 0x25ed
movq %r13, %rdi
callq 0x4ffc
incq %rbp
incq %rbx
jmp 0x2576
leaq (%rax,%r14,4), %rsi
movq %r13, %rdi
callq 0x4ffc
movq 0x8(%r12), %rax
subq (%r12), %rax
incq %r14
sarq $0x2, %rax
movq (%rsp), %rcx
subq %rbp, %rcx
addq %rax, %rcx
movq %rcx, (%rsp)
jmp 0x25e8
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x501a
leaq 0x10(%rsp), %rdi
callq 0x606a
movq (%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2647
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x606a
movq %rbx, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./assignment2.hpp
// Function: assignment2::partition(std::vector<int, std::allocator<int>>&, int, int)
int partition(vector<int>& input, int left, int right)
    {
        int p = input[left];
        int i = left + 1;
        
        for (int j = left + 1; j < right; j++)
        {
            if (input[j] < p)
            {
                swap(input[i], input[j]);
                i++;
            }
        }
        swap(input[left], input[i-1]);
        
        return (i-1);
    }

// Assembly:
movslq %esi, %rsi
movq (%rdi), %rcx
movl (%rcx,%rsi,4), %eax
leal 0x1(%rsi), %r8d
movslq %r8d, %rdi
movslq %edx, %rdx
movslq %r8d, %r9
cmpq %rdx, %rdi
jge 0x276e
movl (%rcx,%rdi,4), %r10d
cmpl %eax, %r10d
jge 0x2769
movl (%rcx,%r9,4), %r8d
movl %r10d, (%rcx,%r9,4)
movl %r8d, (%rcx,%rdi,4)
incl %r9d
movl %r9d, %r8d
incq %rdi
jmp 0x2746
leal -0x1(%r9), %eax
movl (%rcx,%rsi,4), %edx
movl -0x4(%rcx,%r9,4), %edi
movl %edi, (%rcx,%rsi,4)
movl %edx, -0x4(%rcx,%r9,4)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./assignment2.hpp
// Function: assignment2::partitionLast(std::vector<int, std::allocator<int>>&, int, int)
int partitionLast(vector<int>& input, int left, int right)
    {
        noCompLast += right - left - 1;
        
        // swap the last element with the first
        swap(input[right-1], input[left]);
        
        return partition(input, left, right);
    }

// Assembly:
movslq %esi, %rax
notl %esi
addl %edx, %esi
addl %esi, 0xba17(%rip)      # 0xe1b8
movq (%rdi), %rcx
movslq %edx, %rdx
movl -0x4(%rcx,%rdx,4), %esi
movl (%rcx,%rax,4), %r8d
movl %r8d, -0x4(%rcx,%rdx,4)
movl %esi, (%rcx,%rax,4)
movl %eax, %esi
jmp 0x2733
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./assignment2.hpp
// Function: assignment2::partitionMedian(std::vector<int, std::allocator<int>>&, int, int)
int partitionMedian(vector<int>& input, int left, int right)
    {
        noCompMedian += right - left - 1;
        
        int midInd = (left + right - 1) / 2;
        // initially pivot position is unknown
        int p = -1;
        
        // compute the median of the three elements (first, median, last)
        // and assign its index to the pivot
        if (input[left] < input[midInd])
        {
            if (input[left] >= input[right-1])
                p = left;
            else if (input[midInd] < input[right-1])
                p = midInd;
        }
        else
        {
            if (input[midInd] >= input[right-1])
                p = midInd;
            else if (input[left] < input[right-1])
                p = left;
        }
        // fallback
        if (p == -1)
            p = right - 1;
        
        // bring the median pivot to the beginning
        swap(input[left], input[p]);
        
        return partition(input, left, right);
    }

// Assembly:
pushq %rbp
pushq %rbx
movl %edx, %ecx
movl %esi, %r8d
movl %esi, %eax
notl %eax
addl %edx, %eax
addl %eax, 0xb9eb(%rip)      # 0xe1bc
leal -0x1(%rcx), %r9d
leal (%rcx,%r8), %eax
decl %eax
movl $0x2, %esi
cltd
idivl %esi
movslq %r8d, %rsi
movq (%rdi), %rdx
movl (%rdx,%rsi,4), %r10d
movslq %eax, %r11
movl (%rdx,%r11,4), %ebp
movslq %ecx, %r11
movl -0x4(%rdx,%r11,4), %ebx
cmpl %ebp, %r10d
jge 0x2817
movl %r8d, %r11d
cmpl %ebx, %r10d
jge 0x282b
cmpl %ebx, %ebp
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
cmovll %eax, %r11d
jmp 0x282b
movl %eax, %r11d
cmpl %ebx, %ebp
jge 0x282b
cmpl %ebx, %r10d
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
cmovll %r8d, %r11d
cmpl $-0x1, %r11d
cmovnel %r11d, %r9d
movslq %r9d, %rax
movl (%rdx,%rax,4), %r8d
movl %r8d, (%rdx,%rsi,4)
movl %r10d, (%rdx,%rax,4)
movl %ecx, %edx
popq %rbx
popq %rbp
jmp 0x2733
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./assignment2.hpp
// Function: assignment2::QuickSort(std::vector<int, std::allocator<int>>&, int, int, int)
void QuickSort(vector<int>& input, int left, int right, int partitionType)
    {
        if (left == right)
            return;
        
        int pivotIndex = -1;
        switch (partitionType)
        {
            case 1: pivotIndex = partitionFirst(input, left, right); break;
            case 2: pivotIndex = partitionLast(input, left, right); break;
            case 3: pivotIndex = partitionMedian(input, left, right); break;
        }
        QuickSort(input, left, pivotIndex, partitionType);
        QuickSort(input, pivotIndex+1, right, partitionType);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
pushq $-0x1
popq %r13
cmpl %ebp, %r15d
je 0x28c1
cmpl $0x3, %ebx
je 0x2899
cmpl $0x2, %ebx
je 0x288a
movl %r13d, %r12d
cmpl $0x1, %ebx
jne 0x28a9
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x2783
jmp 0x28a6
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x2794
jmp 0x28a6
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x27be
movl %eax, %r12d
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
movl %ebx, %ecx
callq 0x284b
incl %r12d
movl %r12d, %r15d
jmp 0x2864
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./assignment4.hpp
// Function: assignment4::DFS(std::map<int, std::vector<int, std::allocator<int>>, std::less<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int>>>>>&, int)
void DFS(Graph& g, int i)
    {
        assert(g.count(i) > 0); // every node MUST be in a graph
        
        _seen[i] = 1;           // mark s as seen
        _leaders[i] = _s;

        // for every edge (s, v)
        for (int v : g[i])
        {
            if (!_seen[v])   // if v is not yet explored
            {
                DFS(g, v);
            }
        }
        _time++;
        _times[i] = _time;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %rax
movl %esi, (%rax)
movq %rax, %rsi
callq 0x5114
testq %rax, %rax
je 0x2976
leaq 0xc(%rsp), %rsi
movslq (%rsi), %rax
movq 0xb8d5(%rip), %rcx      # 0xe1d8
movl $0x1, (%rcx,%rax,4)
movl 0xb888(%rip), %eax      # 0xe198
movslq (%rsi), %rcx
movq 0xb8d6(%rip), %rdx      # 0xe1f0
movl %eax, (%rdx,%rcx,4)
movq %rbx, %rdi
callq 0x512e
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x294f
movslq (%r14), %rsi
movq 0xb89d(%rip), %rax      # 0xe1d8
cmpl $0x0, (%rax,%rsi,4)
jne 0x2949
movq %rbx, %rdi
callq 0x28d0
addq $0x4, %r14
jmp 0x292c
movl 0xb8b3(%rip), %eax      # 0xe208
incl %eax
movl %eax, 0xb8ab(%rip)      # 0xe208
movslq 0xc(%rsp), %rcx
movq 0xb857(%rip), %rdx      # 0xe1c0
movl %eax, (%rdx,%rcx,4)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x66a3(%rip), %rdi      # 0x9020
leaq 0x66ab(%rip), %rsi      # 0x902f
leaq 0x66b6(%rip), %rcx      # 0x9041
pushq $0x47
popq %rdx
callq 0x2150
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./assignment4.hpp
// Function: assignment4::DFSLoop(std::map<int, std::vector<int, std::allocator<int>>, std::less<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int>>>>>&)
void DFSLoop(Graph& g)
    {
        // initally time and leader set to 0 and -1, respectively
        // seen list i reset too
        _time = 0;
        _s = -1;
        _seen = seenList(g.size()+1, 0);   // mark all nodes unexplored
        
        int n = g.size();   // we assume the vertex labeling 1..n here
        
        for (int i = n; i > 0; i--)
        {
            if (!_seen[i]) // if i is not yet explored
            {
                _s = i;
                DFS(g, i);
            }
        }
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
andl $0x0, 0xb867(%rip)      # 0xe208
orl $-0x1, 0xb7f0(%rip)     # 0xe198
movq %rdi, %rbx
movq 0x28(%rdi), %rsi
incq %rsi
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x10(%rsp), %r14
leaq 0xb(%rsp), %rcx
movq %r14, %rdi
callq 0x517c
leaq 0xb805(%rip), %rdi      # 0xe1d8
movq %r14, %rsi
callq 0x6bbe
movq %r14, %rdi
callq 0x606a
movl 0x28(%rbx), %r14d
testl %r14d, %r14d
jle 0x2a11
movq 0xb7e5(%rip), %rax      # 0xe1d8
cmpl $0x0, (%rax,%r14,4)
jne 0x2a0c
movl %r14d, 0xb797(%rip)     # 0xe198
movq %rbx, %rdi
movl %r14d, %esi
callq 0x28d0
decq %r14
jmp 0x29e7
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./assignment4.hpp
// Function: assignment4::constructNewGraph(std::map<int, std::vector<int, std::allocator<int>>, std::less<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int>>>>>&, std::vector<int, std::allocator<int>> const&)
Graph constructNewGraph(Graph& originalGraph, const timesList& fTimes)
    {
        Graph newGraph;
        
        // First fTimes should have exactly n+1 elements of the originalGraph
        // assuming vertex labels start from 1 to n.
        assert(fTimes.size() == originalGraph.size()+1);
        
        for (size_t i = 1; i < fTimes.size(); i++)
        {
            // if the vertex in original graph doesn't have outgoing edges
            if (originalGraph[i].size() == 0)
            {
                // just construct it with updated key in a new graph
                newGraph[fTimes[i]] = std::vector<int>();
                continue;
            }
            
            for (int neighbor : originalGraph[i])
            {
                
                // neighbors of i-th vertex of original graph are
                // vertices with new names taken from the finishing times list
                newGraph[fTimes[i]].push_back(fTimes[neighbor]);
            }
        }
        
        return newGraph;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
leaq 0x8(%rdi), %rax
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
movq (%rdx), %rcx
movq 0x8(%rdx), %rax
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
movq %rsi, 0x8(%rsp)
movq 0x28(%rsi), %rsi
incq %rsi
cmpq %rsi, %rdx
jne 0x2b50
movq %rdi, %rbx
pushq $0x1
popq %r13
leaq 0x10(%rsp), %r15
subq %rcx, %rax
sarq $0x2, %rax
cmpq %rax, %r13
jae 0x2b3e
movl %r13d, 0x10(%rsp)
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x51d2
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
movq %r13, 0x30(%rsp)
je 0x2af6
movl %r13d, 0x10(%rsp)
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x51d2
movq (%rax), %r12
movq 0x8(%rax), %r15
leaq (,%r13,4), %rbp
cmpq %r15, %r12
je 0x2b2a
movslq (%r12), %r13
movq (%r14), %rsi
addq %rbp, %rsi
movq %rbx, %rdi
callq 0x512e
shlq $0x2, %r13
addq (%r14), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x4ffc
addq $0x4, %r12
jmp 0x2ac7
andq $0x0, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq (,%r13,4), %rsi
addq (%r14), %rsi
movq %rbx, %rdi
callq 0x512e
movq %rax, %rdi
movq %r15, %rsi
callq 0x6bbe
movq %r15, %rdi
callq 0x606a
movq 0x30(%rsp), %r13
incq %r13
movq (%r14), %rcx
movq 0x8(%r14), %rax
jmp 0x2a71
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x650e(%rip), %rdi      # 0x9065
leaq 0x64d1(%rip), %rsi      # 0x902f
leaq 0x6528(%rip), %rcx      # 0x908d
pushq $0x72
popq %rdx
callq 0x2150
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x606a
jmp 0x2b83
jmp 0x2b80
jmp 0x2b80
movq %rax, %r14
movq %rbx, %rdi
callq 0x586e
movq %r14, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./assignment3.hpp
// Function: assignment3::Graph::Graph(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Graph(std::string fileName)
        {
            ifstream file(fileName, ios::in);
            
            if (file.is_open())
            {
                std::string rawInput;
                while (getline(file, rawInput))
                {
                    std::istringstream is(rawInput);
                    int pos;
                    is >> pos;
                    adjacencyList.insert(std::pair<int, std::vector<int>>(pos, std::vector<int>( std::istream_iterator<int>(is), std::istream_iterator<int>() ) ));
                }
                file.close();
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rdi, %rbx
andl $0x0, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x8(%rdi), %rax
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
andq $0x0, 0x28(%rdi)
movq $0xf423f, 0x30(%rdi)    # imm = 0xF423F
leaq 0x90(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x2290
leaq 0x108(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x54e9
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x60(%rsp), %r12
leaq 0x298(%rsp), %r13
leaq 0x80(%rsp), %rbp
leaq 0x10(%rsp), %r15
leaq 0x40(%rsp), %r14
leaq 0x90(%rsp), %rdi
movq %r12, %rsi
callq 0x2050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x54d2
movq %r13, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
callq 0x22c0
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
callq 0x2140
movq %rbp, %rdi
movq %r13, %rsi
callq 0x5da0
andq $0x0, 0x30(%rsp)
andl $0x0, 0x38(%rsp)
movb $0x0, 0x3c(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x30(%rsp), %rdx
leaq 0xb(%rsp), %rcx
callq 0x5dac
movl 0xc(%rsp), %eax
movl %eax, 0x40(%rsp)
movaps 0x10(%rsp), %xmm0
movups %xmm0, 0x48(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5e16
leaq 0x48(%rsp), %rdi
callq 0x606a
movq %r15, %rdi
callq 0x606a
movq %r13, %rdi
callq 0x20f0
jmp 0x5411
leaq 0x90(%rsp), %rdi
callq 0x2060
leaq 0x60(%rsp), %rdi
callq 0x20e0
leaq 0x90(%rsp), %rdi
callq 0x2080
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5540
movq %rax, %r14
jmp 0x555a
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x606a
leaq 0x10(%rsp), %rdi
callq 0x606a
jmp 0x552f
jmp 0x552c
jmp 0x552c
movq %rax, %r14
leaq 0x298(%rsp), %rdi
callq 0x20f0
jmp 0x5543
jmp 0x5540
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x20e0
leaq 0x90(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x586e
movq %r14, %rdi
callq 0x22f0
// File: /workspace/github_cpp_makefile_star2_O2/Manca[P]algorithms1/./lib/Heap.hpp
// Function: DataStructures::Heap::rightChild(int)
int rightChild(int x)
        {
            size_t right = x*2 + 2;
            if (right < _heap.size())
                return right;
            else
                return leftChild(x);
        }

// Assembly:
leal 0x2(,%rsi,2), %eax
movslq %eax, %rcx
movq 0x10(%rdi), %rdx
subq 0x8(%rdi), %rdx
sarq $0x2, %rdx
cmpq %rcx, %rdx
jbe 0x5d9a
retq
jmp 0x5d62
nop
// File: /workspace/github_cpp_makefile_star2_O2/migueeelvargas[P]Auto-Complete/DictionaryTrie.cpp
// Function: DictionaryTrie::deleteAll(TrieNode*)
void DictionaryTrie::deleteAll(TrieNode* root) {
  if (root == NULL)
    return;

  deleteAll(root->left);
  deleteAll(root->right);
  deleteAll(root->mid);

  delete root;
}

// Assembly:
testq %rsi, %rsi
je 0x490a
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rsi
callq 0x48c8
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x48c8
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x48c8
pushq $0x28
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21e0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/migueeelvargas[P]Auto-Complete/DictionaryTrie.cpp
// Function: DictionaryTrie::find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) const
bool DictionaryTrie::find(std::string word) const {
  // If TST is empty, exit.
  if (root == NULL)
    return false;

  // Traverse the tree, looking for word.
  auto retVal = traverse(word);

  // Check if return value is valid & is a word.
  return word[word.length()-1] == retVal.first->symbol
          && retVal.second == word.length()-1 
          && retVal.first->isAWord;
}

// Assembly:
cmpq $0x0, 0x8(%rdi)
je 0x4b19
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x2260
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4b2a
movq %rax, %rbx
movl %edx, %ebp
movq %r15, %rdi
callq 0x2100
movq (%r14), %rax
movq 0x8(%r14), %rcx
movb -0x1(%rax,%rcx), %al
decq %rcx
cmpb (%rbx), %al
sete %al
movl %ebp, %edx
cmpq %rdx, %rcx
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x4b1c
movb 0x20(%rbx), %al
jmp 0x4b1e
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/migueeelvargas[P]Auto-Complete/DictionaryTrie.cpp
// Function: DictionaryTrie::predictCompletions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
std::vector<std::string> DictionaryTrie::predictCompletions(std::string prefix, 
  unsigned int num_completions) {

  // First check if the prefix is in the TST & if not return an empty vector
  if(!find(prefix)){
    std::cout << "Prefix not in trie." << std::endl;
    return {};
  }

  if(num_completions == 0) {
    std::cout << "The number of completions is set to 0, 0 returned." << std::endl;
    return {};
  }

  std::vector<std::string> words;
  std::multimap<int, std::string, std::greater<int>> prefixWords;

  // Finds all the words with the given prefix
  findPrefixWords(prefix, prefixWords);

  // Based on the num_completions add only the top # of words
  unsigned int count = 0;
  for(auto it = prefixWords.begin(); 
    (count < num_completions) && (it != prefixWords.end()); ++it) {
    
    words.push_back(it->second);
    count++;
  }
  return words;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x2260
movq %r14, %rdi
movq %r12, %rsi
callq 0x4ab6
movl %eax, %r12d
leaq 0x50(%rsp), %rdi
callq 0x2100
testb %r12b, %r12b
je 0x4c4e
testl %ebp, %ebp
je 0x4c6a
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x28(%rsp), %r12
andl $0x0, (%r12)
andq $0x0, 0x8(%r12)
movq %r12, 0x10(%r12)
movq %r12, 0x18(%r12)
andq $0x0, 0x20(%r12)
movq %rsp, %rdi
movq %r15, %rsi
callq 0x2260
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
callq 0x4cdc
movq %rsp, %rdi
callq 0x2100
xorl %r15d, %r15d
movq 0x38(%rsp), %r14
cmpl %ebp, %r15d
jae 0x4c5e
cmpq %r12, %r14
je 0x4c5e
leaq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x4710
incl %r15d
movq %r14, %rdi
callq 0x2160
movq %rax, %r14
jmp 0x4c28
movq 0x5383(%rip), %rdi      # 0x9fd8
leaq 0x14c6(%rip), %rsi      # 0x6122
jmp 0x4c78
leaq 0x20(%rsp), %rdi
callq 0x4f96
jmp 0x4c90
movq 0x5367(%rip), %rdi      # 0x9fd8
leaq 0x14be(%rip), %rsi      # 0x6136
callq 0x21c0
movq %rax, %rdi
callq 0x2120
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
movq %rbx, %rax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rsp, %rdi
callq 0x2100
jmp 0x4cc1
jmp 0x4cbe
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x2100
jmp 0x4cd3
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x4f96
movq %rbx, %rdi
callq 0x2f46
movq %r14, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/migueeelvargas[P]Auto-Complete/DictionaryTrie.cpp
// Function: DictionaryTrie::findPrefixWords(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::multimap<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::greater<int>, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
void DictionaryTrie::findPrefixWords (std::string prefix,
  std::multimap<int, std::string, std::greater<int>> &prefixWords) {

  auto retVal = traverse(prefix);
  TrieNode* parent = retVal.first;

  // Checks if the prefix doesn't have any words, exits
  if (parent == NULL)
    return;

  // If the prefix is a word, add it to prefixWords
  if (parent->isAWord) {
    prefixWords.insert(std::pair<int, std::string>(parent->freq, prefix));
  }

  std::string buffer = "";
  // Get all prefix words
  getPrefixWords(parent->mid, prefix, prefixWords);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x50(%rsp), %r13
movq %r13, %rdi
callq 0x2260
movq %r14, %rdi
movq %r13, %rsi
callq 0x4b2a
movq %rax, %r12
movq %r13, %rdi
callq 0x2100
testq %r12, %r12
je 0x4da1
cmpb $0x1, 0x20(%r12)
jne 0x4d52
movq %r12, %rsi
addq $0x24, %rsi
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r15, %rdx
callq 0x4f40
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4ffa
leaq 0x10(%rsp), %rdi
callq 0x2100
leaq 0x135b(%rip), %rsi      # 0x60b4
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2f6e
movq 0x18(%r12), %r12
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x2260
leaq 0x30(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x4de2
leaq 0x30(%rsp), %rdi
callq 0x2100
leaq 0x8(%rsp), %rdi
callq 0x2100
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x4dd0
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2100
jmp 0x4dcb
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2100
jmp 0x4dda
movq %rax, %rbx
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/migueeelvargas[P]Auto-Complete/DictionaryTrie.cpp
// Function: DictionaryTrie::getPrefixWords(TrieNode*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::multimap<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::greater<int>, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
void DictionaryTrie::getPrefixWords (TrieNode* curr, std::string prefix,
  std::multimap<int, std::string, std::greater<int>> &prefixWords) {

  // Base case
  if (curr == NULL)
    return;

  // Traverse the left side of TST
  getPrefixWords(curr->right, prefix, prefixWords);
  getPrefixWords(curr->left, prefix, prefixWords);

  // Check if node is a word, & store prefix + current character
  if(curr->isAWord)
    prefixWords.insert(std::pair<int, std::string>(curr->freq, prefix + curr->symbol));

  // getPrefixWords(curr->mid, prefix.append(&(curr->symbol)), prefixWords);
  getPrefixWords(curr->mid, prefix + curr->symbol, prefixWords);  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
testq %rsi, %rsi
je 0x4eef
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq 0x10(%rsi), %r13
leaq 0x60(%rsp), %rbp
movq %rbp, %rdi
movq %rdx, %rsi
callq 0x2260
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x4de2
leaq 0x60(%rsp), %rdi
callq 0x2100
movq 0x8(%r12), %r13
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x2260
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x4de2
leaq 0x40(%rsp), %rdi
callq 0x2100
cmpb $0x1, 0x20(%r12)
jne 0x4eba
leaq 0x24(%r12), %r13
movsbl (%r12), %edx
movq %rsp, %rdi
movq %r15, %rsi
callq 0x4f50
leaq 0x80(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %rsp, %rdx
callq 0x4f86
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4ffa
leaq 0x88(%rsp), %rdi
callq 0x2100
movq %rsp, %rdi
callq 0x2100
movq 0x18(%r12), %r13
movsbl (%r12), %edx
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x4f50
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x4de2
leaq 0x20(%rsp), %rdi
callq 0x2100
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x2100
movq %rsp, %rdi
jmp 0x4f32
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x4f32
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x4f32
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/migueeelvargas[P]Auto-Complete/DictionaryBST.cpp
// Function: DictionaryBST::insert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool DictionaryBST::insert(std::string word){
	// Checks if word is already in the dictionary
	if(find(word))
		return false;

	dictionary.insert(word);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x2260
movq %r14, %rdi
movq %r15, %rsi
callq 0x51d2
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x2100
testb %bpl, %bpl
jne 0x51ac
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5252
xorb $0x1, %bpl
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/migueeelvargas[P]Auto-Complete/DictionaryHashtable.cpp
// Function: DictionaryHashtable::insert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool DictionaryHashtable::insert(std::string word) {
	// Checks if word is already in the dictionary
	if(find(word))
		return false;

	dictionary.insert(word);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x2260
movq %r14, %rdi
movq %r15, %rsi
callq 0x5548
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x2100
testb %bpl, %bpl
jne 0x5522
movq %r14, %rdi
movq %rbx, %rsi
callq 0x561a
xorb $0x1, %bpl
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/core.cpp
// Function: gamecore::configtrack(_IO_FILE*)
void gamecore::configtrack(FILE * fin) {
	int tc;
	fscanf(fin, "%d %d", &fpslimit, &tc);
	double spn;
	int C, L, R, dta;
	fscanf(fin, "%lf%d%d%d%d", &spn, &C, &L, &R, &dta);
	tv.clear();
	for (int i = 0; i < tc; ++i) {
		int A, B;
		fscanf(fin, "%d%d", &A, &B);
		binder[A] = i;
		tv.push_back(track());
		tv[i].reset();
		tv[i].setdisplaych(B);
		tv[i].bindscore(&sb);
		tv[i].setspn(spn);
		tv[i].setrange(35000, 80000, 150000, 200000);
		tv[i].setarea(rect(coord(1, R * i + 1), coord(C, R * i + R)));
		tv[i].setdelta(dta);
		tv[i].setlightheight(L);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x5a8(%rdi), %rdx
leaq 0x352c(%rip), %rsi      # 0x6089
leaq 0x1c(%rsp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x22f0
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
leaq 0x3513(%rip), %rsi      # 0x608f
leaq 0x38(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x14(%rsp), %r8
leaq 0x8(%rsp), %r9
movq %rbx, 0x30(%rsp)
movq %rbx, %rdi
xorl %eax, %eax
callq 0x22f0
leaq 0x4c8(%r14), %rdi
movq %rdi, 0x28(%rsp)
callq 0x30b0
leaq 0x4e0(%r14), %rax
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
xorl %ebx, %ebx
movslq 0x1c(%rsp), %rax
cmpq %rax, %rbx
jge 0x2d16
movq 0x30(%rsp), %rdi
leaq 0x34bb(%rip), %rsi      # 0x6096
leaq 0x44(%rsp), %rbp
movq %rbp, %rdx
leaq 0xc(%rsp), %rcx
xorl %eax, %eax
callq 0x22f0
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x30b8
movl %ebx, (%rax)
leaq 0x60(%rsp), %r12
movq %r12, %rdi
callq 0x56d4
movq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x3b6e
movq %r12, %rdi
callq 0x56f0
movq 0x4c8(%r14), %rdi
addq %r15, %rdi
callq 0x58c4
movq 0x4c8(%r14), %rdi
addq %r15, %rdi
movsbl 0xc(%rsp), %esi
callq 0x5894
movq 0x4c8(%r14), %rdi
addq %r15, %rdi
movq %r14, %rsi
callq 0x56fa
movq 0x4c8(%r14), %rdi
addq %r15, %rdi
movsd 0x38(%rsp), %xmm0
callq 0x589a
movq 0x4c8(%r14), %rdi
addq %r15, %rdi
movl $0x88b8, %esi           # imm = 0x88B8
movl $0x13880, %edx          # imm = 0x13880
movl $0x249f0, %ecx          # imm = 0x249F0
movl $0x30d40, %r8d          # imm = 0x30D40
callq 0x58a0
movq 0x4c8(%r14), %rbp
addq %r15, %rbp
movl 0x8(%rsp), %edx
imull %ebx, %edx
incl %edx
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0x5d6e
movl 0x18(%rsp), %esi
incq %rbx
movl 0x8(%rsp), %edx
imull %ebx, %edx
leaq 0x48(%rsp), %r12
movq %r12, %rdi
callq 0x5d6e
leaq 0x50(%rsp), %r13
movq %r13, %rdi
leaq 0x60(%rsp), %rsi
movq %r12, %rdx
callq 0x5dcc
movq %rbp, %rdi
movq %r13, %rsi
callq 0x5700
movq 0x4c8(%r14), %rdi
addq %r15, %rdi
movl 0x10(%rsp), %esi
callq 0x5a0a
movq 0x4c8(%r14), %rdi
addq %r15, %rdi
movl 0x14(%rsp), %esi
callq 0x5a1c
addq $0x68, %r15
jmp 0x2bc1
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x56f0
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/core.cpp
// Function: gamecore::configui()
void gamecore::configui() {
	ui.bindtimer(&ti);
	ui.bindscore(&sb);
	ui.setFPS(coord(1, tv.size() * tv[0].getwidth() + 1));
	ui.setStatusPos(coord(tv[0].getdown().p2.x + 1, 3));
	for (int i = 0; i != (int)tv.size(); ++i)
		ui.pushtrack(&tv[i]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x510(%rdi), %r14
leaq 0x38(%rdi), %rsi
movq %r14, %rdi
callq 0x3ff0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3ff6
movq 0x4c8(%rbx), %rdi
movq 0x4d0(%rbx), %rax
subq %rdi, %rax
pushq $0x68
popq %r13
cqto
idivq %r13
movq %rax, %r15
callq 0x5a0e
imull %eax, %r15d
incl %r15d
leaq 0x8(%rsp), %r12
pushq $0x1
popq %rsi
movq %r12, %rdi
movl %r15d, %edx
callq 0x5d6e
movq %r14, %rdi
movq %r12, %rsi
callq 0x3ffe
movq 0x4c8(%rbx), %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x59b8
movl 0x8(%r15), %esi
incl %esi
movq %rsp, %r15
pushq $0x3
popq %rdx
movq %r15, %rdi
callq 0x5d6e
movq %r14, %rdi
movq %r15, %rsi
callq 0x400e
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x4c8(%rbx), %rsi
movq 0x4d0(%rbx), %rax
subq %rsi, %rax
cqto
idivq %r13
movl %eax, %eax
cmpq %rax, %r12
je 0x2e1d
addq %r15, %rsi
movq %r14, %rdi
callq 0x4502
incq %r12
addq $0x68, %r15
jmp 0x2dec
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/core.cpp
// Function: gamecore::getclick(int)
void gamecore::getclick(int ch) {
	bool light = true;
	if (ch < 0) light = false, ch = -ch;
	if (binder.count(ch)) {
		track & tar = tv[binder[ch]];
		if (light) {
			int cur = ti.current();
			tar.checkhit(cur);
		}
		tar.setlight(light);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
movq %rdi, %r14
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x4e0(%rdi), %r15
movq %r15, %rdi
callq 0x3106
testq %rax, %rax
je 0x2ea1
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
callq 0x30b8
movslq (%rax), %rax
imulq $0x68, %rax, %r15
addq 0x4c8(%r14), %r15
testl %ebx, %ebx
js 0x2e92
addq $0x38, %r14
movq %r14, %rdi
callq 0x56a2
movslq %eax, %rsi
movq %r15, %rdi
callq 0x58d4
notl %ebx
shrl $0x1f, %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x58cc
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/core.cpp
// Function: gamecore::start()
void gamecore::start() {
	configtimer();
	int lst = ti.current();
	while (true) {
		while (int t = kb.getNextKey()) getclick(t);
		for (auto & i : tv) i.checkmiss(ti.current());
		if (ti.interval(lst) * fpslimit >= 1) {
			lst = ti.current();
			ui.update(lst);
			ui.flush();
		}
		if (!sd.empty() && ti.current() > sd.front())
			sd.playnext();
		usleep(10);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x38(%rdi), %r14
movq %r14, %rdi
callq 0x5694
movq %r14, %rdi
callq 0x56a2
movl %eax, 0xc(%rsp)
leaq 0x4a8(%rbx), %r15
leaq 0x510(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x40(%rbx), %rbp
movq %r15, %rdi
callq 0x4c20
testl %eax, %eax
je 0x2f04
movq %rbx, %rdi
movl %eax, %esi
callq 0x2e2c
jmp 0x2eec
movq 0x4c8(%rbx), %r12
movq 0x4d0(%rbx), %r13
movq %r14, %rdi
cmpq %r13, %r12
je 0x2f30
callq 0x56a2
movslq %eax, %rsi
movq %r12, %rdi
callq 0x5978
addq $0x68, %r12
jmp 0x2f12
movl 0xc(%rsp), %esi
callq 0x56ba
cvtsi2sdl 0x5a8(%rbx), %xmm1
mulsd %xmm0, %xmm1
ucomisd 0x30c3(%rip), %xmm1     # 0x6010
jb 0x2f73
movq %r14, %rdi
callq 0x56a2
movl %eax, 0xc(%rsp)
movslq %eax, %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x409e
movq %r12, %rdi
callq 0x4490
movq %rbp, %rdi
callq 0x5096
testb %al, %al
jne 0x2f9f
movq %r14, %rdi
callq 0x56a2
movl %eax, %r12d
movq %rbp, %rdi
callq 0x508e
cmpl %eax, %r12d
jle 0x2f9f
movq %rbp, %rdi
callq 0x50a2
pushq $0xa
popq %rdi
callq 0x2220
jmp 0x2eec
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/cui.cpp
// Function: UI::UI()
UI::UI() {
	initscr();
	start_color();
	FPSset = false;
	init_pair(1, COLOR_BLACK, COLOR_RED);
	init_pair(2, COLOR_BLACK, COLOR_BLUE);
	init_pair(3, COLOR_WHITE, COLOR_BLACK);
	init_pair(4, COLOR_WHITE, COLOR_MAGENTA);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x4516
leaq 0x70(%rbx), %rdi
callq 0x5d68
leaq 0x78(%rbx), %rdi
callq 0x5d68
leaq 0x80(%rbx), %rdi
callq 0x5d68
callq 0x2260
callq 0x2060
movb $0x0, 0x88(%rbx)
pushq $0x1
popq %rdi
xorl %esi, %esi
movl %edi, %edx
callq 0x2030
pushq $0x2
popq %rdi
pushq $0x4
popq %rdx
xorl %esi, %esi
callq 0x2030
pushq $0x3
popq %rdi
pushq $0x7
popq %rsi
xorl %edx, %edx
callq 0x2030
pushq $0x4
popq %rdi
pushq $0x7
popq %rsi
pushq $0x5
popq %rdx
callq 0x2030
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r15
jmp 0x3fbc
movq %rax, %r15
movq %r14, %rdi
callq 0x4588
movq %rbx, %rdi
callq 0x4790
movq %r15, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/cui.cpp
// Function: UI::update(long)
void UI::update(clock_t now) {
	clear();
	for (auto tr : trs) {
		int fg = tr->getdisplaych();
		int bg = 3 + tr->islight();
		attron(COLOR_PAIR(bg));
		matrix(halfdown(tr, tr->getarea()), ' ');
		attroff(COLOR_PAIR(bg));
		for (auto box : tr->gettrack(now)) {
			attron(COLOR_PAIR(fg));
			matrix(box, ' ');
			attroff(COLOR_PAIR(fg));
		}
		attron(COLOR_PAIR(bg));
		matrix(tr->getdown(), '=');
		attroff(COLOR_PAIR(bg));
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
callq 0x22c0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rcx, 0x18(%rsp)
movq 0x6f01(%rip), %r12      # 0xafd0
leaq 0x78(%rsp), %rbx
leaq 0x68(%rsp), %r14
cmpq 0x18(%rsp), %rax
je 0x4230
movq %rax, 0x28(%rsp)
movq (%rax), %r15
movq %r15, %rdi
callq 0x5890
movzbl %al, %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movq %r15, %rbp
callq 0x58d0
movzbl %al, %r15d
shll $0x8, %r15d
addl $0x300, %r15d           # imm = 0x300
movq (%r12), %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x20c0
leaq 0x48(%rsp), %rdi
movq %rbp, %r13
movq %rbp, %rsi
callq 0x5708
leaq 0x88(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
leaq 0x48(%rsp), %rdx
callq 0x406f
movq %rbp, %rdi
pushq $0x20
popq %rsi
callq 0x4019
movq (%r12), %rdi
movl %r15d, 0x8(%rsp)
movl %r15d, %esi
xorl %edx, %edx
callq 0x21f0
leaq 0x30(%rsp), %rdi
movq %r13, 0x20(%rsp)
movq %r13, %rsi
movq 0x10(%rsp), %rdx
callq 0x57ce
movq 0x30(%rsp), %r13
movq 0x38(%rsp), %rbp
movl 0xc(%rsp), %eax
shll $0x8, %eax
movzwl %ax, %r15d
cmpq %rbp, %r13
je 0x41dd
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5de0
movq (%r12), %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x20c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5de0
movq %r14, %rdi
pushq $0x20
popq %rsi
callq 0x4019
movq (%r12), %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x21f0
addq $0x10, %r13
jmp 0x4195
leaq 0x30(%rsp), %rdi
callq 0x47c4
movq (%r12), %rdi
movl 0x8(%rsp), %ebp
movl %ebp, %esi
xorl %edx, %edx
callq 0x20c0
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x59b8
movq %r15, %rdi
pushq $0x3d
popq %rsi
callq 0x4019
movq (%r12), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x21f0
movq 0x28(%rsp), %rax
addq $0x8, %rax
jmp 0x40d9
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x47c4
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/cui.cpp
// Function: UI::flush()
void UI::flush() {
	while (!flevent.empty() && ti->interval(flevent.front()) > 1.0)
		flevent.pop();
	flevent.push(ti->current());
	if (FPSset) showFPS();
	showscore();
	refresh();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq 0x30(%rbx), %rax
cmpq %rax, 0x50(%rbx)
je 0x44c4
movq 0x18(%rbx), %rdi
movl (%rax), %esi
callq 0x56ba
ucomisd 0x1b58(%rip), %xmm0     # 0x6010
jbe 0x44c4
movq %r14, %rdi
callq 0x486e
jmp 0x449b
movq 0x18(%rbx), %rdi
callq 0x56a2
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0x48c4
cmpb $0x1, 0x88(%rbx)
jne 0x44ed
movq %rbx, %rdi
callq 0x4286
movq %rbx, %rdi
callq 0x42b4
callq 0x22b0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/keybdevent.cpp
// Function: keybd::getNextKey()
int keybd::getNextKey(){
	const size_t siz = sizeof ie;
	while (true) {
		int res = read(dev, &ie, siz);
		if (res == -1) return 0;
		if (ie.type == 1) {
			if (ie.value <= 1) {
				return ie.value ? (int) ie.code : -((int) ie.code);
			}
		}
	}
	return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x18
popq %r14
movl 0x18(%rbx), %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2230
cmpl $-0x1, %eax
je 0x4c65
cmpw $0x1, 0x10(%rbx)
sete %al
movl 0x14(%rbx), %ecx
cmpl $0x2, %ecx
setl %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x4c2b
movzwl 0x12(%rbx), %edx
movl %edx, %eax
negl %eax
testl %ecx, %ecx
cmovnel %edx, %eax
jmp 0x4c67
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/main.cpp
// Function: main
int main(int argc, char ** argv) {
	if (argc <= 1) return 0;
	gamecore gm;
	FILE * fin = fopen(argc < 3 ? "track.ini" : argv[2], "r");
	if (fin == NULL) {
		std::cerr << "Cannot open config file" << std::endl;
		return -1;
	}
	char keybd[1024], beep[1024];
	fgets(keybd, 1024, fin);
	keybd[strlen(keybd) - 1] = 0;
	fgets(beep, 1024, fin);
	beep[strlen(beep) - 1] = 0;
	if (gm.registerkeybd(keybd) < 0) {
		std::cerr << "Open keyboard event error" << std::endl;
		return -1;
	}
	if (gm.configsound(beep) < 0) {
		std::cerr << "Open beep device error" << std::endl;
		return -1;
	}
	gm.configscore();
	gm.configtrack(fin);
	gm.configui();
	fin = fopen(argv[1], "r");
	if (fin == NULL) {
		std::cerr << "Cannot open " << argv[1] << std::endl;
		return -1;
	}
	gm.readbeatmap(fin);
	fclose(fin);
	gm.setsound(true);
	gm.warn();
	gm.start();
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xdb0, %rsp            # imm = 0xDB0
xorl %ebp, %ebp
cmpl $0x2, %edi
jl 0x4eb3
movq %rsi, %rbx
movl %edi, %r14d
movq %rsp, %rdi
callq 0x25ec
cmpl $0x2, %r14d
jne 0x4d6b
leaq 0x14c4(%rip), %rdi      # 0x622d
jmp 0x4d6f
movq 0x10(%rbx), %rdi
leaq 0x1508(%rip), %rsi      # 0x627e
callq 0x21e0
testq %rax, %rax
je 0x4e67
movq %rax, %r14
leaq 0x9b0(%rsp), %r15
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdx
callq 0x2280
movq %r15, %rdi
callq 0x20b0
xorl %ebp, %ebp
movb %bpl, -0x1(%rax,%r15)
leaq 0x5b0(%rsp), %r12
movq %r12, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x2280
movq %r12, %rdi
callq 0x20b0
movb %bpl, -0x1(%rax,%r12)
movq %rsp, %rdi
movq %r15, %rsi
callq 0x275c
testl %eax, %eax
js 0x4e84
movq %rsp, %rdi
leaq 0x5b0(%rsp), %rsi
callq 0x2768
testl %eax, %eax
js 0x4e8d
movq %rsp, %rdi
callq 0x2772
movq %rsp, %rdi
movq %r14, %rsi
callq 0x2b38
movq %rsp, %rdi
callq 0x2d3e
movq 0x8(%rbx), %rdi
leaq 0x145a(%rip), %rsi      # 0x627e
callq 0x21e0
testq %rax, %rax
je 0x4ec5
movq %rax, %r14
movq %rsp, %rdi
movq %rax, %rsi
callq 0x2782
movq %r14, %rdi
callq 0x2160
movq %rsp, %rdi
pushq $0x1
popq %rsi
callq 0x2fc6
movq %rsp, %rdi
callq 0x2fac
xorl %ebp, %ebp
movq %rsp, %rdi
callq 0x2eac
jmp 0x4eab
movq 0x6182(%rip), %rdi      # 0xaff0
leaq 0x13c2(%rip), %rsi      # 0x6237
callq 0x2150
movq %rax, %rdi
callq 0x20d0
jmp 0x4ea8
leaq 0x13c4(%rip), %rsi      # 0x624f
jmp 0x4e94
leaq 0x13d5(%rip), %rsi      # 0x6269
movq 0x6155(%rip), %rdi      # 0xaff0
callq 0x2150
movq %rax, %rdi
callq 0x20d0
pushq $-0x1
popq %rbp
movq %rsp, %rdi
callq 0x2700
movl %ebp, %eax
addq $0xdb0, %rsp            # imm = 0xDB0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x6124(%rip), %rdi      # 0xaff0
leaq 0x13ad(%rip), %rsi      # 0x6280
callq 0x2150
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x2150
jmp 0x4ea0
jmp 0x4ee8
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2700
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/score.cpp
// Function: score::push(int)
void score::push(int x) {
	switch (x) {
		case TAG_PERFECT:
			++perfect, ++combo, totscore += combo * 12 + 300;
			break;
		case TAG_GREAT:
			++great, ++combo, totscore += combo * 4 + 100;
			break;
		case TAG_GOOD:
			++good, totscore += combo * 2 + 50;
			break;
		case TAG_BAD:
			++bad, combo = 0;
			break;
		default: break;
	}
	++click, lststatus = x;
	maxcombo = std::max(maxcombo, combo);
}

// Assembly:
leal -0x1(%rsi), %eax
cmpl $0x3, %eax
ja 0x4fe8
leaq 0x1319(%rip), %rcx      # 0x6298
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
incl (%rdi)
movslq 0x10(%rdi), %rcx
leal 0x1(%rcx), %eax
movl %eax, 0x10(%rdi)
movq 0x18(%rdi), %rdx
imulq $0xc, %rcx, %rcx
addq %rdx, %rcx
addq $0x138, %rcx            # imm = 0x138
jmp 0x4fe2
incl 0x8(%rdi)
movslq 0x10(%rdi), %rax
movq 0x18(%rdi), %rcx
leaq (%rcx,%rax,2), %rcx
addq $0x32, %rcx
jmp 0x4fe2
incl 0xc(%rdi)
andl $0x0, 0x10(%rdi)
xorl %eax, %eax
jmp 0x4feb
incl 0x4(%rdi)
movslq 0x10(%rdi), %rcx
leaq 0x1(%rcx), %rax
movl %eax, 0x10(%rdi)
movq 0x18(%rdi), %rdx
leaq (%rdx,%rcx,4), %rcx
addq $0x68, %rcx
movq %rcx, 0x18(%rdi)
jmp 0x4feb
movl 0x10(%rdi), %eax
incl 0x2c(%rdi)
movl %esi, 0x28(%rdi)
movl 0x20(%rdi), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movl %eax, 0x20(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/sound.cpp
// Function: sound::beep(double, double)
void sound::beep(double hi, double ti) {
	if (enablesound) {
		// DEBUG MODE
		int tt = std::max((int) ceil(ti * 960), 1);
		ioctl(dev, KDMKTONE, (tt << 16)+(int) (1193180 / hi));
	}
}

// Assembly:
cmpb $0x1, (%rdi)
jne 0x5140
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
mulsd 0x11af(%rip), %xmm1     # 0x62a8
movsd %xmm0, 0x8(%rsp)
movapd %xmm1, %xmm0
callq 0x2050
cvttsd2si %xmm0, %eax
cmpl $0x2, %eax
pushq $0x1
popq %rcx
cmovgel %eax, %ecx
movl 0x58(%rbx), %edi
shll $0x10, %ecx
movsd 0x118d(%rip), %xmm0     # 0x62b0
divsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %edx
addl %ecx, %edx
movl $0x4b30, %esi           # imm = 0x4B30
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
jmp 0x2210
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/track.cpp
// Function: track::getpos(note*, long)
rect track::getpos(note * nt, clock_t now) {
	double mid = (nt->tick - now) / 1000000.;
	rect ar;
	ar.p2.x = area.p1.x + (int) (area.p2.x - area.p1.x + 1) * (1 - mid / spn) - 1;
	ar.p1.x = ar.p2.x - nt->size + 1;
	ar.p1.y = area.p1.y;
	ar.p2.y = area.p2.y;
	return rect::areaand(area, ar);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movslq (%rdx), %rax
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
divsd 0xb77(%rip), %xmm0      # 0x62b8
movsd %xmm0, (%rsp)
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x5dc4
movl 0x2c(%r14), %eax
movl 0x34(%r14), %ecx
cvtsi2sd %eax, %xmm0
subl %eax, %ecx
incl %ecx
cvtsi2sd %ecx, %xmm1
movsd (%rsp), %xmm2
divsd 0x8(%r14), %xmm2
addsd 0x896(%rip), %xmm2      # 0x6010
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
addsd 0xb36(%rip), %xmm2      # 0x62c0
leaq 0x2c(%r14), %rsi
cvttsd2si %xmm2, %eax
movl %eax, 0x8(%r12)
subl 0x4(%r15), %eax
incl %eax
movl %eax, (%r12)
movl 0x30(%r14), %eax
movl %eax, 0x4(%r12)
movl 0x38(%r14), %eax
movl %eax, 0xc(%r12)
movq %rbx, %rdi
movq %r12, %rdx
callq 0x5df6
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/daklqw[P]beepmania/track.cpp
// Function: track::gettrack(long)
std::vector<rect> track::gettrack(clock_t now) {
	int _c = cur;
	std::vector<rect> res;
	while (_c < (int)notes.size()) {
		if (notes[_c].tick - now > spn * CLOCKS_PER_SEC) break;
		rect tmp = getpos(&notes[_c++], now);
		if (tmp.none()) continue;
		res.push_back(tmp);
	}
	return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movslq 0x58(%rsi), %r13
xorpd %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movupd %xmm0, (%rdi)
leaq (,%r13,8), %rbp
leaq 0x8(%rsp), %r12
movq 0x40(%r15), %rdx
movq 0x48(%r15), %rax
subq %rdx, %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r13
jge 0x586a
movslq (%rdx,%rbp), %rax
subq %r14, %rax
cvtsi2sd %rax, %xmm0
movsd 0x8(%r15), %xmm1
mulsd 0x7e5(%rip), %xmm1      # 0x6018
ucomisd %xmm1, %xmm0
ja 0x586a
addq %rbp, %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x571a
movq %r12, %rdi
callq 0x5e40
testb %al, %al
jne 0x5861
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5a20
addq $0x8, %rbp
incq %r13
jmp 0x5803
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 0x47c4
movq %r14, %rdi
callq 0x22e0
nop