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

    std::string output;

    int prev_node_type_int = get_node_type_int(prev_node);
    //int next_node_type_int = get_node_type_int(next_node);

    // initial part of edge
    // output = NODE_CHARS[get_node_type_int(prev_node)] + std::to_string(prev_depth) + std::to_string((breadth / 1)) + " -> " 
    //     + NODE_CHARS[next_node_type_int] + std::to_string(next_depth) + std::to_string((breadth * 3 + next_node_type_int)); 
    if (prev_node_type_int == ORI_NODE_INT) {

        output = NODE_CHARS[prev_node_type_int] + std::to_string(prev_depth) + std::to_string((breadth / 1)) + " -> ";

    } else {

        output = prev_node->get_uid() + " -> ";
    }
    
    output += next_node->get_uid();

    // printf("Graph::get_edge_str(): adding edge for %s(%d, %d) -> %s(%d, %d). edge_str = %s\n",
    //     NODE_CHARS[get_node_type_int(prev_node)], prev_depth, breadth,
    //     NODE_CHARS[get_node_type_int(next_node)], next_depth, (breadth * 3 + next_node_type_int),
    //     output.c_str());

    // appropriately format probability value
    char prob_val_str[MAX_STRING_SIZE];
    snprintf(prob_val_str, MAX_STRING_SIZE, "%-.5E", prob_val);
    // add probability value as 'label' and 'weight'
    output += "[label =\"" + std::string(prob_val_str) + "\", weight=\"" + std::string(prob_val_str) + "\"];\n";

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movsd %xmm0, (%rsp)
movl %r9d, %r15d
movq %rcx, %r14
movl %edx, %r12d
movq %rsi, %rbx
movq %rdi, 0xc8(%rsp)
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rsi, %rdi
callq 0x1a739
cmpl $0x5, %eax
jne 0x1b495
movl %r12d, %ebp
negl %ebp
cmovsl %r12d, %ebp
movl $0x1, %r13d
cmpl $0xa, %ebp
jb 0x1b565
movl $0x4, %r13d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x1b55c
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x1b562
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x1b565
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r13d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x1b453
addl $-0x3, %r13d
jmp 0x1b565
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x28(%rbx), %rsi
movq 0x30(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x1c27c
leaq 0x16216(%rip), %rsi     # 0x316d0
leaq 0x8(%rsp), %rdi
callq 0x4760
leaq 0x100(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b4f5
movq %rdx, 0xf0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x100(%rsp)
jmp 0x1b4fd
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0xf0(%rsp), %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x88(%rsp), %rdi
movq %rbx, %rsi
callq 0x4460
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x1b544
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1b830
movq 0x18(%rsp), %rsi
jmp 0x1b828
addl $-0x2, %r13d
jmp 0x1b565
decl %r13d
movq 0x24efc(%rip), %rbx     # 0x40468
shrl $0x1f, %r12d
leal (%r12,%r13), %esi
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x48(%rsp), %rdi
movl $0x2d, %edx
callq 0x4430
movl %r12d, %edi
leaq 0x48(%rsp), %r12
addq (%r12), %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0x1c20f
movq %rbx, %rdi
callq 0x41b0
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
movq %rax, %r8
callq 0x43f0
leaq 0x38(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b5e6
movq %rsi, %rbx
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x1b5ef
movups (%rcx), %xmm0
movq %rsi, %rbx
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x1b664
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x1b65b
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x1b661
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x1b664
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x1b628
addl $-0x3, %r12d
jmp 0x1b664
addl $-0x2, %r12d
jmp 0x1b664
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq 0x78(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x68(%rsp), %rdi
movl $0x2d, %edx
callq 0x4430
movl %r15d, %edi
addq 0x68(%rsp), %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x1c20f
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %r8
movq 0x70(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
movq %rbx, %r12
cmpq %rbx, %rcx
je 0x1b6bb
movq 0x38(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1b6d6
movl $0xf, %esi
cmpq %r13, 0x68(%rsp)
je 0x1b6d1
movq 0x78(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1b6e7
movq 0x68(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x4150
jmp 0x1b6f5
leaq 0x68(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x43f0
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x1b719
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1b71f
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x15f8d(%rip), %rsi     # 0x316d0
leaq 0x8(%rsp), %rdi
callq 0x4760
leaq 0x100(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b77d
movq %rdx, 0xf0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x100(%rsp)
jmp 0x1b784
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0xf0(%rsp), %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x88(%rsp), %rdi
movq %rbx, %rsi
callq 0x4460
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x1b7cb
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b7e6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x1b7fd
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x1b814
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1b830
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x100(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x28(%r14), %rsi
movq 0x30(%r14), %rdx
addq %rsi, %rdx
leaq 0xf0(%rsp), %rdi
callq 0x1c27c
movq 0xf0(%rsp), %rsi
movq 0xf8(%rsp), %rdx
leaq 0x88(%rsp), %rdi
callq 0x4150
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0x1b88e
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x15e40(%rip), %rdx     # 0x316d5
leaq 0xf0(%rsp), %rbx
movl $0x80, %esi
movq %rbx, %rdi
movsd (%rsp), %xmm0
movb $0x1, %al
callq 0x4620
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
movq %rbx, %rdi
callq 0x41b0
leaq (%rsp,%rax), %rdx
addq $0xf0, %rdx
leaq 0xd0(%rsp), %rdi
movq %rbx, %rsi
callq 0x19074
leaq 0x15df4(%rip), %rcx     # 0x316db
leaq 0xd0(%rsp), %rdi
movl $0x9, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x43f0
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b925
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x1b92c
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x15d96(%rip), %rsi     # 0x316e5
callq 0x4760
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1b97c
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x1b984
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb8(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xf0(%rsp), %rbx
movq %rbx, %rdi
callq 0x41b0
leaq (%rsp,%rax), %rdx
addq $0xf0, %rdx
leaq 0xa8(%rsp), %rdi
movq %rbx, %rsi
callq 0x19074
movq 0x48(%rsp), %rcx
movq 0x50(%rsp), %r8
movq 0xb0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x1b9f8
movq 0x58(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1ba19
movl $0xf, %esi
cmpq %r13, 0xa8(%rsp)
je 0x1ba14
movq 0xb8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1ba2d
movq 0xa8(%rsp), %rsi
leaq 0x48(%rsp), %rdi
callq 0x4150
jmp 0x1ba3e
leaq 0xa8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x43f0
leaq 0x38(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x1ba62
movq %rsi, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x1ba68
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x15c65(%rip), %rsi     # 0x316f1
leaq 0x28(%rsp), %rdi
callq 0x4760
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1babd
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x1bac4
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
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
leaq 0x88(%rsp), %rdi
callq 0x4150
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1bb0a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1bb25
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1bb42
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x1bb59
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bb70
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x1bb8d
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x43a0
movq 0x88(%rsp), %rcx
leaq 0x15b31(%rip), %rdx     # 0x316cd
movl $0x80, %esi
movq 0xc8(%rsp), %rdi
xorl %eax, %eax
callq 0x4620
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x1bbd5
movq 0x98(%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 %r12, %rbx
movq %rax, (%rsp)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1bc12
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bc12
movq %r12, %rbx
movq %rax, (%rsp)
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x1bc2f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bc2f
movq %rax, (%rsp)
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1bc4c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bc4c
movq %rax, (%rsp)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1bd6e
movq 0x58(%rsp), %rsi
jmp 0x1bd43
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bd6e
movq 0x18(%rsp), %rsi
jmp 0x1bd43
jmp 0x1bd6a
jmp 0x1bd6a
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1bcb0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bcb0
movq %rax, (%rsp)
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1bcd1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bcd1
movq %rax, (%rsp)
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1bcf4
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bcf4
movq %rax, (%rsp)
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x1bd11
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bd11
movq %rax, (%rsp)
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bd2e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bd2e
movq %rax, (%rsp)
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x1bd6e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x43a0
jmp 0x1bd6e
jmp 0x1bd6a
movq %rax, (%rsp)
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0x1bd6e
movq 0x100(%rsp), %rsi
jmp 0x1bd43
movq %rax, (%rsp)
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x1bd93
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x43a0
movq (%rsp), %rdi
callq 0x4700