// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/Correct.cpp
// Function: verify_ul_window(long long, long long, overlap_region_alloc*, Correct_dumy*, ul_idx_t const*, char*, double, long long, long long, void*)
void verify_ul_window(long long window_start, long long window_end, overlap_region_alloc* overlap_list,Correct_dumy* dumy, const ul_idx_t *uref,
char* r_string, double max_ov_diff_ec, long long blockLen, long long max_error, void *km)
{
    long long i;
    long long currentID;
    long long x_start, y_start, o_len;
    long long Window_Len = blockLen + (max_error << 1);
    char* x_string = NULL;
    char* y_string = NULL;
    long long x_end, x_len;
    int end_site;
    unsigned int error;
    int groupLen = 0;
    int return_sites[GROUP_SIZE];
    unsigned int return_sites_error[GROUP_SIZE];
    uint64_t overlapID[GROUP_SIZE];
    uint64_t y_startGroup[GROUP_SIZE];
    int y_extra_begin[GROUP_SIZE];
    int y_extra_end[GROUP_SIZE];
    int error_threshold[GROUP_SIZE];
    int extra_begin;
    int extra_end;

    ///here are overlaps fully covered by blockLen
    for (i = 0; i < (long long)dumy->length; i++)
    {
        extra_begin = extra_end = 0;
        ///if the window has been fully covered, the interval at x is [window_start, window_end]
        x_len = blockLen;
        currentID = dumy->overlapID[i];
        x_start = window_start;
        ///offset of y
        y_start = (x_start - overlap_list->list[currentID].x_pos_s) + overlap_list->list[currentID].y_pos_s;
        /****************************may have bugs********************************/
        y_start += y_start_offset(x_start, &(overlap_list->list[currentID].f_cigar));
        /****************************may have bugs********************************/
        
  
        if(!determine_overlap_region(max_error, y_start, overlap_list->list[currentID].y_id, Window_Len, uref->ug->u.a[overlap_list->list[currentID].y_id].len,
        &extra_begin, &extra_end, &y_start, &o_len)) {
            continue;
        }

        // if(overlap_list->list[currentID].y_id == 4) {
        //     fprintf(stderr, "[M::%s] q_s::%lld, t_s::%lld, t_pri_l::%lld, aux_beg::%d, aux_end::%d, aln_l::%lld\n", __func__, 
        //         x_start, y_start, o_len, extra_begin, extra_end, Window_Len);
        // }

        fill_subregion_ul(dumy->overlap_region_group[groupLen], y_start, o_len, overlap_list->list[currentID].y_pos_strand, 
        uref, overlap_list->list[currentID].y_id, extra_begin, extra_end);

        y_extra_begin[groupLen] = extra_begin;
        y_extra_end[groupLen] = extra_end;
        overlapID[groupLen] = currentID;
        y_startGroup[groupLen] = y_start;
        error_threshold[groupLen] = max_error;
        x_string = r_string + x_start;
        groupLen++;
        

        if (groupLen == GROUP_SIZE)
        {
            // Reserve_Banded_BPM_4_SSE_only(dumy->overlap_region_group[0], dumy->overlap_region_group[1], 
            // dumy->overlap_region_group[2], dumy->overlap_region_group[3], Window_Len, x_string, blockLen,
            //     return_sites, return_sites_error, max_error, dumy->Peq_SSE);
            return_sites[0] = 
                    Reserve_Banded_BPM(dumy->overlap_region_group[0], Window_Len, x_string, blockLen, max_error, &return_sites_error[0]);
            return_sites[1] = 
                    Reserve_Banded_BPM(dumy->overlap_region_group[1], Window_Len, x_string, blockLen, max_error, &return_sites_error[1]);
            return_sites[2] = 
                    Reserve_Banded_BPM(dumy->overlap_region_group[2], Window_Len, x_string, blockLen, max_error, &return_sites_error[2]);
            return_sites[3] = 
                    Reserve_Banded_BPM(dumy->overlap_region_group[3], Window_Len, x_string, blockLen, max_error, &return_sites_error[3]);
            




            groupLen = 0;
            
            if (return_sites_error[0]!=(unsigned int)-1) {
                overlap_list->list[overlapID[0]].align_length += x_len;

                append_window_list(&overlap_list->list[overlapID[0]], window_start, window_end, 
                            y_startGroup[0], y_startGroup[0] + return_sites[0], (int)return_sites_error[0],
                            y_extra_begin[0], y_extra_end[0], error_threshold[0], blockLen, km);
            }
            

            if (return_sites_error[1]!=(unsigned int)-1) {
                overlap_list->list[overlapID[1]].align_length += x_len;
                append_window_list(&overlap_list->list[overlapID[1]], window_start, window_end, 
                            y_startGroup[1], y_startGroup[1] + return_sites[1], (int)return_sites_error[1],
                            y_extra_begin[1], y_extra_end[1], error_threshold[1], blockLen, km);
            }
            

            if (return_sites_error[2]!=(unsigned int)-1) {
                overlap_list->list[overlapID[2]].align_length += x_len;

                append_window_list(&overlap_list->list[overlapID[2]], window_start, window_end, 
                            y_startGroup[2], y_startGroup[2] + return_sites[2], (int)return_sites_error[2],
                            y_extra_begin[2], y_extra_end[2], error_threshold[2], blockLen, km);
            }
            

            if (return_sites_error[3]!=(unsigned int)-1) {
                overlap_list->list[overlapID[3]].align_length += x_len;

                append_window_list(&overlap_list->list[overlapID[3]], window_start, window_end, 
                            y_startGroup[3], y_startGroup[3] + return_sites[3], (int)return_sites_error[3],
                            y_extra_begin[3], y_extra_end[3], error_threshold[3], blockLen, km);
            } 
        }
    }

    if (groupLen == 1)
    {
        end_site = Reserve_Banded_BPM(dumy->overlap_region_group[0], Window_Len, x_string, blockLen, max_error, &error);

        if (error!=(unsigned int)-1) {
            overlap_list->list[overlapID[0]].align_length += x_len;

            append_window_list(&overlap_list->list[overlapID[0]], window_start, window_end, 
                                y_startGroup[0], y_startGroup[0] + end_site, (int)error,
                                y_extra_begin[0], y_extra_end[0], error_threshold[0], blockLen, km);
        }
    }
    else if (groupLen > 1)
    {
        // Reserve_Banded_BPM_4_SSE_only(dumy->overlap_region_group[0], dumy->overlap_region_group[1], 
        //         dumy->overlap_region_group[2], dumy->overlap_region_group[3], Window_Len, x_string, blockLen,
        //             return_sites, return_sites_error, max_error, dumy->Peq_SSE);

        for (i = 0; i < groupLen; i++)
        {
            return_sites[i] = Reserve_Banded_BPM(dumy->overlap_region_group[i], Window_Len, x_string, blockLen, max_error, &return_sites_error[i]);

            if (return_sites_error[i]!=(unsigned int)-1) {
                overlap_list->list[overlapID[i]].align_length += x_len;
                append_window_list(&overlap_list->list[overlapID[i]], window_start, window_end, 
                                y_startGroup[i], y_startGroup[i] + return_sites[i], (int)return_sites_error[i],
                                y_extra_begin[i], y_extra_end[i], error_threshold[i], blockLen, km);
            }
        }

        groupLen = 0;
    }

    long long reverse_i = dumy->size - 1;
    int threshold;
    
    ///here are overlaps partially covered by blockLen
    for (i = 0; i < (long long)dumy->lengthNT; i++)
    {
        extra_begin = extra_end = 0;
        currentID = dumy->overlapID[reverse_i--];
        x_start = MAX(window_start, (long long)overlap_list->list[currentID].x_pos_s);
        x_end = MIN(window_end, (long long)overlap_list->list[currentID].x_pos_e);

        ///overlap length between [window_start, window_end]
        x_len = x_end - x_start + 1;
        threshold = x_len * max_ov_diff_ec;
        /****************************may have bugs********************************/
        threshold = Adjust_Threshold(threshold, x_len);
        if(threshold > THRESHOLD_MAX_SIZE) threshold = THRESHOLD_MAX_SIZE;
        /****************************may have bugs********************************/
        
        ///offset of y
        y_start = (x_start - overlap_list->list[currentID].x_pos_s) + overlap_list->list[currentID].y_pos_s;
        /****************************may have bugs********************************/
        y_start += y_start_offset(x_start, &(overlap_list->list[currentID].f_cigar));
        /****************************may have bugs********************************/

        Window_Len = x_len + (threshold << 1);

        if(!determine_overlap_region(threshold, y_start, overlap_list->list[currentID].y_id, Window_Len, uref->ug->u.a[overlap_list->list[currentID].y_id].len,
        &extra_begin, &extra_end, &y_start, &o_len)) {
            continue;
        }

        // if(overlap_list->list[currentID].y_id == 4) {
        //     fprintf(stderr, "[M::%s] q_s::%lld, t_s::%lld, t_pri_l::%lld, aux_beg::%d, aux_end::%d, aln_l::%lld\n", __func__, 
        //         x_start, y_start, o_len, extra_begin, extra_end, Window_Len);
        // }
        
        fill_subregion_ul(dumy->overlap_region, y_start, o_len, overlap_list->list[currentID].y_pos_strand, 
        uref, overlap_list->list[currentID].y_id, extra_begin, extra_end);        

        x_string = r_string + x_start;
        y_string = dumy->overlap_region;

        end_site = Reserve_Banded_BPM(y_string, Window_Len, x_string, x_len, threshold, &error);

        if (error!=(unsigned int)-1) {
            overlap_list->list[currentID].align_length += x_len;
            append_window_list(&overlap_list->list[currentID], x_start, x_end, y_start, y_start + end_site, (int)error,
            extra_begin, extra_end, threshold, blockLen, km);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movsd %xmm0, 0xe8(%rsp)
movq %r9, 0xc8(%rsp)
movq %r8, 0xd0(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x170(%rsp), %rax
movq %rcx, 0x68(%rsp)
cmpq $0x0, 0x30(%rcx)
jle 0x48b34
movq 0x178(%rsp), %rsi
leaq (%rax,%rsi,2), %rax
movq %rax, 0x58(%rsp)
leal (%rsi,%rsi), %eax
cltq
addq $0x1f, %rax
movq %rax, 0x80(%rsp)
movslq %esi, %rax
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rcx
leaq 0x244(%rcx), %rax
movq %rax, 0x60(%rsp)
movq 0xc8(%rsp), %rax
movq 0x10(%rsp), %rdx
addq %rdx, %rax
movq %rax, 0x28(%rsp)
leaq 0x438(%rcx), %rax
movq %rax, 0x70(%rsp)
leaq 0x62c(%rcx), %rax
movq %rax, 0xe0(%rsp)
leaq 0x820(%rcx), %rax
movq %rax, 0xd8(%rsp)
movq $0x0, 0x20(%rsp)
movzwl %si, %eax
movl %eax, 0x8c(%rsp)
xorl %r13d, %r13d
movq $0x0, (%rsp)
movq 0x28(%rcx), %rax
movq (%rax,%r13,8), %rcx
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x38(%rsp)
imulq $0xa8, %rcx, %rbx
leaq (%rax,%rbx), %r15
addq $0x38, %r15
movl -0x34(%r15), %ebp
movl -0x24(%r15), %r14d
movl 0x8(%r15), %esi
decl %esi
movq %r15, %rdi
callq 0x3d110
cltq
movl 0x8(%r15), %r12d
cmpq 0x10(%rsp), %rax
je 0x485bc
testl %r12d, %r12d
je 0x48e12
xorl %r12d, %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x3d110
cltq
cmpq 0x10(%rsp), %rax
jg 0x485a6
incq %r12
movl 0x8(%r15), %eax
cmpq %rax, %r12
jb 0x48584
jmp 0x485b3
testq %r12, %r12
je 0x48e12
movl 0x8(%r15), %eax
cmpq %rax, %r12
je 0x48e12
movq 0x10(%rsp), %rax
subq %rbp, %rax
addq %rax, %r14
decl %r12d
movq %r15, %rdi
movl %r12d, %esi
callq 0x3d11b
cltq
addq %r14, %rax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movl 0x10(%rcx,%rbx), %esi
movq 0xd0(%rsp), %rdx
movq (%rdx), %rdx
movq 0x10(%rdx), %rdx
leaq (%rsi,%rsi,4), %rsi
movl (%rdx,%rsi,8), %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
cmpq %r15, %rax
jae 0x48996
movq 0x80(%rsp), %rdi
subq %rax, %rdi
addq %r15, %rdi
movq 0x58(%rsp), %r8
cmpq %r8, %rdi
jl 0x48996
leaq (%rdx,%rsi,8), %rdx
subq 0x50(%rsp), %rax
subq %rax, %r15
cmpq %r8, %r15
cmovgeq %r8, %r15
subq %r15, %r8
movq %r8, (%rsp)
movl %eax, %esi
negl %esi
testq %rax, %rax
movl $0x0, %edi
cmovgq %rax, %rdi
movq %rdi, %r8
movq %rdi, 0x78(%rsp)
sarq $0x3f, %rax
andl %esi, %eax
subq %rax, %r15
movq 0x20(%rsp), %r12
movslq %r12d, %r12
imulq $0x1f4, %r12, %rbp      # imm = 0x1F4
addq 0x60(%rsp), %rbp
movzbl 0x1c(%rcx,%rbx), %ecx
movslq %eax, %rbx
leaq (%rbx,%rbp), %r14
subq $0x8, %rsp
xorl %edi, %edi
movq %r14, %rsi
movq %r15, %r9
pushq $0x0
callq 0x36049
addq $0x10, %rsp
movq %rbp, %rdi
movl $0x4e, %esi
movq %rbx, %rdx
callq 0x20e0
addq %r14, %r15
movslq (%rsp), %r14
movq %r15, %rdi
movl $0x4e, %esi
movq %r14, %rdx
callq 0x20e0
movl %ebx, 0xb0(%rsp,%r12,4)
movl %r14d, 0xa0(%rsp,%r12,4)
movq 0x38(%rsp), %rax
movq %rax, 0x110(%rsp,%r12,8)
movq 0x78(%rsp), %rax
movq %rax, 0xf0(%rsp,%r12,8)
movq 0x50(%rsp), %rax
movl %eax, 0x90(%rsp,%r12,4)
incl %r12d
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movq %r12, 0x20(%rsp)
cmpl $0x4, %r12d
jne 0x48996
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %r14
movl %r14d, %esi
movq 0x28(%rsp), %rbp
movq %rbp, %rdx
movq 0x170(%rsp), %rbx
movl %ebx, %ecx
movl 0x8c(%rsp), %r15d
movl %r15d, %r8d
leaq 0x40(%rsp), %r9
callq 0x84e99
movl %eax, %r12d
movq 0x70(%rsp), %rdi
movl %r14d, %esi
movq %rbp, %rdx
movl %ebx, %ecx
movl %r15d, %r8d
leaq 0x44(%rsp), %r9
callq 0x84e99
movl %eax, 0x20(%rsp)
movq 0xe0(%rsp), %rdi
movl %r14d, %esi
movq %rbp, %rdx
movl %ebx, %ecx
movl %r15d, %r8d
leaq 0x48(%rsp), %r9
callq 0x84e99
movl %eax, 0x38(%rsp)
movq 0xd8(%rsp), %rdi
movl %r14d, %esi
movq %rbp, %rdx
movl %ebx, %ecx
movl %r15d, %r8d
leaq 0x4c(%rsp), %r9
callq 0x84e99
movl %eax, %ebp
cmpl $-0x1, 0x40(%rsp)
je 0x48819
imulq $0xa8, 0x110(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
addl %ebx, 0x28(%rcx,%rax)
leaq (%rcx,%rax), %rdi
movl 0xf0(%rsp), %ecx
addl %ecx, %r12d
movl 0x40(%rsp), %r9d
movl 0xb0(%rsp), %eax
movl 0xa0(%rsp), %r10d
movl 0x90(%rsp), %r11d
subq $0x8, %rsp
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
movl %r12d, %r8d
pushq 0x188(%rsp)
pushq %rbx
pushq %r11
pushq %r10
pushq %rax
callq 0x3efc4
addq $0x30, %rsp
cmpl $-0x1, 0x44(%rsp)
je 0x48893
imulq $0xa8, 0x118(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movq 0x170(%rsp), %rbx
addl %ebx, 0x28(%rcx,%rax)
leaq (%rcx,%rax), %rdi
movl 0xf8(%rsp), %ecx
movl 0x20(%rsp), %r8d
addl %ecx, %r8d
movl 0x44(%rsp), %r9d
movl 0xb4(%rsp), %eax
movl 0xa4(%rsp), %r10d
movl 0x94(%rsp), %r11d
subq $0x8, %rsp
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
pushq 0x188(%rsp)
pushq %rbx
pushq %r11
pushq %r10
pushq %rax
callq 0x3efc4
addq $0x30, %rsp
cmpl $-0x1, 0x48(%rsp)
je 0x4890d
imulq $0xa8, 0x120(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movq 0x170(%rsp), %rbx
addl %ebx, 0x28(%rcx,%rax)
leaq (%rcx,%rax), %rdi
movl 0x100(%rsp), %ecx
movl 0x38(%rsp), %r8d
addl %ecx, %r8d
movl 0x48(%rsp), %r9d
movl 0xb8(%rsp), %eax
movl 0xa8(%rsp), %r10d
movl 0x98(%rsp), %r11d
subq $0x8, %rsp
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
pushq 0x188(%rsp)
pushq %rbx
pushq %r11
pushq %r10
pushq %rax
callq 0x3efc4
addq $0x30, %rsp
movq $0x0, 0x20(%rsp)
cmpl $-0x1, 0x4c(%rsp)
je 0x4898d
imulq $0xa8, 0x128(%rsp), %rax
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movq 0x170(%rsp), %rbx
addl %ebx, 0x28(%rcx,%rax)
leaq (%rcx,%rax), %rdi
movl 0x108(%rsp), %ecx
addl %ecx, %ebp
movl 0x4c(%rsp), %r9d
movl 0xbc(%rsp), %eax
movl 0xac(%rsp), %r10d
movl 0x9c(%rsp), %r11d
subq $0x8, %rsp
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
movl %ebp, %r8d
pushq 0x188(%rsp)
pushq %rbx
pushq %r11
pushq %r10
pushq %rax
callq 0x3efc4
addq $0x30, %rsp
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
incq %r13
movq 0x68(%rsp), %rcx
cmpq 0x30(%rcx), %r13
jl 0x48531
movq 0x20(%rsp), %rax
cmpl $0x1, %eax
jne 0x48a62
leaq 0x244(%rcx), %rdi
movq 0x178(%rsp), %rax
movzwl %ax, %r8d
leaq 0x1c(%rsp), %rbx
movq 0x58(%rsp), %rsi
movq (%rsp), %rdx
movq 0x170(%rsp), %r14
movl %r14d, %ecx
movq %rbx, %r9
callq 0x84e99
cmpl $-0x1, (%rbx)
je 0x48b34
imulq $0xa8, 0x110(%rsp), %rcx
movq 0x8(%rsp), %rdx
movq (%rdx), %rdx
addl %r14d, 0x28(%rdx,%rcx)
leaq (%rdx,%rcx), %rdi
movl 0xf0(%rsp), %ecx
addl %ecx, %eax
movl 0x1c(%rsp), %r9d
movl 0xb0(%rsp), %r10d
movl 0xa0(%rsp), %r11d
movl 0x90(%rsp), %ebx
subq $0x8, %rsp
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
movl %eax, %r8d
pushq 0x188(%rsp)
pushq %r14
pushq %rbx
pushq %r11
pushq %r10
callq 0x3efc4
addq $0x30, %rsp
jmp 0x48b34
movq 0x170(%rsp), %r12
movq 0x60(%rsp), %rdi
jle 0x48b34
movl %eax, %r14d
shlq $0x2, %r14
xorl %r15d, %r15d
movq 0x178(%rsp), %rax
movzwl %ax, %ebp
leaq (%rsp,%r15), %rbx
addq $0x40, %rbx
movq %rdi, %r13
movq 0x58(%rsp), %rsi
movq (%rsp), %rdx
movl %r12d, %ecx
movl %ebp, %r8d
movq %rbx, %r9
callq 0x84e99
cmpl $-0x1, (%rbx)
je 0x48b1d
imulq $0xa8, 0x110(%rsp,%r15,2), %rcx
movq 0x8(%rsp), %rdx
movq (%rdx), %rdx
addl %r12d, 0x28(%rdx,%rcx)
leaq (%rdx,%rcx), %rdi
movl 0xf0(%rsp,%r15,2), %ecx
addl %ecx, %eax
movl 0x40(%rsp,%r15), %r9d
movl 0xb0(%rsp,%r15), %r10d
movl 0xa0(%rsp,%r15), %r11d
movl 0x90(%rsp,%r15), %ebx
subq $0x8, %rsp
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
movl %eax, %r8d
pushq 0x188(%rsp)
pushq %r12
pushq %rbx
pushq %r11
pushq %r10
callq 0x3efc4
addq $0x30, %rsp
addq $0x4, %r15
movq %r13, %rdi
addq $0x1f4, %rdi            # imm = 0x1F4
cmpq %r15, %r14
jne 0x48a8a
movq 0x68(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jle 0x48e00
movq 0x40(%rax), %rcx
leaq 0x50(%rax), %rdx
movq %rdx, 0x50(%rsp)
xorl %r14d, %r14d
movq %r14, 0x20(%rsp)
movq 0x28(%rax), %rax
movq %rcx, 0x58(%rsp)
imulq $0xa8, -0x8(%rax,%rcx,8), %rcx
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x38(%rsp)
leaq (%rax,%rcx), %r15
addq $0x38, %r15
movl -0x34(%r15), %r12d
movl -0x30(%r15), %ecx
movq 0x10(%rsp), %rbp
cmpq %rbp, %r12
cmovgq %r12, %rbp
movq 0x30(%rsp), %rax
cmpq %rax, %rcx
cmovgeq %rax, %rcx
movq %rcx, 0x80(%rsp)
movq %rcx, %rax
subq %rbp, %rax
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
mulsd 0xe8(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
cmpl $0x1f, %ecx
movl $0x1f, %edx
cmovll %ecx, %edx
cmpq $0x3, %rax
movl %edx, %r13d
movl $0x1, %eax
cmovgel %eax, %r13d
testl %ecx, %ecx
cmovnel %edx, %r13d
movl -0x24(%r15), %r14d
movl 0x8(%r15), %esi
decl %esi
movq %r15, %rdi
callq 0x3d110
cltq
movl 0x8(%r15), %ebx
cmpq %rax, %rbp
je 0x48c48
testl %ebx, %ebx
je 0x48e17
xorl %ebx, %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x3d110
cltq
cmpq %rax, %rbp
jl 0x48c32
incq %rbx
movl 0x8(%r15), %eax
cmpq %rax, %rbx
jb 0x48c13
jmp 0x48c3f
testq %rbx, %rbx
je 0x48e17
movl 0x8(%r15), %eax
cmpq %rax, %rbx
je 0x48e17
movq %rbp, %rax
subq %r12, %rax
addq %rax, %r14
decl %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x3d11b
movslq %eax, %r15
addq %r14, %r15
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x38(%rsp), %rcx
movl 0x10(%rax,%rcx), %edx
movq 0xd0(%rsp), %rcx
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
leaq (%rdx,%rdx,4), %rdx
movl (%rcx,%rdx,8), %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
cmpq %r12, %r15
movq 0x20(%rsp), %r14
jae 0x48de6
leal (,%r13,2), %esi
movslq %esi, %rsi
movq (%rsp), %rdi
leaq (%rdi,%rsi), %rbx
subq %r15, %rsi
addq %r12, %rsi
addq $0x1f, %rsi
cmpq %rbx, %rsi
jl 0x48de6
leaq (%rcx,%rdx,8), %rdx
movslq %r13d, %rcx
subq %rcx, %r15
subq %r15, %r12
cmpq %rbx, %r12
cmovgeq %rbx, %r12
movq %rbx, %rcx
subq %r12, %rcx
movq %rcx, 0x28(%rsp)
movl %r15d, %ecx
negl %ecx
testq %r15, %r15
movl $0x0, %r8d
cmovgq %r15, %r8
sarq $0x3f, %r15
andl %ecx, %r15d
subq %r15, %r12
movq 0x38(%rsp), %rcx
movzbl 0x1c(%rax,%rcx), %ecx
movslq %r15d, %rsi
movq %rsi, 0x60(%rsp)
movq 0x50(%rsp), %rax
addq %rax, %rsi
movq %rsi, 0x78(%rsp)
subq $0x8, %rsp
xorl %edi, %edi
movq %r8, 0x78(%rsp)
movq %r12, %r9
pushq $0x0
callq 0x36049
addq $0x10, %rsp
movq 0x50(%rsp), %rdi
movl $0x4e, %esi
movq 0x60(%rsp), %rdx
callq 0x20e0
addq 0x78(%rsp), %r12
movslq 0x28(%rsp), %rdx
movq %r12, %rdi
movl $0x4e, %esi
callq 0x20e0
movq 0xc8(%rsp), %rax
leaq (%rax,%rbp), %rdx
movzwl %r13w, %r8d
movq 0x50(%rsp), %rdi
movl %ebx, %esi
movq (%rsp), %rcx
leaq 0x1c(%rsp), %r9
callq 0x84e99
cmpl $-0x1, 0x1c(%rsp)
je 0x48de6
movq 0x8(%rsp), %rcx
movq (%rcx), %rcx
movq 0x38(%rsp), %rdx
movq (%rsp), %rsi
addl %esi, 0x28(%rcx,%rdx)
leaq (%rcx,%rdx), %rdi
movq 0x70(%rsp), %rcx
addl %ecx, %eax
movl 0x1c(%rsp), %r9d
subq $0x8, %rsp
movq %rbp, %rsi
movq 0x88(%rsp), %rdx
movl %eax, %r8d
pushq 0x188(%rsp)
pushq 0x180(%rsp)
pushq %r13
pushq 0x48(%rsp)
pushq %r15
callq 0x3efc4
addq $0x30, %rsp
movq 0x58(%rsp), %rcx
decq %rcx
incq %r14
movq 0x68(%rsp), %rax
cmpq 0x38(%rax), %r14
jl 0x48b54
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x56e8
callq 0x5714