// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/ecovlp.cpp
// Function: add_cns_arc_bp(cns_gfa*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
inline uint32_t add_cns_arc_bp(cns_gfa *cns, uint32_t src, uint32_t bp, uint32_t plus0, uint32_t rid, uint32_t av_bp)
{
    uint32_t rr, des;
    rr = get_cns_arc_bp(cns, src, bp, 1, av_bp);
    if(rr != ((uint32_t)-1)) {///find an existing node
        des = (*cns).a[src].arc.a[rr].v;
        (*cns).a[des].sc++;
        (*cns).a[src].arc.a[rr].sc += plus0;

        rr = add_cns_arc(cns, des, src, 0, plus0); 
        // if(rr == 0) {
        //     fprintf(stderr, "[M::%s] src::%u -> des::%u\n", __func__, src, des);
        //     prt_cns_arc(cns, src);
        //     prt_cns_arc(cns, des);
        // }
        assert(rr);

        return des;
    } else {///create a new node
        des = insert_cns_node(cns);
        (*cns).a[des].sc++; (*cns).a[des].c = bp;
        insert_cns_arc(cns, src, des, 1, plus0, rid); 
        insert_cns_arc(cns, des, src, 0, plus0, rid);
    }

    return des;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0x14(%rsp)
movl %edx, %r13d
movq %rdi, %r15
movq 0x10(%rdi), %r12
movl %esi, 0xc(%rsp)
movl %esi, %ebp
leaq (,%rbp,4), %rbx
addq %rbp, %rbx
movl 0x18(%r12,%rbx,8), %edx
testq %rdx, %rdx
je 0x196115
movq 0x20(%r12,%rbx,8), %rcx
xorl %eax, %eax
movl (%rcx,%rax,8), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
cmpl $0x2, %esi
jb 0x19610d
testl %r9d, %r9d
je 0x1960f9
cmpl 0x28(%r15), %esi
jb 0x1960f9
cmpl 0x2c(%r15), %esi
jb 0x19610d
leaq (%rsi,%rsi,4), %rsi
movl (%r12,%rsi,8), %esi
andl $0x3, %esi
cmpl %r13d, %esi
je 0x196312
incq %rax
cmpq %rax, %rdx
jne 0x1960da
movl %r8d, 0x10(%rsp)
movq (%r15), %r14
cmpq 0x8(%r15), %r14
jne 0x196171
leaq (%r14,%r14), %rax
testq %r14, %r14
movl $0x2, %ecx
cmovneq %rax, %rcx
movq %rcx, 0x8(%r15)
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rsi
movq %r12, %rdi
callq 0x2370
movq %rax, %r12
movq %rax, 0x10(%r15)
movq 0x8(%r15), %rax
movl %r14d, %ecx
subq %rcx, %rax
jbe 0x196171
leaq (%rcx,%rcx,4), %rcx
leaq (%r12,%rcx,8), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdx
xorl %esi, %esi
callq 0x20e0
movq (%r15), %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r15)
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
movq %rcx, 0x18(%r12,%rax,8)
movq %rcx, 0x8(%r12,%rax,8)
movl $0x0, (%r12,%rax,8)
movl (%r15), %r14d
decl %r14d
movq 0x10(%r15), %rax
leaq (,%r14,8), %rcx
leaq (%rcx,%rcx,4), %r12
addl $0x8, (%rax,%r12)
movq 0x10(%r15), %rax
movl (%rax,%r12), %ecx
andl $0x3, %r13d
andl $-0x4, %ecx
orl %r13d, %ecx
movl %ecx, (%rax,%r12)
movq (%r15), %rax
cmpq %rbp, %rax
jbe 0x1963e7
movq 0x10(%r15), %rcx
movq 0x8(%rcx,%rbx,8), %rax
cmpq 0x10(%rcx,%rbx,8), %rax
jne 0x196224
leaq (%rcx,%rbx,8), %rdx
addq $0x8, %rdx
leaq (%rax,%rax), %rdi
testq %rax, %rax
movl $0x2, %esi
cmovneq %rdi, %rsi
leaq (,%rbp,8), %rax
leaq (%rax,%rax,4), %rbx
movq %rsi, 0x10(%rcx,%rbx)
movq 0x18(%rdx), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x10(%r15), %rcx
movq %rax, 0x20(%rcx,%rbx)
movq 0x8(%rcx,%rbx), %rax
shlq $0x3, %rbp
leaq (,%rbp,4), %rsi
addq %rbp, %rsi
movq 0x20(%rcx,%rsi), %rdx
leaq 0x1(%rax), %rdi
movq %rdi, 0x8(%rcx,%rsi)
movl 0x14(%rsp), %ebp
movl %ebp, 0x4(%rdx,%rax,8)
movl %r14d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, (%rdx,%rax,8)
movq 0x10(%r15), %rdi
movq 0x18(%rdi,%rsi), %rcx
leaq 0x1(%rcx), %r8
movq %r8, 0x18(%rdi,%rsi)
cmpq 0x8(%rdi,%rsi), %r8
jae 0x196289
addq %rdi, %rsi
addq $0x8, %rsi
movq 0x18(%rsi), %rsi
movq (%rsi,%rcx,8), %rdi
movq (%rdx,%rax,8), %r8
movq %r8, (%rsi,%rcx,8)
movq %rdi, (%rdx,%rax,8)
movq (%r15), %rax
cmpq %r14, %rax
jbe 0x196410
movq 0x10(%r15), %rcx
leaq (%r14,%r14,4), %rbx
movq 0x8(%rcx,%rbx,8), %rax
cmpq 0x10(%rcx,%rbx,8), %rax
jne 0x1962e1
leaq (%rax,%rax), %rdx
testq %rax, %rax
movl $0x2, %esi
cmovneq %rdx, %rsi
leaq (%rcx,%rbx,8), %rax
addq $0x8, %rax
movq %rsi, 0x10(%rcx,%r12)
movq 0x18(%rax), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x10(%r15), %rcx
movq %rax, 0x20(%rcx,%r12)
movq 0x8(%rcx,%r12), %rax
movq 0x20(%rcx,%rbx,8), %rdx
leaq 0x1(%rax), %rsi
movq %rsi, 0x8(%rcx,%rbx,8)
movl %ebp, 0x4(%rdx,%rax,8)
movl 0xc(%rsp), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, (%rdx,%rax,8)
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, %rax
je 0x196115
movl (%rcx,%rax,8), %r14d
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
leaq (,%r14,8), %rcx
leaq (%rcx,%rcx,4), %rcx
addl $0x8, (%r12,%rcx)
movq 0x10(%r15), %rsi
movq 0x20(%rsi,%rbx,8), %rdx
movl 0x14(%rsp), %r11d
addl %r11d, 0x4(%rdx,%rax,8)
movq 0x8(%rsi,%rcx), %rdx
movq 0x18(%rsi,%rcx), %rax
movl %eax, %ecx
subl %edx, %ecx
jae 0x1963c8
movl %eax, %eax
leaq (%r14,%r14,4), %rdi
movq 0x20(%rsi,%rdi,8), %rdi
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl (%rdi,%rax,8), %r8d
andl %esi, %r8d
movl 0xc(%rsp), %r10d
cmpl %r10d, %r8d
jne 0x19638a
addl %r11d, 0x4(%rdi,%rax,8)
jmp 0x196300
movl %edx, %edx
leaq (%rdi,%rax,8), %rdi
addq $0x4, %rdi
incl %ecx
xorl %r8d, %r8d
cmpl %r8d, %ecx
je 0x1963b9
movl 0x4(%rdi), %r9d
andl %esi, %r9d
decq %r8
addq $0x8, %rdi
cmpl %r10d, %r9d
jne 0x196399
subq %r8, %rax
addl %r11d, (%rdi)
jmp 0x1963bf
subq %r8, %rax
incq %rax
cmpq %rdx, %rax
jb 0x196300
leaq 0x9db4f(%rip), %rdi     # 0x233f1e
leaq 0xa7c65(%rip), %rsi     # 0x23e03b
leaq 0xa94a3(%rip), %rcx     # 0x23f880
movl $0x269, %edx            # imm = 0x269
callq 0x2110
movq 0xfebf2(%rip), %rcx     # 0x294fe0
movq (%rcx), %rdi
movl %eax, (%rsp)
leaq 0xa9445(%rip), %rsi     # 0x23f840
leaq 0xa946f(%rip), %rdx     # 0x23f871
movl 0x10(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl %r14d, %r9d
jmp 0x196437
movq 0xfebc9(%rip), %rcx     # 0x294fe0
movq (%rcx), %rdi
movl %eax, (%rsp)
leaq 0xa941c(%rip), %rsi     # 0x23f840
leaq 0xa9446(%rip), %rdx     # 0x23f871
movl 0x10(%rsp), %ecx
movl %r14d, %r8d
movl 0xc(%rsp), %r9d
xorl %eax, %eax
callq 0x22b0
movl $0x1, %edi
callq 0x2250