LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::run()
void run() {
            try {
                auto ptr = program.begin();
                while (ptr != program.end()) {
                    int ret = execute(ptr -> second);
                    switch (ret) {
                    case -1: return;
                    case  0: ptr++; break;
                    default: ptr = program.find(ret);
                    }
                }
            } catch(eDIVIDE_BY_ZERO) {
                std::cout << "DIVIDE BY ZERO" << std::endl;
            } catch(eINVALID_NUMBER) {
                std::cout << "INVALID NUMBER" << std::endl;
            } catch(eVARIABLE_NOT_DEFINED) {
                std::cout << "VARIABLE NOT DEFINED" << std::endl;
            } catch(eLINE_NUMBER_ERROR) {
                std::cout << "LINE NUMBER ERROR" << std::endl;
            }
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x38(%rdi), %r15
movq 0x50(%rdi), %rbp
leaq 0x40(%rdi), %r14
leaq 0x8(%rsp), %r12
cmpq %r14, %rbp
je 0x2f76
leaq 0x28(%rbp), %rsi
movq %r12, %rdi
callq 0x34cc
movq %rbx, %rdi
movq %r12, %rsi
callq 0x33b8
movl %eax, %r13d
leaq 0x10(%rsp), %rdi
callq 0x2988
movl %r13d, 0x4(%rsp)
testl %r13d, %r13d
je 0x2ea0
cmpl $-0x1, %r13d
je 0x2f76
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0x4712
jmp 0x2ea8
movq %rbp, %rdi
callq 0x2150
movq %rax, %rbp
jmp 0x2e50
jmp 0x2eaf
movq %rdx, %r15
movq %rax, %rbx
jmp 0x2ec7
movq %rdx, %r15
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2988
cmpl $0x4, %r15d
jne 0x2ef2
movq %rbx, %rdi
callq 0x20b0
movq 0x70f4(%rip), %rdi      # 0x9fd0
leaq 0x31ef(%rip), %rsi      # 0x60d2
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
jmp 0x2f71
cmpl $0x3, %r15d
jne 0x2f1d
movq %rbx, %rdi
callq 0x20b0
movq 0x70c9(%rip), %rdi      # 0x9fd0
leaq 0x31b5(%rip), %rsi      # 0x60c3
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
jmp 0x2f71
cmpl $0x2, %r15d
jne 0x2f48
movq %rbx, %rdi
callq 0x20b0
movq 0x709e(%rip), %rdi      # 0x9fd0
leaq 0x3175(%rip), %rsi      # 0x60ae
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
jmp 0x2f71
cmpl $0x1, %r15d
jne 0x2fab
movq %rbx, %rdi
callq 0x20b0
movq 0x7073(%rip), %rdi      # 0x9fd0
leaq 0x3138(%rip), %rsi      # 0x609c
callq 0x21c0
movq %rax, %rdi
callq 0x20f0
callq 0x22a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
callq 0x22a0
jmp 0x2fab
movq %rax, %rbx
callq 0x22a0
jmp 0x2fab
movq %rax, %rbx
callq 0x22a0
jmp 0x2fab
movq %rax, %rbx
callq 0x22a0
movq %rbx, %rdi
callq 0x22d0
movq %rax, %rdi
callq 0x2c7e
nop
// File: /workspace/github_cpp_makefile_star2_O2/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::insert(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&)
bool insert (const expression& expr) {
            step s;
            int id = to_int(expr[0]);

            if (expr.size() == 1) {
                if (program.count(id)) 
                    program.erase(id);
                return true;
            }
            
            s.expr = expr;
            if (!command_id.count(s.expr[1]))
                return false;
      
            s.type = command_id[s.expr[1]];
            s.expr.erase(s.expr.begin());
            s.expr.erase(s.expr.begin());

            if (!check(s)) return false;
      
            program[id] = s;
            return true;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x18(%rsp), %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
movq (%rsi), %r12
movq %r12, %rdi
callq 0x270c
movl %eax, 0xc(%rsp)
movq 0x8(%r15), %rax
subq %r12, %rax
cmpq $0x20, %rax
jne 0x3085
addq $0x38, %r14
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x34de
movb $0x1, %bpl
testq %rax, %rax
je 0x3135
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x4ae8
jmp 0x3135
movq %rbx, %rdi
movq %r15, %rsi
callq 0x47f8
movq 0x18(%rsp), %rsi
addq $0x20, %rsi
leaq 0x7138(%rip), %rdi      # 0xa1d8
callq 0x48c2
testq %rax, %rax
je 0x3133
movq 0x18(%rsp), %rsi
addq $0x20, %rsi
leaq 0x711a(%rip), %rdi      # 0xa1d8
callq 0x48dc
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x4942
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x4942
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x34cc
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x4948
movl %eax, %ebp
leaq 0x38(%rsp), %rdi
callq 0x2988
testb %bpl, %bpl
je 0x3133
addq $0x38, %r14
leaq 0xc(%rsp), %rsi
movq %r14, %rdi
callq 0x4a80
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x4ace
jmp 0x3135
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x2988
movl %ebp, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x2988
jmp 0x3162
jmp 0x315f
jmp 0x315f
movq %rax, %r14
movq %rbx, %rdi
callq 0x2988
movq %r14, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::execute(basic::basic_interpreter::step)
int execute(step s) {
            //step& s = program[line_number];

            switch (s.type) {
            case 4: return -1;
            case 5:
                ASSERT(program.count(to_int(s.expr[0])), LINE_NUMBER_ERROR);
                return to_int(s.expr[0]);
            case 1: assign(s.expr.begin(), s.expr.end()); break;
            case 6:
                if (compare(s.expr.begin(), s.expr.end() - 2))
                    return to_int(*s.expr.rbegin());
                break;
            case 2: print(eval(s.expr.begin(), s.expr.end())); break;
            case 3: input(*(s.expr.begin()));
            }

            return 0;
        }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl (%rsi), %eax
decl %eax
cmpl $0x5, %eax
ja 0x34a8
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x2c2b(%rip), %rcx      # 0x6004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rbx), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq 0x10(%rbx), %rax
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %r14, %rdi
callq 0x34f8
jmp 0x34a8
addq $0x38, %r14
movq 0x8(%rbx), %rdi
callq 0x270c
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
movq %r14, %rdi
callq 0x34de
testq %rax, %rax
je 0x34b2
movq 0x8(%rbx), %rdi
jmp 0x34a1
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x37c0
jmp 0x34a8
pushq $-0x1
popq %rax
jmp 0x34aa
movq 0x8(%rbx), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq 0x10(%rbx), %rax
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %r14, %rdi
callq 0x36aa
movq %r14, %rdi
movl %eax, %esi
callq 0x3694
jmp 0x34a8
movq 0x8(%rbx), %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq 0x10(%rbx), %rax
addq $-0x40, %rax
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq %r14, %rdi
callq 0x3532
testb %al, %al
je 0x34a8
movq 0x10(%rbx), %rdi
addq $-0x20, %rdi
callq 0x270c
jmp 0x34aa
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
pushq $0x1
popq %rdi
callq 0x2100
leaq 0x68df(%rip), %rsi      # 0x9da0
movq %rax, %rdi
xorl %edx, %edx
callq 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::compare(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
bool compare(const expr_iter& begin,
                     const expr_iter& end) {
            for (expr_iter ptr = begin + 1; ptr != end; ++ptr) {
                if (*ptr == ">") return eval(begin, ptr) >  eval(ptr + 1, end);
                if (*ptr == "<") return eval(begin, ptr) <  eval(ptr + 1, end);
                if (*ptr == "=") return eval(begin, ptr) == eval(ptr + 1, end);
            }
            return 0;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq (%rsi), %rbx
leaq 0x2bb4(%rip), %r13      # 0x610b
leaq 0x2baf(%rip), %rbp      # 0x610d
leaq 0x20(%rbx), %r15
movq (%r14), %r12
cmpq %r12, %r15
je 0x35e5
movq %r15, %rdi
movq %r13, %rsi
callq 0x294e
testb %al, %al
jne 0x35f3
movq %r15, %rdi
movq %rbp, %rsi
callq 0x294e
testb %al, %al
jne 0x3639
movq %r15, %rdi
leaq 0x2b79(%rip), %rsi      # 0x610f
callq 0x294e
movq %r15, %rbx
testb %al, %al
je 0x355e
leaq 0x18(%rsp), %rbx
movq %r15, (%rbx)
movq 0x10(%rsp), %r13
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
callq 0x36aa
movl %eax, %ebp
movq (%rbx), %rax
addq $0x20, %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
movq %r13, %rdi
movq %r14, %rdx
callq 0x36aa
cmpl %eax, %ebp
sete %cl
jmp 0x367d
addq $0x20, %rbx
movq %rbx, 0x18(%rsp)
jmp 0x367d
addq $0x20, %rbx
leaq 0x18(%rsp), %r13
movq %rbx, (%r13)
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq 0x36aa
movl %eax, %ebp
movq (%r13), %rax
addq $0x20, %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x36aa
cmpl %eax, %ebp
setg %cl
jmp 0x367d
addq $0x20, %rbx
leaq 0x18(%rsp), %r13
movq %rbx, (%r13)
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq 0x36aa
movl %eax, %ebp
movq (%r13), %rax
addq $0x20, %rax
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x36aa
cmpl %eax, %ebp
setl %cl
cmpq %r12, %r15
setne %al
andb %cl, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::eval(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
int eval(const expr_iter& begin,
                 const expr_iter& end) {
            std::vector<expr_iter> match(end - begin), stack;
            for (expr_iter ptr = begin; ptr != end; ptr++) {
                if (*ptr == "(") stack.emplace_back(ptr);
                else if (*ptr == ")") {
                    match[stack.back() - begin] = ptr;
                    stack.pop_back();
                }
            }
            return eval(begin, end, begin, match);
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, 0x8(%rsp)
movq (%rdx), %rsi
subq (%rbx), %rsi
sarq $0x5, %rsi
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %r12
movq %r12, %rdx
callq 0x3d54
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
andq $0x0, 0x10(%r12)
movq (%rbx), %rdi
leaq 0x2a1a(%rip), %r13      # 0x6111
movq %rsp, %rbp
leaq 0x2a41(%rip), %r15      # 0x6142
movq %rdi, (%rsp)
cmpq %rdi, (%r14)
je 0x3760
movq %r13, %rsi
callq 0x294e
testb %al, %al
je 0x3723
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3da6
jmp 0x3756
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x294e
testb %al, %al
je 0x3756
movq 0x18(%rsp), %rax
movq -0x8(%rax), %rax
subq (%rbx), %rax
movq 0x30(%rsp), %rcx
sarq $0x2, %rax
movq (%rsp), %rdx
movq %rdx, (%rcx,%rax)
addq $-0x8, 0x18(%rsp)
movq (%rsp), %rdi
addq $0x20, %rdi
jmp 0x3701
leaq 0x30(%rsp), %r8
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x3dde
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x400a
leaq 0x30(%rsp), %rdi
callq 0x400a
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x37a1
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x400a
leaq 0x30(%rsp), %rdi
callq 0x400a
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::eval(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int eval(const string& str) {
            if (is_digit(str))
                return to_int(str); 
            ASSERT(map.count(str), VARIABLE_NOT_DEFINED);
            return map[str];
        }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2743
testb %al, %al
je 0x424b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x270c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4516
testq %rax, %rax
je 0x4270
movq %r14, %rdi
movq %rbx, %rsi
callq 0x38d2
movl (%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x1
popq %rdi
callq 0x2100
leaq 0x5b11(%rip), %rsi      # 0x9d90
movq %rax, %rdi
xorl %edx, %edx
callq 0x22b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::operator<<(std::ostream&, basic::basic_interpreter::step const&)
std::ostream& operator<< (std::ostream &sout, const step& s) {
                sout << command[s.type];
                for (auto str : s.expr)
                    sout << ' ' << str;
                sout << std::endl;
                return sout;
            }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movslq (%rsi), %rax
shlq $0x5, %rax
leaq 0x5a8c(%rip), %rsi      # 0xa210
addq %rax, %rsi
callq 0x21b0
movq 0x8(%r15), %r14
movq 0x10(%r15), %r12
movq %rsp, %r15
pushq $0x20
popq %rbp
cmpq %r12, %r14
je 0x47cd
movq %r15, %rdi
movq %r14, %rsi
callq 0x2250
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2210
movq %rax, %rdi
movq %r15, %rsi
callq 0x21b0
movq %r15, %rdi
callq 0x20e0
addq $0x20, %r14
jmp 0x479a
movq %rbx, %rdi
callq 0x20f0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::check(basic::basic_interpreter::step)
bool check(step s) {
            switch (s.type) {
            case 1:
                REPORT(s.expr.size() < 3);
                REPORT(!is_var(s.expr[0]));
                REPORT(s.expr[1] != "=");
                REPORT(!check_expr(s.expr.begin() + 2, s.expr.end()));
                break;
            case 2:
                //REPORT(s.expr.size() < 1);
                REPORT(!check_expr(s.expr.begin(), s.expr.end()));
                break;
            case 3:
                REPORT(s.expr.size() != 1);
                REPORT(!check_expr(s.expr.begin(), s.expr.end()));
                break;
            case 4:
                REPORT(s.expr.size() != 0);
                break;
            case 5:
                REPORT(s.expr.size() != 1);
                REPORT(!is_digit(s.expr[0]));
                break;
            case 6:
                REPORT(s.expr.size() < 5);
                REPORT(!is_digit(*(s.expr.end() - 1)));
                REPORT(*(s.expr.end() - 2) != "THEN");
                REPORT(!check_expr(s.expr.begin(), s.expr.end() - 2));
            }

            return true;
        }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl (%rsi), %eax
decl %eax
cmpl $0x5, %eax
ja 0x4a24
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x16b3(%rip), %rcx      # 0x601c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rax
subq %rdi, %rax
cmpq $0x41, %rax
jb 0x4a60
callq 0x2784
testb %al, %al
je 0x4a60
movq 0x8(%r14), %rdi
addq $0x20, %rdi
leaq 0x176c(%rip), %rsi      # 0x610f
callq 0x524d
testb %al, %al
jne 0x4a60
movq 0x8(%r14), %rax
addq $0x40, %rax
jmp 0x4a04
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rax
subq %rdi, %rax
cmpq $0x20, %rax
jne 0x4a60
callq 0x2743
jmp 0x4a20
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rax
movq %rax, %rdx
subq %rcx, %rdx
cmpq $0x20, %rdx
jne 0x4a60
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
jmp 0x4a10
movq 0x10(%r14), %rax
cmpq 0x8(%r14), %rax
jne 0x4a60
jmp 0x4a24
movq 0x8(%r14), %rax
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq 0x10(%r14), %rax
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x5258
testb %al, %al
je 0x4a60
movb $0x1, %al
jmp 0x4a62
movq 0x10(%r14), %rdi
movq %rdi, %rax
subq 0x8(%r14), %rax
cmpq $0x81, %rax
jb 0x4a60
addq $-0x20, %rdi
callq 0x2743
testb %al, %al
je 0x4a60
movq 0x10(%r14), %rdi
addq $-0x40, %rdi
leaq 0x171b(%rip), %rsi      # 0x6172
callq 0x524d
testb %al, %al
je 0x4a6a
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%r14), %rax
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq 0x10(%r14), %rax
addq $-0x40, %rax
jmp 0x4a10
// File: /workspace/github_cpp_makefile_star2_O2/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::check_expr(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
bool check_expr(const expr_iter& begin,
                        const expr_iter& end) {
            int cnt = 0;
            for (auto ptr = begin; ptr != end; ptr++) {
                if (*ptr == "(") {
                    ++cnt;
                    if (ptr + 1 == end) return false;
                    if (*(ptr + 1) == ")") return false;
                }
                if (*ptr == ")") if (--cnt < 0) return false;
                if (is_element(*ptr) && ptr + 1 != end && *(ptr + 1) != ")") {
                    if (ptr + 2 == end || (!is_element(*(ptr + 2)) && *(ptr + 2) != "("))
                        return false;
                }
            }
      
            return cnt == 0;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq (%rsi), %rbx
xorl %ebp, %ebp
leaq 0xed0(%rip), %r12       # 0x6142
movq (%r14), %r15
cmpq %r15, %rbx
je 0x5312
movq %rbx, %rdi
leaq 0xe89(%rip), %rsi       # 0x6111
callq 0x294e
testb %al, %al
je 0x52a8
incl %ebp
leaq 0x20(%rbx), %rdi
cmpq (%r14), %rdi
je 0x5312
movq %r12, %rsi
callq 0x294e
testb %al, %al
jne 0x5312
movq %rbx, %rdi
movq %r12, %rsi
callq 0x294e
testb %al, %al
je 0x52c0
leal -0x1(%rbp), %eax
testl %ebp, %ebp
movl %eax, %ebp
jle 0x5312
movq %rbx, %rdi
callq 0x27ae
testb %al, %al
je 0x5309
leaq 0x20(%rbx), %rdi
cmpq (%r14), %rdi
je 0x5309
movq %r12, %rsi
callq 0x524d
testb %al, %al
je 0x5309
leaq 0x40(%rbx), %r13
cmpq (%r14), %r13
je 0x5312
movq %r13, %rdi
callq 0x27ae
testb %al, %al
jne 0x5309
movq %r13, %rdi
leaq 0xe11(%rip), %rsi       # 0x6111
callq 0x524d
testb %al, %al
jne 0x5312
addq $0x20, %rbx
jmp 0x5272
cmpq %r15, %rbx
sete %cl
testl %ebp, %ebp
sete %al
andb %cl, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/pacman.cpp
// Function: Pacman::Pacman()
Pacman::Pacman()
{
        center();
        alive = true;
        head = UP;
        num_moves = 0;
        score = 0;
        dots_eaten = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movabsq $0x1e0000000a, %rax     # imm = 0x1E0000000A
movq %rax, 0x4(%rdi)
movw $0x7601, (%rdi)         # imm = 0x7601
andq $0x0, 0xc(%rdi)
andl $0x0, 0x14(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/pacman.cpp
// Function: Pacman::move(char (*) [61], char)
bool Pacman::move(char board[ROWS][COLS], char command)
{
        bool ate_dot = false;
        rotate_head(command);
        num_moves++;
        if (!boulder_ahead(board, command)){
                board[row][col] = SPACE;
                if (command == CMD_UP){         // move, wrap if needed
                        if (row == 0) {row = ROWS-1;} else {row--;}
                } else if (command == CMD_DWN){
                        if (row == ROWS-1) {row = 0;} else {row++;}
                } else if (command == CMD_RGT){
                        if (col == COLS-1) {col = 0;} else {col++;}
                } else if (command == CMD_LFT){
                        if (col == 0) {col = COLS-1;} else {col--;}
                }
        }
        if (board[row][col] == GHOST)
                die();
        if (board[row][col] == DOT){
                ate_dot = true;
                dots_eaten++;
        }
        return ate_dot;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %esi
callq 0x25a8
incl 0xc(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x25d4
testb %al, %al
je 0x251c
movslq 0x4(%rbx), %rax
movslq 0x8(%rbx), %rcx
imulq $0x3d, %rax, %rax
addq %rax, %r14
movb (%rcx,%r14), %al
cmpb $0x6d, %al
jne 0x2505
addq %rcx, %r14
movb $0x0, (%rbx)
movb (%r14), %al
cmpb $0x6f, %al
jne 0x250c
incl 0x14(%rbx)
cmpb $0x6f, %al
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movslq 0x4(%rbx), %rax
movslq 0x8(%rbx), %rcx
imulq $0x3d, %rax, %rax
addq %r14, %rax
movb $0x20, (%rcx,%rax)
movsbl %r15b, %eax
cmpl $0x61, %eax
je 0x2571
cmpl $0x64, %eax
je 0x2552
cmpl $0x73, %eax
je 0x2560
cmpl $0x77, %eax
jne 0x24e5
movl 0x4(%rbx), %eax
testl %eax, %eax
je 0x2590
decl %eax
jmp 0x2588
movl 0x8(%rbx), %eax
cmpl $0x3c, %eax
jne 0x257c
andl $0x0, 0x8(%rbx)
jmp 0x24e5
movl 0x4(%rbx), %eax
cmpl $0x14, %eax
jne 0x2586
andl $0x0, 0x4(%rbx)
jmp 0x24e5
movl 0x8(%rbx), %eax
testl %eax, %eax
je 0x259c
decl %eax
jmp 0x257e
incl %eax
movl %eax, 0x8(%rbx)
jmp 0x24e5
incl %eax
movl %eax, 0x4(%rbx)
jmp 0x24e5
movl $0x14, 0x4(%rbx)
jmp 0x24e5
movl $0x3c, 0x8(%rbx)
jmp 0x24e5
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/pacman.cpp
// Function: Pacman::boulder_ahead(char (*) [61], char)
bool Pacman::boulder_ahead(char board[ROWS][COLS], char command)
{
        if (command == CMD_UP){
                if (row == 0){
                        return (board[ROWS-1][col] == BOULDER);
                } else {
                        return (board[row-1][col] == BOULDER);
                }
        } else if (command == CMD_DWN){
                if (row == ROWS-1){
                        return (board[0][col] == BOULDER);
                } else {
                        return (board[row+1][col] == BOULDER);
                }
        } else if (command == CMD_RGT){
                if (col == COLS-1){
                        return (board[row][0] == BOULDER);
                } else {
                        return (board[row][col+1] == BOULDER);
                }
        } else if (command == CMD_LFT){
                if (col == 0){
                        return (board[row][COLS-1] == BOULDER);
                } else {
                        return (board[row][col-1] == BOULDER);
                }
        }
        return true;  // error case locks Pacman in place
}

// Assembly:
cmpl $0x61, %edx
je 0x2635
cmpl $0x64, %edx
je 0x260e
cmpl $0x73, %edx
je 0x2622
movb $0x1, %al
cmpl $0x77, %edx
jne 0x269a
movslq 0x4(%rdi), %rax
testq %rax, %rax
je 0x2674
imulq $0x3d, %rax, %rax
addq %rax, %rsi
movslq 0x8(%rdi), %rax
addq %rax, %rsi
addq $-0x3d, %rsi
jmp 0x268f
movslq 0x8(%rdi), %rax
movslq 0x4(%rdi), %rcx
cmpq $0x3c, %rax
jne 0x2651
imulq $0x3d, %rcx, %rax
jmp 0x2630
movslq 0x4(%rdi), %rax
cmpq $0x14, %rax
jne 0x2660
movslq 0x8(%rdi), %rax
addq %rax, %rsi
jmp 0x268f
movslq 0x8(%rdi), %rax
movslq 0x4(%rdi), %rcx
testq %rax, %rax
je 0x2684
imulq $0x3d, %rcx, %rcx
addq %rcx, %rsi
addq %rax, %rsi
decq %rsi
jmp 0x268f
imulq $0x3d, %rcx, %rcx
addq %rcx, %rsi
addq %rax, %rsi
incq %rsi
jmp 0x268f
imulq $0x3d, %rax, %rax
addq %rax, %rsi
movslq 0x8(%rdi), %rax
addq %rax, %rsi
addq $0x3d, %rsi
jmp 0x268f
movslq 0x8(%rdi), %rax
addq %rax, %rsi
addq $0x4c4, %rsi            # imm = 0x4C4
jmp 0x268f
imulq $0x3d, %rcx, %rax
addq %rax, %rsi
addq $0x3c, %rsi
pushq %rbp
movq %rsp, %rbp
cmpb $0x58, (%rsi)
sete %al
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/ghost.cpp
// Function: Ghost::move(char (*) [61], int, int)
bool Ghost::move(char board[ROWS][COLS], int target_r, int target_c)
{
        int new_row = row;
        int new_col = col; 
        board[row][col] = board_char;   // replace element of board
        if (abs(row-target_r) > abs(col-target_c)){     // never wraps
                if (row > target_r){
                        new_row--;
                } else if (row < target_r){
                        new_row++;
                }
                if (board[new_row][new_col] != GHOST)
                        row = new_row;
        } else {
                if (col > target_c){
                        new_col--;
                } else if (col < target_c){
                        new_col++;
                }
                if (board[new_row][new_col] != GHOST)
                        col = new_col;
        }
        place_on_board(board);
        return (target_r == row && target_c == col);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
movslq (%rdi), %r10
movslq 0x4(%rdi), %r9
movb 0x8(%rdi), %al
imulq $0x3d, %r10, %r11
addq %rsi, %r11
movb %al, (%r9,%r11)
movl (%rdi), %r8d
movl %r8d, %eax
subl %edx, %eax
movl %eax, %ebx
negl %ebx
cmovsl %eax, %ebx
movl 0x4(%rdi), %eax
movl %eax, %r14d
subl %ecx, %r14d
movl %r14d, %r15d
negl %r15d
cmovsl %r14d, %r15d
cmpl %r15d, %ebx
jbe 0x2806
xorl %ebx, %ebx
cmpl %edx, %r8d
setl %bl
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
cmovlel %ebx, %r11d
addl %r10d, %r11d
movslq %r11d, %r10
imulq $0x3d, %r10, %r10
addq %rsi, %r10
cmpb $0x6d, (%r9,%r10)
je 0x282b
movl %r11d, (%rdi)
jmp 0x282e
xorl %ebx, %ebx
cmpl %ecx, %eax
setl %bl
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
cmovlel %ebx, %r10d
addl %r9d, %r10d
movslq %r10d, %r9
cmpb $0x6d, (%r9,%r11)
je 0x282b
movl %r10d, 0x4(%rdi)
movl %r10d, %eax
movl %r8d, %r11d
movslq %r11d, %r8
movslq %eax, %r9
imulq $0x3d, %r8, %rax
addq %rax, %rsi
leaq (%rsi,%r9), %rax
movb (%r9,%rsi), %sil
cmpb $0x6d, %sil
je 0x284d
movb %sil, 0x8(%rdi)
movb $0x6d, (%rax)
xorl (%rdi), %edx
xorl 0x4(%rdi), %ecx
orl %edx, %ecx
sete %al
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/game.cpp
// Function: Game::print_manual()
void Game::print_manual()
{
        screen_clear();
        cout << "PACMAN GAME\n"
                "            \n"
                " Move left:    " << CMD_LFT << "\n"
                " Move right:   " << CMD_RGT << "\n"
                " Move up:      " << CMD_UP  << "\n"
                " Move down:    " << CMD_DWN << "\n"
                "\n"
                " Collect all the dots. They look like: " << DOT << "\n"
                " Avoid the ghosts.     They look like: " << GHOST << "\n"
                "\n"
                " Good luck!\n"
                "\n"
                " Press any key to continue...\n";

        getachar();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x3399
movq 0x4694(%rip), %rdi      # 0x6fd0
leaq 0x16d1(%rip), %rsi      # 0x4014
callq 0x20d0
pushq $0x61
popq %rsi
movq %rax, %rdi
callq 0x20f0
leaq 0x16e3(%rip), %rsi      # 0x403d
movq %rax, %rdi
callq 0x20d0
pushq $0x64
popq %rsi
movq %rax, %rdi
callq 0x20f0
leaq 0x16da(%rip), %rsi      # 0x404e
movq %rax, %rdi
callq 0x20d0
pushq $0x77
popq %rsi
movq %rax, %rdi
callq 0x20f0
leaq 0x16d1(%rip), %rsi      # 0x405f
movq %rax, %rdi
callq 0x20d0
pushq $0x73
popq %rsi
movq %rax, %rdi
callq 0x20f0
leaq 0x16c8(%rip), %rsi      # 0x4070
movq %rax, %rdi
callq 0x20d0
pushq $0x6f
popq %rsi
movq %rax, %rdi
callq 0x20f0
leaq 0x16d8(%rip), %rsi      # 0x409a
movq %rax, %rdi
callq 0x20d0
pushq $0x6d
popq %rsi
movq %rax, %rdi
callq 0x20f0
leaq 0x16e7(%rip), %rsi      # 0x40c3
movq %rax, %rdi
callq 0x20d0
popq %rbp
jmp 0x3054
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/game.cpp
// Function: Game::run()
void Game::run()
{
        while (!game_won && p.is_alive()){
                reset_level();
                start_level();
                play_level();
                if (p.is_alive())
                        complete_level();
        }
        if (game_won){
                cout << "You win!\n";
        } else {
                cout << "You lost :(\n";
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x50c(%rdi), %r14
movb 0x509(%rbx), %al
testb %al, %al
jne 0x2a45
movq %r14, %rdi
callq 0x271a
testb %al, %al
je 0x2a3f
movq %rbx, %rdi
callq 0x2a6a
movq %rbx, %rdi
callq 0x2aca
movq %rbx, %rdi
callq 0x2b28
movq %r14, %rdi
callq 0x271a
testb %al, %al
je 0x29fb
movq %rbx, %rdi
callq 0x2c98
jmp 0x29fb
movb 0x509(%rbx), %al
leaq 0x16a5(%rip), %rcx      # 0x40f1
leaq 0x16a8(%rip), %rsi      # 0x40fb
testb $0x1, %al
cmovneq %rcx, %rsi
movq 0x4570(%rip), %rdi      # 0x6fd0
popq %rbx
popq %r14
popq %rbp
jmp 0x20d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/game.cpp
// Function: Game::reset_level()
void Game::reset_level()
{
        clear_board();
        init_dots();    // prepare dots, boulders, and ghosts
        set_dots();
        set_boulders();
        set_ghosts();
        p.center();     // prepare pacman
        p.place_on_board(board);
        p.set_dots(0);
        level_over = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x2cd0
movq %rbx, %rdi
callq 0x2e5c
movq %rbx, %rdi
callq 0x2eba
movq %rbx, %rdi
callq 0x2e1a
movq %rbx, %rdi
callq 0x2f74
leaq 0x50c(%rbx), %r14
movq %r14, %rdi
callq 0x249e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x26a6
movq %r14, %rdi
xorl %esi, %esi
callq 0x2722
movb $0x0, 0x508(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/game.cpp
// Function: Game::start_level()
void Game::start_level()
{
        screen_clear();
        print_board();
        cout << "Level " << level << ": Press any key to start\n";
        getachar();
        screen_clear(); // print initial state of boar
        print_board(); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3399
movq %rbx, %rdi
callq 0x2cf8
movq 0x44e9(%rip), %rdi      # 0x6fd0
leaq 0x1622(%rip), %rsi      # 0x4110
callq 0x20d0
movl 0x504(%rbx), %esi
movq %rax, %rdi
callq 0x21a0
leaq 0x160f(%rip), %rsi      # 0x4117
movq %rax, %rdi
callq 0x20d0
callq 0x3054
callq 0x3399
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2cf8
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/game.cpp
// Function: Game::play_level()
void Game::play_level()
{
        char move;
        while (p.is_alive() && !level_over){
                // Pacman moves
                move = getacharnow(2);
                if (move == CMD_QUIT){
                        level_over = true;
                        p.die();
                        return;
                } else if (move == CHEAT){
                        level_over = true;
                }
                if (p.move(board, move)){
                        eat_dot(p.get_row(), p.get_col());
                        level_over = !(p.get_dots() < level*DOTS_PER_LEVEL);
                }
                if (p.is_alive())   // Show Ghost if Pacman is eaten
                        p.place_on_board(board);
                screen_home();
                print_board();
                
                // Ghosts move
                if (p.get_num_moves()%GHOST_FREQ==0 && !level_over){
                        for (int i=0; i<NUM_GHOSTS; i++){
                                if (ghosts[i].move(board, p.get_row(),
                                                          p.get_col()))
                                        p.die();        // Pacman eaten
                                ghosts[i].place_on_board(board);
                        }
                }
                screen_home();
                print_board();
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x50c(%rdi), %rbx
movq %rbx, %rdi
callq 0x271a
testb %al, %al
je 0x2c6a
cmpb $0x0, 0x508(%r14)
jne 0x2c6a
pushq $0x2
popq %rdi
callq 0x32ba
cmpb $0x47, %al
je 0x2b77
movzbl %al, %ecx
cmpl $0x71, %ecx
jne 0x2b7f
jmp 0x2c79
movb $0x1, 0x508(%r14)
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x24b6
testb %al, %al
je 0x2bcb
movq %rbx, %rdi
callq 0x26ea
movl %eax, %r12d
movq %rbx, %rdi
callq 0x26e0
movq %r14, %rdi
movl %r12d, %esi
movl %eax, %edx
callq 0x2f00
movq %rbx, %rdi
callq 0x272c
imull $0x5, 0x504(%r14), %ecx
cmpl %ecx, %eax
setge 0x508(%r14)
movq %rbx, %rdi
callq 0x271a
testb %al, %al
je 0x2be2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x26a6
callq 0x341f
movq %r14, %rdi
callq 0x2cf8
movq %rbx, %rdi
callq 0x26c2
testb $0x1, %al
jne 0x2c05
cmpb $0x0, 0x508(%r14)
je 0x2c17
callq 0x341f
movq %r14, %rdi
callq 0x2cf8
jmp 0x2b40
movl $0x524, %r15d           # imm = 0x524
cmpq $0x554, %r15            # imm = 0x554
je 0x2c05
leaq (%r14,%r15), %r12
movq %rbx, %rdi
callq 0x26ea
movl %eax, %r13d
movq %rbx, %rdi
callq 0x26e0
movq %r12, %rdi
movq %r14, %rsi
movl %r13d, %edx
movl %eax, %ecx
callq 0x2796
testb %al, %al
je 0x2c59
movq %rbx, %rdi
callq 0x269c
movq %r12, %rdi
movq %r14, %rsi
callq 0x2862
addq $0xc, %r15
jmp 0x2c1d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, 0x508(%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x269c
nop
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/game.cpp
// Function: Game::print_board()
void Game::print_board()
{
        for (int r=-1; r<=ROWS; r++){
                for (int c=-1; c<=COLS; c++){
                        if ((r==-1||r==ROWS)||(c==-1||c==COLS)){
                                cout << border(r,c);
                        } else {
                                cout << board[r][c];
                        }
                }
                cout << endl;
        }
        cout << "Score: " << p.get_score() << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
pushq $-0x1
popq %rbx
movq 0x42bd(%rip), %r14      # 0x6fd0
movq %rdi, -0x30(%rbp)
movq %rdi, %r13
cmpq $0x16, %rbx
je 0x2da9
movq %rbx, %rax
incq %rax
movq %rax, -0x38(%rbp)
sete %al
cmpq $0x15, %rbx
sete %r15b
orb %al, %r15b
pushq $-0x3f
popq %rax
testq %rax, %rax
je 0x2d94
cmpq $-0x3f, %rax
sete %cl
movq %rax, %r12
incq %r12
je 0x2d5f
orb %r15b, %cl
jne 0x2d5f
movb 0x1(%r13,%rax), %cl
jmp 0x2d84
cmpl $0x15, %ebx
je 0x2d6b
movb $0x7c, %cl
cmpl $-0x1, %ebx
jne 0x2d84
cmpq $-0x1, %rax
setne %cl
addb %cl, %cl
addb $0x2b, %cl
cmpq $-0x3f, %rax
movzbl %cl, %ecx
pushq $0x2b
popq %rax
cmovel %eax, %ecx
movsbl %cl, %esi
movq %r14, %rdi
callq 0x20f0
movq %r12, %rax
jmp 0x2d3f
movq %r14, %rdi
callq 0x2050
addq $0x3d, %r13
movq -0x38(%rbp), %rbx
jmp 0x2d1a
movq 0x4220(%rip), %rdi      # 0x6fd0
leaq 0x1351(%rip), %rsi      # 0x4108
callq 0x20d0
movq %rax, %r14
movq -0x30(%rbp), %rdi
addq $0x50c, %rdi            # imm = 0x50C
callq 0x2710
movq %r14, %rdi
movl %eax, %esi
callq 0x21a0
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
nop
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/game.cpp
// Function: Game::init_dots()
void Game::init_dots()
{
        set_boulders(); // to avoid boulders in each level
        for (int i=0; i<NUM_DOTS; i++){
                dots[i].set_random_location(board);
                dots[i].set_eaten(false);
                dots[i].place_on_board(board); // to ensure no dots overlap
        }
        clear_board();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2e1a
movl $0x554, %r15d           # imm = 0x554
cmpq $0x7ac, %r15            # imm = 0x7AC
je 0x2ea7
leaq (%rbx,%r15), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3616
movq %r14, %rdi
xorl %esi, %esi
callq 0x3698
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3670
addq $0xc, %r15
jmp 0x2e74
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2cd0
nop
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/game.cpp
// Function: Game::eat_dot(int, int)
void Game::eat_dot(int r, int c)
{
        for (int i=0; i<DOTS_PER_LEVEL*level; i++)
                if (dots[i].is_at(r,c))
                        dots[i].was_eaten();
        p.add_to_score(DOT_REWARD);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x554(%rdi), %r12
xorl %r13d, %r13d
movslq 0x504(%rbx), %rax
leaq (%rax,%rax,4), %rax
cmpq %rax, %r13
jge 0x2f54
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x3688
testb %al, %al
je 0x2f4b
movq %r12, %rdi
callq 0x36a2
incq %r13
addq $0xc, %r12
jmp 0x2f21
addq $0x50c, %rbx            # imm = 0x50C
pushq $0x1
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2706
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/game.cpp
// Function: Game::set_ghosts()
void Game::set_ghosts()
{
        for (int i=0; i<NUM_GHOSTS; i++){
                if (i==0){
                        ghosts[i].set_location(0,0);
                } else if (i==1){
                        ghosts[i].set_location(0,COLS-1);
                } else if (i==2){
                        ghosts[i].set_location(ROWS-1,0);
                } else if (i==3){
                        ghosts[i].set_location(ROWS-1,COLS-1);
                } else {
                        ghosts[i].set_random_location();
                }
                ghosts[i].place_on_board(board);
        }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x548(%rdi), %rax
movq %rax, -0x40(%rbp)
leaq 0x53c(%rdi), %rax
movq %rax, -0x38(%rbp)
leaq 0x530(%rdi), %rax
movq %rax, -0x30(%rbp)
leaq 0x524(%rdi), %r14
xorl %r12d, %r12d
leaq 0x104a(%rip), %r15      # 0x4004
movq %r14, %r13
cmpq $0x4, %r12
je 0x300c
movl %r12d, %eax
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq %r14, %rdi
xorl %esi, %esi
jmp 0x2fdd
movq -0x38(%rbp), %rdi
pushq $0x14
popq %rsi
xorl %edx, %edx
jmp 0x2ff3
movq -0x40(%rbp), %rdi
pushq $0x14
popq %rsi
jmp 0x2ff0
movq -0x30(%rbp), %rdi
xorl %esi, %esi
pushq $0x3c
popq %rdx
callq 0x2746
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2862
incq %r12
addq $0xc, %r13
jmp 0x2fbd
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/termfuncs.cpp
// Function: getachar()
char getachar()
{
	char q_key = 0;
	char *qk = NULL;
	char c;
	int  nread;

	if ( ( qk = getenv("TF_QUIT") ) != NULL ){
		q_key = qk[0];
	}
	cout << std::flush;
	if ( isatty(0) ){
		struct termios	info, orig;
		// system("stty -echo -icanon");
		tcgetattr(0, &info);
		orig = info;
		prev_tty_state = orig;
		prev_state_stored = 1;

		info.c_lflag &= ~ECHO;
		info.c_lflag &= ~ICANON;
		tcsetattr(0, TCSANOW, &info);

		nread = read(0, &c, 1);
		if ( nread == 1 && c == ESCAPE )
			c = handle_escape_seq();

		// system("stty echo icanon");
		tcsetattr(0, TCSANOW, &orig);
	}
	else {
		if ( cin.get(c) )
			nread = 1;
		else
			nread = 0;
		// cout << "got " << nread << " chars [" << c << "]\n";
		if ( nread == 0 && qk != NULL )
			exit(0);
	}

	if ( nread == 1 && qk != NULL && c == q_key ){
		exit(0);
	}

	return ( nread > 0 ? c : 0 );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
leaq 0x10c7(%rip), %rdi      # 0x4134
callq 0x2120
movq %rax, %rbx
testq %rax, %rax
je 0x3080
movsbl (%rbx), %r12d
jmp 0x3083
xorl %r12d, %r12d
movq 0x3f46(%rip), %rdi      # 0x6fd0
callq 0x2060
xorl %edi, %edi
callq 0x21b0
testl %eax, %eax
je 0x3129
leaq -0x9c(%rbp), %r14
xorl %edi, %edi
movq %r14, %rsi
callq 0x20e0
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups 0x2c(%r14), %xmm3
movaps %xmm0, -0x60(%rbp)
movaps %xmm1, -0x50(%rbp)
movaps %xmm2, -0x40(%rbp)
movups %xmm3, -0x34(%rbp)
andb $-0xb, 0xc(%r14)
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2130
leaq -0x21(%rbp), %r15
pushq $0x1
popq %rdx
xorl %edi, %edi
movq %r15, %rsi
callq 0x2160
movq %rax, %r14
cmpl $0x1, %r14d
sete %al
movb (%r15), %r15b
cmpb $0x1b, %r15b
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x311a
callq 0x3194
movl %eax, %r15d
movb %al, -0x21(%rbp)
leaq -0x60(%rbp), %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x2130
jmp 0x315d
movq 0x3eb0(%rip), %rdi      # 0x6fe0
leaq -0x21(%rbp), %rsi
callq 0x2150
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %eax
testq %rbx, %rbx
je 0x3150
movl %eax, %ecx
andl $0x5, %ecx
jne 0x318d
xorl %r14d, %r14d
testb $0x5, %al
sete %r14b
movb -0x21(%rbp), %r15b
testq %rbx, %rbx
je 0x3171
cmpl $0x1, %r14d
jne 0x3171
movsbl %r15b, %eax
cmpl %eax, %r12d
je 0x318d
xorl %ecx, %ecx
testl %r14d, %r14d
movzbl %r15b, %eax
cmovlel %ecx, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/termfuncs.cpp
// Function: handle_escape_seq()
char handle_escape_seq()
{
	struct termios	info, orig;
	char		buf[100];
	int		pos = 0;
	char		c;
	void		(*oldhand)(int);

	if ( !isatty(0) ) 
		return ESCAPE;

	oldhand = signal(SIGINT, SIG_IGN);

	// system("stty -echo -icanon");
	tcgetattr(0, &info);
	orig = info;

	info.c_lflag &= ~ECHO;
	info.c_lflag &= ~ICANON;
	info.c_cc[VMIN] = 0;
	info.c_cc[VTIME] = 1;			// 1/10 second
	tcsetattr(0, TCSANOW, &info);

	do
	{
		if ( read(0, &c, 1) == 1 )	// if got one
			buf[pos++] = c;		// store it
		else
			break;			// else timeout
	}
	while( !isalpha((int)c) && pos < 99 );	// until alpha or full

	if ( pos == 0 || (buf[0] != '[' && buf[0] != 'O' ) )
		c = ESCAPE;
	else 
		switch(buf[1]){
			case 'A':		c = KEY_UP;	break;
			case 'B':		c = KEY_DOWN;	break;
			case 'C':		c = KEY_RIGHT;	break;
			case 'D':		c = KEY_LEFT;	break;
			default :
						c = ESCAPE;
		}

	tcsetattr(0, TCSANOW, &orig);
	signal(SIGINT, oldhand);
	// system("stty echo icanon");
	return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xf0, %rsp
xorl %edi, %edi
callq 0x21b0
testl %eax, %eax
je 0x3252
pushq $0x2
popq %rdi
pushq $0x1
popq %r14
movq %r14, %rsi
callq 0x2100
movq %rax, %rbx
xorl %r12d, %r12d
leaq -0x10c(%rbp), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x20e0
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups 0x2c(%r15), %xmm3
movaps %xmm0, -0x60(%rbp)
movaps %xmm1, -0x50(%rbp)
movaps %xmm2, -0x40(%rbp)
movups %xmm3, -0x34(%rbp)
andb $-0xb, 0xc(%r15)
movw $0x1, 0x16(%r15)
xorl %edi, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2130
leaq -0x21(%rbp), %r15
xorl %edi, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2160
cmpq $0x1, %rax
jne 0x3257
movsbl -0x21(%rbp), %edi
movb %dil, -0xd0(%rbp,%r12)
callq 0x2190
testl %eax, %eax
jne 0x325c
leaq 0x1(%r12), %rax
cmpq $0x62, %r12
movq %rax, %r12
jb 0x321a
jmp 0x325c
movb $0x1b, %r14b
jmp 0x32a7
testq %r12, %r12
je 0x328c
movzbl -0xd0(%rbp), %eax
movb $0x1b, %r14b
cmpl $0x5b, %eax
je 0x3270
cmpl $0x4f, %eax
jne 0x328f
movb -0xcf(%rbp), %cl
addb $-0x41, %cl
cmpb $0x3, %cl
ja 0x328f
shlb $0x3, %cl
movl $0x84858382, %r14d      # imm = 0x84858382
shrl %cl, %r14d
jmp 0x328f
movb $0x1b, %r14b
leaq -0x60(%rbp), %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x2130
pushq $0x2
popq %rdi
movq %rbx, %rsi
callq 0x2100
movl %r14d, %eax
addq $0xf0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/termfuncs.cpp
// Function: getacharnow(int)
char getacharnow(int decisecs)
{
	char c;

	cout << std::flush;
	if ( isatty(0) ) 
	{
		struct termios	info, orig;
		// system("stty -echo -icanon");
		tcgetattr(0, &info);
		orig = info;
		prev_tty_state = orig;
		prev_state_stored = 1;

		info.c_lflag &= ~ECHO;
		info.c_lflag &= ~ICANON;
		info.c_cc[VMIN] = 0;
		info.c_cc[VTIME] = decisecs;
		tcsetattr(0, TCSANOW, &info);

		if ( read(0, &c, 1) == 1 ){
			if ( c == ESCAPE )
				c = handle_escape_seq();
		}
		else
			c = '\0';

		tcsetattr(0, TCSANOW, &orig);
		// system("stty echo icanon");
	}
	else {
		if ( read(0, &c, 1) != 1 )
			c = '\0';
	}

	return (int) c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl %edi, %r14d
movq 0x3cfc(%rip), %rdi      # 0x6fd0
callq 0x2060
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x21b0
testl %eax, %eax
je 0x336d
xorl %ebx, %ebx
leaq -0x9c(%rbp), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x20e0
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups 0x2c(%r15), %xmm3
movaps %xmm0, -0x60(%rbp)
movaps %xmm1, -0x50(%rbp)
andb $-0xb, 0xc(%r15)
movaps %xmm2, -0x40(%rbp)
movups %xmm3, -0x34(%rbp)
movb $0x0, 0x17(%r15)
movb %r14b, 0x16(%r15)
xorl %edi, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2130
leaq -0x19(%rbp), %rsi
pushq $0x1
popq %rdx
xorl %edi, %edi
callq 0x2160
cmpq $0x1, %rax
jne 0x335e
movb -0x19(%rbp), %bl
cmpb $0x1b, %bl
jne 0x335e
callq 0x3194
movl %eax, %ebx
leaq -0x60(%rbp), %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x2130
jmp 0x3389
leaq -0x19(%rbp), %rbx
pushq $0x1
popq %rdx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2160
cmpq $0x1, %rax
movzbl (%rbx), %ebx
cmovnel %r15d, %ebx
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/justinjo[P]Pacman/termfuncs.cpp
// Function: random_int(int, int)
int random_int(int lo, int hi)
{
	int	range = hi - lo + 1;
	char	*seed_str;

	if ( rand_seed == -1 ) {
		seed_str = getenv( "SNAKE_SEED" );
		if ( seed_str != NULL )
			seed_random( (unsigned) atoi(seed_str) );
		else 
			seed_random( (unsigned) time(NULL) );
	}
	if ( range <= 0 )
		return 17;		// add to function specs

	return lo + ( rand() % range );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movl %edi, %ebx
subl %edi, %r14d
cmpl $-0x1, 0x3c5f(%rip)     # 0x7108
jne 0x34d4
leaq 0xc8f(%rip), %rdi       # 0x4141
callq 0x2120
testq %rax, %rax
je 0x34c6
movq %rax, %rdi
callq 0x2180
jmp 0x34cd
xorl %edi, %edi
callq 0x20b0
movl %eax, %edi
callq 0x3475
testl %r14d, %r14d
js 0x34eb
incl %r14d
callq 0x2030
cltd
idivl %r14d
movl %edx, %eax
addl %ebx, %eax
jmp 0x34ee
pushq $0x11
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
nop