LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 $0x18, %rsp
movq %rdx, %r14
leaq 0x8(%rdi), %rax
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
movq 0x8(%rdx), %rax
subq (%rdx), %rax
movq %rax, %rcx
sarq $0x2, %rcx
movq %rsi, 0x10(%rsp)
movq 0x28(%rsi), %rdx
incq %rdx
cmpq %rdx, %rcx
jne 0x2d42
movq %rdi, %rbx
cmpq $0x5, %rax
jb 0x2d30
movl $0x1, %r13d
movl %r13d, 0xc(%rsp)
movq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x63ae
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x2ceb
movl %r13d, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x63ae
movq (%rax), %r12
movq 0x8(%rax), %r15
cmpq %r15, %r12
je 0x2d19
movslq (%r12), %rbp
leaq (,%r13,4), %rsi
addq (%r14), %rsi
movq %rbx, %rdi
callq 0x61cc
shlq $0x2, %rbp
addq (%r14), %rbp
movq 0x8(%rax), %rsi
cmpq 0x10(%rax), %rsi
je 0x2cda
movl (%rbp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rax)
jmp 0x2ce5
movq %rax, %rdi
movq %rbp, %rdx
callq 0x733a
addq $0x4, %r12
jmp 0x2c9e
leaq (,%r13,4), %rsi
addq (%r14), %rsi
movq %rbx, %rdi
callq 0x61cc
movq (%rax), %rdi
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
testq %rdi, %rdi
je 0x2d19
callq 0x21b0
incq %r13
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x2, %rax
cmpq %rax, %r13
jb 0x2c66
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x737c(%rip), %rdi      # 0xa0c5
leaq 0x733f(%rip), %rsi      # 0xa08f
leaq 0x7396(%rip), %rcx      # 0xa0ed
movl $0x72, %edx
callq 0x2120
jmp 0x2d67
jmp 0x2d67
jmp 0x2d67
movq %rax, %r14
movq %rbx, %rdi
callq 0x6c3a
movq %r14, %rdi
callq 0x2310
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5e16
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rsi
callq 0x5dd2
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x5dd2
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x5dd2
movl $0x28, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21d0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x60c0
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %rsp, %r15
movq %r15, %rdi
callq 0x349c
movq %r14, %rdi
movq %r15, %rsi
callq 0x60d2
movq %rax, %r14
movl %edx, %ebp
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x6097
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movb -0x1(%rax,%rcx), %al
decq %rcx
cmpb (%r14), %al
sete %al
movl %ebp, %edx
cmpq %rdx, %rcx
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x60c3
movb 0x20(%r14), %al
jmp 0x60c5
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rsi), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %r13
movq %r13, %rdi
callq 0x349c
movq %r14, %rdi
movq %r13, %rsi
callq 0x60d2
movq %rax, %r12
movq (%r13), %rdi
cmpq %rbp, %rdi
je 0x637b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21d0
testq %r12, %r12
je 0x6450
cmpb $0x1, 0x20(%r12)
jne 0x63d3
movl 0x24(%r12), %eax
leaq 0x8(%rsp), %rdi
movl %eax, -0x8(%rdi)
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
callq 0x349c
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x67ee
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x63d3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21d0
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1cd1(%rip), %rdx      # 0x80b4
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x37e0
movq 0x18(%r12), %r12
leaq 0x38(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x349c
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x64b6
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x643a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21d0
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x6450
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x64ad
movq 0x18(%rsp), %rsi
jmp 0x64a0
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x6492
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x6492
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x64ad
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
jmp 0x64ad
movq %rax, %rbx
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %rsp, %r15
movq %r15, %rdi
callq 0x349c
movq %r14, %rdi
movq %r15, %rsi
callq 0x6c02
movq %rax, %r15
leaq 0x8(%r14), %r13
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x6980
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
cmpq %r13, %r15
jne 0x6990
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6a5a
cmpq %r13, %r15
sete %al
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x69bd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
movq %rsp, %r15
movq %r15, %rdi
callq 0x349c
movq %r14, %rdi
movq %r15, %rsi
callq 0x721e
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x6d02
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
testq %r15, %r15
jne 0x6d1a
leaq 0x20(%rsp), %rdx
movq %r14, (%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6e00
testq %r15, %r15
sete %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x6d45
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x33d2(%rip), %rsi      # 0x6089
leaq 0xc(%rsp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2310
leaq 0x14(%rsp), %rax
movq %rax, (%rsp)
leaq 0x33b9(%rip), %rsi      # 0x608f
leaq 0x38(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
leaq 0x8(%rsp), %r9
movq %rbx, 0x30(%rsp)
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2310
movq 0x4c8(%r14), %r15
movq 0x4d0(%r14), %r12
cmpq %r15, %r12
je 0x2d27
movq %r15, %rbx
movq %rbx, %rdi
callq 0x581e
addq $0x68, %rbx
cmpq %r12, %rbx
jne 0x2d0f
movq %r15, 0x4d0(%r14)
cmpl $0x0, 0xc(%rsp)
jle 0x2ea5
leaq 0x4c8(%r14), %rax
movq %rax, 0x28(%rsp)
leaq 0x4e0(%r14), %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x30(%rsp), %rdi
leaq 0x333c(%rip), %rsi      # 0x6096
leaq 0x44(%rsp), %r12
movq %r12, %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x2310
movq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x3348
movl %ebx, (%rax)
leaq 0x60(%rsp), %r15
movq %r15, %rdi
callq 0x5800
movq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x3b5a
leaq 0x60(%rsp), %r15
movq %r15, %rdi
callq 0x581e
movq 0x4c8(%r14), %rdi
addq %rbp, %rdi
callq 0x5a3c
movq 0x4c8(%r14), %rdi
addq %rbp, %rdi
movsbl 0x10(%rsp), %esi
callq 0x59f8
movq 0x4c8(%r14), %rdi
addq %rbp, %rdi
movq %r14, %rsi
callq 0x5838
movq 0x4c8(%r14), %rdi
addq %rbp, %rdi
movsd 0x38(%rsp), %xmm0
callq 0x59fe
movq 0x4c8(%r14), %rdi
addq %rbp, %rdi
movl $0x88b8, %esi           # imm = 0x88B8
movl $0x13880, %edx          # imm = 0x13880
movl $0x249f0, %ecx          # imm = 0x249F0
movl $0x30d40, %r8d          # imm = 0x30D40
callq 0x5a04
movq 0x4c8(%r14), %r12
addq %rbp, %r12
movl 0x8(%rsp), %edx
imull %ebx, %edx
incl %edx
movq %r15, %rdi
movl $0x1, %esi
callq 0x5ee8
movl 0x1c(%rsp), %esi
incq %rbx
movl 0x8(%rsp), %edx
imull %ebx, %edx
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0x5ee8
leaq 0x50(%rsp), %r13
movq %r13, %rdi
leaq 0x60(%rsp), %rsi
movq %r15, %rdx
callq 0x5f46
movq %r12, %rdi
movq %r13, %rsi
callq 0x583e
movq 0x4c8(%r14), %rdi
addq %rbp, %rdi
movl 0x14(%rsp), %esi
callq 0x5bb0
movq 0x4c8(%r14), %rdi
addq %rbp, %rdi
movl 0x18(%rsp), %esi
callq 0x5bc2
movslq 0xc(%rsp), %rax
addq $0x68, %rbp
cmpq %rax, %rbx
jl 0x2d4e
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x581e
movq %rbx, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x510(%rdi), %r14
leaq 0x38(%rdi), %rsi
movq %r14, %rdi
callq 0x406a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4070
movq 0x4c8(%rbx), %rdi
movq 0x4d0(%rbx), %r15
subq %rdi, %r15
shrq $0x3, %r15
callq 0x5bb4
imull %r15d, %eax
imull $0xc4ec4ec5, %eax, %edx # imm = 0xC4EC4EC5
incl %edx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x1, %esi
callq 0x5ee8
movq %r14, %rdi
movq %r15, %rsi
callq 0x4078
movq 0x4c8(%rbx), %rsi
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x5b5e
movl 0x8(%r15), %esi
incl %esi
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x3, %edx
callq 0x5ee8
movq %r14, %rdi
movq %r15, %rsi
callq 0x4088
movq 0x4c8(%rbx), %rsi
movq 0x4d0(%rbx), %rax
subq %rsi, %rax
shrq $0x3, %rax
imull $0xc4ec4ec5, %eax, %eax # imm = 0xC4EC4EC5
testl %eax, %eax
je 0x2fc9
xorl %r15d, %r15d
xorl %r12d, %r12d
addq %r15, %rsi
movq %r14, %rdi
callq 0x465a
incq %r12
movq 0x4c8(%rbx), %rsi
movq 0x4d0(%rbx), %rax
subq %rsi, %rax
shrq $0x3, %rax
imull $0xc4ec4ec5, %eax, %eax # imm = 0xC4EC4EC5
addq $0x68, %r15
cmpq %rax, %r12
jne 0x2f97
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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, %eax
negl %eax
cmovsl %esi, %eax
movl %eax, 0xc(%rsp)
movq 0x4f0(%rdi), %rcx
testq %rcx, %rcx
je 0x3070
movl %esi, %ebx
movq %rdi, %r14
addq $0x4e0, %rdi            # imm = 0x4E0
leaq 0x4e8(%r14), %rsi
movq %rsi, %rdx
xorl %r8d, %r8d
cmpl %eax, 0x20(%rcx)
setl %r8b
cmovgeq %rcx, %rdx
movq 0x10(%rcx,%r8,8), %rcx
testq %rcx, %rcx
jne 0x300c
cmpq %rsi, %rdx
je 0x3070
cmpl 0x20(%rdx), %eax
jl 0x3070
leaq 0xc(%rsp), %rsi
callq 0x3348
movslq (%rax), %rax
imulq $0x68, %rax, %r15
addq 0x4c8(%r14), %r15
testl %ebx, %ebx
js 0x3061
addq $0x38, %r14
movq %r14, %rdi
callq 0x5794
movslq %eax, %rsi
movq %r15, %rdi
callq 0x5a50
notl %ebx
shrl $0x1f, %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x5a48
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5786
movq %r14, %rdi
callq 0x5794
movl %eax, 0xc(%rsp)
leaq 0x4a8(%rbx), %r15
leaq 0x510(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0x40(%rbx), %rbp
movq %r15, %rdi
callq 0x4c80
testl %eax, %eax
je 0x30d2
movq %rbx, %rdi
movl %eax, %esi
callq 0x2fd6
jmp 0x30ba
movq 0x4c8(%rbx), %r12
movq 0x4d0(%rbx), %r13
movq %r14, %rdi
cmpq %r13, %r12
je 0x30fe
callq 0x5794
movslq %eax, %rsi
movq %r12, %rdi
callq 0x5b1c
addq $0x68, %r12
jmp 0x30e0
movl 0xc(%rsp), %esi
callq 0x57bc
xorps %xmm1, %xmm1
cvtsi2sdl 0x5a8(%rbx), %xmm1
mulsd %xmm0, %xmm1
ucomisd 0x2ef2(%rip), %xmm1     # 0x6010
jb 0x3144
movq %r14, %rdi
callq 0x5794
movl %eax, 0xc(%rsp)
movslq %eax, %rsi
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x4134
movq %r12, %rdi
callq 0x45e0
movq %rbp, %rdi
callq 0x51d8
testb %al, %al
jne 0x3170
movq %r14, %rdi
callq 0x5794
movl %eax, %r12d
movq %rbp, %rdi
callq 0x51d0
cmpl %eax, %r12d
jle 0x3170
movq %rbp, %rdi
callq 0x51e4
movl $0xa, %edi
callq 0x2230
jmp 0x30ba
nop
// File: /workspace/github_cpp_makefile_star2_O3/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)
movq $0x0, 0x10(%rdi)
leaq 0x20(%rdi), %r14
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x60(%rdi)
movq %r14, %rdi
xorl %esi, %esi
callq 0x4720
leaq 0x70(%rbx), %rdi
callq 0x5ee0
leaq 0x78(%rbx), %rdi
callq 0x5ee0
leaq 0x80(%rbx), %rdi
callq 0x5ee0
callq 0x2270
callq 0x2070
movb $0x0, 0x88(%rbx)
movl $0x1, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x2040
movl $0x2, %edi
xorl %esi, %esi
movl $0x4, %edx
callq 0x2040
movl $0x3, %edi
movl $0x7, %esi
xorl %edx, %edx
callq 0x2040
movl $0x4, %edi
movl $0x7, %esi
movl $0x5, %edx
callq 0x2040
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r15
jmp 0x401c
movq %rax, %r15
movq %r14, %rdi
callq 0x46c8
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4030
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %r15, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x30(%rsp)
movq %rdi, %rbx
callq 0x22e0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rcx, 0x28(%rsp)
cmpq %rcx, %rax
je 0x42f0
movq 0x5e62(%rip), %rbx      # 0x9fd0
leaq 0x78(%rsp), %rbp
leaq 0x68(%rsp), %r12
movq %rax, 0x40(%rsp)
movq (%rax), %r14
movq %r14, %rdi
callq 0x59f4
movb %al, 0xb(%rsp)
movq %r14, %rdi
callq 0x5a4c
movzbl %al, %r13d
shll $0x8, %r13d
addl $0x300, %r13d           # imm = 0x300
movq (%rbx), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x20d0
leaq 0x48(%rsp), %rdi
movq %r14, %r15
movq %r14, %rsi
callq 0x5846
movl 0x50(%rsp), %r14d
movq %r15, %rdi
callq 0x5bbe
subl %eax, %r14d
incl %r14d
movl %r14d, 0x48(%rsp)
leaq 0x88(%rsp), %r14
movq %r14, %rdi
leaq 0x48(%rsp), %rsi
callq 0x5f5a
movq %r14, %rdi
movl $0x20, %esi
callq 0x4093
movq (%rbx), %rdi
movl %r13d, 0xc(%rsp)
movl %r13d, %esi
xorl %edx, %edx
callq 0x2200
leaq 0x10(%rsp), %rdi
movq %r15, 0x38(%rsp)
movq %r15, %rsi
movq 0x30(%rsp), %rdx
callq 0x590e
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %r14
cmpq %r14, %r15
je 0x4289
movzbl 0xb(%rsp), %eax
shll $0x8, %eax
movzwl %ax, %r13d
movq %rbp, %rdi
movq %r15, %rsi
callq 0x5f5a
movq (%rbx), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x20d0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x5f5a
movq %r12, %rdi
movl $0x20, %esi
callq 0x4093
movq (%rbx), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x2200
addq $0x10, %r15
cmpq %r14, %r15
jne 0x423e
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0x429e
movq 0x20(%rsp), %rsi
subq %r15, %rsi
movq %r15, %rdi
callq 0x21a0
movq (%rbx), %rdi
movl 0xc(%rsp), %r15d
movl %r15d, %esi
xorl %edx, %edx
callq 0x20d0
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq 0x38(%rsp), %rsi
callq 0x5b5e
movq %r14, %rdi
movl $0x3d, %esi
callq 0x4093
movq (%rbx), %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x2200
movq 0x40(%rsp), %rax
addq $0x8, %rax
cmpq 0x28(%rsp), %rax
jne 0x4178
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x431c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x2300
// File: /workspace/github_cpp_makefile_star2_O3/daklqw[P]beepmania/cui.cpp
// Function: UI::showscore()
void UI::showscore() {
	move(fpsat.x + 1, fpsat.y);
	printw("perfect: %d", sb->perfect);
	move(fpsat.x + 2, fpsat.y);
	printw("great  : %d", sb->great);
	move(fpsat.x + 3, fpsat.y);
	printw("good   : %d", sb->good);
	move(fpsat.x + 4, fpsat.y);
	printw("bad    : %d", sb->bad);
	move(fpsat.x + 5, fpsat.y);
	printw("combo  : %d", sb->combo);
	move(fpsat.x + 6, fpsat.y);
	printw("maxcb. : %d", sb->maxcombo);
	move(fpsat.x + 7, fpsat.y);
	printw("score  : %d", sb->totscore);
	move(fpsat.x + 8, fpsat.y);
	printw("acc    : %.2lf%%", sb->getacc() * 100);
	move(fpsat.x + 9, fpsat.y);
	double tmp = sb->getavgdelta();
	printw("hitavg : %.0lf(%c)", tmp, (tmp >= 0 ? 'e' : 'l'));
	move(fpsat.x + 10, fpsat.y);
	printw("lstdta : %d", sb->lstdelta);
	move(statat.x, statat.y);
	printw("%5d %s", sb->combo, statusName.at(sb->lststatus));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x70(%rdi), %edi
movl 0x74(%rbx), %esi
incl %edi
callq 0x2120
movq 0x90(%rbx), %rax
movl (%rax), %esi
leaq 0x1caa(%rip), %rdi      # 0x60cb
xorl %eax, %eax
callq 0x2190
movl 0x70(%rbx), %edi
movl 0x74(%rbx), %esi
addl $0x2, %edi
callq 0x2120
movq 0x90(%rbx), %rax
movl 0x4(%rax), %esi
leaq 0x1c90(%rip), %rdi      # 0x60d7
xorl %eax, %eax
callq 0x2190
movl 0x70(%rbx), %edi
movl 0x74(%rbx), %esi
addl $0x3, %edi
callq 0x2120
movq 0x90(%rbx), %rax
movl 0x8(%rax), %esi
leaq 0x1c76(%rip), %rdi      # 0x60e3
xorl %eax, %eax
callq 0x2190
movl 0x70(%rbx), %edi
movl 0x74(%rbx), %esi
addl $0x4, %edi
callq 0x2120
movq 0x90(%rbx), %rax
movl 0xc(%rax), %esi
leaq 0x1c5c(%rip), %rdi      # 0x60ef
xorl %eax, %eax
callq 0x2190
movl 0x70(%rbx), %edi
movl 0x74(%rbx), %esi
addl $0x5, %edi
callq 0x2120
movq 0x90(%rbx), %rax
movl 0x10(%rax), %esi
leaq 0x1c42(%rip), %rdi      # 0x60fb
xorl %eax, %eax
callq 0x2190
movl 0x70(%rbx), %edi
movl 0x74(%rbx), %esi
addl $0x6, %edi
callq 0x2120
movq 0x90(%rbx), %rax
movl 0x20(%rax), %esi
leaq 0x1c28(%rip), %rdi      # 0x6107
xorl %eax, %eax
callq 0x2190
movl 0x70(%rbx), %edi
movl 0x74(%rbx), %esi
addl $0x7, %edi
callq 0x2120
movq 0x90(%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x1c0d(%rip), %rdi      # 0x6113
xorl %eax, %eax
callq 0x2190
movl 0x70(%rbx), %edi
movl 0x74(%rbx), %esi
addl $0x8, %edi
callq 0x2120
movq 0x90(%rbx), %rdi
callq 0x5052
mulsd 0x1b89(%rip), %xmm0     # 0x60b8
leaq 0x1be9(%rip), %rdi      # 0x611f
movb $0x1, %al
callq 0x2190
movl 0x70(%rbx), %edi
movl 0x74(%rbx), %esi
addl $0x9, %edi
callq 0x2120
movq 0x90(%rbx), %rdi
callq 0x5148
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl $0x65, %eax
movl $0x6c, %esi
cmovael %eax, %esi
leaq 0x1bbd(%rip), %rdi      # 0x6130
movb $0x1, %al
callq 0x2190
movl 0x70(%rbx), %edi
movl 0x74(%rbx), %esi
addl $0xa, %edi
callq 0x2120
movq 0x90(%rbx), %rax
movl 0x24(%rax), %esi
leaq 0x1baa(%rip), %rdi      # 0x6143
xorl %eax, %eax
callq 0x2190
movl 0x80(%rbx), %edi
movl 0x84(%rbx), %esi
callq 0x2120
movq 0x90(%rbx), %rsi
movl 0x10(%rsi), %ebx
addq $0x28, %rsi
leaq 0x642a(%rip), %rdi      # 0xa9f0
callq 0x4682
movq (%rax), %rdx
leaq 0x1b7a(%rip), %rdi      # 0x614f
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
jmp 0x2190
nop
// File: /workspace/github_cpp_makefile_star2_O3/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(%rdi), %rax
cmpq %rax, 0x50(%rdi)
je 0x461c
movq 0x18(%rbx), %rdi
movl (%rax), %esi
callq 0x57bc
ucomisd 0x1a08(%rip), %xmm0     # 0x6010
jbe 0x461c
movq %r14, %rdi
callq 0x4896
movq 0x30(%rbx), %rax
cmpq %rax, 0x50(%rbx)
jne 0x45f5
movq 0x18(%rbx), %rdi
callq 0x5794
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0x48e4
cmpb $0x1, 0x88(%rbx)
jne 0x4645
movq %rbx, %rdi
callq 0x4380
movq %rbx, %rdi
callq 0x4400
callq 0x22d0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movl 0x18(%rdi), %edi
movl $0x18, %edx
movq %r14, %rsi
callq 0x2240
xorl %ebx, %ebx
cmpl $-0x1, %eax
je 0x4cd9
cmpw $0x1, 0x10(%r14)
sete %cl
movl 0x14(%r14), %eax
cmpl $0x2, %eax
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x4ccb
movl 0x18(%r14), %edi
movl $0x18, %edx
movq %r14, %rsi
callq 0x2240
jmp 0x4c99
movzwl 0x12(%r14), %ecx
movl %ecx, %ebx
negl %ebx
testl %eax, %eax
cmovnel %ecx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5100
leaq 0x1205(%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
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,4), %rcx
addq $0x138, %rcx            # imm = 0x138
jmp 0x50fa
incl 0x8(%rdi)
movslq 0x10(%rdi), %rax
movq 0x18(%rdi), %rcx
leaq (%rcx,%rax,2), %rcx
addq $0x32, %rcx
jmp 0x50fa
incl 0xc(%rdi)
movl $0x0, 0x10(%rdi)
xorl %eax, %eax
jmp 0x5103
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 0x5103
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_O3/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 0x5284
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
mulsd 0x106d(%rip), %xmm1     # 0x62a8
movsd %xmm0, 0x8(%rsp)
movapd %xmm1, %xmm0
callq 0x2060
cvttsd2si %xmm0, %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movl 0x58(%rbx), %edi
shll $0x10, %ecx
movsd 0x1049(%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 0x2220
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa39(%rip), %xmm0      # 0x62b8
movsd %xmm0, (%rsp)
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x5f3e
movl 0x2c(%r14), %eax
movl 0x34(%r14), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
subl %eax, %ecx
incl %ecx
cvtsi2sd %ecx, %xmm1
movsd (%rsp), %xmm2
divsd 0x8(%r14), %xmm2
addsd 0x755(%rip), %xmm2      # 0x6010
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
addsd 0x9f5(%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 0x5f70
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rdi, %rbx
movslq 0x58(%rsi), %r13
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x40(%rsi), %rdx
movq 0x48(%rsi), %rax
subq %rdx, %rax
shrq $0x3, %rax
cmpl %eax, %r13d
jge 0x59c2
movq %rsi, %r15
leaq (,%r13,8), %rbp
leaq 0x8(%rsp), %r12
movslq (%rdx,%rbp), %rax
subq %r14, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd 0x8(%r15), %xmm1
mulsd 0x6a1(%rip), %xmm1      # 0x6018
ucomisd %xmm1, %xmm0
ja 0x59c2
addq %rbp, %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x5858
movq %r12, %rdi
callq 0x5fba
testb %al, %al
jne 0x59a5
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5bc6
incq %r13
movq 0x40(%r15), %rdx
movq 0x48(%r15), %rax
subq %rdx, %rax
shrq $0x3, %rax
cltq
addq $0x8, %rbp
cmpq %rax, %r13
jl 0x595a
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
testq %rdi, %rdi
je 0x59eb
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21a0
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O3/daklqw[P]beepmania/track.cpp
// Function: track::checkhit(long)
bool track::checkhit(clock_t now) {
	if (cur == (int)notes.size()) return false;
	int delta = notes[cur].tick - (now - checkdelta);
	int res = match(delta);
	if (res == -1) return false;
	++cur;
	sb->push(res);
	if (res != TAG_BAD) sb->pushdelta(delta);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movslq 0x58(%rdi), %rax
movq 0x40(%rdi), %rcx
movq 0x48(%rdi), %rdx
subq %rcx, %rdx
shrq $0x3, %rdx
cmpl %edx, %eax
jne 0x5a73
xorl %r14d, %r14d
jmp 0x5ada
movq %rdi, %rbx
movl 0x20(%rdi), %ebp
subl %esi, %ebp
addl (%rcx,%rax,8), %ebp
movl %ebp, %ecx
negl %ecx
cmovsl %ebp, %ecx
cmpl 0x10(%rdi), %ecx
jle 0x5aa3
cmpl 0x14(%rbx), %ecx
jle 0x5aaa
cmpl 0x18(%rbx), %ecx
jle 0x5ab1
cmpl 0x1c(%rbx), %ecx
jg 0x5a6e
movl $0x4, %esi
movb $0x1, %r15b
jmp 0x5ab9
movl $0x1, %esi
jmp 0x5ab6
movl $0x2, %esi
jmp 0x5ab6
movl $0x3, %esi
xorl %r15d, %r15d
incl %eax
movl %eax, 0x58(%rbx)
movq 0x60(%rbx), %rdi
callq 0x5084
movb $0x1, %r14b
testb %r15b, %r15b
jne 0x5ada
movq 0x60(%rbx), %rdi
movl %ebp, %esi
callq 0x5116
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/daklqw[P]beepmania/track.cpp
// Function: track::match(int)
int track::match(int dta) {
	if (std::abs(dta) <= perfect) return TAG_PERFECT;
	if (std::abs(dta) <= great) return TAG_GREAT;
	if (std::abs(dta) <= good) return TAG_GOOD;
	if (std::abs(dta) <= bad) return TAG_BAD;
	return TAG_MISS;
}

// Assembly:
movl %esi, %ecx
negl %ecx
cmovsl %esi, %ecx
movl $0x1, %eax
cmpl 0x10(%rdi), %ecx
jle 0x5b1a
movl $0x2, %eax
cmpl 0x14(%rdi), %ecx
jle 0x5b1a
movl $0x3, %eax
cmpl 0x18(%rdi), %ecx
jle 0x5b1a
xorl %eax, %eax
cmpl 0x1c(%rdi), %ecx
setle %al
leal (%rax,%rax,4), %eax
decl %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/daklqw[P]beepmania/track.cpp
// Function: track::checkmiss(long)
bool track::checkmiss(clock_t now) {
	if (cur == (int)notes.size()) return false;
	int res = (now - checkdelta) - notes[cur].tick;
	if (res > bad) {
		++cur;
		sb->push(TAG_BAD);
		return true;
	}
	return false;
}

// Assembly:
movslq 0x58(%rdi), %rax
movq 0x40(%rdi), %rcx
movq 0x48(%rdi), %rdx
subq %rcx, %rdx
shrq $0x3, %rdx
cmpl %edx, %eax
je 0x5b5b
movl 0x20(%rdi), %edx
addl (%rcx,%rax,8), %edx
subl %edx, %esi
cmpl %esi, 0x1c(%rdi)
jge 0x5b5b
pushq %rax
incl %eax
movl %eax, 0x58(%rdi)
movq 0x60(%rdi), %rdi
movl $0x4, %esi
callq 0x5084
movb $0x1, %al
addq $0x8, %rsp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/biotomas[P]ipasir/sat/picosat961/picosat-961/picomus.c
// Function: die
static void die (const char * fmt, ...) {
  va_list ap;
  fputs ("*** picomus: ", stdout);
  va_start (ap, fmt);
  vfprintf (stdout, fmt, ap);
  va_end (ap);
  fputc ('\n', stdout);
  fflush (stdout);
  exit (1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x27cc
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq 0x157fd(%rip), %r15     # 0x17fd0
movq (%r15), %rsi
leaq 0xf056(%rip), %rdi      # 0x11833
callq 0x10e0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movq %r14, 0x10(%rdx)
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x11b0
movq (%r15), %rsi
movl $0xa, %edi
callq 0x1110
movq (%r15), %rdi
callq 0x1160
movl $0x1, %edi
callq 0x11d0
// File: /workspace/github_cpp_makefile_star2_O3/biotomas[P]ipasir/sat/picosat961/picosat-961/picomus.c
// Function: warn
static void warn (const char * fmt, ...) {
  va_list ap;
  if (verbose < 0) return;
  fputs ("c [picomus] WARNING: ", stdout);
  va_start (ap, fmt);
  vfprintf (stdout, fmt, ap);
  va_end (ap);
  fputc ('\n', stdout);
  fflush (stdout);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x288a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl $0x0, 0x15897(%rip)     # 0x18128
js 0x28f1
movq %rdi, %rbx
movq 0x15733(%rip), %r14     # 0x17fd0
movq (%r14), %rsi
leaq 0xef9a(%rip), %rdi      # 0x11841
callq 0x10e0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x11b0
movq (%r14), %rsi
movl $0xa, %edi
callq 0x1110
movq (%r14), %rdi
callq 0x1160
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/biotomas[P]ipasir/sat/picosat961/picosat-961/picomus.c
// Function: msg
static void msg (int level, const char * fmt, ...) {
  va_list ap;
  if (verbose < level) return;
  fputs ("c [picomus] ", stdout);
  va_start (ap, fmt);
  vfprintf (stdout, fmt, ap);
  va_end (ap);
  fputc ('\n', stdout);
  fflush (stdout);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x2955
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl %edi, 0x157cd(%rip)     # 0x18128
jl 0x29bb
movq %rsi, %rbx
movq 0x15669(%rip), %r14     # 0x17fd0
movq (%r14), %rsi
leaq 0xef99(%rip), %rdi      # 0x1190a
callq 0x10e0
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x11b0
movq (%r14), %rsi
movl $0xa, %edi
callq 0x1110
movq (%r14), %rdi
callq 0x1160
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/biotomas[P]ipasir/sat/picosat961/picosat-961/picomus.c
// Function: callback
static void callback (void * dummy, const int * mus) {
  int remaining;
  const int * p;
  (void) dummy;
  if (verbose <= 0) return;
  remaining = 0;
  for (p = mus; *p; p++) remaining++;
  assert (remaining <= nclauses);
  reductions++;
  msg (1, "reduction %d to %d = %.0f%% out of %d after %.1f sec",
       reductions,
       remaining, percent (remaining, nclauses), nclauses,
       picosat_time_stamp () - start);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpl $0x0, 0x15753(%rip)     # 0x18128
jle 0x29eb
cmpl $0x0, (%rsi)
je 0x29f4
xorl %ebx, %ebx
cmpl $0x0, 0x4(%rsi,%rbx,4)
leaq 0x1(%rbx), %rbx
jne 0x29de
jmp 0x29f6
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorl %ebx, %ebx
movl 0x1575c(%rip), %ebp     # 0x18158
cmpl %ebp, %ebx
jg 0x2a70
movl 0x15781(%rip), %r14d    # 0x18188
incl %r14d
movl %r14d, 0x15777(%rip)    # 0x18188
xorpd %xmm1, %xmm1
testl %ebp, %ebp
je 0x2a30
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
cvtsi2sd %ebp, %xmm0
mulsd 0xe5dc(%rip), %xmm1     # 0x11008
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
callq 0x9d2d
movapd %xmm0, %xmm1
subsd 0x156d9(%rip), %xmm1    # 0x18120
leaq 0xef02(%rip), %rsi      # 0x11950
movl $0x1, %edi
movl %r14d, %edx
movl %ebx, %ecx
movsd 0x8(%rsp), %xmm0
movl %ebp, %r8d
movb $0x2, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x28fc
leaq 0xeea0(%rip), %rdi      # 0x11917
leaq 0xe6d1(%rip), %rsi      # 0x1114f
leaq 0xeea8(%rip), %rcx      # 0x1192d
movl $0x9d, %edx
callq 0x10d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/jaldhar[P]Lets-Build-a-Simple-Interpreter/calc3.cc
// Function: Interpreter::expression()
long Interpreter::expression() {

    // set current token to the first token taken from the input
    _current_token = get_next_token();

    long result = term();
    while (_current_token.type == TOKENTYPE::PLUS ||
    _current_token.type == TOKENTYPE::MINUS) {
        Token token = _current_token;
        if (token.type == TOKENTYPE::PLUS) {
            eat(TOKENTYPE::PLUS);
            result = result + term();
        } else if (token.type == TOKENTYPE::MINUS) {
            eat(TOKENTYPE::MINUS);
            result = result - term();
        }
    }

    return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x24d8
movq %rdx, %r14
movl %eax, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x26ee
movl 0x18(%rbx), %eax
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0x2, %ecx
jne 0x24cc
movq %rbx, %rdi
cmpl $0x2, %eax
jne 0x24bc
movl $0x2, %esi
callq 0x26ee
addq 0x20(%rbx), %r14
jmp 0x248a
movl $0x3, %esi
callq 0x26ee
subq 0x20(%rbx), %r14
jmp 0x248a
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jaldhar[P]Lets-Build-a-Simple-Interpreter/calc3.cc
// Function: Interpreter::eat(TOKENTYPE)
void Interpreter::eat(TOKENTYPE token_type) {
    if (_current_token.type == token_type) {
        _current_token = get_next_token();
    } else {
        ostringstream out;
        out << "Error parsing input. Wanted: " << token_type;
        throw(out.str().c_str());
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %esi, 0xc(%rsp)
cmpl %esi, 0x18(%rdi)
jne 0x271b
movq %rdi, %rbx
callq 0x24d8
movl %eax, 0x18(%rbx)
movq %rdx, 0x20(%rbx)
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
retq
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x2170
leaq 0x8fd(%rip), %rsi       # 0x302c
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x2160
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x234c
movl $0x8, %edi
callq 0x2090
movq %rax, %r14
leaq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x21c0
movq 0x10(%rsp), %rax
movq %rax, (%r14)
movq 0x283a(%rip), %rsi      # 0x4fb0
movq %r14, %rdi
xorl %edx, %edx
callq 0x21e0
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27b0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x27b0
movq %rax, %rbx
movq %r14, %rdi
callq 0x20e0
jmp 0x27b0
movq %rax, %rbx
movq 0x2809(%rip), %rsi      # 0x4fc0
leaq 0x30(%rsp), %rdi
callq 0x20a0
leaq 0xa0(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O3/jaldhar[P]Lets-Build-a-Simple-Interpreter/calc3.cc
// Function: Interpreter::advance()
void Interpreter::advance() {
    _pos++;
    if (_pos > _text.length() - 1) {
        _current_char = '\0';   // Indicates end of input
    } else {
        _current_char = _text[_pos];
    }
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
incq %rax
movq %rax, 0x8(%rdi)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
jbe 0x27f4
xorl %eax, %eax
jmp 0x27fa
movq (%rcx), %rcx
movb (%rcx,%rax), %al
movb %al, 0x10(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/jaldhar[P]Lets-Build-a-Simple-Interpreter/calc3.cc
// Function: Interpreter::integer()
long Interpreter::integer() {
    string result("");

    while (_current_char != '\0' && isdigit(_current_char)) {
        result += _current_char;
        advance();
    }

    return stol(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x7d8(%rip), %rdx       # 0x3049
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x2af4
movsbl 0x10(%rbx), %eax
leal -0x30(%rax), %ecx
cmpl $0x9, %ecx
ja 0x28ca
movq %rsp, %r14
movsbl %al, %esi
movq %r14, %rdi
callq 0x2100
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
incq %rax
movq %rax, 0x8(%rbx)
movq 0x8(%rcx), %rdx
decq %rdx
cmpq %rdx, %rax
ja 0x28c6
movq (%rcx), %rcx
movsbl (%rcx,%rax), %eax
movb %al, 0x10(%rbx)
movl %eax, %ecx
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x288b
jmp 0x28ca
movb $0x0, 0x10(%rbx)
movq (%rsp), %r15
callq 0x2040
movq %rax, %rbx
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x20(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x2180
cmpq %r15, (%r12)
je 0x293d
movq %rax, %r14
movl (%rbx), %eax
testl %eax, %eax
je 0x2913
cmpl $0x22, %eax
jne 0x2915
leaq 0x75e(%rip), %rdi       # 0x306c
callq 0x2190
movl %ebp, (%rbx)
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x292b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x728(%rip), %rdi       # 0x306c
callq 0x20b0
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x2958
movl %ebp, (%rbx)
jmp 0x2958
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x296e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %r14, %rdi
callq 0x21f0
// File: /workspace/github_cpp_makefile_star2_O3/jaldhar[P]Lets-Build-a-Simple-Interpreter/calc3.cc
// Function: main
int main() {
    string text;
    while(cin) {
        cout << "calc> ";
        getline(cin, text);

        try {
            Interpreter interpreter(text);
            long result = interpreter.expression();
            cout << result << endl;
        }
        catch(const char* error) {
            cerr << error << endl;
            break;
        }
    }

    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x2639(%rip), %rbx      # 0x4fd8
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0x2a69
movq 0x2610(%rip), %r14      # 0x4fc8
movq %rsp, %r12
xorl %r15d, %r15d
leaq 0x20(%rsp), %r13
movl $0x6, %edx
movq %r14, %rdi
leaq 0x693(%rip), %rsi       # 0x3065
callq 0x2160
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2210
movq %r12, 0x20(%rsp)
movq %r15, 0x28(%rsp)
movq (%rsp), %rax
movb (%rax), %al
movb %al, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movq %r15, 0x40(%rsp)
movq %r13, %rdi
callq 0x2474
movq %r14, %rdi
movq %rax, %rsi
callq 0x2120
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
je 0x29c3
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2a84
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2ab3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x21f0
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2a98
movq %rbx, %rdi
callq 0x2070
movq 0x251e(%rip), %rdi      # 0x4ff0
movq %rax, %rsi
callq 0x2140
movq %rax, %rdi
callq 0x2080
callq 0x21d0
jmp 0x2a69
movq %rax, %rbx
callq 0x21d0
jmp 0x2a98
nop