// File: chhylp123[P]hifiasm/horder.cpp
// Function: update_unitig_ends(asg_t*, asg_arc_t*, unsigned long, unsigned long, unsigned long)
void update_unitig_ends(asg_t *g, asg_arc_t *arc, uint64_t puid, uint64_t nuid_0, uint64_t nuid_1)
{
    uint64_t nv, k, v, idx, ridx;
    

    v = puid<<1;
    idx = g->idx[v]>>32; nv = asg_arc_n(g, v);
    for (k = 0; k < nv; k++)
    {
        arc[idx+k].ul = ((uint32_t)arc[idx+k].ul) + (nuid_0<<32);
        get_r_edge(g, g->arc[idx+k].v^1, v^1, &ridx);
        arc[ridx].v = nuid_0^1;
    }


    v = (puid<<1)+1;
    idx = g->idx[v]>>32; nv = asg_arc_n(g, v);
    for (k = 0; k < nv; k++)
    {
        arc[idx+k].ul = ((uint32_t)arc[idx+k].ul) + (nuid_1<<32);
        get_r_edge(g, g->arc[idx+k].v^1, v^1, &ridx);
        arc[ridx].v = nuid_1^1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
shlq %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x239e86
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
addq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %eax
movl %eax, %ecx
movq -0x20(%rbp), %rax
shlq $0x20, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rdx
addq -0x38(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rcx
addq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
movq -0x40(%rbp), %rdx
xorq $0x1, %rdx
leaq -0x50(%rbp), %rcx
callq 0x239c80
movq -0x20(%rbp), %rax
xorq $0x1, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x239ddd
movq -0x18(%rbp), %rax
shlq %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x239f74
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
addq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %eax
movl %eax, %ecx
movq -0x28(%rbp), %rax
shlq $0x20, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rdx
addq -0x38(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x48(%rbp), %rcx
addq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
movq -0x40(%rbp), %rdx
xorq $0x1, %rdx
leaq -0x50(%rbp), %rcx
callq 0x239c80
movq -0x28(%rbp), %rax
xorq $0x1, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
imulq $0x18, -0x50(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x239ecb
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)