// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: update_poa_arch_0(poa_g_t*, unsigned int, unsigned int, long, long, long)
void update_poa_arch_0(poa_g_t *g, uint32_t src, uint32_t des, int64_t str_id, int64_t str_src, int64_t str_des)
{
    uint32_t k, v, w, a_n; poa_arc_t *a; emap_t *em;
    v = src<<1; w = des<<1;
    a_n = poa_arc_n(g, v); a = poa_arc_a(g, v);
    for (k = 0; k < a_n; k++) {
        if(a[k].v == w) break;
    }
    if(k >= a_n) {
        push_poa_arch_0(g, src, des, str_id, str_src, str_des);
    } else {
        a[k].ul++;
        v = des<<1; v^=1; 
        w = src<<1; w^=1;
        a_n = poa_arc_n(g, v); a = poa_arc_a(g, v);
        for (k = 0; k < a_n; k++) {
            if(a[k].v == w) break;
        }
        assert(k < a_n);
        a[k].ul++;

        kv_pushp(emap_t, g->e_idx, &em);
        em->pge = src; em->pge <<= 32; em->pge += des;
        em->ule = str_src; em->ule <<= 32; em->ule += str_des;
        em->ulid = str_id;

        // assert((g->seq.a[em->pge>>32].nid^(debug_is_rev?1:0)) == ((uint32_t)debug_str->a[em->ule>>32]));
        // assert((g->seq.a[(uint32_t)em->pge].nid^(debug_is_rev?1:0)) == ((uint32_t)debug_str->a[(uint32_t)em->ule]));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %r15
movq %rcx, %r14
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %rbp
leal (%r12,%r12), %eax
movq 0x40(%rdi), %rdx
movq (%rdx,%rax,8), %r8
testl %r8d, %r8d
setne %r10b
je 0x1f7473
leal (,%r13,2), %esi
movq 0x28(%rbp), %rcx
movq %r8, %r9
shrq $0x20, %r9
shlq $0x4, %r9
leaq (%rcx,%r9), %rdi
cmpl %esi, 0x8(%rdi)
jne 0x1f73f4
xorl %r9d, %r9d
jmp 0x1f741e
leaq (%r9,%rcx), %r10
addq $0x18, %r10
leal -0x1(%r8), %r11d
xorl %r9d, %r9d
cmpl %r9d, %r11d
je 0x1f7473
incq %r9
leaq 0x10(%r10), %rbx
cmpl %esi, (%r10)
movq %rbx, %r10
jne 0x1f7403
cmpl %r8d, %r9d
setb %r10b
testb %r10b, %r10b
je 0x1f7473
shlq $0x4, %r9
incq (%rdi,%r9)
movl %esi, %esi
movq 0x8(%rdx,%rsi,8), %rdx
testl %edx, %edx
je 0x1f7454
orl $0x1, %eax
movq %rdx, %rsi
shrq $0x1c, %rsi
andq $-0x10, %rsi
addq %rsi, %rcx
cmpl %eax, 0x8(%rcx)
je 0x1f7499
addq $0x10, %rcx
decl %edx
jne 0x1f7447
leaq 0x435eb(%rip), %rdi     # 0x23aa46
leaq 0x41ec3(%rip), %rsi     # 0x239325
leaq 0x435e5(%rip), %rcx     # 0x23aa4e
movl $0x15af, %edx           # imm = 0x15AF
callq 0x2110
movq %rbp, %rdi
movl %r12d, %esi
movl %r13d, %edx
movq %r14, %rcx
movq %r15, %r8
movq (%rsp), %r9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f721c
incq (%rcx)
movq 0xd0(%rbp), %rax
cmpq %rax, 0xc8(%rbp)
jne 0x1f74de
leaq (%rax,%rax), %rcx
testq %rax, %rax
movl $0x2, %eax
cmovneq %rcx, %rax
movq %rax, 0xd0(%rbp)
movq 0xd8(%rbp), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movq %rax, 0xd8(%rbp)
movq 0xc8(%rbp), %rax
movq 0xd8(%rbp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0xc8(%rbp)
leaq (%rax,%rax,2), %rax
shlq $0x20, %r12
movl %r13d, %edx
orq %r12, %rdx
movq %rdx, (%rcx,%rax,8)
shlq $0x20, %r15
addq (%rsp), %r15
movq %r15, 0x8(%rcx,%rax,8)
movl %r14d, 0x10(%rcx,%rax,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq