// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: merge_u_trans(u_trans_t*, unsigned int, ma_ug_t*)
double merge_u_trans(u_trans_t *a, uint32_t occ, ma_ug_t *ug)
{
    radix_sort_u_trans_qs(a, a+occ);
    uint32_t i, k, ov_q, ov_t, is_found = 1, ts, te;
    double w_q, w_s;
    u_trans_t *p = NULL;

    for (i = 0; i < occ; i++)
    {
        if(a[i].del || a[i].rev == 0) continue;
        ts = a[i].ts; te = a[i].te - 1;
        a[i].ts = ug->g->seq[a[i].tn].len - te - 1;
        a[i].te = ug->g->seq[a[i].tn].len - ts - 1 + 1;
    }


    while (is_found)
    {
        for (i = is_found = 0; i < occ; i++)
        {
            if(a[i].del) continue;
            p = &(a[i]);
            for (k = i+1; k < occ; k++)
            {
                if(a[k].del) continue;
                if(p->qe < a[k].qs) break;

                if(p->qe >= a[k].qs && p->te >= a[k].ts)
                {
                    ov_q = ((MIN(p->qe, a[k].qe) > MAX(p->qs, a[k].qs))?
                                            MIN(p->qe, a[k].qe) - MAX(p->qs, a[k].qs):0);
                    ov_t = ((MIN(p->te, a[k].te) > MAX(p->ts, a[k].ts))?
                                            MIN(p->te, a[k].te) - MAX(p->ts, a[k].ts):0);

                    ov_q = a[k].qe - a[k].qs - ov_q;
                    ov_t = a[k].te - a[k].ts - ov_t;

                    w_q = ((double)ov_q/(double)(a[k].qe - a[k].qs)) * a[k].nw;
                    w_s = ((double)ov_t/(double)(a[k].te - a[k].ts)) * a[k].nw;

                    p->qe = MAX(p->qe, a[k].qe); 
                    p->te = MAX(p->te, a[k].te);
                    p->nw += MIN(w_q, w_s);
                    is_found = 1;
                    a[k].del = 1;
                }
            }
        }
        for (i = k = 0; i < occ; i++)
        {
            if(a[i].del) continue;
            a[k] = a[i];
            k++;
        }
        occ = k;
    }


    for (i = 0; i < occ; i++)
    {
        if(a[i].del) continue;
        p = &(a[i]);
        for (k = i+1; k < occ; k++)
        {
            if(a[k].del) continue;
            ov_q = ((MIN(p->qe, a[k].qe) > MAX(p->qs, a[k].qs))?
                                        MIN(p->qe, a[k].qe) - MAX(p->qs, a[k].qs):0);

            if(ov_q == 0) break;
            if(ov_q == (a[k].qe-a[k].qs))
            {
                a[k].del = 1;
                continue;
            }
            if(ov_q == (p->qe - p->qs))
            {
                p->del = 1;
                continue;
            }
            ov_t = get_offset_adjust(ov_q, a[k].qe-a[k].qs, a[k].te-a[k].ts);
            a[k].qs += ov_q; a[k].ts += ov_t;
            a[k].nw -= ((double)ov_q/(double)(a[k].qe - a[k].qs)) * a[k].nw;
        }
    }
    for (i = k = 0; i < occ; i++)
    {
        if(a[i].del) continue;
        a[k] = a[i];
        k++;
    }
    occ = k;




    radix_sort_u_trans_ts(a, a+occ);
    for (i = 0; i < occ; i++)
    {
        if(a[i].del) continue;
        p = &(a[i]);
        for (k = i+1; k < occ; k++)
        {
            if(a[k].del) continue;
            ov_t = ((MIN(p->te, a[k].te) > MAX(p->ts, a[k].ts))?
                                            MIN(p->te, a[k].te) - MAX(p->ts, a[k].ts):0);

            if(ov_t == 0) break;
            if(ov_t == (a[k].te-a[k].ts))
            {
                a[k].del = 1;
                continue;
            }
            if(ov_t == (p->te - p->ts))
            {
                p->del = 1;
                continue;
            }
            ov_q = get_offset_adjust(ov_t, a[k].te-a[k].ts, a[k].qe-a[k].qs);
            a[k].ts += ov_t; a[k].qs += ov_q; 
            a[k].nw -= ((double)ov_t/(double)(a[k].te - a[k].ts)) * a[k].nw;
        }
    }
    for (i = k = 0, w_q = 0; i < occ; i++)
    {
        if(a[i].del) continue;
        w_q += a[i].nw;
        a[k] = a[i];
        k++;
    }
    occ = k;


    for (i = 0; i < occ; i++)
    {
        if(a[i].del || a[i].rev == 0) continue;
        ts = a[i].ts; te = a[i].te - 1;
        a[i].ts = ug->g->seq[a[i].tn].len - te - 1;
        a[i].te = ug->g->seq[a[i].tn].len - ts - 1 + 1;
    }

    return w_q;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rsi
callq 0xca4c0
movl $0x1, -0x2c(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x111150
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
jne 0x111095
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x6, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x11109a
jmp 0x111142
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x14(%rcx), %ecx
movl (%rax,%rcx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl -0x34(%rbp), %ecx
subl $0x1, %ecx
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x14(%rcx), %ecx
movl (%rax,%rcx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl -0x30(%rbp), %ecx
subl $0x1, %ecx
addl $0x1, %ecx
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x111053
jmp 0x111152
cmpl $0x0, -0x2c(%rbp)
je 0x1116bf
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x11164a
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x111193
jmp 0x11163c
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x11163a
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x1111d7
jmp 0x11162c
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jae 0x1111f5
jmp 0x11163a
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jb 0x11162a
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jb 0x11162a
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
ja 0x111256
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x54(%rbp)
jmp 0x11126a
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jb 0x111293
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
jmp 0x1112a6
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
movl -0x58(%rbp), %eax
movl -0x5c(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x111337
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
ja 0x1112da
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x60(%rbp)
jmp 0x1112ee
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x64(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jb 0x111317
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x68(%rbp)
jmp 0x11132a
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x68(%rbp)
movl -0x64(%rbp), %eax
movl -0x68(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x6c(%rbp)
jmp 0x11133e
xorl %eax, %eax
movl %eax, -0x6c(%rbp)
jmp 0x11133e
movl -0x6c(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
ja 0x11136a
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x70(%rbp)
jmp 0x11137e
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jb 0x1113aa
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x78(%rbp)
jmp 0x1113be
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x78(%rbp)
movl -0x74(%rbp), %eax
movl -0x78(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x11145f
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
ja 0x1113f2
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x7c(%rbp)
jmp 0x111406
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jb 0x111435
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x84(%rbp)
jmp 0x11144c
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x84(%rbp)
movl -0x80(%rbp), %eax
movl -0x84(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x88(%rbp)
jmp 0x111469
xorl %eax, %eax
movl %eax, -0x88(%rbp)
jmp 0x111469
movl -0x88(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %eax
subl %ecx, %eax
movl -0x24(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
movl 0xc(%rax,%rdx), %ecx
movl 0x10(%rax,%rdx), %eax
subl %ecx, %eax
movl -0x28(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %esi
movl 0x4(%rax,%rcx), %edx
subl %esi, %edx
cvtsi2sd %rdx, %xmm1
divsd %xmm1, %xmm0
movsd 0x20(%rax,%rcx), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x28(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
movl 0xc(%rax,%rdx), %ecx
movl 0x10(%rax,%rdx), %eax
subl %ecx, %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
mulsd 0x20(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
jb 0x111556
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x8c(%rbp)
jmp 0x11156d
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jb 0x1115a3
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x90(%rbp)
jmp 0x1115ba
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x10(%rax)
movsd -0x40(%rbp), %xmm1
movsd -0x48(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x1115e6
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
jmp 0x1115f3
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x98(%rbp), %xmm0
movq -0x50(%rbp), %rax
addsd 0x20(%rax), %xmm0
movsd %xmm0, 0x20(%rax)
movl $0x1, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %cl
andb $0x7f, %cl
orb $-0x80, %cl
movb %cl, 0x28(%rax)
jmp 0x11162c
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1111ae
jmp 0x11163c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x11116a
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x1116b4
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x11167a
jmp 0x1116a9
movq -0x8(%rbp), %rsi
movl -0x1c(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movl $0x30, %edx
callq 0x2180
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x111658
movl -0x20(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x111152
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x1119ef
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x1116ef
jmp 0x1119e1
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x1119df
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x111733
jmp 0x1119d1
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
ja 0x11175c
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x9c(%rbp)
jmp 0x111773
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0xa0(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jb 0x1117a5
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
jmp 0x1117bb
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
movl -0xa0(%rbp), %eax
movl -0xa4(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x11186d
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
ja 0x1117f8
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xa8(%rbp)
jmp 0x11180f
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jb 0x111841
movq -0x50(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xb0(%rbp)
jmp 0x111857
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0xb0(%rbp)
movl -0xac(%rbp), %eax
movl -0xb0(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0xb4(%rbp)
jmp 0x111877
xorl %eax, %eax
movl %eax, -0xb4(%rbp)
jmp 0x111877
movl -0xb4(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x11188b
jmp 0x1119df
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
movq -0x8(%rbp), %rdx
movl -0x20(%rbp), %esi
imulq $0x30, %rsi, %rsi
addq %rsi, %rdx
subl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x1118d2
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %cl
andb $0x7f, %cl
orb $-0x80, %cl
movb %cl, 0x28(%rax)
jmp 0x1119d1
movl -0x24(%rbp), %eax
movq -0x50(%rbp), %rcx
movl 0x4(%rcx), %ecx
movq -0x50(%rbp), %rdx
subl (%rdx), %ecx
cmpl %ecx, %eax
jne 0x1118fb
movq -0x50(%rbp), %rax
movb 0x28(%rax), %cl
andb $0x7f, %cl
orb $-0x80, %cl
movb %cl, 0x28(%rax)
jmp 0x1119d1
movl -0x24(%rbp), %edi
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %esi
subl %edx, %esi
movl 0x10(%rax,%rcx), %edx
movl 0xc(%rax,%rcx), %eax
subl %eax, %edx
callq 0xc14d0
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %esi
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %edx
addl %esi, %edx
movl %edx, (%rax,%rcx)
movl -0x28(%rbp), %esi
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movl 0xc(%rax,%rcx), %edx
addl %esi, %edx
movl %edx, 0xc(%rax,%rcx)
movl -0x24(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %eax
subl %ecx, %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm2
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm1
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x11170a
jmp 0x1119e1
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1116c6
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x111a59
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x111a1f
jmp 0x111a4e
movq -0x8(%rbp), %rsi
movl -0x1c(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movl $0x30, %edx
callq 0x2180
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1119fd
movl -0x20(%rbp), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0xc(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rsi
callq 0xca990
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x111db1
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x111aa6
jmp 0x111da3
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x111da1
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x111aea
jmp 0x111d93
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
ja 0x111b13
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xb8(%rbp)
jmp 0x111b2a
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
movl %eax, -0xbc(%rbp)
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jb 0x111b5f
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xc0(%rbp)
jmp 0x111b76
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0xc0(%rbp)
movl -0xbc(%rbp), %eax
movl -0xc0(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x111c2c
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
ja 0x111bb3
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xc4(%rbp)
jmp 0x111bca
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movl %eax, -0xc8(%rbp)
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jb 0x111bff
movq -0x50(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xcc(%rbp)
jmp 0x111c16
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0xcc(%rbp)
movl -0xc8(%rbp), %eax
movl -0xcc(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0xd0(%rbp)
jmp 0x111c36
xorl %eax, %eax
movl %eax, -0xd0(%rbp)
jmp 0x111c36
movl -0xd0(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x111c4a
jmp 0x111da1
movl -0x28(%rbp), %eax
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
movq -0x8(%rbp), %rdx
movl -0x20(%rbp), %esi
imulq $0x30, %rsi, %rsi
addq %rsi, %rdx
subl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jne 0x111c92
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %cl
andb $0x7f, %cl
orb $-0x80, %cl
movb %cl, 0x28(%rax)
jmp 0x111d93
movl -0x28(%rbp), %eax
movq -0x50(%rbp), %rcx
movl 0x10(%rcx), %ecx
movq -0x50(%rbp), %rdx
subl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jne 0x111cbc
movq -0x50(%rbp), %rax
movb 0x28(%rax), %cl
andb $0x7f, %cl
orb $-0x80, %cl
movb %cl, 0x28(%rax)
jmp 0x111d93
movl -0x28(%rbp), %edi
movq -0x8(%rbp), %rcx
movl -0x20(%rbp), %eax
leaq (%rax,%rax,2), %rdx
shlq $0x4, %rdx
movl 0x10(%rcx,%rdx), %esi
movl 0xc(%rcx,%rdx), %eax
subl %eax, %esi
movl (%rcx,%rdx), %eax
movl 0x4(%rcx,%rdx), %edx
subl %eax, %edx
callq 0xc14d0
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %esi
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movl 0xc(%rax,%rcx), %edx
addl %esi, %edx
movl %edx, 0xc(%rax,%rcx)
movl -0x24(%rbp), %esi
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %edx
addl %esi, %edx
movl %edx, (%rax,%rcx)
movl -0x28(%rbp), %eax
cvtsi2sd %rax, %xmm0
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
leaq (%rcx,%rcx,2), %rdx
shlq $0x4, %rdx
movl 0xc(%rax,%rdx), %ecx
movl 0x10(%rax,%rdx), %eax
subl %ecx, %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm2
movq -0x8(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm1
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x111ac1
jmp 0x111da3
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x111a7d
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x111e40
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
je 0x111de9
jmp 0x111e35
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movsd 0x20(%rax), %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x8(%rbp), %rsi
movl -0x1c(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rsi
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movl $0x30, %edx
callq 0x2180
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x111dc7
movl -0x20(%rbp), %eax
movl %eax, -0xc(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x111f4a
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
jne 0x111e8f
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x6, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x111e94
jmp 0x111f3c
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
subl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x14(%rcx), %ecx
movl (%rax,%rcx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl -0x34(%rbp), %ecx
subl $0x1, %ecx
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x14(%rcx), %ecx
movl (%rax,%rcx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl -0x30(%rbp), %ecx
subl $0x1, %ecx
addl $0x1, %ecx
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x111e4d
movsd -0x40(%rbp), %xmm0
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)