// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, -0x50(%rbp)
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl (%rdx), %eax
addl $-0x4, %eax
cmpl $0xe, %eax
ja 0x9411
leaq 0x6fba(%rip), %rcx      # 0x10324
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x7164(%rip), %rsi      # 0x104de
leaq -0x48(%rbp), %rdi
callq 0x3430
leaq 0x20(%rbx), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3440
jmp 0x94f8
leaq 0x714f(%rip), %rsi      # 0x104eb
leaq -0x48(%rbp), %rdi
callq 0x3430
leaq 0x20(%rbx), %rsi
leaq 0xefd0(%rip), %rdi      # 0x18380
callq 0x9b5c
leaq 0xefcc(%rip), %rcx      # 0x18388
cmpq %rcx, %rax
je 0x94e8
addq $0x28, %rax
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x3440
jmp 0x94f8
leaq 0x714f(%rip), %rsi      # 0x10530
leaq -0x48(%rbp), %rdi
callq 0x3430
movsbl 0x20(%rbx), %edx
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x70(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x3270
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3440
jmp 0x946e
leaq 0xefc8(%rip), %rdi      # 0x183e0
movq %rbx, %rsi
callq 0x9f12
leaq 0xefc1(%rip), %rcx      # 0x183e8
cmpq %rcx, %rax
je 0x94d6
addq $0x28, %rax
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x3180
jmp 0x94f8
leaq 0x70db(%rip), %rsi      # 0x10527
leaq -0x48(%rbp), %rdi
callq 0x3430
movl 0x20(%rbx), %esi
leaq -0x70(%rbp), %rdi
callq 0x9afb
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3440
leaq -0x70(%rbp), %rdi
callq 0x3140
jmp 0x94f8
leaq 0x7095(%rip), %rsi      # 0x10515
leaq -0x48(%rbp), %rdi
callq 0x3430
leaq 0x20(%rbx), %rsi
leaq 0xef7c(%rip), %rdi      # 0x18410
callq 0x9aaa
leaq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x3440
leaq 0x6e5a(%rip), %rsi      # 0x10306
leaq -0x48(%rbp), %rdi
callq 0x3420
jmp 0x94f8
leaq 0x704c(%rip), %rsi      # 0x1050a
leaq -0x48(%rbp), %rdi
callq 0x3430
leaq 0x20(%rbx), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3440
jmp 0x94f8
leaq 0x6f8b(%rip), %rsi      # 0x10468
leaq -0x48(%rbp), %rdi
callq 0x3430
jmp 0x94f8
leaq 0x7003(%rip), %rsi      # 0x104f2
leaq -0x48(%rbp), %rdi
callq 0x3420
movq 0xeac9(%rip), %rdi      # 0x17fc8
movq -0x50(%rbp), %rsi
callq 0x3210
testb %r15b, %r15b
je 0x9529
movq 0xeab4(%rip), %rdi      # 0x17fc8
leaq 0x701c(%rip), %rsi      # 0x10537
callq 0x3230
leaq 0x7333(%rip), %rsi      # 0x1085a
jmp 0x9543
movq 0xea98(%rip), %rdi      # 0x17fc8
leaq 0x7003(%rip), %rsi      # 0x1053a
callq 0x3230
leaq 0x6ffa(%rip), %rsi      # 0x1053d
movq -0x50(%rbp), %rdi
callq 0x3420
movq 0xea75(%rip), %rdi      # 0x17fc8
leaq -0x48(%rbp), %rsi
callq 0x3210
movq %rax, %rdi
callq 0x3150
movq 0x8(%rbx), %r12
leaq -0x90(%rbp), %r15
movq 0x10(%rbx), %r14
cmpq %r14, %r12
je 0x95ab
movq %r15, %rdi
movq -0x50(%rbp), %rsi
callq 0x32e0
leaq 0x8(%r12), %r13
xorl %esi, %esi
cmpq %r14, %r13
sete %sil
movq (%r12), %rdx
movq %r15, %rdi
callq 0x932a
movq %r15, %rdi
callq 0x3140
movq %r13, %r12
jmp 0x956f
leaq -0x48(%rbp), %rdi
callq 0x3140
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x95c5
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
jmp 0x95f3
jmp 0x95e4
jmp 0x95e4
jmp 0x95e4
jmp 0x95e4
jmp 0x95e4
jmp 0x95e4
jmp 0x95e4
jmp 0x95e4
jmp 0x95e4
jmp 0x95e4
jmp 0x95e4
movq %rax, %rbx
jmp 0x95f8
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x3140
leaq -0x48(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x33e0
nop