// File: /workspace/github_cpp_makefile_star2_O1/adamiaonr[P]rid-analytics/src/graph.cpp
// Function: Graph::add_node(Node*, int, Node*, int, int, double)
void Graph::add_node(
    Node * prev_node, int prev_depth, 
    Node * next_node, int next_depth,
    int breadth,
    double prob_val) {

    // don't add nodes which are impossible to reach...
    //if (prob_val == 0.0) return;

    char node_str[MAX_STRING_SIZE];
    char edge_str[MAX_STRING_SIZE];

    // 1) node declaration, i.e. variable name, label, color, etc.
    get_node_str(node_str, next_node, next_depth, breadth);
    this->graph_filestream << "\t" + std::string(node_str);

    // 2) edge connecting it from parent
    get_edge_str(edge_str, prev_node, prev_depth, next_node, next_depth, breadth, prob_val);
    this->graph_filestream << "\t" + std::string(edge_str) + "\n";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movsd %xmm0, 0x48(%rsp)
movl %r9d, %ebp
movq %rcx, %r14
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
leaq 0xf0(%rsp), %r13
movq %r13, %rdi
movq %rcx, %rsi
movl %r8d, %edx
movl %r9d, %ecx
callq 0x1a76b
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, %rdi
callq 0x41b0
leaq (%rsp,%rax), %rdx
addq $0xf0, %rdx
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0x19074
leaq 0x158eb(%rip), %rcx     # 0x316f6
leaq 0x28(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x43f0
addq $0x20, %rbx
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1be4a
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1be52
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x4400
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1be93
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1beaf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movl %r15d, %edx
movq %r14, %rcx
movl %ebp, %r9d
movsd 0x48(%rsp), %xmm0
callq 0x1b3e0
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq %r13, %rdi
callq 0x41b0
leaq (%rsp,%rax), %rdx
addq $0x70, %rdx
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x19074
leaq 0x157fb(%rip), %rcx     # 0x316f6
leaq 0x50(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x43f0
leaq 0x38(%rsp), %r15
movq %r15, 0x28(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x18(%rsp), %r12
je 0x1bf3c
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x1bf43
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1574c(%rip), %rsi     # 0x316b2
callq 0x4760
movq %r12, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1bf8e
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1bf96
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x4400
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1bfd7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bfee
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x1c005
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x43a0
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1c036
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1c036
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1c057
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1c057
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x1c0aa
movq 0x60(%rsp), %rsi
jmp 0x1c09d
jmp 0x1c0a7
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1c089
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1c089
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1c0aa
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1c0aa
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4700