// File: adamiaonr[P]rid-analytics/src/graph.cpp
// Function: get_node_str(char*, Node*, int, int)
void get_node_str(char * node_str, Node * node, int depth, int breadth) {

    std::string output;

    int node_type_int = get_node_type_int(node);

    // varname
    output = NODE_CHARS[node_type_int] + std::to_string(depth) + std::to_string(3 * breadth + node_type_int);

    // FIXME: just to make it easier to add edges afterwards, use a unique 
    // id to identify each node and set it in the node directly...
    node->set_uid(output);

    // label
//    output += std::string("[label=\"") + NODE_CHARS[node_type_int] + std::to_string(depth) + std::to_string(breadth) + "\"";
//    output += std::string("[label=\"") + node->get_uid() + "\"";
    output += std::string("[label=\"") + NODE_CHARS[node_type_int] + "(" 
        + std::to_string(node->get_curr_tier()) + ":"
        + (node->get_next_tier() == END_OF_PATH ? "EOP" : std::to_string(node->get_next_tier())) 
        + ")" "\"";
    // color
    output += std::string(", color=") + GRAPHVIZ_COLORS[node_type_int];

    // wrap it up
    output += "];\n";

    snprintf(node_str, MAX_STRING_SIZE, "%s", output.c_str());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x5730
movq -0x10(%rbp), %rdi
callq 0x30a10
movl %eax, -0x268(%rbp)
jmp 0x30ad3
movl -0x268(%rbp), %eax
movl %eax, -0x3c(%rbp)
movslq -0x3c(%rbp), %rcx
leaq 0x51ac9(%rip), %rax     # 0x825b0
movq (%rax,%rcx,8), %rax
movq %rax, -0x270(%rbp)
movl -0x14(%rbp), %esi
leaq -0xb0(%rbp), %rdi
callq 0x31bb0
jmp 0x30b03
movq -0x270(%rbp), %rsi
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x31a70
jmp 0x30b1f
movl -0x18(%rbp), %ecx
movl %ecx, %eax
leal (%rax,%rax,2), %esi
movl -0x3c(%rbp), %eax
addl %eax, %esi
leaq -0xd0(%rbp), %rdi
callq 0x31bb0
jmp 0x30b3a
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0x31ae0
jmp 0x30b53
leaq -0x38(%rbp), %rdi
movq %rdi, -0x280(%rbp)
leaq -0x70(%rbp), %rsi
movq %rsi, -0x288(%rbp)
callq 0x5600
movq -0x288(%rbp), %rdi
callq 0x52f0
leaq -0xd0(%rbp), %rdi
callq 0x52f0
leaq -0x90(%rbp), %rdi
callq 0x52f0
leaq -0xb0(%rbp), %rdi
callq 0x52f0
movq -0x280(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x278(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x51f0
jmp 0x30bbe
movq -0x278(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x31cd0
jmp 0x30bd3
leaq -0xf0(%rbp), %rdi
callq 0x52f0
leaq -0x1d1(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x5930
movq -0x290(%rbp), %rdx
leaq 0x328c5(%rip), %rsi     # 0x634c5
leaq -0x1d0(%rbp), %rdi
callq 0x30320
jmp 0x30c0e
movslq -0x3c(%rbp), %rcx
leaq 0x51997(%rip), %rax     # 0x825b0
movq (%rax,%rcx,8), %rdx
leaq -0x1b0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x31d00
jmp 0x30c32
leaq 0x33327(%rip), %rdx     # 0x63f60
leaq -0x190(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x31d00
jmp 0x30c4e
movq -0x10(%rbp), %rdi
callq 0x31d50
movl %eax, -0x294(%rbp)
jmp 0x30c5f
movl -0x294(%rbp), %esi
leaq -0x1f8(%rbp), %rdi
callq 0x31bb0
jmp 0x30c73
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
leaq -0x1f8(%rbp), %rdx
callq 0x31ae0
jmp 0x30c8f
leaq 0x32b49(%rip), %rdx     # 0x637df
leaq -0x150(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x31d00
jmp 0x30cab
movq -0x10(%rbp), %rdi
movb $0x0, -0x21a(%rbp)
callq 0x31d60
movl %eax, -0x298(%rbp)
jmp 0x30cc3
movl -0x298(%rbp), %eax
cmpl $-0x1, %eax
jne 0x30d06
leaq -0x219(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x5930
movq -0x2a0(%rbp), %rdx
movb $0x1, -0x21a(%rbp)
leaq 0x327d8(%rip), %rsi     # 0x634ce
leaq -0x218(%rbp), %rdi
callq 0x30320
jmp 0x30d04
jmp 0x30d2d
movq -0x10(%rbp), %rdi
callq 0x31d60
movl %eax, -0x2a4(%rbp)
jmp 0x30d17
movl -0x2a4(%rbp), %esi
leaq -0x218(%rbp), %rdi
callq 0x31bb0
jmp 0x30d2b
jmp 0x30d2d
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
leaq -0x218(%rbp), %rdx
callq 0x31ae0
jmp 0x30d49
leaq 0x32782(%rip), %rdx     # 0x634d2
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x31d00
jmp 0x30d65
leaq -0x38(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x5650
jmp 0x30d77
leaq -0x110(%rbp), %rdi
callq 0x52f0
leaq -0x130(%rbp), %rdi
callq 0x52f0
leaq -0x218(%rbp), %rdi
callq 0x52f0
testb $0x1, -0x21a(%rbp)
jne 0x30da6
jmp 0x30db2
leaq -0x219(%rbp), %rdi
callq 0x5510
leaq -0x150(%rbp), %rdi
callq 0x52f0
leaq -0x170(%rbp), %rdi
callq 0x52f0
leaq -0x1f8(%rbp), %rdi
callq 0x52f0
leaq -0x190(%rbp), %rdi
callq 0x52f0
leaq -0x1b0(%rbp), %rdi
callq 0x52f0
leaq -0x1d0(%rbp), %rdi
callq 0x52f0
leaq -0x1d1(%rbp), %rdi
callq 0x5510
leaq -0x261(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x5930
movq -0x2b0(%rbp), %rdx
leaq 0x326ae(%rip), %rsi     # 0x634d5
leaq -0x260(%rbp), %rdi
callq 0x30320
jmp 0x30e35
movslq -0x3c(%rbp), %rcx
leaq 0x51730(%rip), %rax     # 0x82570
movq (%rax,%rcx,8), %rdx
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x31d00
jmp 0x30e59
leaq -0x38(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x5650
jmp 0x30e6b
leaq -0x240(%rbp), %rdi
callq 0x52f0
leaq -0x260(%rbp), %rdi
callq 0x52f0
leaq -0x261(%rbp), %rdi
callq 0x5510
leaq 0x3266d(%rip), %rsi     # 0x63503
leaq -0x38(%rbp), %rdi
callq 0x5460
jmp 0x30ea1
movq -0x8(%rbp), %rax
movq %rax, -0x2b8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x51d0
movq -0x2b8(%rbp), %rdi
movq %rax, %rcx
movl $0x80, %esi
leaq 0x32613(%rip), %rdx     # 0x634de
movb $0x0, %al
callq 0x5830
leaq -0x38(%rbp), %rdi
callq 0x52f0
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x310ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x30f35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x30f29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x52f0
leaq -0x90(%rbp), %rdi
callq 0x52f0
leaq -0xb0(%rbp), %rdi
callq 0x52f0
jmp 0x310ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x52f0
jmp 0x310ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x31092
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x31086
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3107a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3106e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x31062
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x31056
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3104a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x31031
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x31025
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x31019
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x52f0
leaq -0x130(%rbp), %rdi
callq 0x52f0
leaq -0x218(%rbp), %rdi
callq 0x52f0
testb $0x1, -0x21a(%rbp)
jne 0x3103c
jmp 0x31048
leaq -0x219(%rbp), %rdi
callq 0x5510
jmp 0x3104a
leaq -0x150(%rbp), %rdi
callq 0x52f0
leaq -0x170(%rbp), %rdi
callq 0x52f0
leaq -0x1f8(%rbp), %rdi
callq 0x52f0
leaq -0x190(%rbp), %rdi
callq 0x52f0
leaq -0x1b0(%rbp), %rdi
callq 0x52f0
leaq -0x1d0(%rbp), %rdi
callq 0x52f0
leaq -0x1d1(%rbp), %rdi
callq 0x5510
jmp 0x310ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x310e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x310d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x52f0
leaq -0x260(%rbp), %rdi
callq 0x52f0
leaq -0x261(%rbp), %rdi
callq 0x5510
leaq -0x38(%rbp), %rdi
callq 0x52f0
movq -0x48(%rbp), %rdi
callq 0x5920
nop