// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: worker_clean_usg(void*, long, int)
static void worker_clean_usg(void *data, long i, int tid) // callback for kt_for()
{
    usg_t *g = (usg_t *)data; usg_seq_t *z = g->a + i; uint32_t k, m, l, srt; 
    usg_arc_warp *x; usg_arc_mm_warp *y;
    if(z->del) z->arc[0].n = z->arc[1].n = 0;

    x = &(z->arc[0]); y = &(z->arc_mm[0]);
    for (k = m = srt = 0; k < x->n; k++) {
        if(x->a[k].del) continue;
        x->a[m] = x->a[k]; x->a[m].idx = 0;
        if(m > 0 && x->a[m].v < x->a[m-1].v) srt = 1;
        m++;
    }
    x->n = m; if(srt) radix_sort_usg_arc_srt(x->a, x->a + x->n);

    radix_sort_usg_arc_mm_srt(y->a, y->a + y->n); k = l = m = 0;
    while (k < y->n && l < x->n) {
        if(y->a[k].v < x->a[l].v) {
            k++;
        } else if(y->a[k].v > x->a[l].v) {
            l++;
        } else {
            y->a[m].v = y->a[k].v;
            if(m > 0 && y->a[m].v == y->a[m-1].v) {
                x->a[l].idx++;
            } else {
                x->a[l].idx = m; x->a[l].idx <<= 32; x->a[l].idx++;
            }
            m++; k++;
        }
    }
    y->n = m;    



    x = &(z->arc[1]); y = &(z->arc_mm[1]);
    for (k = m = srt = 0; k < x->n; k++) {
        if(x->a[k].del) continue;
        x->a[m] = x->a[k]; x->a[m].idx = 0;
        if(m > 0 && x->a[m].v < x->a[m-1].v) srt = 1;
        m++;
    }
    x->n = m; if(srt) radix_sort_usg_arc_srt(x->a, x->a + x->n);
    
    radix_sort_usg_arc_mm_srt(y->a, y->a + y->n); k = l = m = 0;
    while (k < y->n && l < x->n) {
        if(y->a[k].v < x->a[l].v) {
            k++;
        } else if(y->a[k].v > x->a[l].v) {
            l++;
        } else {
            y->a[m].v = y->a[k].v;
            if(m > 0 && y->a[m].v == y->a[m-1].v) {
                x->a[l].idx++;
            } else {
                x->a[l].idx = m; x->a[l].idx <<= 32; x->a[l].idx++;
            }
            m++; k++;
        }
    }
    y->n = m;    

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0x78, -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, 0x70(%rax)
je 0x34d8c0
movq -0x28(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x28(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x34d9d0
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x34d91f
jmp 0x34d9c2
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x2c(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rcx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq $0x0, 0x18(%rax)
cmpl $0x0, -0x30(%rbp)
jbe 0x34d9b9
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x30(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jae 0x34d9b9
movl $0x1, -0x38(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x34d8ed
movl -0x30(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x0, -0x38(%rbp)
je 0x34da05
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x40(%rbp), %rax
movq (%rax), %rax
shlq $0x5, %rax
addq %rax, %rsi
callq 0x30f2d0
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x48(%rbp), %rax
imulq $0xc, (%rax), %rax
addq %rax, %rsi
callq 0x30f760
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %ecx
movq -0x48(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x49(%rbp)
jae 0x34da5d
movl -0x34(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpq (%rcx), %rax
setb %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x34da69
jmp 0x34dbc8
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jae 0x34daa2
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x34dbc3
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jbe 0x34dadb
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x34dbc1
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %edx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
cmpl $0x0, -0x30(%rbp)
jbe 0x34db58
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x30(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x34db58
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
jmp 0x34dbaf
movl -0x30(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
shlq $0x20, %rcx
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x34dbc3
jmp 0x34da3a
movl -0x30(%rbp), %eax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x10, %rax
addq $0x18, %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
addq $0x40, %rax
addq $0x18, %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x34dcec
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x34dc3b
jmp 0x34dcde
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x2c(%rbp), %eax
shlq $0x5, %rax
addq %rax, %rcx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq $0x0, 0x18(%rax)
cmpl $0x0, -0x30(%rbp)
jbe 0x34dcd5
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x30(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jae 0x34dcd5
movl $0x1, -0x38(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x34dc09
movl -0x30(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x0, -0x38(%rbp)
je 0x34dd21
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x40(%rbp), %rax
movq (%rax), %rax
shlq $0x5, %rax
addq %rax, %rsi
callq 0x30f2d0
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x48(%rbp), %rax
imulq $0xc, (%rax), %rax
addq %rax, %rsi
callq 0x30f760
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, %ecx
movq -0x48(%rbp), %rdx
xorl %eax, %eax
cmpq (%rdx), %rcx
movb %al, -0x4a(%rbp)
jae 0x34dd79
movl -0x34(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpq (%rcx), %rax
setb %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
testb $0x1, %al
jne 0x34dd85
jmp 0x34dee4
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jae 0x34ddbe
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x34dedf
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jbe 0x34ddf7
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x34dedd
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %edx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
cmpl $0x0, -0x30(%rbp)
jbe 0x34de74
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x30(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x34de74
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
jmp 0x34decb
movl -0x30(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %edx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
shlq $0x20, %rcx
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x34dedf
jmp 0x34dd56
movl -0x30(%rbp), %eax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)