// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/./POA.h
// Function: add_insertionEdge_weight(Graph*, long long, char*, long long)
inline void add_insertionEdge_weight(Graph* g, long long alignNodeID, char* insert, long long insert_length)
{
    
    long long nodeID;
    long long edgeID;
    Edge_alloc* edge = &(g->g_nodes.list[alignNodeID].insertion_edges);

    if (insert_length == 1)
    {
        edgeID = getEdge(g, edge, 1, insert[0]);
        if (edgeID != -1)
        {
            edge->list[edgeID].weight++;
        }
        else ///there is no such edge
        {
            nodeID  = add_Node_Graph(g, insert[0]);
            append_Edge_alloc(edge, alignNodeID, nodeID, 1, 1);
            ///add the new node to alignNodeID by insertion_edges
            //should link to the initial node, instead of the next node of the initial node
            ///append_Edge_alloc(&(g->g_nodes.list[nodeID].insertion_edges), nodeID, alignNodeID + 1, 1, 0);
            append_Edge_alloc(&(g->g_nodes.list[nodeID].insertion_edges), nodeID, alignNodeID, 1, 0);
        }
    }
    else
    {
        ///edgeID = get_insertion_Edges(g, edge, insert_length, insert);
        edgeID = get_insertion_Edges_new(g, alignNodeID, insert_length, insert);
        if (edgeID != -1)
        {
            ///just one outdegree
            edge->list[edgeID].weight++;
        }
        else
        {
            create_insertion_Edges(g, alignNodeID, insert_length, insert);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rax
addq $0x18, %r14
movq %rsi, %rbp
shlq $0x7, %rbp
leaq (%rax,%rbp), %r13
addq $0x60, %r13
cmpq $0x1, %rcx
jne 0x44d4d
movb (%r15), %cl
movq 0x10(%r13), %rdi
testq %rdi, %rdi
jle 0x44e90
movq (%r13), %rdx
leaq 0x20(%rdx), %r8
xorl %esi, %esi
movabsq $0x100000000, %r9       # imm = 0x100000000
xorl %r10d, %r10d
cmpq $0x1, (%r8)
jne 0x44d39
movq -0x18(%r8), %r11
shlq $0x7, %r11
cmpb %cl, 0x18(%rax,%r11)
je 0x44e8a
incq %r10
addq %r9, %rsi
addq $0x38, %r8
cmpq %r10, %rdi
jne 0x44d20
jmp 0x44e90
movq %rcx, %r12
movslq %ebx, %rcx
shlq $0x7, %rcx
movq 0x70(%rax,%rcx), %rdx
testq %rdx, %rdx
jle 0x44dd3
addq %rax, %rcx
addq $0x60, %rcx
movq (%rcx), %rsi
xorl %ecx, %ecx
imulq $0x38, %rcx, %r8
movq 0x20(%rsi,%r8), %rdi
testl %edi, %edi
je 0x44dc0
movslq %edi, %r9
cmpq %r12, %r9
jne 0x44dc0
testl %edi, %edi
jle 0x44db8
addq %rsi, %r8
movl %edi, %r10d
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
xorl %r9d, %r9d
movslq 0x8(%r8), %r8
shlq $0x7, %r8
movb 0x18(%rax,%r8), %r11b
cmpb (%r15,%r9), %r11b
jne 0x44dbb
movq 0x60(%rax,%r8), %r8
incq %r9
cmpq %r9, %r10
jne 0x44d96
jmp 0x44dca
xorl %r9d, %r9d
cmpl %edi, %r9d
je 0x44dca
incq %rcx
cmpq %rdx, %rcx
jne 0x44d6d
jmp 0x44dd3
cmpl $-0x1, %ecx
jne 0x44e56
testq %r12, %r12
je 0x44ef7
movsbl (%r15), %esi
movq %r14, %rdi
callq 0x44796
movq %rax, %r13
movq (%r14), %rax
leaq (%rax,%rbp), %rdi
addq $0x60, %rdi
movl $0x1, %ecx
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %r8
callq 0x442e2
cmpq $0x2, %r12
jl 0x44e6b
decq %r12
incq %r15
movsbl (%r15), %esi
movq %r14, %rdi
callq 0x44796
movq %rax, %rbp
movq (%r14), %rax
movq %r13, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x60, %rdi
movl $0x1, %ecx
movq %r13, %rsi
movq %rbp, %rdx
movq %r12, %r8
callq 0x442e2
incq %r15
movq %rbp, %r13
decq %r12
jne 0x44e15
jmp 0x44e6e
movslq %ecx, %rax
movq (%r13), %rcx
imulq $0x38, %rax, %rax
incq 0x10(%rcx,%rax)
jmp 0x44ef7
movq %r13, %rbp
movq (%r14), %rax
movq %rbp, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x60, %rdi
movl $0x1, %ecx
movq %rbp, %rsi
jmp 0x44ed1
cmpl $-0x1, %r10d
jne 0x44eea
movsbl %cl, %esi
movq %r14, %rdi
callq 0x44796
movq %rax, %r15
movl $0x1, %ecx
movl $0x1, %r8d
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x442e2
movq (%r14), %rax
movq %r15, %rcx
shlq $0x7, %rcx
leaq (%rax,%rcx), %rdi
addq $0x60, %rdi
movl $0x1, %ecx
movq %r15, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x442e2
sarq $0x20, %rsi
imulq $0x38, %rsi, %rax
incq 0x10(%rdx,%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop