// File: taurheim[P]AgNES/./util/astUtil.h
// Function: printNode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, ASTNode*)
static void printNode(std::string indent, bool last, ASTNode * node) {
    std::string nodeString;
    switch(node->nodeType) {
        case AST_IDENTIFIER: {
            IdentifierNode * identifier = static_cast<IdentifierNode*>(node);
            nodeString = "Identifier: ";
            nodeString.append(identifier->name);
            break;
        }
        case AST_TYPE: {
            TypeNode * type = static_cast<TypeNode*>(node);
            nodeString = "Type: ";
            auto search = varTypeToString.find(type->varType);
            if (search != varTypeToString.end()) {
                nodeString.append(search->second);
            } else {
                nodeString.append("ASTUTIL::TYPE_NOT_FOUND");
            }
            break;
        }
        case AST_OPERATOR: {
            OpNode * op = static_cast<OpNode*>(node);
            nodeString = "Operator: ";
            nodeString.append(op->operation);
            break;
        }
        case AST_STATEMENT: {
            StatementNode * statement = static_cast<StatementNode*>(node);
            nodeString = "Statement (type: ";
            nodeString.append(statementTypeToString[statement->type]);
            nodeString.append(")");
            break;
        }
        case AST_NUMBER: {
            NumberNode * number = static_cast<NumberNode*>(node);
            nodeString = "Number: ";
            nodeString.append(std::to_string(number->value));
            break;
        }
        case AST_CHAR: {
            CharNode * charNode = static_cast<CharNode*>(node);
            nodeString = "Char: ";
            nodeString.append(std::string(1,charNode->value));
            break;
        }
        default: {
            auto search = nodeTypeToString.find(node->nodeType);
            if (search != nodeTypeToString.end()) {
                nodeString = search->second;
            } else {
                nodeString = "NOTFOUND";
            }
        }
    }

    std::cout << indent;

    if (last) {
        std::cout << "\\-";
        indent.append(" ");
    } else {
        std::cout << "|-";
        indent.append("| ");
    }

    std::cout << nodeString << std::endl;

    for(auto it = node->children.begin(); it != node->children.end(); ++it ){
        bool isLast = std::next(it) == node->children.end();
        printNode(indent, isLast, *it);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x140(%rbp)
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3410
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl $-0x4, %eax
movl %eax, %ecx
movq %rcx, -0x138(%rbp)
subl $0xe, %eax
ja 0x13413
movq -0x138(%rbp), %rax
leaq 0x11254(%rip), %rcx     # 0x243b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x113f6(%rip), %rsi     # 0x24572
leaq -0x38(%rbp), %rdi
callq 0x33e0
jmp 0x13187
movq -0x40(%rbp), %rsi
addq $0x20, %rsi
leaq -0x38(%rbp), %rdi
callq 0x35a0
jmp 0x1319a
jmp 0x1349c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x13675
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0x113c0(%rip), %rsi     # 0x2457f
leaq -0x38(%rbp), %rdi
callq 0x33e0
jmp 0x131ca
movq -0x58(%rbp), %rsi
addq $0x20, %rsi
leaq 0x22267(%rip), %rdi     # 0x35440
callq 0x14b00
movq %rax, -0x148(%rbp)
jmp 0x131e7
movq -0x148(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq 0x22247(%rip), %rdi     # 0x35440
callq 0x14b60
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x14b30
testb $0x1, %al
jne 0x13215
jmp 0x13232
leaq -0x60(%rbp), %rdi
callq 0x14b90
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x38(%rbp), %rdi
callq 0x35a0
jmp 0x13230
jmp 0x13246
leaq 0x1134d(%rip), %rsi     # 0x24586
leaq -0x38(%rbp), %rdi
callq 0x3590
jmp 0x13244
jmp 0x13246
jmp 0x1349c
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0x11344(%rip), %rsi     # 0x2459e
leaq -0x38(%rbp), %rdi
callq 0x33e0
jmp 0x13265
movq -0x70(%rbp), %rsi
addq $0x20, %rsi
leaq -0x38(%rbp), %rdi
callq 0x35a0
jmp 0x13278
jmp 0x1349c
movq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq 0x1131d(%rip), %rsi     # 0x245a9
leaq -0x38(%rbp), %rdi
callq 0x33e0
jmp 0x13297
movq -0x78(%rbp), %rsi
addq $0x20, %rsi
leaq 0x2222a(%rip), %rdi     # 0x354d0
callq 0x14bb0
movq %rax, -0x150(%rbp)
jmp 0x132b4
movq -0x150(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x35a0
jmp 0x132c6
leaq 0x11039(%rip), %rsi     # 0x24306
leaq -0x38(%rbp), %rdi
callq 0x3590
jmp 0x132d8
jmp 0x1349c
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0x112cf(%rip), %rsi     # 0x245bb
leaq -0x38(%rbp), %rdi
callq 0x33e0
jmp 0x132f7
movq -0x80(%rbp), %rax
movl 0x20(%rax), %esi
leaq -0xa0(%rbp), %rdi
callq 0x14c90
jmp 0x1330c
leaq -0x38(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x35a0
jmp 0x1331e
leaq -0xa0(%rbp), %rdi
callq 0x31d0
jmp 0x1349c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x31d0
jmp 0x13675
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq 0x11266(%rip), %rsi     # 0x245c4
leaq -0x38(%rbp), %rdi
callq 0x33e0
jmp 0x13369
movq -0xa8(%rbp), %rax
movsbl 0x20(%rax), %eax
movl %eax, -0x15c(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x3530
movl -0x15c(%rbp), %edx
movq -0x158(%rbp), %rcx
leaq -0xc8(%rbp), %rdi
movl $0x1, %esi
callq 0x31f0
jmp 0x133ad
leaq -0x38(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x35a0
jmp 0x133bf
leaq -0xc8(%rbp), %rdi
callq 0x31d0
leaq -0xc9(%rbp), %rdi
callq 0x3350
jmp 0x1349c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x13402
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x31d0
leaq -0xc9(%rbp), %rdi
callq 0x3350
jmp 0x13675
movq -0x18(%rbp), %rsi
leaq 0x22082(%rip), %rdi     # 0x354a0
callq 0x14db0
movq %rax, -0x168(%rbp)
jmp 0x1342c
movq -0x168(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq 0x2205f(%rip), %rdi     # 0x354a0
callq 0x14e10
movq %rax, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x14de0
testb $0x1, %al
jne 0x13466
jmp 0x13486
leaq -0xd8(%rbp), %rdi
callq 0x14e40
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x38(%rbp), %rdi
callq 0x3040
jmp 0x13484
jmp 0x1349a
leaq 0x1106f(%rip), %rsi     # 0x244fc
leaq -0x38(%rbp), %rdi
callq 0x33e0
jmp 0x13498
jmp 0x1349a
jmp 0x1349c
movq -0x140(%rbp), %rsi
movq 0x21b1e(%rip), %rdi     # 0x34fc8
callq 0x32a0
jmp 0x134b1
testb $0x1, -0x9(%rbp)
je 0x134e3
movq 0x21b0a(%rip), %rdi     # 0x34fc8
leaq 0x11106(%rip), %rsi     # 0x245cb
callq 0x32e0
jmp 0x134cc
movq -0x140(%rbp), %rdi
leaq 0x1144c(%rip), %rsi     # 0x24926
callq 0x3590
jmp 0x134e1
jmp 0x1350f
movq 0x21ade(%rip), %rdi     # 0x34fc8
leaq 0x110dd(%rip), %rsi     # 0x245ce
callq 0x32e0
jmp 0x134f8
movq -0x140(%rbp), %rdi
leaq 0x110cb(%rip), %rsi     # 0x245d1
callq 0x3590
jmp 0x1350d
jmp 0x1350f
movq 0x21ab2(%rip), %rdi     # 0x34fc8
leaq -0x38(%rbp), %rsi
callq 0x32a0
movq %rax, -0x170(%rbp)
jmp 0x13528
movq -0x170(%rbp), %rdi
movq 0x21a82(%rip), %rsi     # 0x34fb8
callq 0x3330
jmp 0x1353d
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x14e60
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x14ed0
movq %rax, -0xf0(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x14e90
testb $0x1, %al
jne 0x13581
jmp 0x13663
movq -0xe8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
movl $0x1, %esi
callq 0x14f40
movq %rax, -0x178(%rbp)
jmp 0x135a9
movq -0x178(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x14ed0
movq %rax, -0x110(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x14f00
movq -0x140(%rbp), %rsi
movb %al, -0xf1(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x3140
jmp 0x135f9
movzbl -0xf1(%rbp), %eax
movl %eax, -0x17c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x14f70
movl -0x17c(%rbp), %esi
movq (%rax), %rdx
andl $0x1, %esi
leaq -0x130(%rbp), %rdi
callq 0x13110
jmp 0x1362c
leaq -0x130(%rbp), %rdi
callq 0x31d0
leaq -0xe8(%rbp), %rdi
callq 0x14f90
jmp 0x13551
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x31d0
jmp 0x13675
leaq -0x38(%rbp), %rdi
callq 0x31d0
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x31d0
movq -0x48(%rbp), %rdi
callq 0x3520
nopw (%rax,%rax)