LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0xbe34
leaq 0x4942(%rip), %rcx      # 0x1070c
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 0xc930
movq %rbx, %rdi
movq %rdx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xc098
movq %rbx, %rdi
movq %rdx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xcb1e
leaq -0x38(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbe52
movq %r14, %rdi
callq 0x3140
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rdx), %r14
movq 0x10(%rdx), %r15
cmpq %r15, %r14
je 0xbe29
movq (%r14), %rsi
movq %rbx, %rdi
callq 0xbda6
addq $0x8, %r14
jmp 0xbe3c
// File: /workspace/github_cpp_makefile_star2_O2/taurheim[P]AgNES/irGenerator.cpp
// Function: IRGenerator::genTACFunction(ASTNode*)
void IRGenerator::genTACFunction(ASTNode * func) {
    IdentifierNode * functionName = (IdentifierNode*) func->children[1];
    intermediateCode.push_back({ IR_NEWLABEL, functionName->name});

    // TODO this doesn't support variables with different sizes
    intermediateCode.push_back({ IR_BEGINFUNC, functionName->name });
    auto beginFuncRef = std::prev(intermediateCode.end());
    int startingRegisterCount = registerCount;

    ASTNode * functionBody = func->children[3];
    for(auto & statement : functionBody->children) {
        genTACStatement(statement);
    }

    // How many locals are there
    std::string localsCount = std::to_string((registerCount - startingRegisterCount));
    intermediateCode.push_back({ IR_ENDFUNC, localsCount });
    // Now that we know how many labels are used
    (*beginFuncRef).second = localsCount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %r14
movq %rsi, -0x38(%rbp)
movq 0x8(%rsi), %rax
movq 0x8(%rax), %r12
leaq 0x10(%rdi), %rbx
leaq -0x98(%rbp), %rdi
movl $0x3, -0x8(%rdi)
addq $0x20, %r12
movq %r12, %rsi
callq 0x32e0
leaq -0x68(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %eax, %eax
movb %al, (%rcx)
leaq -0x48(%rbp), %r15
movq %r15, -0x10(%r15)
andq $0x0, -0x8(%r15)
movb %al, (%r15)
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0xccb6
leaq -0xa0(%rbp), %r13
movq %r13, %rdi
callq 0x6104
movl $0x7, (%r13)
leaq -0x98(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x32e0
leaq -0x68(%rbp), %rax
movq %rax, 0x20(%r13)
andq $0x0, 0x28(%r13)
xorl %eax, %eax
movb %al, 0x30(%r13)
movq %r15, 0x40(%r13)
andq $0x0, 0x48(%r13)
movb %al, 0x50(%r13)
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0xccb6
leaq -0xa0(%rbp), %rdi
callq 0x6104
pushq $0x1
popq %rsi
movq %rbx, -0x30(%rbp)
movq %rbx, %rdi
callq 0xccc6
movq %rax, %r12
movl 0x8(%r14), %r13d
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %r15
movq 0x10(%rax), %rbx
cmpq %rbx, %r15
je 0xca45
movq (%r15), %rsi
movq %r14, %rdi
callq 0xc098
addq $0x8, %r15
jmp 0xca2f
movl 0x8(%r14), %esi
subl %r13d, %esi
leaq -0xc0(%rbp), %r14
movq %r14, %rdi
callq 0x9afb
leaq -0x98(%rbp), %rdi
movl $0x8, -0x8(%rdi)
movq %r14, %rsi
callq 0x32e0
leaq -0xa0(%rbp), %rsi
leaq -0x68(%rbp), %rax
movq %rax, 0x28(%rsi)
andq $0x0, 0x30(%rsi)
xorl %eax, %eax
movb %al, 0x38(%rsi)
leaq -0x48(%rbp), %rcx
movq %rcx, 0x48(%rsi)
andq $0x0, 0x50(%rsi)
movb %al, 0x58(%rsi)
movq -0x30(%rbp), %rdi
callq 0xccb6
leaq -0xa0(%rbp), %rdi
callq 0x6104
addq $0x38, %r12
leaq -0xc0(%rbp), %rsi
movq %r12, %rdi
callq 0x3180
leaq -0xc0(%rbp), %rdi
callq 0x3140
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcaf3
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x6104
jmp 0xcaf6
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x3140
jmp 0xcb15
jmp 0xcb06
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x6104
movq %rbx, %rdi
callq 0x33e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, %rbx
movq %rdi, %r15
movq 0x8(%rsi), %r14
movq (%r14), %r12
addq $0x10, %r15
addq $0x20, %r12
addq $0x8, %r14
leaq -0x90(%rbp), %r13
cmpq 0x10(%rbx), %r14
je 0xcbbe
movq (%r14), %rax
movq 0x8(%rax), %rax
movq (%rax), %rsi
movl $0xc, -0x90(%rbp)
addq $0x20, %rsi
leaq -0x88(%rbp), %rdi
callq 0x32e0
leaq 0xb968(%rip), %rdi      # 0x184e8
movq %r12, %rsi
callq 0xae54
leaq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x32e0
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
andq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
movq %r15, %rdi
movq %r13, %rsi
callq 0xccb6
movq %r13, %rdi
callq 0x6104
addq $0x8, %r14
jmp 0xcb4f
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x6104
jmp 0xcbed
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x33e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl 0x28(%rsi), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x28(%rsi)
leaq -0x30(%rbp), %r14
movq %r14, %rdi
movl %eax, %esi
callq 0x9afb
leaq 0x3b42(%rip), %rsi      # 0x10764
movq %rbx, %rdi
movq %r14, %rdx
callq 0xcd61
leaq -0x30(%rbp), %rdi
callq 0x3140
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x80(%rsi), %r15
leaq 0x3653(%rip), %rsi      # 0x10868
movq %r15, %rdi
callq 0x3230
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
leaq 0x364b(%rip), %r12      # 0x1087a
movq %r15, %rdi
movq %r12, %rsi
callq 0x3230
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
movq %r12, %rsi
callq 0x3230
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
movq %r12, %rsi
callq 0x3230
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
movq %r14, %rdi
callq 0xd2ec
leaq 0x68(%r14), %r12
leaq -0x90(%rbp), %r15
movq %r12, %r13
movq (%r13), %r13
cmpq %r12, %r13
je 0xd2b1
leaq 0x10(%r13), %rsi
movq %r15, %rdi
callq 0x6d4c
movq %r14, %rdi
movq %r15, %rsi
callq 0xd38a
movq %r15, %rdi
callq 0x6104
jmp 0xd287
addq $0x88, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3370
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x6104
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3624(%rip), %rsi      # 0x1092b
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x3621(%rip), %rsi      # 0x10942
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x3610(%rip), %r15      # 0x1094b
movq %r14, %rdi
movq %r15, %rsi
callq 0x3230
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %r14, %rdi
movq %r15, %rsi
callq 0x3230
leaq 0x40(%rbx), %rsi
movq %rax, %rdi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
addq $0x80, %rdi
leaq 0x328f(%rip), %rsi      # 0x10acf
callq 0x3230
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movl 0x294(%rbx), %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe86c
movq %rbx, %rdi
movl %r15d, %esi
callq 0xe7f2
leaq 0x1f8(%rbx), %rdi
movq %r14, %rsi
callq 0xebcc
movl %r15d, (%rax)
incl 0x294(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::generateAddition(TAC)
void CodeGenerator::generateAddition(TAC tac) {
    code << "; add " << tac.first << " := " << tac.second << " + " << tac.third << nl;
    CodeVar assignTo = lookup(tac.first);
    CodeVar arg1 = lookup(tac.second);
    CodeVar arg2 = lookup(tac.third);

    // For now, use $0 as our adder
    // This is bad and should not be done this way
    // Reset A to 0
    loadConstIntoA(0);
    code << "STA $0" << nl;

    // Add arg1
    loadLocalIntoA(arg1.value);
    code << "CLC" << nl;
    code << "ADC $0" << nl;
    code << "STA $0" << nl;

    // Add arg2
    loadLocalIntoA(arg2.value);
    code << "CLC" << nl;
    code << "ADC $0" << nl;

    // Store the output
    storeAIntoLocal(assignTo.value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r12
movq %rdi, %rbx
addq $0x80, %rdi
leaq 0x2cd9(%rip), %rsi      # 0x109e2
movq %rdi, -0x38(%rbp)
callq 0x3230
leaq 0x8(%r12), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
leaq 0x2a41(%rip), %rsi      # 0x1076a
movq %rax, %rdi
callq 0x3230
leaq 0x28(%r12), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
leaq 0x2a27(%rip), %rsi      # 0x1076f
movq %rax, %rdi
callq 0x3230
addq $0x48, %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq -0x98(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe668
movq %rax, %r14
leaq -0x98(%rbp), %rdi
callq 0x3140
leaq -0x78(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe668
movq %rax, %r15
leaq -0x78(%rbp), %rdi
callq 0x3140
leaq -0x58(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe668
movq %rax, %r12
shrq $0x20, %r15
shrq $0x20, %r14
movq %r14, -0x30(%rbp)
shrq $0x20, %r12
leaq -0x58(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe86c
leaq 0x2be6(%rip), %rsi      # 0x109e9
movq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %rbx, %rdi
movl %r15d, %esi
callq 0xe76e
leaq 0x2bc4(%rip), %r15      # 0x109f0
movq %r14, %rdi
movq %r15, %rsi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x2bab(%rip), %r13      # 0x109f4
movq %r14, %rdi
movq %r13, %rsi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %r14, %rdi
leaq 0x2b80(%rip), %rsi      # 0x109e9
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %rbx, %rdi
movl %r12d, %esi
callq 0xe76e
movq %r14, %rdi
movq %r15, %rsi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %r14, %rdi
movq %r13, %rsi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0xe8a4
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdecf
jmp 0xdecf
movq %rax, %rbx
movq %r13, %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::generateSubtraction(TAC)
void CodeGenerator::generateSubtraction(TAC tac) {
    code << "; subtract " << tac.first << " := " << tac.second << " - " << tac.third << nl;
    CodeVar assignTo = lookup(tac.first);
    // TODO why are these flipped?
    CodeVar arg1 = lookup(tac.third);
    CodeVar arg2 = lookup(tac.second);

    // Reset A to 0
    loadConstIntoA(0);
    code << "STA $0" << nl;

    // Add arg1
    loadLocalIntoA(arg1.value);
    code << "CLC" << nl;
    code << "ADC $0" << nl;
    code << "STA $0" << nl;

    // Subtract arg2
    loadLocalIntoA(arg2.value);
    code << "CLC" << nl;
    code << "SBC $0" << nl;

    // Store the output
    storeAIntoLocal(assignTo.value);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x2af4(%rip), %rsi      # 0x109fb
movq %r14, %rdi
callq 0x3230
leaq 0x8(%r12), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x3210
leaq 0x2844(%rip), %rsi      # 0x1076a
movq %rax, %rdi
callq 0x3230
leaq 0x28(%r12), %rsi
movq %rax, %rdi
movq %rsi, -0x38(%rbp)
callq 0x3210
leaq 0x282d(%rip), %rsi      # 0x10773
movq %rax, %rdi
callq 0x3230
addq $0x48, %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq -0x98(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe668
movq %rax, -0x30(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3140
leaq -0x78(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe668
movq %rax, %r13
leaq -0x78(%rbp), %rdi
callq 0x3140
leaq -0x58(%rbp), %r15
movq %r15, %rdi
movq -0x38(%rbp), %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe668
movq %rax, %r12
shrq $0x20, %r13
movq -0x30(%rbp), %r15
shrq $0x20, %r15
shrq $0x20, %r12
leaq -0x58(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe86c
leaq 0x29e6(%rip), %rsi      # 0x109e9
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %rbx, %rdi
movl %r13d, %esi
callq 0xe76e
leaq 0x29c8(%rip), %r13      # 0x109f0
movq %r14, %rdi
movq %r13, %rsi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x29af(%rip), %rsi      # 0x109f4
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %r14, %rdi
leaq 0x2987(%rip), %rsi      # 0x109e9
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %rbx, %rdi
movl %r12d, %esi
callq 0xe76e
movq %r14, %rdi
movq %r13, %rsi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x296d(%rip), %rsi      # 0x10a07
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %rbx, %rdi
movl %r15d, %esi
callq 0xe8a4
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe0cb
jmp 0xe0cb
movq %rax, %rbx
movq %r15, %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
movq %rdi, %rbx
leaq 0x80(%rdi), %r15
leaq 0x2908(%rip), %rsi      # 0x10a0e
movq %r15, %rdi
callq 0x3230
leaq 0x8(%r14), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x3210
leaq 0x28f7(%rip), %rsi      # 0x10a1b
movq %rax, %rdi
callq 0x3230
movq %rax, %rdi
movl %r12d, -0x2c(%rbp)
movl %r12d, %esi
callq 0x33b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq -0x50(%rbp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe668
movq %rax, %r13
shrq $0x20, %r13
leaq -0x50(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
movl %r13d, %esi
callq 0xe76e
leaq 0x289e(%rip), %rsi      # 0x10a20
movq %r15, %rdi
callq 0x3230
movzbl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x33b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x287e(%rip), %rsi      # 0x10a26
movq %r15, %rdi
callq 0x3230
addq $0x28, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x33e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x8, %r14
leaq -0x38(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x32e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe668
movq %rax, %r15
shrq $0x20, %r15
leaq -0x38(%rbp), %rdi
callq 0x3140
leaq 0x80(%rbx), %rdi
leaq 0x277e(%rip), %rsi      # 0x10a2b
callq 0x3230
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %rbx, %rdi
movl %r15d, %esi
callq 0xe76e
movq %rbx, %rdi
callq 0xe5e2
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x26d8(%rip), %rsi      # 0x10a58
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x26da(%rip), %r13      # 0x10a74
movq %r14, %rdi
movq %r13, %rsi
callq 0x3230
leaq 0x40(%rbx), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %rbx, %rdi
callq 0xe5e2
movq %r14, %rdi
movq %r13, %rsi
callq 0x3230
leaq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x255b(%rip), %r13      # 0x1094b
movq %r14, %rdi
movq %r13, %rsi
callq 0x3230
movq %rax, %rdi
movq %r12, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x2661(%rip), %rsi      # 0x10a79
movq %r14, %rdi
callq 0x3230
addq $0x8, %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movq %rbx, %rdi
callq 0xe55c
movq %r14, %rdi
movq %r13, %rsi
callq 0x3230
movq %rax, %rdi
movq %r12, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x2635(%rip), %rsi      # 0x10ac5
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
addq $0x8, %r15
pushq $0xa
popq %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0xec35
movq %rbx, %rdi
movl %eax, %esi
callq 0xe9a4
leaq 0x23c7(%rip), %rsi      # 0x1088c
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3210
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x23d9(%rip), %rsi      # 0x10950
movq %r14, %rdi
callq 0x3230
leaq 0x20(%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x23b5(%rip), %rsi      # 0x10955
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x23a4(%rip), %rsi      # 0x1095e
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3210
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
leaq 0x2366(%rip), %rsi      # 0x10963
movq %r14, %rdi
callq 0x3230
leaq 0x20(%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x232a(%rip), %rsi      # 0x10950
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x231d(%rip), %rsi      # 0x10968
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3210
// File: /workspace/github_cpp_makefile_star2_O2/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 $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x32e0
movq %r15, %rsi
callq 0xeb8c
movl %eax, %r12d
movq %r15, %rdi
callq 0x3140
testb %r12b, %r12b
je 0xe6b2
pushq $0xa
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xec35
pushq $0x2
jmp 0xe70e
leaq 0x258(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf290
leaq 0x260(%r14), %rcx
cmpq %rcx, %rax
je 0xe6e1
movq %r15, %rdi
movq %rbx, %rsi
callq 0xebcc
movl (%rax), %eax
pushq $0x3
jmp 0xe70e
leaq 0x1f8(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf290
leaq 0x200(%r14), %rcx
cmpq %rcx, %rax
je 0xe723
movq %r15, %rdi
movq %rbx, %rsi
callq 0xebcc
movl (%rax), %eax
pushq $0x1
popq %rcx
shlq $0x20, %rax
orq %rcx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x228(%r14), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf290
leaq 0x230(%r14), %rcx
cmpq %rcx, %rax
jne 0xe75d
movl 0x298(%r14), %r12d
movq %r15, %rdi
movq %rbx, %rsi
callq 0xebcc
movl %r12d, (%rax)
incl 0x298(%r14)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xebcc
movl (%rax), %eax
xorl %ecx, %ecx
jmp 0xe70f
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14d
movq %rdi, %rbx
leaq 0x80(%rdi), %r15
leaq 0x21c3(%rip), %rsi      # 0x10950
movq %r15, %rdi
callq 0x3230
leaq 0x40(%rbx), %rsi
movq %rax, %rdi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movl $0x100, %r12d           # imm = 0x100
subl %r14d, %r12d
leaq 0x22b8(%rip), %rsi      # 0x10a74
movq %r15, %rdi
callq 0x3230
movq %rax, %rdi
movl %r12d, %esi
callq 0x33d0
leaq 0x2185(%rip), %rsi      # 0x1095b
movq %rax, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14d
movq %rdi, %rbx
leaq 0x80(%rdi), %r15
leaq 0x208d(%rip), %rsi      # 0x10950
movq %r15, %rdi
callq 0x3230
leaq 0x40(%rbx), %rsi
movq %rax, %rdi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
movl $0x100, %r12d           # imm = 0x100
subl %r14d, %r12d
leaq 0x2059(%rip), %rsi      # 0x1094b
movq %r15, %rdi
callq 0x3230
movq %rax, %rdi
movl %r12d, %esi
callq 0x33d0
leaq 0x204f(%rip), %rsi      # 0x1095b
movq %rax, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3210
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0xea37
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xe86c
leaq 0x80(%rbx), %r14
leaq 0x2024(%rip), %rsi      # 0x109f0
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x20f3(%rip), %rsi      # 0x10ad9
movq %r14, %rdi
callq 0x3230
leaq 0x20(%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x1f3c(%rip), %rsi      # 0x1094b
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3210
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x32d0
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x4, -0x180(%rbp,%rax)
pushq $0x30
popq %rsi
movq %r15, %rdi
callq 0x3360
movq %rax, %rdi
movl %r14d, %esi
callq 0x33d0
leaq -0x188(%rbp), %rsi
movq %rbx, %rdi
callq 0x3370
movq 0x8(%rbx), %rdx
cmpq $0x5, %rdx
jb 0xeaad
addq $-0x4, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x30a0
leaq -0x190(%rbp), %rdi
callq 0x30c0
movq %rbx, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3140
jmp 0xeada
movq %rax, %r14
leaq -0x190(%rbp), %rdi
callq 0x30c0
movq %r14, %rdi
callq 0x33e0
// File: /workspace/github_cpp_makefile_star2_O2/taurheim[P]AgNES/codeGenerator.cpp
// Function: CodeGenerator::allocateStackSpace(int)
void CodeGenerator::allocateStackSpace(int size) {
    if (size == 0) return;
    // SBC: A = A - M - (1 - C)
    loadConstIntoA(256 - size);
    code << "CLC" << nl;
    code << "ADC " << cSP << nl;
    code << "STA " << cSP << nl;
}

// Assembly:
testl %esi, %esi
je 0xeb8a
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x100, %eax            # imm = 0x100
subl %esi, %eax
movl %eax, %esi
callq 0xe86c
leaq 0x80(%rbx), %r14
leaq 0x1ed1(%rip), %rsi      # 0x109f0
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x1fa0(%rip), %rsi      # 0x10ad9
movq %r14, %rdi
callq 0x3230
leaq 0x20(%rbx), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3210
leaq 0x1de9(%rip), %rsi      # 0x1094b
movq %r14, %rdi
callq 0x3230
movq %rax, %rdi
movq %r15, %rsi
callq 0x3210
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3210
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]DrLink/analyze_molecule.cpp
// Function: decipher_cigar(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int decipher_cigar(string cigar)
{
    // CIGAR alphabet: M I D N S H P; * = X: 23S23M1D8M1I16M1D29M
    char *cstr = (char*)cigar.c_str();
    string numstr("");
    int covlen = 0;
    for (int i=0; i<cigar.size(); i++)
    {
        if(cstr[i]>='0' && cstr[i]<='9')
        {
            numstr += cstr[i];
        }
        else
        if(cstr[i] == 'M' || cstr[i] == 'I'|| cstr[i] == 'D'|| cstr[i] == 'N'|| 
           cstr[i] == 'S' || cstr[i] == 'H'|| cstr[i] == 'P')
        {
            if(cstr[i] == 'M' || cstr[i] == 'D')
            {
                covlen += atoi(numstr.c_str());
            }
            numstr.clear();
        }
    }    
    return covlen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %r15
leaq 0x252e2(%rip), %rsi     # 0x2db1a
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %rdx
movq %r14, %rdi
callq 0x4d3e
xorl %r12d, %r12d
movl $0x9430, %r13d          # imm = 0x9430
xorl %ebp, %ebp
cmpq %r12, 0x8(%rbx)
jbe 0x88ac
movzbl (%r15,%r12), %eax
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x8875
movsbl %al, %esi
movq %r14, %rdi
callq 0x42c0
jmp 0x88a7
addl $-0x44, %eax
cmpl $0xf, %eax
ja 0x88a7
btl %eax, %r13d
jb 0x8899
movl $0x201, %ecx            # imm = 0x201
btl %eax, %ecx
jae 0x88a7
movq 0x8(%rsp), %rdi
callq 0x44c0
addl %eax, %ebp
andq $0x0, 0x10(%rsp)
movq 0x8(%rsp), %rax
movb $0x0, (%rax)
incq %r12
jmp 0x8855
leaq 0x8(%rsp), %rdi
callq 0x4638
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4638
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]DrLink/detect_recombsite.cpp
// Function: output_real_molecule_len_distribution(std::map<int, unsigned long, std::less<int>, std::allocator<std::pair<int const, unsigned long>>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool output_real_molecule_len_distribution(map<int, unsigned long> molecule_len_control, string outPrefix)
{
    // all "real" molecule passing checkings on ML, RN and HET
    // among which COs were reported.
    string outMLenFile = outPrefix + "_realMoLen_stat.txt";    
    ofstream ofp;
    ofp.open(outMLenFile.c_str(), ios::out);
    if(!ofp.good())
    {
        cout << "   Error: cannot open " << outMLenFile << " to write data. " << endl;
        return false;
    }
    map<int, unsigned long>::iterator mlitr;
    map<int, unsigned long>::iterator mlitr_end;
    mlitr     = molecule_len_control.begin();
    mlitr_end = molecule_len_control.end();
    ofp << "#molecule_len_kb\tmolecule_num_in_bin" << endl;
    while(mlitr != mlitr_end)
    {
        ofp << (*mlitr).first  << "\t" 
            << (*mlitr).second << endl;
        mlitr ++;
    }
    ofp.close(); 
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
leaq 0x16ce6(%rip), %rdx     # 0x2b571
movq %rsp, %rdi
callq 0x95e2
leaq 0x20(%rsp), %rdi
callq 0x4570
movq (%rsp), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x4050
movq 0x20(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x40(%rsp,%rax), %ebp
testl %ebp, %ebp
je 0x148f6
movq 0x28702(%rip), %rdi     # 0x3cfc8
leaq 0x1524b(%rip), %rsi     # 0x29b18
callq 0x4330
movq %rsp, %rsi
movq %rax, %rdi
callq 0x42e0
leaq 0x155e8(%rip), %rsi     # 0x29ecc
movq %rax, %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
jmp 0x1496a
movq 0x18(%rbx), %r14
leaq 0x16c84(%rip), %rsi     # 0x2b585
leaq 0x20(%rsp), %rdi
callq 0x4330
movq %rax, %rdi
callq 0x41c0
addq $0x8, %rbx
leaq 0x20(%rsp), %r15
leaq 0x191f6(%rip), %r12     # 0x2db19
cmpq %rbx, %r14
je 0x14960
movl 0x20(%r14), %esi
movq %r15, %rdi
callq 0x4580
movq %rax, %rdi
movq %r12, %rsi
callq 0x4330
movq 0x28(%r14), %rsi
movq %rax, %rdi
callq 0x4230
movq %rax, %rdi
callq 0x41c0
movq %r14, %rdi
callq 0x4240
movq %rax, %r14
jmp 0x14923
leaq 0x20(%rsp), %rdi
callq 0x4430
testl %ebp, %ebp
sete %bl
leaq 0x20(%rsp), %rdi
callq 0x4480
movq %rsp, %rdi
callq 0x4638
movl %ebx, %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x149a9
jmp 0x1499c
jmp 0x1499c
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4480
movq %rsp, %rdi
callq 0x4638
movq %rbx, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]DrLink/detect_recombsite.cpp
// Function: check_candidate_cosite(std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::pair<unsigned long, unsigned long>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::pair<unsigned long, unsigned long>>>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned long, unsigned long)
bool check_candidate_cosite(multimap<string, std::pair<unsigned long, unsigned long> >* badMolecule,
                            string mkey,
                            unsigned long mstart,
                            unsigned long mend)
{
    bool passchecking = true; // if not in bad molecule set, passing checking
    std::pair <multimap<string, std::pair<unsigned long, unsigned long> >::iterator, 
               multimap<string, std::pair<unsigned long, unsigned long> >::iterator> clitr_region;
    clitr_region = (*badMolecule).equal_range(mkey);
    multimap<string, std::pair<unsigned long, unsigned long> >::iterator clitr;
    for (clitr=clitr_region.first; clitr!=clitr_region.second; ++clitr)
    {
        std::pair<unsigned long, unsigned long> span = (*clitr).second;
        if( (mstart>=span.first && mstart<=span.second) ||
            (mend>=span.first   && mend<=span.second) )
        {
            // caution: might be too stringent here: check overlapping size then?
            passchecking = false;
            break;
        }
    }
    return passchecking; 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
callq 0x178a2
movq %rdx, %r15
cmpq %r15, %rax
je 0x14b93
movq 0x40(%rax), %rdx
movq 0x48(%rax), %rcx
cmpq %r14, %rdx
seta %sil
cmpq %r14, %rcx
setb %dil
orb %sil, %dil
cmpb $0x1, %dil
jne 0x14b93
cmpq %rbx, %rdx
seta %dl
cmpq %rbx, %rcx
setb %cl
orb %dl, %cl
cmpb $0x1, %cl
jne 0x14b93
movq %rax, %rdi
callq 0x4240
jmp 0x14b52
cmpq %r15, %rax
sete %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]DrLink/detect_recombsite.cpp
// Function: get_chr_num_ii(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int get_chr_num_ii(string marker_file)
{
    // here we get the number of chrs in the given marker list
    ifstream ifp;
    if(!ifp.good() )
    {
        cout << "   warning: file not found. " << endl;
        return 0;
    }
    map<string, int> chrs;
    while(ifp.good())
    {
        string line("");
        getline(ifp, line);
        if(line.size()==0 || line[0]=='#') continue;
        vector<string> lineinfo = split_string(line, '\t');
        string chrid = lineinfo[1];
        if(chrs.find(chrid) ==chrs.end() )
        {
           chrs.insert(std::pair<string, int>(chrid, 1) );
        }
    }
    return chrs.size();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0x4380
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xd0(%rsp,%rax)
je 0x1549a
movq 0x27b49(%rip), %rdi     # 0x3cfc8
leaq 0x17775(%rip), %rsi     # 0x2cbfb
callq 0x4330
xorl %ebx, %ebx
movq %rax, %rdi
callq 0x41c0
jmp 0x155ac
leaq 0x40(%rsp), %rcx
andl $0x0, (%rcx)
andq $0x0, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
andq $0x0, 0x20(%rcx)
leaq 0x1865f(%rip), %rbx     # 0x2db1a
leaq 0x18(%rsp), %r14
leaq 0x68(%rsp), %r15
leaq 0xb0(%rsp), %r12
movq %rsp, %r13
leaq 0x90(%rsp), %rbp
cmpl $0x0, 0xd0(%rsp,%rax)
jne 0x1559f
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4d3e
movq %r12, %rdi
movq %r14, %rsi
callq 0x4090
cmpq $0x0, 0x20(%rsp)
je 0x15586
movq 0x18(%rsp), %rax
cmpb $0x23, (%rax)
je 0x15586
movb $0x9, 0x68(%rsp)
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x26120
movq (%rsp), %rsi
addq $0x20, %rsi
movq %rbp, %rdi
callq 0x4400
leaq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0xa992
leaq 0x40(%rsp), %rcx
cmpq %rcx, %rax
jne 0x15576
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4400
movl $0x1, 0x88(%rsp)
leaq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0xaa08
movq %r15, %rdi
callq 0x4638
movq %rbp, %rdi
callq 0x4638
movq %r13, %rdi
callq 0x5d02
movq %r14, %rdi
callq 0x4638
movq 0xb0(%rsp), %rax
movq -0x18(%rax), %rax
jmp 0x154d8
leaq 0x38(%rsp), %rdi
movl 0x28(%rdi), %ebx
callq 0xa004
leaq 0xb0(%rsp), %rdi
callq 0x40d0
movl %ebx, %eax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x15620
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x4638
jmp 0x155e6
jmp 0x155e3
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x4638
jmp 0x155fa
jmp 0x15604
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5d02
jmp 0x15607
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x4638
jmp 0x15616
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xa004
leaq 0xb0(%rsp), %rdi
callq 0x40d0
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]DrLink/find_intersection.cpp
// Function: get_CO_reads(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>*)
bool get_CO_reads(string coreadfile, map<string, int>* reads)
{
    ifstream ifp;
    ifp.open(coreadfile.c_str(), ios::in);
    if(!ifp.is_open())
    {
        cout << "   Error: cannot find file " << coreadfile << endl;
        return false;
    }
    while(ifp.good())
    {
        string line("");
        getline(ifp, line);
        if(line.size()==0 || line[0]=='#') continue;
        //00000000	0	1109895	1110045	2	J00137:120:HNWTCBBXX:2:1112:28970:19021	151M
        vector<string> lineinfo = split_string(line, '\t');
        (*reads).insert(std::pair<string, int>(lineinfo[5], 1));
    }
    ifp.close();
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x70(%rsp), %r15
movq %r15, %rdi
callq 0x4380
movq (%rbx), %rsi
pushq $0x8
popq %rdx
movq %r15, %rdi
callq 0x4200
leaq 0xe8(%rsp), %rdi
callq 0x40c0
movb %al, 0xf(%rsp)
testb %al, %al
je 0x19fbb
leaq 0x13c0d(%rip), %r15     # 0x2db1a
leaq 0x28(%rsp), %r12
leaq 0x48(%rsp), %r13
leaq 0x70(%rsp), %rbp
leaq 0x10(%rsp), %rbx
movq 0x70(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x90(%rsp,%rax)
jne 0x19fe3
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x4d3e
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4090
cmpq $0x0, 0x30(%rsp)
je 0x19fae
movq 0x28(%rsp), %rax
cmpb $0x23, (%rax)
je 0x19fae
movb $0x9, 0x48(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x26120
movq 0x10(%rsp), %rsi
movl $0xa0, %eax
addq %rax, %rsi
movq %r13, %rdi
callq 0x4400
movl $0x1, 0x68(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xaa08
movq %r13, %rdi
callq 0x4638
movq %rbx, %rdi
callq 0x5d02
movq %r12, %rdi
callq 0x4638
jmp 0x19f21
movq 0x23006(%rip), %rdi     # 0x3cfc8
leaq 0x12f28(%rip), %rsi     # 0x2cef1
callq 0x4330
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42e0
movq %rax, %rdi
callq 0x41c0
jmp 0x19fed
leaq 0x70(%rsp), %rdi
callq 0x40a0
leaq 0x70(%rsp), %rdi
callq 0x40d0
movb 0xf(%rsp), %al
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a02f
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x4638
jmp 0x1a021
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5d02
jmp 0x1a037
jmp 0x1a034
movq %rax, %rbx
jmp 0x1a041
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4638
leaq 0x70(%rsp), %rdi
callq 0x40d0
movq %rbx, %rdi
callq 0x45a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/schneebergerlab[P]DrLink/separate_chr_v2.cpp
// Function: gen_random(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, int)
bool gen_random(string* str, const int len) {
    // from stackoverflow
    static const char alphanum[] =
        "0123456789"
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        "abcdefghijklmnopqrstuvwxyz";
    for (int i = 0; i < len; ++i) {
        (*str) += alphanum[rand() % (sizeof(alphanum) - 1)];
    }
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %ebx
pushq $0x3e
popq %r15
leaq 0x7fcb(%rip), %r12      # 0x2deb0
subl $0x1, %ebx
jb 0x25f05
callq 0x40f0
cltq
xorl %edx, %edx
divq %r15
movsbl (%rdx,%r12), %esi
movq %r14, %rdi
callq 0x42c0
jmp 0x25ee5
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/ArashPartow[P]exprtk-extras/./exprtk.hpp
// Function: bool exprtk::collect_variables<double, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::deque>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, exprtk::symbol_table<double>&, std::deque<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>>>>&)
inline bool collect_variables(const std::string& expression,
                                 exprtk::symbol_table<T>& extrnl_symbol_table,
                                 Sequence<std::string, Allocator>& symbol_list)
   {
      typedef details::collector_helper<T> collect_t;

      std::set<std::string> symbol_set;

      const bool variable_pass = collect_t::collection_pass
                                    (expression, symbol_set, true, false, false, extrnl_symbol_table);
      const bool vector_pass   = collect_t::collection_pass
                                    (expression, symbol_set, true, false,  true, extrnl_symbol_table);

      if (!variable_pass && !vector_pass)
         return false;

      std::set<std::string>::iterator itr = symbol_set.begin();

      while (symbol_set.end() != itr)
      {
         symbol_list.push_back(*itr);
         ++itr;
      }

      return true;
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r12
andl $0x0, (%r12)
andq $0x0, 0x8(%r12)
movq %r12, 0x10(%r12)
movq %r12, 0x18(%r12)
andq $0x0, 0x20(%r12)
movq %rsp, %rsi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r14, %r9
callq 0x11227c
movl %eax, %ebp
movq %rsp, %rsi
pushq $0x1
popq %rdx
movq %r15, %rdi
xorl %ecx, %ecx
movl %edx, %r8d
movq %r14, %r9
callq 0x11227c
orb %al, %bpl
je 0x110714
movq 0x18(%rsp), %r14
cmpq %r14, %r12
je 0x110714
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x112450
movq %r14, %rdi
callq 0x10e480
movq %rax, %r14
jmp 0x1106f6
movq %rsp, %rdi
callq 0x110e86
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11072f
jmp 0x11072f
movq %rax, %rbx
movq %rsp, %rdi
callq 0x110e86
movq %rbx, %rdi
callq 0x10e310