// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/ecovlp.cpp
// Function: gen_mm_cns_arc(cns_gfa*, unsigned int, unsigned int, unsigned int, unsigned int)
inline void gen_mm_cns_arc(cns_gfa *cns, uint32_t src, uint32_t des, uint32_t sc, uint32_t f)
{
    cns_t *av = &((*cns).a[src]), *aw;
    uint32_t vk, wk;
    for (vk = 0; vk < av->arc.nou; vk++) {///out-edge of src
        if((av->arc.a[vk].v != des) || (del_cns_arc((*av), vk))) continue;
        // av->arc.a[vk].f = 1; ///not sure if we should set these edges as visited
        av->arc.a[vk].f = f;
        av->arc.a[vk].sc += sc;

        aw = &((*cns).a[des]);
        for (wk = aw->arc.nou; wk < aw->arc.n; wk++) {///in-edge of des
            if((aw->arc.a[wk].v != src) || (del_cns_arc((*aw), wk))) continue;
            // aw->arc.a[wk].f = 1; ///not sure if we should set these edges as visited
            aw->arc.a[wk].f = f;
            aw->arc.a[wk].sc += sc; 
            break;
        }

        assert(wk < aw->arc.n);
        return;
    }

    cns_arc *p, t;
    ///src -> des
    kv_pushp(cns_arc, (*cns).a[src].arc, &p);
    p->sc = sc; p->v = des;
    // p->f = 1; ///not sure if we should set these edges as visited
    p->f = f; 
    ///ou-edge
    (*cns).a[src].arc.nou++;
    if((*cns).a[src].arc.nou < (*cns).a[src].arc.n) {
        t = (*cns).a[src].arc.a[(*cns).a[src].arc.nou-1]; 
        (*cns).a[src].arc.a[(*cns).a[src].arc.nou-1] = *p;
        *p = t;
    }

    ///src <- des; in-edge
    kv_pushp(cns_arc, (*cns).a[des].arc, &p);
    p->sc = sc; p->v = src;
    // p->f = 1; ///not sure if we should set these edges as visited
    p->f = f; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, 0x4(%rsp)
movl %edx, %r12d
movl %esi, %r14d
movq %rdi, %r15
movq 0x10(%rdi), %rcx
movl %esi, %r13d
leaq (,%r13,4), %rax
addq %r13, %rax
leaq (%rcx,%rax,8), %rax
addq $0x8, %rax
movq 0x10(%rax), %rsi
testq %rsi, %rsi
je 0x18d6a1
movq 0x18(%rax), %rdx
movl $0x1, %r8d
xorl %edi, %edi
movl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
movl (%rdx,%rdi,8), %r10d
andl %r9d, %r10d
cmpl %r12d, %r10d
setne %r11b
cmpl %r9d, %r10d
sete %bpl
orb %r11b, %bpl
je 0x18d7d9
movl %r8d, %edi
incl %r8d
cmpq %rdi, %rsi
ja 0x18d678
movq 0x8(%rax), %rdx
cmpq %rdx, (%rax)
jne 0x18d6e5
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
movl $0x2, %edx
cmovneq %rsi, %rdx
leaq (,%r13,8), %rsi
leaq (%rsi,%rsi,4), %rbp
movq %rdx, 0x10(%rcx,%rbp)
movq 0x8(%rax), %rsi
movq 0x18(%rax), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x10(%r15), %rcx
movq %rax, 0x20(%rcx,%rbp)
movq 0x10(%r15), %rsi
shlq $0x3, %r13
leaq (,%r13,4), %rdx
addq %r13, %rdx
movq 0x8(%rsi,%rdx), %rax
movq 0x20(%rsi,%rdx), %rcx
leaq 0x1(%rax), %rdi
movq %rdi, 0x8(%rsi,%rdx)
movl 0x4(%rsp), %ebp
movl %ebp, 0x4(%rcx,%rax,8)
movl %r12d, %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
shll $0x1f, %ebx
orl %ebx, %esi
movl %esi, (%rcx,%rax,8)
movq 0x10(%r15), %rdi
movq 0x18(%rdi,%rdx), %rsi
incq %rsi
movq %rsi, 0x18(%rdi,%rdx)
cmpq 0x8(%rdi,%rdx), %rsi
jae 0x18d759
addq %rdi, %rdx
addq $0x8, %rdx
movq 0x18(%rdx), %rdx
movq -0x8(%rdx,%rsi,8), %rdi
movq (%rcx,%rax,8), %r8
movq %r8, -0x8(%rdx,%rsi,8)
movq %rdi, (%rcx,%rax,8)
movq 0x10(%r15), %rax
movl %r12d, %ecx
leaq (%rcx,%rcx,4), %r12
movq 0x10(%rax,%r12,8), %rdx
cmpq %rdx, 0x8(%rax,%r12,8)
jne 0x18d7af
leaq (%rax,%r12,8), %rdi
addq $0x8, %rdi
leaq (%rdx,%rdx), %rsi
testq %rdx, %rdx
movl $0x2, %edx
cmovneq %rsi, %rdx
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %r13
movq %rdx, 0x10(%rax,%r13)
movq 0x8(%rdi), %rsi
movq 0x18(%rdi), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x10(%r15), %rcx
movq %rax, 0x20(%rcx,%r13)
movq 0x10(%r15), %rax
movq 0x8(%rax,%r12,8), %rcx
movq 0x20(%rax,%r12,8), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x8(%rax,%r12,8)
movl %ebp, 0x4(%rdx,%rcx,8)
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
orl %r14d, %ebx
movl %ebx, (%rdx,%rcx,8)
jmp 0x18d853
shll $0x1f, %ebx
orl %ebx, %r10d
movl %r10d, (%rdx,%rdi,8)
movq 0x18(%rax), %rax
movl 0x4(%rsp), %ebp
addl %ebp, 0x4(%rax,%rdi,8)
movq 0x10(%r15), %rax
movl %r12d, %ecx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rax
addq $0x8, %rax
movl 0x10(%rax), %ecx
movq (%rax), %rdx
cmpq %rcx, %rdx
jbe 0x18d84e
movq 0x18(%rax), %rsi
leal 0x1(%rcx), %edi
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl (%rsi,%rcx,8), %r9d
andl %r8d, %r9d
cmpl %r14d, %r9d
setne %r10b
cmpl %r8d, %r9d
sete %r11b
orb %r10b, %r11b
je 0x18d83f
movl %edi, %ecx
incl %edi
cmpq %rcx, %rdx
ja 0x18d81a
jmp 0x18d84e
orl %ebx, %r9d
movl %r9d, (%rsi,%rcx,8)
movq 0x18(%rax), %rdx
addl %ebp, 0x4(%rdx,%rcx,8)
cmpq %rcx, (%rax)
jbe 0x18d862
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa46f5(%rip), %rdi     # 0x231f5e
leaq 0xa457b(%rip), %rsi     # 0x231deb
leaq 0xa5e0e(%rip), %rcx     # 0x233685
movl $0x4d7, %edx            # imm = 0x4D7
callq 0x2110