// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: remap_gen_arcs(usg_t*, unsigned int, unsigned int, unsigned int, unsigned int)
void remap_gen_arcs(usg_t *g, uint32_t ov, uint32_t ow, uint32_t nv, uint32_t nw)
{
    usg_arc_t *op = NULL, *np = NULL; usg_arc_warp *sv; uint32_t k; usg_arc_mm_t *v_a, *pm; uint32_t v_n;
    sv = &(g->a[nv>>1].arc[nv&1]); kv_pushp(usg_arc_t, *sv, &np);
    op = get_usg_arc(g, ov, ow); assert(op);///must get op ater since op might be changed by kv_pushp

    np->ul = (uint32_t)op->ul; np->ul |= (((uint64_t)nv)<<32); np->v = nw;
    np->ol = op->ol; np->del = 0; np->ou = op->ou; 
    np->idx = g->a[nv>>1].arc_mm[nv&1].n; np->idx <<= 32; np->idx |= (uint32_t)op->idx;

    v_n = (uint32_t)op->idx;
    for (k = 0; k < v_n; k++) {
        kv_pushp(usg_arc_mm_t, g->a[nv>>1].arc_mm[nv&1], &pm);
        v_a = g->a[op->ul>>33].arc_mm[(op->ul>>32)&1].a + (op->idx>>32);//va might be changed
        pm->v = nw; pm->uid = v_a[k].uid; pm->off = v_a[k].off;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
movl %ecx, %eax
shrl %eax
movl %ecx, %edx
andl $0x1, %edx
imulq $0x78, %rax, %r13
movq (%rdi), %rax
addq %r13, %rax
movq %rdx, 0x20(%rsp)
leaq (%rdx,%rdx,2), %r15
leaq (%rax,%r15,8), %rbx
addq $0x10, %rbx
movq 0x8(%rbx), %rax
cmpq %rax, (%rbx)
movl %r8d, 0xc(%rsp)
jne 0x20b8b2
leaq (%rax,%rax), %rdx
testq %rax, %rax
movl $0x2, %esi
cmovneq %rdx, %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
shlq $0x5, %rsi
movq %rcx, 0x10(%rsp)
callq 0x2370
movq 0x10(%rsp), %rcx
movl 0xc(%rsp), %r8d
movq %rax, 0x10(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %r9
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movl %r12d, %edx
shrl %edx
imulq $0x78, %rdx, %rsi
addq (%r14), %rsi
andl $0x1, %r12d
leaq (%r12,%r12,2), %rdi
movl 0x10(%rsi,%rdi,8), %edx
testq %rdx, %rdx
je 0x20b8f2
movq 0x20(%rsi,%rdi,8), %r12
cmpl %ebp, 0x8(%r12)
je 0x20b8f5
addq $0x20, %r12
decq %rdx
jne 0x20b8e2
xorl %r12d, %r12d
testq %r12, %r12
je 0x20ba62
shlq $0x5, %rax
movl (%r12), %edx
shlq $0x20, %rcx
orq %rdx, %rcx
movq %rcx, (%r9,%rax)
movl %r8d, 0x8(%r9,%rax)
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl 0xc(%r12), %edx
movl %edx, 0xc(%r9,%rax)
movl 0x10(%r12), %edx
movl %edx, 0x10(%r9,%rax)
movq (%r14), %rdx
addq %r13, %rdx
movq 0x40(%rdx,%r15,8), %rdx
shlq $0x20, %rdx
movq %rdx, 0x18(%r9,%rax)
movl 0x18(%r12), %esi
orq %rdx, %rsi
movq %rsi, 0x18(%r9,%rax)
movl 0x18(%r12), %eax
testq %rax, %rax
je 0x20ba53
shlq $0x2, %rax
leaq (%rax,%rax,2), %r9
xorl %ebx, %ebx
movq %r15, 0x18(%rsp)
movq (%r14), %rax
addq %r13, %rax
movq 0x48(%rax,%r15,8), %rcx
cmpq %rcx, 0x40(%rax,%r15,8)
jne 0x20b9e5
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
leaq 0x40(%rax,%r15,8), %rcx
movq 0x20(%rsp), %rsi
leal (,%rsi,8), %esi
leaq (%rsi,%rsi,2), %rbp
movq %rdx, 0x48(%rax,%rbp)
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rdi
shlq $0x2, %rax
leaq (%rax,%rax,2), %rsi
movq %r13, %r15
movq %r14, %r13
movq %r9, %r14
callq 0x2370
movq %r14, %r9
movq %r13, %r14
movq %r15, %r13
movq 0x18(%rsp), %r15
movl 0xc(%rsp), %r8d
movq (%r14), %rcx
addq %r13, %rcx
movq %rax, 0x50(%rcx,%rbp)
movq (%r14), %rax
leaq (%rax,%r13), %rcx
movq 0x40(%rcx,%r15,8), %rdx
movq 0x50(%rcx,%r15,8), %rsi
leaq 0x1(%rdx), %rdi
movq %rdi, 0x40(%rcx,%r15,8)
movq (%r12), %rcx
movq %rcx, %rdi
shrq $0x21, %rdi
shrq $0x20, %rcx
andl $0x1, %ecx
imulq $0x78, %rdi, %rdi
addq %rax, %rdi
leaq (%rcx,%rcx,2), %rax
movl 0x1c(%r12), %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x2, %rcx
addq 0x50(%rdi,%rax,8), %rcx
leaq (%rdx,%rdx,2), %rax
movl %r8d, (%rsi,%rax,4)
movl 0x4(%rbx,%rcx), %edx
movl %edx, 0x4(%rsi,%rax,4)
movl 0x8(%rbx,%rcx), %ecx
movl %ecx, 0x8(%rsi,%rax,4)
addq $0xc, %rbx
cmpq %rbx, %r9
jne 0x20b96d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20443(%rip), %rdi     # 0x22beac
leaq 0x2d8b5(%rip), %rsi     # 0x239325
leaq 0x30883(%rip), %rcx     # 0x23c2fa
movl $0x2d77, %edx           # imm = 0x2D77
callq 0x2110