// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: worker_for_trans_clean_re(void*, long, int)
static void worker_for_trans_clean_re(void *data, long i, int tid) // callback for kt_for()
{
    u_trans_clean_t *s = (u_trans_clean_t*)data;
    kv_u_trans_t *ta = s->ta;
    kv_u_trans_t *res = &(s->res[tid]);
    u_trans_t *a = NULL, *r_a = NULL, *mz, *cz, *sz;
    uint32_t n, r_n, id = i, k, l, z;
    uint32_t ovq, ovt, os, oe;

    a = u_trans_a(*ta, id); n = u_trans_n(*ta, id);
    for (k = 1, l = 0; k <= n; k++) {
        if(k == n || a[l].tn != a[k].tn) {
            if(k > l) {
                get_u_trans_spec(ta, a[l].tn, a[l].qn, &r_a, &r_n);
                if(r_n > 0 && id > a[l].tn) {
                    l = k; continue;
                }

                mz = cz = sz = NULL; 
                for (z = l; z < k; z++) {
                    cz = &(a[z]);
                    if(cz->f == RC_3) {
                        if((!sz) || (sz->nw < cz->nw)) sz = cz;
                    }
                    if(mz) {
                        if((mz->f == RC_0) && (cz->f != RC_0)) continue;
                        if((mz->f == RC_1) && ((cz->f == RC_2) || (cz->f == RC_3))) continue;
                    }
                    if((!mz) || ((cz->f < mz->f) && ((cz->f == RC_0) || (cz->f == RC_1))) || 
                        (mz->nw < cz->nw) || ((mz->nw == cz->nw) && ((mz->qe - mz->qs) < (cz->qe - cz->qs)))) {
                        mz = cz; 
                    }
                }
                for (z = 0; z < r_n; z++) {
                    cz = &(r_a[z]);
                    if(cz->f == RC_3) {
                        if((!sz) || (sz->nw < cz->nw)) sz = cz;
                    }
                    if(mz) {
                        if((mz->f == RC_0) && (cz->f != RC_0)) continue;
                        if((mz->f == RC_1) && ((cz->f == RC_2) || (cz->f == RC_3))) continue;
                    }
                    if((!mz) || ((cz->f < mz->f) && ((cz->f == RC_0) || (cz->f == RC_1))) || 
                        (mz->nw < cz->nw) || ((mz->nw == cz->nw) && ((mz->qe - mz->qs) < (cz->te - cz->ts)))) {
                        mz = cz;
                    }
                }


                
                // fprintf(stderr, "-[M::%s::] is_mz::%u, qn::%u, tn::%u\n", __func__, (uint32_t)(!!mz), mz->qn, mz->tn);
                if((mz) && (mz->qn != mz->tn)) {
                    ///need to check it cover enough reads
                    kv_pushp(u_trans_t, *res, &cz); (*cz) = (*mz);
                    if((sz) && (sz->rev == cz->rev)) {
                        if((cz->qn != sz->qn) || (cz->tn != sz->tn)) {
                            cz->qn = mz->tn; cz->qs = mz->ts; cz->qe = mz->te;
                            cz->tn = mz->qn; cz->ts = mz->qs; cz->te = mz->qe;
                        }
                        if((cz->qn == sz->qn) && (cz->tn == sz->tn)) {
                            os = MAX(cz->qs, sz->qs); oe = MIN(cz->qe, sz->qe);
                            ovq = ((oe > os)? (oe - os):0);

                            os = MAX(cz->ts, sz->ts); oe = MIN(cz->te, sz->te);
                            ovt = ((oe > os)? (oe - os):0);

                            if(((ovq) && (ovq > ((cz->qe-cz->qs)*0.8)) && (ovq > ((sz->qe-sz->qs)*0.8))) && 
                                (((ovt) && (ovt > ((cz->te-cz->ts)*0.8)) && (ovt > ((sz->te-sz->ts)*0.8))))) {///sounds like base-level alignment coordinates are more reliable
                                (*cz) = (*sz); cz->f = mz->f; 
                            }
                        }
                    }
                    if(cz->qn != id) {
                        z = cz->qn; cz->qn = cz->tn; cz->tn = z;
                        z = cz->qs; cz->qs = cz->ts; cz->ts = z;
                        z = cz->qe; cz->qe = cz->te; cz->te = z;
                    } 

                    // if(id == 394 || id == 1698 || id == 84)  {
                    //     fprintf(stderr, "+[M::%s]\tutg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\n", __func__, 
                    //         cz->qn+1, "lc"[s->ug->u.a[cz->qn].circ], s->ug->u.a[cz->qn].len, cz->qs, cz->qe, "+-"[cz->rev],
                    //         cz->tn+1, "lc"[s->ug->u.a[cz->tn].circ], s->ug->u.a[cz->tn].len, cz->ts, cz->te);
                    // }

                    if((cz->nw >= 0) && ((!trans_ovlp_connect1(cz, s->ug)) 
                                    || (!ovlp_rocc(cz, s->ug, s->rg, s->small_ov_rate, s->ov_cutoff)))) { 
                        // if(id == 394 || id == 1698 || id == 84)  {
                        //     fprintf(stderr, "-[M::%s]\tutg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\n", __func__, 
                        //         cz->qn+1, "lc"[s->ug->u.a[cz->qn].circ], s->ug->u.a[cz->qn].len, cz->qs, cz->qe, "+-"[cz->rev],
                        //         cz->tn+1, "lc"[s->ug->u.a[cz->tn].circ], s->ug->u.a[cz->tn].len, cz->ts, cz->te);
                        // } 
                        res->n--;
                    }
                }
            }
            l = k;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %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 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl %eax, -0x64(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x64(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x64(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x5c(%rbp)
movl $0x1, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x5c(%rbp), %eax
ja 0x10698c
movl -0x68(%rbp), %eax
cmpl -0x5c(%rbp), %eax
je 0x10618a
movq -0x38(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq -0x38(%rbp), %rcx
movl -0x68(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
je 0x10697c
movl -0x68(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jbe 0x106976
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %esi
movq -0x38(%rbp), %rax
movl -0x6c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
leaq -0x40(%rbp), %rcx
leaq -0x60(%rbp), %r8
callq 0x110ee0
cmpl $0x0, -0x60(%rbp)
jbe 0x1061f0
movl -0x64(%rbp), %eax
movq -0x38(%rbp), %rcx
movl -0x6c(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jbe 0x1061f0
movl -0x68(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x10697e
movq $0x0, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x68(%rbp), %eax
jae 0x10637c
movq -0x38(%rbp), %rax
movl -0x70(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x106266
cmpq $0x0, -0x58(%rbp)
je 0x10625c
movq -0x58(%rbp), %rax
movsd 0x20(%rax), %xmm1
movq -0x50(%rbp), %rax
movsd 0x20(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x106264
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x106266
cmpq $0x0, -0x48(%rbp)
je 0x1062ce
movq -0x48(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x106294
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x106294
jmp 0x10636e
movq -0x48(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x1062cc
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x2, %eax
je 0x1062c7
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x1062cc
jmp 0x10636e
jmp 0x1062ce
cmpq $0x0, -0x48(%rbp)
je 0x106364
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
movq -0x48(%rbp), %rcx
movb 0x28(%rcx), %cl
andb $0x3f, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jge 0x106318
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x106364
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0x106364
movq -0x48(%rbp), %rax
movsd 0x20(%rax), %xmm1
movq -0x50(%rbp), %rax
movsd 0x20(%rax), %xmm0
ucomisd %xmm1, %xmm0
ja 0x106364
movq -0x48(%rbp), %rax
movsd 0x20(%rax), %xmm0
movq -0x50(%rbp), %rax
ucomisd 0x20(%rax), %xmm0
jne 0x10636c
jp 0x10636c
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x48(%rbp), %rcx
subl (%rcx), %eax
movq -0x50(%rbp), %rcx
movl 0x4(%rcx), %ecx
movq -0x50(%rbp), %rdx
subl (%rdx), %ecx
cmpl %ecx, %eax
jae 0x10636c
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x10636e
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x10620e
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0x1064f2
movq -0x40(%rbp), %rax
movl -0x70(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x1063db
cmpq $0x0, -0x58(%rbp)
je 0x1063d1
movq -0x58(%rbp), %rax
movsd 0x20(%rax), %xmm1
movq -0x50(%rbp), %rax
movsd 0x20(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1063d9
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x1063db
cmpq $0x0, -0x48(%rbp)
je 0x106443
movq -0x48(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x106409
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x106409
jmp 0x1064e4
movq -0x48(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x106441
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x2, %eax
je 0x10643c
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x106441
jmp 0x1064e4
jmp 0x106443
cmpq $0x0, -0x48(%rbp)
je 0x1064da
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
movq -0x48(%rbp), %rcx
movb 0x28(%rcx), %cl
andb $0x3f, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jge 0x10648d
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x1064da
movq -0x50(%rbp), %rax
movb 0x28(%rax), %al
andb $0x3f, %al
movzbl %al, %eax
cmpl $0x1, %eax
je 0x1064da
movq -0x48(%rbp), %rax
movsd 0x20(%rax), %xmm1
movq -0x50(%rbp), %rax
movsd 0x20(%rax), %xmm0
ucomisd %xmm1, %xmm0
ja 0x1064da
movq -0x48(%rbp), %rax
movsd 0x20(%rax), %xmm0
movq -0x50(%rbp), %rax
ucomisd 0x20(%rax), %xmm0
jne 0x1064e2
jp 0x1064e2
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x48(%rbp), %rcx
subl (%rcx), %eax
movq -0x50(%rbp), %rcx
movl 0x10(%rcx), %ecx
movq -0x50(%rbp), %rdx
subl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jae 0x1064e2
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x1064e4
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x106383
cmpq $0x0, -0x48(%rbp)
je 0x106974
movq -0x48(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x48(%rbp), %rcx
cmpl 0x14(%rcx), %eax
je 0x106974
jmp 0x106513
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x106581
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x106543
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x88(%rbp)
jmp 0x106551
movl $0x2, %eax
movq %rax, -0x88(%rbp)
jmp 0x106551
movq -0x88(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x30(%rbp), %rax
imulq $0x30, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdi
movl $0x30, %edx
callq 0x2180
cmpq $0x0, -0x58(%rbp)
je 0x10689d
movq -0x58(%rbp), %rax
movb 0x28(%rax), %al
shrb $0x6, %al
andb $0x1, %al
movzbl %al, %eax
movq -0x50(%rbp), %rcx
movb 0x28(%rcx), %cl
shrb $0x6, %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x10689d
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x58(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x106609
movq -0x50(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x58(%rbp), %rcx
cmpl 0x14(%rcx), %eax
je 0x10665b
movq -0x48(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x48(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x48(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x48(%rbp), %rax
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x48(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x58(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x10689b
movq -0x50(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x58(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jne 0x10689b
movq -0x50(%rbp), %rax
movl (%rax), %eax
movq -0x58(%rbp), %rcx
cmpl (%rcx), %eax
jb 0x10669f
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
jmp 0x1066ab
movq -0x58(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x58(%rbp), %rcx
cmpl 0x4(%rcx), %eax
ja 0x1066d3
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x90(%rbp)
jmp 0x1066e0
movq -0x58(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jbe 0x1066ff
movl -0x80(%rbp), %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x106709
xorl %eax, %eax
movl %eax, -0x94(%rbp)
jmp 0x106709
movl -0x94(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x58(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jb 0x106731
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x98(%rbp)
jmp 0x10673e
movq -0x58(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
ja 0x106766
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x9c(%rbp)
jmp 0x106773
movq -0x58(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jbe 0x106792
movl -0x80(%rbp), %eax
subl -0x7c(%rbp), %eax
movl %eax, -0xa0(%rbp)
jmp 0x10679c
xorl %eax, %eax
movl %eax, -0xa0(%rbp)
jmp 0x10679c
movl -0xa0(%rbp), %eax
movl %eax, -0x78(%rbp)
cmpl $0x0, -0x74(%rbp)
je 0x106899
movl -0x74(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x50(%rbp), %rax
movl (%rax), %ecx
movl 0x4(%rax), %eax
subl %ecx, %eax
cvtsi2sd %rax, %xmm1
movsd 0x27ba61(%rip), %xmm2   # 0x382230
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x106899
movl -0x74(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x58(%rbp), %rax
movl (%rax), %ecx
movl 0x4(%rax), %eax
subl %ecx, %eax
cvtsi2sd %rax, %xmm1
movsd 0x27ba33(%rip), %xmm2   # 0x382230
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x106899
cmpl $0x0, -0x78(%rbp)
je 0x106899
movl -0x78(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x50(%rbp), %rax
movl 0xc(%rax), %ecx
movl 0x10(%rax), %eax
subl %ecx, %eax
cvtsi2sd %rax, %xmm1
movsd 0x27b9fa(%rip), %xmm2   # 0x382230
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x106899
movl -0x78(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x58(%rbp), %rax
movl 0xc(%rax), %ecx
movl 0x10(%rax), %eax
subl %ecx, %eax
cvtsi2sd %rax, %xmm1
movsd 0x27b9cf(%rip), %xmm2   # 0x382230
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x106899
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdi
movl $0x30, %edx
callq 0x2180
movq -0x48(%rbp), %rax
movb 0x28(%rax), %dl
andb $0x3f, %dl
movq -0x50(%rbp), %rax
movb 0x28(%rax), %cl
andb $0x3f, %dl
andb $-0x40, %cl
orb %dl, %cl
movb %cl, 0x28(%rax)
jmp 0x10689b
jmp 0x10689d
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x64(%rbp), %eax
je 0x10690d
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x70(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
movl -0x70(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x70(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rax
movsd 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x106972
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0x101b70
cmpl $0x0, %eax
je 0x106964
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rax
movsd 0x30(%rax), %xmm0
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %ecx
callq 0x101f70
cmpl $0x0, %eax
jne 0x106972
movq -0x30(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
jmp 0x106974
jmp 0x106976
movl -0x68(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x10697e
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x10614e
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)