// File: /workspace/github_cpp_makefile_star2_O3/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, %r12d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xf0(%rsp), %r13
movq %r13, %rdi
movq %rcx, %rsi
movl %r8d, %edx
movl %r9d, %ecx
callq 0x1a2bf
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r13, %rdi
callq 0x41b0
leaq (%rsp,%rax), %rdx
addq $0xf0, %rdx
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x18bc0
leaq 0x14b8d(%rip), %rcx     # 0x304d6
leaq 0x8(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x43f0
addq $0x20, %rbx
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b988
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x1b990
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x4400
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1b9d1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1b9ed
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x70(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movl %r12d, %edx
movq %r14, %rcx
movl %ebp, %r9d
movsd 0x48(%rsp), %xmm0
callq 0x1af25
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 0x18bc0
leaq 0x14a9d(%rip), %rcx     # 0x304d6
leaq 0x50(%rsp), %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x43f0
leaq 0x18(%rsp), %r12
movq %r12, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x38(%rsp), %r15
je 0x1ba7a
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1ba82
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x149ed(%rip), %rsi     # 0x30492
callq 0x4760
movq %r15, 0x28(%rsp)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x1bacd
movq %rsi, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x1bad7
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %r15, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
callq 0x4400
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bb0e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1bb25
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x1bb3c
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 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bb6d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bb6d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1bb8e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bb8e
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x1bbe1
movq 0x60(%rsp), %rsi
jmp 0x1bbd4
jmp 0x1bbde
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x1bbc0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bbc0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1bbe1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bbe1
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4700
nop