// File: /workspace/github_cpp_makefile_star2_O3/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, %ebp
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 0x1964bf
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 %r10b
orb %r11b, %r10b
je 0x1965ea
movl %r8d, %edi
incl %r8d
cmpq %rdi, %rsi
ja 0x196496
movq (%rax), %rdx
cmpq 0x8(%rax), %rdx
jne 0x19650c
leaq (%rdx,%rdx), %rdi
testq %rdx, %rdx
movl $0x2, %esi
cmovneq %rdi, %rsi
leaq (,%r13,8), %rdx
movl %ebp, 0x4(%rsp)
leaq (%rdx,%rdx,4), %rbp
movq %rsi, 0x10(%rcx,%rbp)
movq 0x18(%rax), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x10(%r15), %rcx
movq %rax, 0x20(%rcx,%rbp)
movq 0x8(%rcx,%rbp), %rdx
movl 0x4(%rsp), %ebp
shlq $0x3, %r13
leaq (,%r13,4), %rsi
addq %r13, %rsi
movq 0x20(%rcx,%rsi), %rax
leaq 0x1(%rdx), %rdi
movq %rdi, 0x8(%rcx,%rsi)
movl %ebp, 0x4(%rax,%rdx,8)
movl %r12d, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
shll $0x1f, %ebx
orl %ebx, %ecx
movl %ecx, (%rax,%rdx,8)
movq 0x10(%r15), %rcx
movq 0x18(%rcx,%rsi), %rdi
leaq 0x1(%rdi), %r8
movq %r8, 0x18(%rcx,%rsi)
cmpq 0x8(%rcx,%rsi), %r8
jae 0x196576
addq %rsi, %rcx
addq $0x8, %rcx
movq 0x18(%rcx), %rcx
movq (%rcx,%rdi,8), %rsi
movq (%rax,%rdx,8), %r8
movq %r8, (%rcx,%rdi,8)
movq %rsi, (%rax,%rdx,8)
movq 0x10(%r15), %rcx
movl %r12d, %edx
leaq (%rdx,%rdx,4), %r12
movq 0x8(%rcx,%r12,8), %rax
cmpq 0x10(%rcx,%r12,8), %rax
jne 0x1965c9
leaq (%rcx,%r12,8), %rdi
addq $0x8, %rdi
leaq (%rax,%rax), %r8
testq %rax, %rax
movl $0x2, %esi
cmovneq %r8, %rsi
shlq $0x3, %rdx
leaq (%rdx,%rdx,4), %r13
movq %rsi, 0x10(%rcx,%r13)
movq 0x18(%rdi), %rdi
shlq $0x3, %rsi
callq 0x2370
movq 0x10(%r15), %rcx
movq %rax, 0x20(%rcx,%r13)
movq 0x8(%rcx,%r13), %rax
movq 0x20(%rcx,%r12,8), %rdx
leaq 0x1(%rax), %rsi
movq %rsi, 0x8(%rcx,%r12,8)
movl %ebp, 0x4(%rdx,%rax,8)
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
orl %r14d, %ebx
movl %ebx, (%rdx,%rax,8)
jmp 0x196666
shll $0x1f, %ebx
movl %ebx, %ecx
orl %r12d, %ecx
movl %ecx, (%rdx,%rdi,8)
movq 0x18(%rax), %rax
addl %ebp, 0x4(%rax,%rdi,8)
movq 0x10(%r15), %rdx
movl %r12d, %eax
leaq (%rax,%rax,4), %rsi
movl 0x18(%rdx,%rsi,8), %eax
movq 0x8(%rdx,%rsi,8), %rcx
cmpq %rax, %rcx
jbe 0x196661
leaq (%rdx,%rsi,8), %rdx
addq $0x8, %rdx
movq 0x18(%rdx), %rsi
leal 0x1(%rax), %edi
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl (%rsi,%rax,8), %r9d
andl %r8d, %r9d
cmpl %r14d, %r9d
setne %r10b
cmpl %r8d, %r9d
sete %r9b
orb %r10b, %r9b
je 0x196650
movl %edi, %eax
incl %edi
cmpq %rax, %rcx
ja 0x19662b
jmp 0x196661
orl %r14d, %ebx
movl %ebx, (%rsi,%rax,8)
movq 0x18(%rdx), %rcx
addl %ebp, 0x4(%rcx,%rax,8)
movq (%rdx), %rcx
cmpq %rax, %rcx
jbe 0x196675
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa7b32(%rip), %rdi     # 0x23e1ae
leaq 0xa79b8(%rip), %rsi     # 0x23e03b
leaq 0xa924b(%rip), %rcx     # 0x23f8d5
movl $0x4d7, %edx            # imm = 0x4D7
callq 0x2110