LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/parser.cpp
// Function: Parser::functionBody()
ASTNode * Parser::functionBody() {
    /*
        "{" { <statement> } "}
    */
    ASTNode * node = new ASTNode(AST_FUNCTIONBODY);
    expect(T_LCURLY);

    // 0 or more statements
    while (t.type != T_RCURLY) {
        node->children.push_back(statement());
    }
    
    expect(T_RCURLY);

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x20, %edi
callq 0x3290
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0x10, (%rax)
leaq -0x28(%rbp), %rsi
movl $0x6, (%rsi)
movq %rbx, %rdi
callq 0x903c
cmpl $0x7, 0x18(%rbx)
je 0x9436
movq %r14, %r15
addq $0x8, %r15
leaq -0x28(%rbp), %r12
movq %rbx, %rdi
callq 0x9458
movq %rax, -0x28(%rbp)
movq 0x10(%r14), %rsi
cmpq 0x18(%r14), %rsi
je 0x9425
movq %rax, (%rsi)
addq $0x8, 0x10(%r14)
jmp 0x9430
movq %r15, %rdi
movq %r12, %rdx
callq 0xaf02
cmpl $0x7, 0x18(%rbx)
jne 0x9405
leaq -0x28(%rbp), %rsi
movl $0x7, (%rsi)
movq %rbx, %rdi
callq 0x903c
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/parser.cpp
// Function: Parser::parameter()
ASTNode * Parser::parameter() {
    /*
        <typeSpecifier> <identifier>
    */
    ASTNode * node = new ASTNode(AST_PARAMETER);

    node->children.push_back(type());
    node->children.push_back(identifier());

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
movl $0x20, %edi
callq 0x3290
movq %rax, %rbx
leaq 0x8(%rax), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0x8, (%rax)
movq %r15, %rdi
callq 0x9164
movq %rax, -0x20(%rbp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x98fd
movq %rax, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0x9909
leaq -0x20(%rbp), %rdx
movq %r14, %rdi
callq 0xaf02
movq %r15, %rdi
callq 0x920e
movq %rax, -0x20(%rbp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x9929
movq %rax, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0x9935
leaq -0x20(%rbp), %rdx
movq %r14, %rdi
callq 0xaf02
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/parser.cpp
// Function: Parser::variableDeclaration()
ASTNode * Parser::variableDeclaration() {
    /*
        <identifier> [ "[" <number> "]" ]
    */
    ASTNode * node = new ASTNode(AST_VARDECLARATION);

    node->children.push_back(identifier());

    // Check if its an array
    if(t.type == T_LSQUARE) {
        expect(T_LSQUARE);
        node->children.push_back(number());
        expect(T_RSQUARE);
    }

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x20, %edi
callq 0x3290
movq %rax, %rbx
leaq 0x8(%rax), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0xf, (%rax)
movq %r14, %rdi
callq 0x920e
movq %rax, -0x30(%rbp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x999b
movq %rax, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0x99a7
leaq -0x30(%rbp), %rdx
movq %r15, %rdi
callq 0xaf02
cmpl $0xc, 0x18(%r14)
jne 0x9a3d
leaq -0x30(%rbp), %r13
movl $0xc, (%r13)
movq %r14, %rdi
movq %r13, %rsi
callq 0x903c
movl $0x28, %edi
callq 0x3290
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0x5, (%rax)
movl 0x40(%r14), %eax
movl %eax, 0x20(%r12)
movl $0xf, (%r13)
movq %r14, %rdi
movq %r13, %rsi
callq 0x903c
movq %r12, (%r13)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x9a1f
movq %r12, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0x9a2b
leaq -0x30(%rbp), %rdx
movq %r15, %rdi
callq 0xaf02
leaq -0x30(%rbp), %rsi
movl $0xd, (%rsi)
movq %r14, %rdi
callq 0x903c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/parser.cpp
// Function: Parser::number()
ASTNode * Parser::number() {
    /*
        Terminal
    */
    NumberNode * node = new NumberNode();
    node->value = t.intVal;

    expect(T_INTVALUE);
    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x28, %edi
callq 0x3290
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0x5, (%rax)
movl 0x40(%rbx), %eax
movl %eax, 0x20(%r14)
leaq -0x14(%rbp), %rsi
movl $0xf, (%rsi)
movq %rbx, %rdi
callq 0x903c
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/parser.cpp
// Function: Parser::assignment()
ASTNode * Parser::assignment() {
    /*
        <identifier> ["[" <arrayIndex> "]"] "=" <expression>
    */
    ASTNode * node = new ASTNode(AST_ASSIGNMENT);

    node->children.push_back(identifier());

    // Check if its an array
    if (t.type == T_LSQUARE) {
        expect(T_LSQUARE);
        node->children.push_back(arrayIndex());
        expect(T_RSQUARE);
    }

    expect(T_ASSIGN);
    node->children.push_back(expression());
    expect(T_SEMI);

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x20, %edi
callq 0x3290
movq %rax, %r14
leaq 0x8(%rax), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0xa, (%rax)
movq %rbx, %rdi
callq 0x920e
movq %rax, -0x28(%rbp)
movq 0x10(%r14), %rsi
cmpq 0x18(%r14), %rsi
je 0x9d9c
movq %rax, (%rsi)
addq $0x8, 0x10(%r14)
jmp 0x9da8
leaq -0x28(%rbp), %rdx
movq %r15, %rdi
callq 0xaf02
cmpl $0xc, 0x18(%rbx)
jne 0x9e03
leaq -0x28(%rbp), %r12
movl $0xc, (%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x903c
movq %rbx, %rdi
callq 0x9e68
movq %rax, (%r12)
movq 0x10(%r14), %rsi
cmpq 0x18(%r14), %rsi
je 0x9de5
movq %rax, (%rsi)
addq $0x8, 0x10(%r14)
jmp 0x9df1
leaq -0x28(%rbp), %rdx
movq %r15, %rdi
callq 0xaf02
leaq -0x28(%rbp), %rsi
movl $0xd, (%rsi)
movq %rbx, %rdi
callq 0x903c
leaq -0x28(%rbp), %r12
movl $0x0, (%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x903c
movq %rbx, %rdi
callq 0x9aa6
movq %rax, (%r12)
movq 0x10(%r14), %rsi
cmpq 0x18(%r14), %rsi
je 0x9e3a
movq %rax, (%rsi)
addq $0x8, 0x10(%r14)
jmp 0x9e46
leaq -0x28(%rbp), %rdx
movq %r15, %rdi
callq 0xaf02
leaq -0x28(%rbp), %rsi
movl $0x3, (%rsi)
movq %rbx, %rdi
callq 0x903c
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/parser.cpp
// Function: Parser::arrayIndex()
ASTNode * Parser::arrayIndex() {
    /*
        <expression>
    */
    ASTNode * node = new ASTNode(AST_ARRAYINDEX);

    node->children.push_back(expression());

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movl $0x20, %edi
callq 0x3290
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0x11, (%rax)
movq %r14, %rdi
callq 0x9aa6
movq %rax, -0x18(%rbp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x9eb8
movq %rax, (%rsi)
addq $0x8, 0x10(%rbx)
jmp 0x9ec8
movq %rbx, %rdi
addq $0x8, %rdi
leaq -0x18(%rbp), %rdx
callq 0xaf02
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/parser.cpp
// Function: Parser::character()
ASTNode * Parser::character() {
    /*
        Terminal
    */
   CharNode * node = new CharNode();
   node->value = t.charVal;
   
   expect(T_CHARVALUE);
   return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x28, %edi
callq 0x3290
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movl $0x12, (%rax)
movb 0x44(%rbx), %al
movb %al, 0x20(%r14)
leaq -0x14(%rbp), %rsi
movl $0x11, (%rsi)
movq %rbx, %rdi
callq 0x903c
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/parser.cpp
// Function: Parser::op()
ASTNode * Parser::op() {
    /*
        Terminal
        "+" | "-" etc.
    */
    OpNode * node = new OpNode();

    switch(t.type) {
        case T_PLUS: {
            node->operation = "+";
            break;
        }
        case T_MINUS: {
            node->operation = "-";
            break;
        }
        default: {
            reject("Operation not supported");
        }
    }

    next();
    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl $0x40, %edi
callq 0x3290
movq %rax, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
xorl %eax, %eax
movq %rax, 0x18(%r14)
movl $0xd, (%r14)
leaq 0x30(%r14), %rcx
movq %rcx, 0x20(%r14)
movq %rax, 0x28(%r14)
movb $0x0, 0x30(%r14)
movl 0x18(%rbx), %eax
cmpl $0x1, %eax
je 0x9f82
cmpl $0x2, %eax
jne 0x9fb7
leaq 0x85af(%rip), %rcx      # 0x1252f
jmp 0x9f89
leaq 0x8521(%rip), %rcx      # 0x124aa
movq %r14, %rdi
addq $0x20, %rdi
movq 0x28(%r14), %rdx
movl $0x1, %r8d
xorl %esi, %esi
callq 0x3390
movq %rbx, %rdi
callq 0x8a04
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x84e6(%rip), %rsi      # 0x124ac
leaq 0x84f6(%rip), %rdx      # 0x124c3
leaq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x8354
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8b40
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x9ff5
callq 0x3250
movq %rbx, %rdi
callq 0x3420
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/symbolTable.cpp
// Function: SymbolTable::SymbolTable()
SymbolTable::SymbolTable()
: currentScopeId (0) {
    intDescriptor = new STTypeDescriptor(VT_INT);
    charDescriptor = new STTypeDescriptor(VT_CHAR);
    boolDescriptor = new STTypeDescriptor(VT_BOOL);

    universe = new STEntry(ST_HEAD, 0);
    currentScope = universe;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movl %r14d, 0x10(%rdi)
movl $0xc, %edi
callq 0x3290
movq $0x1, (%rax)
movl %r14d, 0x8(%rax)
movq %rax, 0x18(%rbx)
movl $0xc, %edi
callq 0x3290
movq $0x2, (%rax)
movl %r14d, 0x8(%rax)
movq %rax, 0x20(%rbx)
movl $0xc, %edi
callq 0x3290
movq $0x3, (%rax)
movl %r14d, 0x8(%rax)
movq %rax, 0x28(%rbx)
movl $0x58, %edi
callq 0x3290
movq %r14, (%rax)
movq %r14, 0x10(%rax)
leaq 0x20(%rax), %rcx
movq %rcx, 0x28(%rax)
movq %rcx, 0x20(%rax)
movq %r14, 0x30(%rax)
leaq 0x48(%rax), %rcx
movq %rcx, 0x38(%rax)
movq %r14, 0x40(%rax)
movb $0x0, 0x48(%rax)
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/symbolTable.cpp
// Function: SymbolTable::addEntry(STEntryType, VarType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void SymbolTable::addEntry(STEntryType entryType, VarType varType, std::string varName) {
    STEntry * scopeIterator = currentScope;
    while (scopeIterator->next != nullptr) {
        if (scopeIterator->next->name == varName) {
            std::cout << "Object name already exists in scope: " << varName << std::endl;
            return; 
        } else {
            scopeIterator = scopeIterator->next;
        }
    }
    STTypeDescriptor * typeDescriptor = new STTypeDescriptor(varType);
    STEntry * newEntry = new STEntry();
    newEntry->name = varName;
    newEntry->entryType = entryType;
    newEntry->scopeId = currentScopeId;
    newEntry->typeDescriptor = typeDescriptor;
    scopeIterator->next = newEntry;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %edx, %r12d
movl %esi, -0x2c(%rbp)
movq %rdi, %r14
movq 0x8(%rdi), %r15
movq 0x10(%r15), %rax
addq $0x10, %r15
testq %rax, %rax
je 0xbff0
movq 0x8(%rbx), %r13
movq 0x40(%rax), %rdx
cmpq %r13, %rdx
jne 0xbfe0
testq %rdx, %rdx
je 0xc07b
movq (%rbx), %rsi
movq 0x38(%rax), %rdi
callq 0x32a0
testl %eax, %eax
je 0xc07b
movq (%r15), %r15
movq 0x10(%r15), %rax
addq $0x10, %r15
testq %rax, %rax
jne 0xbfba
movl $0xc, %edi
callq 0x3290
movq %rax, %r13
movl %r12d, (%rax)
movq %r14, -0x38(%rbp)
xorl %r14d, %r14d
movq %r14, 0x4(%rax)
movl $0x58, %edi
callq 0x3290
movq %rax, %r12
movq %r14, 0x10(%rax)
addq $0x20, %rax
movq %rax, 0x28(%r12)
movq %rax, 0x20(%r12)
movq %r14, 0x30(%r12)
leaq 0x38(%r12), %rdi
leaq 0x48(%r12), %rax
movq %rax, 0x38(%r12)
movq %r14, 0x40(%r12)
movb $0x0, 0x48(%r12)
movq %rbx, %rsi
callq 0x3180
movl -0x2c(%rbp), %eax
movl %eax, (%r12)
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x4(%r12)
movq %r13, 0x8(%r12)
movq %r12, (%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xbf4e(%rip), %r14      # 0x17fd0
leaq 0x65e5(%rip), %rsi      # 0x1266e
movl $0x25, %edx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/symbolTable.cpp
// Function: SymbolTable::openScope(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void SymbolTable::openScope(std::string scopeName) {
    currentScopeId++;
    STEntry * oldScope = currentScope;
    currentScope = new STEntry(ST_HEAD, currentScopeId);
    currentScope->name = scopeName;
    
    // Fix references
    currentScope->parentScope = oldScope;
    oldScope->childScopes.push_back(currentScope);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x10(%rdi), %r12d
incl %r12d
movl %r12d, 0x10(%rdi)
movq 0x8(%rdi), %r15
movl $0x58, %edi
callq 0x3290
movl $0x0, (%rax)
movl %r12d, 0x4(%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
leaq 0x20(%rax), %rdx
movq %rdx, 0x28(%rax)
movq %rdx, 0x20(%rax)
movq %rcx, 0x30(%rax)
leaq 0x38(%rax), %rdi
leaq 0x48(%rax), %rdx
movq %rdx, 0x38(%rax)
movq %rcx, 0x40(%rax)
movb $0x0, 0x48(%rax)
movq %rax, 0x8(%rbx)
movq %r14, %rsi
callq 0x3180
movq 0x8(%rbx), %rax
movq %r15, 0x18(%rax)
leaq 0x20(%r15), %r14
movl $0x18, %edi
callq 0x3290
movq 0x8(%rbx), %rcx
movq %rcx, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x3070
incq 0x30(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/symbolTable.cpp
// Function: SymbolTable::lookup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
STEntry * SymbolTable::lookup(std::string name) {
    STEntry * head = currentScope;
    STEntry * currentEntry;
    while (head != nullptr) {
         currentEntry = head->next;
         while (currentEntry != nullptr) {
             if (currentEntry->name == name) {
                 return currentEntry;
             }
             currentEntry = currentEntry->next;
         }
         if(head == universe) {
             break;
         }

        head = head->parentScope;
    }
    return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r15
testq %r15, %r15
je 0xc2e3
movq %rsi, %rbx
movq (%rdi), %r12
movq 0x10(%r15), %r14
testq %r14, %r14
je 0xc2d5
movq 0x8(%rbx), %r13
movq 0x40(%r14), %rdx
cmpq %r13, %rdx
jne 0xc2cc
testq %rdx, %rdx
je 0xc2e6
movq (%rbx), %rsi
movq 0x38(%r14), %rdi
callq 0x32a0
testl %eax, %eax
je 0xc2e6
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0xc2ae
cmpq %r12, %r15
je 0xc2e3
movq 0x18(%r15), %r15
testq %r15, %r15
jne 0xc2a1
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/symbolTable.cpp
// Function: SymbolTable::lookupScope(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
STEntry * SymbolTable::lookupScope(std::string functionName) {
    STEntry * head = universe;
    for (auto & child : universe->childScopes) {
        if (child->name == functionName) {
            return child;
        }
    }
    return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rdi), %r15
addq $0x20, %r15
movq %r15, %r12
movq (%r12), %r12
cmpq %r15, %r12
je 0xc353
movq 0x10(%r12), %r13
movq 0x40(%r13), %rdx
cmpq 0x8(%rbx), %rdx
jne 0xc343
testq %rdx, %rdx
je 0xc347
movq (%rbx), %rsi
movq 0x38(%r13), %rdi
callq 0x32a0
testl %eax, %eax
sete %al
jmp 0xc349
xorl %eax, %eax
jmp 0xc349
movb $0x1, %al
testb %al, %al
cmovneq %r13, %r14
je 0xc313
jmp 0xc356
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/symbolTable.cpp
// Function: SymbolTable::print()
void SymbolTable::print() {
    STEntry * head = currentScope;
    STEntry * currentEntry;
    std::cout << "innerScope" << std::endl;
    while (head != nullptr) {
        std::cout << "| " << std::endl;
        std::cout << "[ Head ]";
        currentEntry = head->next;
        while (currentEntry != nullptr) {
            std::cout << " -> ";
            std::cout << " [ " << currentEntry->name << " ] ";
            currentEntry = currentEntry->next;
         }
         std::cout << " -> guard " << std::endl;
         head = head->parentScope;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rdi), %r12
movq 0xbc4f(%rip), %rbx      # 0x17fd0
leaq 0x630c(%rip), %rsi      # 0x12694
movl $0xa, %edx
movq %rbx, %rdi
callq 0x32d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31a0
testq %r12, %r12
je 0xc4c8
leaq 0x62dc(%rip), %r13      # 0x126a8
leaq 0x62da(%rip), %r14      # 0x126ad
leaq 0x62d7(%rip), %r15      # 0x126b1
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x614b(%rip), %rsi      # 0x12534
callq 0x32d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31a0
movl $0x8, %edx
movq %rbx, %rdi
leaq 0x627b(%rip), %rsi      # 0x1269f
callq 0x32d0
movq %r12, -0x30(%rbp)
movq 0x10(%r12), %r12
testq %r12, %r12
je 0xc47b
movl $0x4, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x32d0
movl $0x3, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x32d0
movq 0x38(%r12), %rsi
movq 0x40(%r12), %rdx
movq %rbx, %rdi
callq 0x32d0
movl $0x3, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x32d0
jmp 0xc42d
movl $0xa, %edx
movq %rbx, %rdi
leaq 0x622b(%rip), %rsi      # 0x126b5
callq 0x32d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31a0
movq -0x30(%rbp), %r12
movq 0x18(%r12), %r12
testq %r12, %r12
jne 0xc3da
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/irGenerator.cpp
// Function: IRGenerator::genTAC(ASTNode*)
void IRGenerator::genTAC(ASTNode * node) {
    switch(node->nodeType) {
        case AST_EXPRESSION:
            {
                genTACExpression(node);
                break;
            }
        case AST_STATEMENT:
            {
                genTACStatement(node);
                break;
            }
        case AST_FUNCTION:
            {
                genTACFunction(node);
                break;
            }
        case AST_DECLARATION:
            {
                genTACDeclaration(node);
                break;
            }
        default:
            {
                for(auto child : node->children) {
                    genTAC(child);
                }
            }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
movl (%rsi), %eax
addl $-0x2, %eax
cmpl $0x9, %eax
ja 0xcabb
leaq 0x5cbc(%rip), %rcx      # 0x12704
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %rdx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xdc52
movq %rbx, %rdi
movq %rdx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xce96
movq %rbx, %rdi
movq %rdx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xdf82
leaq -0x38(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xcada
movq (%r14), %rdi
leaq -0x28(%rbp), %rax
cmpq %rax, %rdi
je 0xcab0
callq 0x3250
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rdx), %r14
movq 0x10(%rdx), %r15
cmpq %r15, %r14
je 0xcab0
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xca24
addq $0x8, %r14
jmp 0xcac3
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/irGenerator.cpp
// Function: IRGenerator::genTACDeclaration(ASTNode*)
void IRGenerator::genTACDeclaration(ASTNode * declaration) {
    TypeNode * typeNode = (TypeNode *)declaration->children[0];
    auto child = declaration->children.begin() + 1;
    while (child != declaration->children.end()) {
        IdentifierNode * id = (IdentifierNode *)((*child)->children[0]);
        intermediateCode.push_back({ IR_DECLARATION, id->name, varTypeToString[typeNode->varType] });
        child++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq 0x8(%rsi), %rax
leaq 0x8(%rax), %r12
cmpq 0x10(%rsi), %r12
je 0xe080
movq %rsi, %rbx
movq %rdi, %r14
movq (%rax), %r15
addq $0x10, %r14
addq $0x20, %r15
leaq -0x38(%rbp), %r13
movq (%r12), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movl $0xc, -0x90(%rbp)
leaq -0x78(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x6992
leaq 0xa500(%rip), %rdi      # 0x184f8
movq %r15, %rsi
callq 0xb9a6
leaq -0x58(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x6992
movq %r13, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
movq %r14, %rdi
movq %r14, %rsi
leaq -0x90(%rbp), %rdx
callq 0xe44e
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0xe04b
callq 0x3250
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xe05d
callq 0x3250
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xe072
callq 0x3250
addq $0x8, %r12
cmpq 0x10(%rbx), %r12
jne 0xdfba
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0xe35c
jmp 0xe0b8
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xe0b8
callq 0x3250
movq %rbx, %rdi
callq 0x3420
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/irGenerator.cpp
// Function: IRGenerator::genLabel[abi:cxx11]()
std::string IRGenerator::genLabel() {
    // if (labelCounts.find(nodeType) == labelCounts.end()) {
    //     labelCounts[nodeType] = 0;
    // }
    // return "_" + nodeType + std::to_string(labelCounts[nodeType]++);
    return "LABEL" + std::to_string(labelCount++);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x28(%rsi), %r13d
leal 0x1(%r13), %eax
movl %eax, 0x28(%rsi)
movl %r13d, %r14d
negl %r14d
cmovsl %r13d, %r14d
movl $0x1, %r15d
cmpl $0xa, %r14d
jb 0xe13f
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r14d, %ecx
cmpl $0x63, %ecx
jbe 0xe136
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xe13c
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xe13f
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xe103
addl $-0x3, %r15d
jmp 0xe13f
addl $-0x2, %r15d
jmp 0xe13f
decl %r15d
shrl $0x1f, %r13d
movl %r13d, %esi
addl %r15d, %esi
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x32e0
movq (%r12), %rdi
addq %r13, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0xa9d4
leaq 0x45e1(%rip), %rcx      # 0x1275c
movl $0x5, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0xe1af
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0xe1b5
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xe1de
callq 0x3250
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xe205
callq 0x3250
movq %rbx, %rdi
callq 0x3420
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::generate[abi:cxx11]()
std::string CodeGenerator::generate() {
    // Make it easy to tell when our code starts
    code << "; Code begins now" << nl;
    code << "NOP" << nl << "NOP" << nl << "NOP" << nl;
    // First set up our stack
    initializeStack();

    // Now run through the code line by line
    for (auto & tac : intermediateCode) {
        generateCodeFromTAC(tac);
    }
    return code.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
leaq 0x80(%rsi), %r15
leaq 0x3f5c(%rip), %rsi      # 0x12860
movl $0x11, %edx
movq %r15, %rdi
callq 0x32d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x32d0
leaq 0x3f4b(%rip), %rbx      # 0x12872
movl $0x3, %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x32d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x32d0
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x32d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x32d0
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x32d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x32d0
movq %r14, %rdi
callq 0xeac0
leaq 0x68(%r14), %r12
movq 0x68(%r14), %r13
cmpq %r12, %r13
je 0xea54
leaq -0x60(%rbp), %rbx
leaq -0x40(%rbp), %r15
movl 0x10(%r13), %eax
movl %eax, -0x98(%rbp)
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq 0x18(%r13), %rsi
movq 0x20(%r13), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x6992
movq %rbx, -0x70(%rbp)
movq 0x38(%r13), %rsi
movq 0x40(%r13), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x6992
movq %r15, -0x50(%rbp)
movq 0x58(%r13), %rsi
movq 0x60(%r13), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %rdi
callq 0x6992
movq %r14, %rdi
leaq -0x98(%rbp), %rsi
callq 0xeb8a
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0xea24
callq 0x3250
movq -0x70(%rbp), %rdi
cmpq %rbx, %rdi
je 0xea32
callq 0x3250
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xea47
callq 0x3250
movq (%r13), %r13
cmpq %r12, %r13
jne 0xe9ab
addq $0x88, %r14
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x33a0
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0xea92
movq %rax, %r14
movq -0x70(%rbp), %rdi
cmpq %rbx, %rdi
je 0xea92
callq 0x3250
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xeab8
callq 0x3250
jmp 0xeab8
movq %rax, %r14
leaq -0x98(%rbp), %rdi
callq 0xe35c
movq %r14, %rdi
callq 0x3420
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::initializeStack()
void CodeGenerator::initializeStack() {
    // The stack should start with one "fake" item on it - the old FP, to which the current FP points
    code << "; Initialize the stack" << nl;
    code << "LDA #$FF" << nl;
    code << "STA " << cSP << nl;
    code << "STA " << cFP << nl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x3e48(%rip), %rsi      # 0x12923
movl $0x16, %edx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
leaq 0x3e3c(%rip), %rsi      # 0x1293a
movl $0x8, %edx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
leaq 0x3e22(%rip), %r15      # 0x12943
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x32d0
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x32d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::allocateGlobal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void CodeGenerator::allocateGlobal(std::string name, std::string type) {
    code << "; global " << name << nl;
    int address = currentGlobalOffset;
    loadConstIntoA(0);
    storeAIntoGlobal(address);
    globalToAddressMap[name] = address;
    currentGlobalOffset++; //Will vary depending on type in the future
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x80(%rdi), %r15
leaq 0x32a5(%rip), %rsi      # 0x12ac7
movl $0x9, %edx
movq %r15, %rdi
callq 0x32d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
movl 0x294(%rbx), %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10ee0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x10e44
leaq 0x1f8(%rbx), %rdi
movq %r14, %rsi
callq 0x11326
movl %r15d, (%rax)
incl 0x294(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::generateBranchOnCondition(TAC, bool)
void CodeGenerator::generateBranchOnCondition(TAC tac, bool condition) {
    code << "; branch if " << tac.first << " is " << condition << nl;
    CodeVar var = lookup(tac.first);
    loadLocalIntoA(var.value);
    code << "CMP #" << condition << nl;
    code << "BEQ " << tac.second << nl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x25ac(%rip), %rsi      # 0x12a06
movl $0xc, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
movq %r14, %rdi
callq 0x32d0
movq %rax, %r13
leaq 0x2592(%rip), %rsi      # 0x12a13
movl $0x4, %edx
movq %rax, %rdi
callq 0x32d0
movq %r13, %rdi
movl %r12d, -0x2c(%rbp)
movl %r12d, %esi
callq 0x33e0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
addq %rsi, %rdx
leaq -0x50(%rbp), %r13
movq %r13, %rdi
callq 0x6992
movq %rbx, %rdi
movq %r13, %rsi
callq 0x10bda
movq %rax, %r13
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x104e8
callq 0x3250
shrq $0x20, %r13
movq %rbx, %rdi
movl %r13d, %esi
callq 0x10da2
leaq 0x251a(%rip), %rsi      # 0x12a18
movl $0x5, %edx
movq %r14, %rdi
callq 0x32d0
movzbl -0x2c(%rbp), %esi
movq %r14, %rdi
callq 0x33e0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq 0x24f1(%rip), %rsi      # 0x12a1e
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x28(%r15), %rsi
movq 0x30(%r15), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x10579
callq 0x3250
movq %rbx, %rdi
callq 0x3420
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::generatePushParam(TAC)
void CodeGenerator::generatePushParam(TAC tac) {
    CodeVar param = lookup(tac.first);
    code << "; push param " << tac.first << nl;
    loadLocalIntoA(param.value);
    pushAToStack();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rsi), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x6992
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10bda
movq %rax, %r15
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x1065b
callq 0x3250
shrq $0x20, %r15
leaq 0x80(%rbx), %r12
leaq 0x23b6(%rip), %rsi      # 0x12a23
movl $0xd, %edx
movq %r12, %rdi
callq 0x32d0
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
movq %r12, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x10da2
movq %rbx, %rdi
callq 0x10b3c
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x106ca
callq 0x3250
movq %rbx, %rdi
callq 0x3420
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::generateSubroutineCall(TAC)
void CodeGenerator::generateSubroutineCall(TAC tac) {
    code << "; push FP, call, restore FP" << nl;

    // Push cFP to stack
    code << "LDA " << cFP << nl;
    pushAToStack();
    
    // Set cFP to cSP
    code << "LDA " << cSP << nl;
    code << "STA " << cFP << nl;

    // Call function
    code << "JSR " << tac.first << nl;

    // Restore FP
    popStackToA();
    code << "STA " << cFP << nl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x2273(%rip), %rsi      # 0x12a50
movl $0x1b, %edx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
leaq 0x226c(%rip), %r12      # 0x12a6c
movl $0x4, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x32d0
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
movq %rbx, %rdi
callq 0x10b3c
movl $0x4, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq 0x20d6(%rip), %r12      # 0x12943
movl $0x4, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x32d0
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq 0x21ce(%rip), %rsi      # 0x12a71
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
movq %rbx, %rdi
callq 0x10a9e
movl $0x4, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x32d0
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x32d0
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::generateEndFunc(TAC)
void CodeGenerator::generateEndFunc(TAC tac) {
    code << "; endFunc" << nl;
    int paramSize = stoi(tac.first);

    // Deallocate space for locals
    deallocateStackSpace(paramSize);

    code << "RTS" << nl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x80(%rdi), %rbx
leaq 0x218a(%rip), %rsi      # 0x12abd
movl $0x9, %edx
movq %rbx, %rdi
callq 0x32d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x32d0
movq 0x8(%r15), %r12
callq 0x3050
movq %rax, %r15
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, (%r15)
leaq -0x38(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x3330
cmpq %r12, (%r13)
je 0x109d6
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x109e2
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x109e2
testl %ecx, %ecx
jne 0x1099b
movl -0x2c(%rbp), %ecx
movl %ecx, (%r15)
movq %r14, %rdi
movl %eax, %esi
callq 0x1106a
leaq 0x1ed8(%rip), %rsi      # 0x12884
movl $0x3, %edx
movq %rbx, %rdi
callq 0x32d0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32d0
leaq 0x20f9(%rip), %rdi      # 0x12ad6
callq 0x3190
leaq 0x20ed(%rip), %rdi      # 0x12ad6
callq 0x3350
cmpl $0x0, (%r15)
jne 0x109fa
movl -0x2c(%rbp), %ecx
movl %ecx, (%r15)
movq %rax, %rdi
callq 0x3420
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::popStackToA()
void CodeGenerator::popStackToA() {
    // X <- cSP
    code << "LDX " << cSP << nl;

    // A <- M[cSP]
    code << "LDA $0,X" << nl;

    // cSP++
    code << "INC " << cSP << nl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x1e92(%rip), %rsi      # 0x12948
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq 0x1e64(%rip), %rsi      # 0x1294d
movl $0x8, %edx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
leaq 0x1e4a(%rip), %rsi      # 0x12956
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x32d0
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::pushAToStack()
void CodeGenerator::pushAToStack() {
    // cSP--
    code << "DEC " << cSP << nl;
    
    // X <- cSP
    code << "LDX " << cSP << nl;

    // M[$0 + $cSP] <- A
    // This effectively means we put the new item at the stack pointer in memory
    code << "STA $0,X" << nl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x1e07(%rip), %rsi      # 0x1295b
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq 0x1dc1(%rip), %rsi      # 0x12948
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq 0x1da6(%rip), %rsi      # 0x12960
movl $0x8, %edx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x32d0
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::lookup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
CodeVar CodeGenerator::lookup(std::string varName) {
    if (isNumber(varName)) {
        int value = std::stoi(varName);
        return {CVT_CONST, value};  
    }
    if (currentParamMap.find(varName) != currentParamMap.end()) {
        return {CVT_PARAM, currentParamMap[varName]};
    }
    if (globalToAddressMap.find(varName) != globalToAddressMap.end()) {
        return {CVT_GLOBAL, globalToAddressMap[varName]};
    }
    if (localToOffsetMap.find(varName) != localToOffsetMap.end()) {
        return {CVT_LOCAL, localToOffsetMap[varName]};
    }
    localToOffsetMap[varName] = currentLocalOffset;
    currentLocalOffset++;
    return {CVT_LOCAL, localToOffsetMap[varName]};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x6992
movq (%r15), %rdi
movq 0x8(%r15), %rcx
leaq (%rdi,%rcx), %rax
movq %rdi, %rdx
testq %rcx, %rcx
je 0x10c40
movq %rcx, %rsi
movq %rdi, %rdx
movsbl (%rdx), %r8d
addl $-0x30, %r8d
cmpl $0x9, %r8d
ja 0x10c40
incq %rdx
decq %rsi
jne 0x10c27
movq %rax, %rdx
testq %rcx, %rcx
setne %cl
cmpq %rax, %rdx
sete %r15b
andb %cl, %r15b
cmpq %r12, %rdi
je 0x10c5a
callq 0x3250
testb %r15b, %r15b
je 0x10cb8
movq (%rbx), %r14
callq 0x3050
movq %rax, %rbx
movl (%rax), %r12d
movl $0x0, (%rax)
leaq -0x28(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x3330
cmpq %r14, (%r15)
je 0x10d79
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x10d85
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x10d85
testl %ecx, %ecx
jne 0x10cae
movl %r12d, (%rbx)
movl $0x2, %ecx
jmp 0x10d65
leaq 0x258(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1181e
leaq 0x260(%r14), %rcx
cmpq %rcx, %rax
je 0x10cea
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11326
movl (%rax), %eax
movl $0x3, %ecx
jmp 0x10d65
leaq 0x1f8(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1181e
leaq 0x200(%r14), %rcx
cmpq %rcx, %rax
je 0x10d1c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11326
movl (%rax), %eax
movl $0x1, %ecx
jmp 0x10d65
leaq 0x228(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1181e
leaq 0x230(%r14), %rcx
cmpq %rcx, %rax
jne 0x10d56
movl 0x298(%r14), %r12d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11326
movl %r12d, (%rax)
incl 0x298(%r14)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x11326
movl (%rax), %eax
xorl %ecx, %ecx
shlq $0x20, %rax
orq %rcx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d56(%rip), %rdi      # 0x12ad6
callq 0x3190
leaq 0x1d4a(%rip), %rdi      # 0x12ad6
callq 0x3350
cmpl $0x0, (%rbx)
jne 0x10d99
movl %r12d, (%rbx)
movq %rax, %rdi
callq 0x3420
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::loadLocalIntoA(int)
void CodeGenerator::loadLocalIntoA(int offset){
    // Locals are located below the frame pointer in memory
    /*
        [ Locals ]
        [ FP ]
        [ Params ]
    */
    // X <- cFP
    code << "LDX " << cFP << nl;
    
    // Subtracting is the same as adding 255 - num
    // e.g. we want to load cFP - 3
    // cFP = $F9
    // cFP = $F9 - $3 = 0xF6
    // $F9 + $FC = 0xF6
    // $FD = $FF - $3 = 255 - 3 = 252
    int adjustedOffset = 256 - offset;
    code << "LDA " << adjustedOffset << ",X" << nl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x1b87(%rip), %rsi      # 0x12948
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
movl $0x100, %r12d           # imm = 0x100
subl %r15d, %r12d
leaq 0x1c6f(%rip), %rsi      # 0x12a6c
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq %r14, %rdi
movl %r12d, %esi
callq 0x3410
movq %rax, %r14
leaq 0x1b34(%rip), %rsi      # 0x12953
movl $0x2, %edx
movq %rax, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x32d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::storeAIntoLocal(int)
void CodeGenerator::storeAIntoLocal(int offset) {
    // Locals are below the frame pointer in memory
    // Offset can't be 0 - locals start at 1
    code << "LDX " << cFP << nl;
    int adjustedOffset = 256 - offset;
    code << "STA " << adjustedOffset << ",X" << nl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x19fb(%rip), %rsi      # 0x12948
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
movl $0x100, %r12d           # imm = 0x100
subl %r15d, %r12d
leaq 0x19ba(%rip), %rsi      # 0x12943
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq %r14, %rdi
movl %r12d, %esi
callq 0x3410
movq %rax, %r14
leaq 0x19a8(%rip), %rsi      # 0x12953
movl $0x2, %edx
movq %rax, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x32d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::loadParamIntoA(int)
void CodeGenerator::loadParamIntoA(int offset) {
    // Params are located above the frame pointer in memory
    /*
        [ Locals ]
        [ FP ]
        [ Params ]
    */
    code << "LDX " << cFP << nl;
    code << "LDA " << offset << ",X" << nl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x80(%rdi), %r15
leaq 0x195a(%rip), %rsi      # 0x12948
movl $0x4, %edx
movq %r15, %rdi
callq 0x32d0
movq 0x40(%rbx), %rsi
movq 0x48(%rbx), %rdx
movq %r15, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq 0x1a4b(%rip), %rsi      # 0x12a6c
movl $0x4, %edx
movq %r15, %rdi
callq 0x32d0
movq %r15, %rdi
movl %r14d, %esi
callq 0x3410
movq %rax, %r14
leaq 0x1910(%rip), %rsi      # 0x12953
movl $0x2, %edx
movq %rax, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x32d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::deallocateStackSpace(int)
void CodeGenerator::deallocateStackSpace(int size) {
    if (size == 0) return;
    loadConstIntoA(size);
    code << "CLC" << nl; //Set stupid carry
    code << "ADC " << cSP << nl;
    code << "STA " << cSP << nl;
}

// Assembly:
testl %esi, %esi
je 0x11115
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x10ee0
leaq 0x80(%rbx), %r14
leaq 0x1959(%rip), %rsi      # 0x129e8
movl $0x3, %edx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
leaq 0x1a1f(%rip), %rsi      # 0x12ad1
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x32d0
leaq 0x185e(%rip), %rsi      # 0x12943
movl $0x4, %edx
movq %r14, %rdi
callq 0x32d0
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x32d0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x32d0
retq
// File: /workspace/github_cpp_makefile_star2_O1/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::padAddress[abi:cxx11](int)
std::string CodeGenerator::padAddress(int num)
{
    std::ostringstream ss;
    ss << std::setw(4) << std::setfill('0') << num;
    std::string result = ss.str();
    if (result.length() > 4)
    {
        result.erase(0, result.length() - 4);
    }
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movl %edx, %r14d
movq %rdi, %rbx
leaq -0x190(%rbp), %r15
movq %r15, %rdi
callq 0x3310
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq $0x4, -0x180(%rbp,%rcx)
movq -0x18(%rax), %rax
leaq (%rax,%rbp), %r15
addq $-0x190, %r15           # imm = 0xFE70
cmpb $0x0, 0xe1(%r15)
jne 0x11183
movq %r15, %rdi
movl $0x20, %esi
callq 0x3260
movb %al, 0xe0(%r15)
movb $0x1, 0xe1(%r15)
movb $0x30, 0xe0(%r15)
leaq -0x190(%rbp), %rdi
movl %r14d, %esi
callq 0x3410
leaq -0x188(%rbp), %rsi
movq %rbx, %rdi
callq 0x33a0
movq 0x8(%rbx), %rdx
cmpq $0x5, %rdx
jb 0x111c1
addq $-0x4, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x30b0
movq 0x6e00(%rip), %rsi      # 0x17fc8
leaq -0x190(%rbp), %rdi
callq 0x3170
leaq -0x120(%rbp), %rdi
callq 0x3100
movq %rbx, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
addq $0x10, %rbx
cmpq %rbx, %rdi
je 0x1120a
callq 0x3250
jmp 0x1120a
movq %rax, %r14
movq 0x6db7(%rip), %rsi      # 0x17fc8
leaq -0x190(%rbp), %rdi
callq 0x3170
leaq -0x120(%rbp), %rdi
callq 0x3100
movq %r14, %rdi
callq 0x3420
nop