// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebx
movq %rdi, -0x58(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rdx, -0x30(%rbp)
movl (%rdx), %eax
leal -0x4(%rax), %ecx
cmpl $0xe, %ecx
ja 0xa169
leaq 0x82e0(%rip), %rdx      # 0x12320
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x8485(%rip), %rcx      # 0x124d5
leaq -0x50(%rbp), %rdi
movl $0xc, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
leaq -0x50(%rbp), %rdi
callq 0x30f0
jmp 0xa367
leaq 0x845e(%rip), %rcx      # 0x124e2
leaq -0x50(%rbp), %rdi
movl $0x6, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
movq 0xe302(%rip), %rdx      # 0x183a0
leaq 0xe2f3(%rip), %rax      # 0x18398
movq %rax, %rcx
testq %rdx, %rdx
je 0xa0d2
movq -0x30(%rbp), %rcx
movl 0x20(%rcx), %esi
leaq 0xe2dd(%rip), %rcx      # 0x18398
xorl %edi, %edi
cmpl %esi, 0x20(%rdx)
setl %dil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rdi,8), %rdx
testq %rdx, %rdx
jne 0xa0bb
movq %rax, %rdx
cmpq %rax, %rcx
je 0xa0ef
movq -0x30(%rbp), %rdx
movl 0x20(%rdx), %edx
cmpl 0x20(%rcx), %edx
leaq 0xe2ad(%rip), %rdx      # 0x18398
cmovgeq %rcx, %rdx
cmpq %rax, %rdx
je 0xa2fd
movq 0x28(%rdx), %rsi
movq 0x30(%rdx), %rdx
leaq -0x50(%rbp), %rdi
callq 0x30f0
jmp 0xa367
leaq 0x8412(%rip), %rcx      # 0x12527
leaq -0x50(%rbp), %rdi
movl $0x6, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
movq -0x30(%rbp), %rax
movsbl 0x20(%rax), %edx
leaq -0x68(%rbp), %r15
movq %r15, -0x10(%r15)
leaq -0x78(%rbp), %rdi
movl $0x1, %esi
callq 0x32e0
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x30f0
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
jne 0xa362
jmp 0xa367
movq 0xe290(%rip), %rsi      # 0x18400
leaq 0xe281(%rip), %rcx      # 0x183f8
movq %rcx, %rdx
testq %rsi, %rsi
je 0xa19d
leaq 0xe272(%rip), %rdx      # 0x183f8
xorl %edi, %edi
cmpl %eax, 0x20(%rsi)
setl %dil
cmovgeq %rsi, %rdx
movq 0x10(%rsi,%rdi,8), %rsi
testq %rsi, %rsi
jne 0xa186
movq %rcx, %rsi
cmpq %rcx, %rdx
je 0xa1b3
cmpl 0x20(%rdx), %eax
leaq 0xe249(%rip), %rsi      # 0x183f8
cmovgeq %rdx, %rsi
cmpq %rcx, %rsi
je 0xa2e1
addq $0x28, %rsi
leaq -0x50(%rbp), %rdi
callq 0x3180
jmp 0xa367
leaq 0x8349(%rip), %rcx      # 0x1251e
leaq -0x50(%rbp), %rdi
movl $0x8, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
movq -0x30(%rbp), %rax
movl 0x20(%rax), %r12d
movl %r12d, %r13d
negl %r13d
cmovsl %r12d, %r13d
movl $0x1, %r15d
cmpl $0xa, %r13d
jb 0xa318
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r13d, %ecx
cmpl $0x63, %ecx
jbe 0xa30f
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xa315
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xa318
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xa218
addl $-0x3, %r15d
jmp 0xa318
leaq 0x82ab(%rip), %rcx      # 0x1250c
leaq -0x50(%rbp), %rdi
movl $0x11, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
movq -0x30(%rbp), %rax
leaq 0x20(%rax), %rsi
leaq 0xe19d(%rip), %rdi      # 0x18420
callq 0xa73a
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq -0x50(%rbp), %rdi
callq 0x30f0
leaq 0x8062(%rip), %rsi      # 0x12301
leaq -0x50(%rbp), %rdi
callq 0x3460
jmp 0xa367
leaq 0x824d(%rip), %rcx      # 0x12501
leaq -0x50(%rbp), %rdi
movl $0xa, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
leaq -0x50(%rbp), %rdi
callq 0x30f0
jmp 0xa367
leaq 0x8175(%rip), %rcx      # 0x1245d
leaq -0x50(%rbp), %rdi
movl $0x8, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3390
jmp 0xa367
leaq 0x81e5(%rip), %rsi      # 0x124e9
leaq -0x50(%rbp), %rdi
callq 0x3460
jmp 0xa367
addl $-0x2, %r15d
jmp 0xa318
decl %r15d
shrl $0x1f, %r12d
leal (%r15,%r12), %esi
leaq -0x68(%rbp), %r14
movq %r14, -0x10(%r14)
leaq -0x78(%rbp), %rdi
movl $0x2d, %edx
callq 0x32e0
addq -0x78(%rbp), %r12
movq %r12, %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0xa9d4
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x30f0
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0xa367
callq 0x3250
movq -0x58(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0xdc57(%rip), %rdi      # 0x17fd0
callq 0x32d0
testb %bl, %bl
je 0xa3a3
movq 0xdc47(%rip), %rdi      # 0x17fd0
leaq 0x819e(%rip), %rsi      # 0x1252e
movl $0x2, %edx
callq 0x32d0
leaq 0x84b1(%rip), %rsi      # 0x12852
jmp 0xa3c2
movq 0xdc26(%rip), %rdi      # 0x17fd0
leaq 0x8180(%rip), %rsi      # 0x12531
movl $0x2, %edx
callq 0x32d0
leaq 0x8172(%rip), %rsi      # 0x12534
movq -0x58(%rbp), %rdi
callq 0x3460
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0xdbf6(%rip), %rdi      # 0x17fd0
callq 0x32d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31a0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r14
movq 0x10(%rax), %r13
cmpq %r13, %r14
je 0xa47e
leaq -0x88(%rbp), %r12
leaq -0x98(%rbp), %r15
movq %r12, -0x98(%rbp)
movq -0x58(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x6992
leaq 0x8(%r14), %rbx
xorl %esi, %esi
cmpq %r13, %rbx
sete %sil
movq (%r14), %rdx
movq %r15, %rdi
callq 0x9ffd
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0xa46e
callq 0x3250
movq -0x30(%rbp), %rax
movq 0x10(%rax), %r13
movq %rbx, %r14
cmpq %r13, %rbx
jne 0xa428
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xa490
callq 0x3250
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
jne 0xa4e5
jmp 0xa4ea
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
jne 0xa4e5
jmp 0xa4ea
jmp 0xa4d1
jmp 0xa4d1
jmp 0xa4d1
jmp 0xa4d1
jmp 0xa4d1
jmp 0xa4d1
jmp 0xa4d1
jmp 0xa4d1
jmp 0xa4d1
jmp 0xa4d1
jmp 0xa4d1
movq %rax, %rbx
jmp 0xa4ea
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0xa4ea
callq 0x3250
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xa4fc
callq 0x3250
movq %rbx, %rdi
callq 0x3420