// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_u_trans_hit(u_trans_hit_idx*, u_trans_hit_t*)
uint32_t get_u_trans_hit(u_trans_hit_idx *t, u_trans_hit_t *hit)
{
    uint32_t uid, ori, l, v, nv, is_update, r_beg, r_end, ovlp;
    uint32_t *a = t->a, a_n = t->an, k, c_uId, idx, offPre;
    ma_utg_t *u = NULL;
    asg_arc_t *av  = NULL;
    hit->qSpre = hit->qEpre = hit->qScur = hit->qEcur = hit->qn = (uint32_t)-1;
    hit->tSpre = hit->tEpre = hit->tScur = hit->tEcur = hit->tn = (uint32_t)-1;

    while (t->u_i < a_n) ///(u_i = 0; u_i < a_n; u_i++)
    {
        uid = a[t->u_i] >> 1;
        ori = a[t->u_i] & 1;
        u = &(t->ug->u.a[uid]);
        if(u->n == 0) continue;
        
        while(t->r_i < u->n) ///for (r_i = 0; r_i < u->n; r_i++)
        {
            l = 0;
            v = (ori == 1?((uint64_t)((u->a[u->n-t->r_i-1])^(uint64_t)(0x100000000)))>>32:((uint64_t)(u->a[t->r_i]))>>32);

            if(t->p_v != (uint32_t)-1)
            {
                av = asg_arc_a(t->read_sg, t->p_v);
                nv = asg_arc_n(t->read_sg, t->p_v);
                
                for (k = 0; k < nv; k++)
                {
                    if(av[k].del) continue;
                    if(av[k].v == v) 
                    {
                        l = asg_arc_len(av[k]);
                        break;
                    }
                }
                if(k == nv) fprintf(stderr, "ERROR-nv\n");
            }

            ///[t->cBeg, t->cEnd)
            r_beg = t->len; r_end = t->len + 
                        (t->p_v != (uint32_t)-1? t->read_sg->seq[t->p_v>>1].len : 0);
            ovlp = ((MIN(t->cEnd, r_end) > MAX(t->cBeg, r_beg))? (MIN(t->cEnd, r_end) - MAX(t->cBeg, r_beg)) : 0);
            c_uId = get_origin_uid(v, t->t_ch, &offPre, &idx);


            if(ovlp == 0)
            {
                if(r_beg >= t->cEnd)
                {
                    if(t->p_uId != (uint32_t)-1)
                    {
                        hit->qn = t->p_uId;
                        hit->qScur = t->s_pos_cur; hit->qEcur = t->len + t->read_sg->seq[t->p_v>>1].len;


                        ovlp = ((MIN(t->cEnd, hit->qEcur) > MAX(t->cBeg, hit->qScur))? 
                                                (MIN(t->cEnd, hit->qEcur) - MAX(t->cBeg, hit->qScur)) : 0);
                        if(ovlp == 0) return 0;

                        
                        ///[t->s_pre_v, t->p_v]
                        uint32_t a_pos, b_pos;
                        get_origin_uid(t->s_pre_v, t->t_ch, &a_pos, NULL);
                        get_origin_uid(t->p_v, t->t_ch, &b_pos, NULL);
                        hit->qSpre = MIN(a_pos, b_pos);
                        hit->qEpre = MAX((a_pos + t->read_sg->seq[t->s_pre_v>>1].len), (b_pos+t->read_sg->seq[t->p_v>>1].len));
                        
                        ///[t->cBeg, t->cEnd)
                        if(hit->qScur < t->cBeg)
                        {
                            if((hit->qn&1) == 0)
                            {
                                ///hit->qSpre += (t->cBeg - hit->qScur);
                                hit->qSpre += get_offset_adjust(t->cBeg - hit->qScur, 
                                                    hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
                            }
                            else
                            {
                                ///hit->qEpre -= (t->cBeg - hit->qScur);
                                hit->qEpre -= get_offset_adjust(t->cBeg - hit->qScur, 
                                                    hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
                            }
                            hit->qScur = t->cBeg;
                        }

                        if(hit->qEcur > t->cEnd)
                        {
                            if((hit->qn&1) == 0)
                            {
                                ///hit->qEpre -= (hit->qEcur - t->cEnd);
                                hit->qEpre -= get_offset_adjust(hit->qEcur - t->cEnd,
                                                    hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
                            }
                            else
                            {
                                // hit->qSpre += (hit->qEcur - t->cEnd);
                                hit->qSpre += get_offset_adjust(hit->qEcur - t->cEnd,
                                                    hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
                            }
                            hit->qEcur = t->cEnd;
                        }
                        t->p_uId = (uint32_t)-1;
                        return 1;
                    }
                    return 0;
                }
                else
                {
                    t->p_uId = c_uId; t->s_pos_cur = t->len + l; t->s_pre_v = v;
                    t->p_v = v; t->len += l; t->p_idx = idx;
                    t->r_i++;
                    continue;
                }
            }
            

            is_update = 0;
            if(t->p_uId != c_uId)
            {
                is_update = 1;
                
            }
            else///p_uId == c_uId
            {
                if((t->p_uId&1) == 0) ///forward
                {
                    if(idx != (t->p_idx+1))
                    {
                        is_update = 1;
                    }
                }
                else //backward
                {
                    if((idx + 1) != t->p_idx)
                    {
                        is_update = 1;
                    }
                }
            } 
            
            if(is_update)
            {
                if(t->p_uId != (uint32_t)-1)
                {                    
                    hit->qn = t->p_uId;
                    hit->qScur = t->s_pos_cur; hit->qEcur = t->len + t->read_sg->seq[t->p_v>>1].len;
                    ///[t->s_pre_v, t->p_v]
                    uint32_t a_pos, b_pos;
                    get_origin_uid(t->s_pre_v, t->t_ch, &a_pos, NULL);
                    get_origin_uid(t->p_v, t->t_ch, &b_pos, NULL);
                    hit->qSpre = MIN(a_pos, b_pos);
                    hit->qEpre = MAX((a_pos + t->read_sg->seq[t->s_pre_v>>1].len), (b_pos+t->read_sg->seq[t->p_v>>1].len));
                    
                    ///[t->cBeg, t->cEnd)
                    if(hit->qScur < t->cBeg)
                    {
                        if((hit->qn&1) == 0)
                        {
                            ///hit->qSpre += (t->cBeg - hit->qScur);
                            hit->qSpre += get_offset_adjust(t->cBeg - hit->qScur, 
                                                hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
                        }
                        else
                        {
                            ///hit->qEpre -= (t->cBeg - hit->qScur);
                            hit->qEpre -= get_offset_adjust(t->cBeg - hit->qScur, 
                                                hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
                        }
                        hit->qScur = t->cBeg;
                    }

                    if(hit->qEcur > t->cEnd)
                    {
                        if((hit->qn&1) == 0)
                        {
                            ///hit->qEpre -= (hit->qEcur - t->cEnd);
                            hit->qEpre -= get_offset_adjust(hit->qEcur - t->cEnd,
                                                hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
                        }
                        else
                        {
                            // hit->qSpre += (hit->qEcur - t->cEnd);
                            hit->qSpre += get_offset_adjust(hit->qEcur - t->cEnd,
                                                hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
                        }
                        hit->qEcur = t->cEnd;
                    }


                    t->p_uId = c_uId; t->s_pos_cur = t->len + l; t->s_pre_v = v;
                    t->p_v = v; t->len += l; t->p_idx = idx;
                    t->r_i++;
                    return 1;
                }
                t->p_uId = c_uId; t->s_pos_cur = t->len + l; t->s_pre_v = v;
            }

            t->p_v = v; t->len += l; t->p_idx = idx;
            t->r_i++;
        }
        t->r_i = 0;
        t->u_i++;
    }
    
    if(t->p_uId != (uint32_t)-1)
    {
        hit->qn = t->p_uId;
        hit->qScur = t->s_pos_cur; hit->qEcur = t->len + t->read_sg->seq[t->p_v>>1].len;


        ovlp = ((MIN(t->cEnd, hit->qEcur) > MAX(t->cBeg, hit->qScur))? 
                                (MIN(t->cEnd, hit->qEcur) - MAX(t->cBeg, hit->qScur)) : 0);
        if(ovlp == 0) return 0;

        
        ///[t->s_pre_v, t->p_v]
        uint32_t a_pos, b_pos;
        get_origin_uid(t->s_pre_v, t->t_ch, &a_pos, NULL);
        get_origin_uid(t->p_v, t->t_ch, &b_pos, NULL);
        hit->qSpre = MIN(a_pos, b_pos);
        hit->qEpre = MAX((a_pos + t->read_sg->seq[t->s_pre_v>>1].len), (b_pos+t->read_sg->seq[t->p_v>>1].len));
        
        ///[t->cBeg, t->cEnd)
        if(hit->qScur < t->cBeg)
        {
            if((hit->qn&1) == 0)
            {
                ///hit->qSpre += (t->cBeg - hit->qScur);
                hit->qSpre += get_offset_adjust(t->cBeg - hit->qScur, 
                                    hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
            }
            else
            {
                ///hit->qEpre -= (t->cBeg - hit->qScur);
                hit->qEpre -= get_offset_adjust(t->cBeg - hit->qScur, 
                                    hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
            }
            hit->qScur = t->cBeg;
        }

        if(hit->qEcur > t->cEnd)
        {
            if((hit->qn&1) == 0)
            {
                ///hit->qEpre -= (hit->qEcur - t->cEnd);
                hit->qEpre -= get_offset_adjust(hit->qEcur - t->cEnd,
                                    hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
            }
            else
            {
                // hit->qSpre += (hit->qEcur - t->cEnd);
                hit->qSpre += get_offset_adjust(hit->qEcur - t->cEnd,
                                    hit->qEcur-hit->qScur, hit->qEpre-hit->qSpre);
            }
            hit->qEcur = t->cEnd;
        }

        t->p_uId = (uint32_t)-1;
        return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdx
movl 0x38(%rdi), %edi
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsi)
movdqu %xmm0, (%rsi)
movq %rsi, 0x8(%rsp)
movq $-0x1, 0x20(%rsi)
movl (%rbx), %eax
cmpl %edi, %eax
jae 0xbc5d6
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rdx, 0x18(%rsp)
movl %edi, 0x10(%rsp)
movl %eax, %eax
movl (%rdx,%rax,4), %eax
movl %eax, 0x14(%rsp)
movl %eax, %ecx
shrl %ecx
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rax
leaq (%rcx,%rcx,4), %rcx
cmpl $0x0, 0x10(%rax,%rcx,8)
je 0xbc5cc
leaq (%rax,%rcx,8), %r13
movl 0x4(%rbx), %eax
movl 0x10(%r13), %ecx
cmpl %ecx, %eax
jae 0xbc5ba
testb $0x1, 0x14(%rsp)
jne 0xbc440
movq 0x18(%r13), %rcx
movl %eax, %eax
movl 0x4(%rcx,%rax,8), %r15d
jmp 0xbc451
movq 0x18(%r13), %rdx
notl %eax
addl %eax, %ecx
movl 0x4(%rdx,%rcx,8), %r15d
xorq $0x1, %r15
movl 0x18(%rbx), %eax
xorl %r14d, %r14d
movl $0x0, %r12d
cmpq %rbp, %rax
je 0xbc4bb
movq 0x48(%rbx), %rcx
movq 0x28(%rcx), %rdx
movq (%rdx,%rax,8), %rax
xorl %r12d, %r12d
testl %eax, %eax
je 0xbc4ab
movq 0x8(%rcx), %rcx
movq %rax, %rsi
shrq $0x20, %rsi
movl %eax, %edx
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rsi
addq $0xc, %rsi
xorl %ecx, %ecx
cmpl $0x0, (%rsi)
js 0xbc49b
cmpl %r15d, -0x4(%rsi)
je 0xbc4af
incq %rcx
addq $0x18, %rsi
cmpq %rcx, %rdx
jne 0xbc490
movl %eax, %ecx
jmp 0xbc4b3
xorl %ecx, %ecx
jmp 0xbc4b3
movl -0xc(%rsi), %r12d
cmpl %eax, %ecx
je 0xbc5b0
movl 0x8(%rbx), %edx
movl 0x18(%rbx), %edi
cmpq %rbp, %rdi
je 0xbc4de
movq 0x48(%rbx), %rax
movq 0x20(%rax), %rax
movl %edi, %ecx
shrl %ecx
movl (%rax,%rcx,8), %r14d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
andl %eax, %r14d
addl %edx, %r14d
movl 0x24(%rbx), %esi
movl 0x28(%rbx), %ecx
cmpl %r14d, %ecx
cmovbl %ecx, %r14d
cmpl %edx, %esi
movl %edx, %r9d
cmoval %esi, %r9d
movq 0x50(%rbx), %r8
movq 0x8(%r8), %r10
movl %r15d, %r11d
shrl %r11d
movq (%r10,%r11,8), %rax
cmpq $-0x1, %rax
je 0xbc520
movq (%r8), %rbp
movl %r15d, %r8d
andl $0x1, %r8d
xorl (%rbp,%r11,4), %r8d
jmp 0xbc526
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
cmpl %r9d, %r14d
jbe 0xbc54b
movl 0x20(%rbx), %r9d
cmpl %r8d, %r9d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jne 0xbc57d
testb $0x1, %r9b
jne 0xbc56c
movl 0x1c(%rbx), %r11d
incl %r11d
cmpl %eax, %r11d
jmp 0xbc574
cmpl %ecx, %edx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jae 0xbc6d4
movl %r8d, 0x20(%rbx)
addl %r12d, %edx
movl %edx, 0xc(%rbx)
movl %r15d, 0x10(%rbx)
movl %r15d, 0x18(%rbx)
jmp 0xbc59d
leal 0x1(%rax), %r11d
cmpl 0x1c(%rbx), %r11d
sete %r11b
testb %r11b, %r11b
jne 0xbc596
cmpl $-0x1, %r9d
jne 0xbc7b9
movl %r8d, 0x20(%rbx)
leal (%rdx,%r12), %ecx
movl %ecx, 0xc(%rbx)
movl %r15d, 0x10(%rbx)
movl %r15d, 0x18(%rbx)
addl %r12d, %edx
movl %edx, 0x8(%rbx)
movl %eax, 0x1c(%rbx)
movl 0x4(%rbx), %eax
incl %eax
movl %eax, 0x4(%rbx)
jmp 0xbc420
callq 0x106de
jmp 0xbc4bb
movl $0x0, 0x4(%rbx)
incl (%rbx)
movq 0x18(%rsp), %rdx
movl 0x10(%rsp), %edi
movl (%rbx), %eax
cmpl %edi, %eax
jb 0xbc3f5
movl 0x20(%rbx), %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
je 0xbca01
movq 0x8(%rsp), %r12
movl %ecx, 0x10(%r12)
movl 0xc(%rbx), %r9d
movl %r9d, 0x8(%r12)
movq 0x48(%rbx), %rdx
movq 0x20(%rdx), %r10
movl 0x18(%rbx), %r11d
shrl %r11d
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl (%r10,%r11,8), %esi
andl %r8d, %esi
addl 0x8(%rbx), %esi
movl %esi, 0xc(%r12)
movl 0x24(%rbx), %edi
movl 0x28(%rbx), %edx
cmpl %esi, %edx
movl %esi, %ebp
cmovbl %edx, %ebp
cmpl %r9d, %edi
movl %r9d, %r14d
cmoval %edi, %r14d
cmpl %r14d, %ebp
jbe 0xbca01
movl 0x10(%rbx), %r14d
movq 0x50(%rbx), %rax
movq 0x8(%rax), %rax
shrl %r14d
movl 0x4(%rax,%r14,8), %ebp
movl 0x4(%rax,%r11,8), %r15d
cmpl %r15d, %ebp
movl %r15d, %eax
cmovbl %ebp, %eax
movl %eax, (%r12)
movl (%r10,%r14,8), %r14d
andl %r8d, %r14d
addl %ebp, %r14d
andl (%r10,%r11,8), %r8d
addl %r15d, %r8d
cmpl %r8d, %r14d
cmoval %r14d, %r8d
movl %r8d, 0x4(%r12)
movl %edi, %r10d
subl %r9d, %r10d
jbe 0xbc930
movl %esi, %r11d
subl %r9d, %r11d
movl %r8d, %r9d
xorps %xmm0, %xmm0
cvtsi2sd %r10, %xmm0
cvtsi2sd %r11, %xmm1
subl %eax, %r9d
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r9, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %r9
testb $0x1, %cl
jne 0xbc921
addl %r9d, %eax
movq 0x8(%rsp), %r8
movl %eax, (%r8)
movq %r8, %rax
jmp 0xbc92d
movl 0x20(%rbx), %r8d
xorl %eax, %eax
cmpl $-0x1, %r8d
je 0xbca01
movq 0x8(%rsp), %r12
movl %r8d, 0x10(%r12)
movl 0xc(%rbx), %ebp
movl %ebp, 0x8(%r12)
movq 0x48(%rbx), %r9
movq 0x20(%r9), %r14
shrl %edi
movl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl (%r14,%rdi,8), %r9d
andl %r11d, %r9d
addl %edx, %r9d
movl %r9d, 0xc(%r12)
cmpl %r9d, %ecx
movl %r9d, %edx
cmovbl %ecx, %edx
cmpl %ebp, %esi
movl %ebp, %r15d
cmoval %esi, %r15d
cmpl %r15d, %edx
jbe 0xbca01
movl 0x10(%rbx), %edx
shrl %edx
movl 0x4(%r10,%rdx,8), %r15d
movl 0x4(%r10,%rdi,8), %r10d
cmpl %r10d, %r15d
movl %r10d, %eax
cmovbl %r15d, %eax
movl %eax, (%r12)
movl (%r14,%rdx,8), %edx
andl %r11d, %edx
addl %r15d, %edx
andl (%r14,%rdi,8), %r11d
addl %r10d, %r11d
cmpl %r11d, %edx
cmoval %edx, %r11d
movl %r11d, 0x4(%r12)
movl %esi, %edx
subl %ebp, %edx
jbe 0xbc99e
movl %r9d, %edi
subl %ebp, %edi
movl %r11d, %r10d
cvtsi2sd %rdx, %xmm0
cvtsi2sd %rdi, %xmm1
subl %eax, %r10d
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r10, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rdx
testb $0x1, %r8b
jne 0xbc98f
addl %edx, %eax
movq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movq %rdx, %rax
jmp 0xbc99b
movq 0x8(%rsp), %r11
movl %r9d, 0x10(%r11)
movl 0xc(%rbx), %ebp
movl %ebp, 0x14(%rsp)
movl %ebp, 0x8(%r11)
movq %r11, %r14
movq 0x48(%rbx), %r11
movq 0x20(%r11), %r11
movq %r11, 0x18(%rsp)
shrl %edi
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl (%r11,%rdi,8), %r13d
andl %ebp, %r13d
addl %edx, %r13d
movl %r13d, 0xc(%r14)
movl 0x10(%rbx), %r14d
shrl %r14d
movl 0x4(%r10,%r14,8), %r11d
movl %r11d, 0x24(%rsp)
movl 0x4(%r10,%rdi,8), %r10d
movl %r10d, 0x10(%rsp)
cmpl %r10d, %r11d
cmovbl %r11d, %r10d
movl %r10d, 0x20(%rsp)
movq 0x8(%rsp), %r11
movl %r10d, (%r11)
movq 0x18(%rsp), %r10
movl (%r10,%r14,8), %r14d
andl %ebp, %r14d
addl 0x24(%rsp), %r14d
movl 0x14(%rsp), %r11d
andl (%r10,%rdi,8), %ebp
addl 0x10(%rsp), %ebp
cmpl %ebp, %r14d
cmoval %r14d, %ebp
movq 0x8(%rsp), %rdi
movl %ebp, 0x4(%rdi)
movl %esi, %edi
subl %r11d, %edi
jbe 0xbc8a5
movl %r13d, %r10d
subl %r11d, %r10d
movl %ebp, %r11d
cvtsi2sd %rdi, %xmm0
cvtsi2sd %r10, %xmm1
movl 0x20(%rsp), %r10d
subl %r10d, %r11d
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r11, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rdi
testb $0x1, %r9b
jne 0xbc898
addl %edi, %r10d
movq 0x8(%rsp), %rdi
movl %r10d, (%rdi)
jmp 0xbc8a2
subl %edi, %ebp
movq 0x8(%rsp), %rdi
movl %ebp, 0x4(%rdi)
movl %esi, 0x8(%rdi)
movl %r13d, %r10d
subl %ecx, %r10d
jbe 0xbc901
movq 0x8(%rsp), %r14
subl 0x8(%r14), %r13d
movl (%r14), %esi
movl 0x4(%r14), %edi
movl %edi, %r11d
xorps %xmm0, %xmm0
cvtsi2sd %r10, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r13, %xmm1
subl %esi, %r11d
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r11, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %r10
testb $0x1, %r9b
jne 0xbc8f7
subl %r10d, %edi
movl %edi, 0x4(%r14)
jmp 0xbc8fd
addl %r10d, %esi
movl %esi, (%r14)
movl %ecx, 0xc(%r14)
movl %r8d, 0x20(%rbx)
addl %r12d, %edx
movl %edx, 0xc(%rbx)
movl %r15d, 0x10(%rbx)
movl %r15d, 0x18(%rbx)
movl %edx, 0x8(%rbx)
movl %eax, 0x1c(%rbx)
incl 0x4(%rbx)
jmp 0xbc9fc
subl %r9d, %r8d
movq 0x8(%rsp), %rax
movl %r8d, 0x4(%rax)
movl %edi, 0x8(%rax)
movl %esi, %r8d
subl %edx, %r8d
jbe 0xbc9f5
movq 0x8(%rsp), %r10
subl 0x8(%r10), %esi
movl (%r10), %eax
movl 0x4(%r10), %edi
movl %edi, %r9d
xorps %xmm0, %xmm0
cvtsi2sd %r8, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rsi, %xmm1
subl %eax, %r9d
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r9, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rsi
testb $0x1, %cl
jne 0xbc984
subl %esi, %edi
movl %edi, 0x4(%r10)
jmp 0xbc989
addl %esi, %eax
movl %eax, (%r10)
movl %edx, 0xc(%r10)
jmp 0xbc9f5
subl %edx, %r11d
movq 0x8(%rsp), %rax
movl %r11d, 0x4(%rax)
movl %esi, 0x8(%rax)
movl %r9d, %esi
subl %ecx, %esi
jbe 0xbc9f5
movq 0x8(%rsp), %r10
subl 0x8(%r10), %r9d
movl (%r10), %eax
movl 0x4(%r10), %edx
movl %edx, %edi
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r9, %xmm1
subl %eax, %edi
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rdi, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rsi
testb $0x1, %r8b
jne 0xbc9ec
subl %esi, %edx
movl %edx, 0x4(%r10)
jmp 0xbc9f1
addl %esi, %eax
movl %eax, (%r10)
movl %ecx, 0xc(%r10)
movl $0xffffffff, 0x20(%rbx) # imm = 0xFFFFFFFF
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq