// File: chhylp123[P]hifiasm/Correct.cpp
// Function: set_herror_win(overlap_region_alloc*, Correct_dumy*, kvec_t_u64_warp*, double, long, long)
void set_herror_win(overlap_region_alloc* ovlp, Correct_dumy* du, kvec_t_u64_warp* v_idx, double max_ov_diff_ec, int64_t rLen, int64_t blockLen)
{
    Window_Pool w_inf; int32_t flag = 0; uint64_t cID, mm, fc, fw, idx_n, idx_i;
    init_Window_Pool(&w_inf, rLen, blockLen, (int)(1.0/max_ov_diff_ec));
    long long window_start, window_end; int64_t i, k, mLen, w_list_id, ws, we; 

    idx_n = get_num_wins(0, rLen, blockLen); idx_i = 0;
    kv_resize(uint64_t, v_idx->a, idx_n); v_idx->a.n = idx_n; 

    while(get_Window(&w_inf, &window_start, &window_end) && flag != -2) {
        du->length = du->lengthNT = 0;
        flag = get_interval(window_start, window_end, ovlp, du, w_inf.window_length);
        switch (flag) {
            case 1:    ///no match here
                break;
            case 0:    ///no match here
                break;
            case -2: ///if flag == -2, loop would be terminated
                break;
        }

        v_idx->a.a[idx_i++] = ((uint64_t)(v_idx->a.n))<<32;
        for (i = 0; i < (int64_t)du->length; i++) {
            cID = (uint32_t)du->overlapID[i];
            if(ovlp->list[cID].is_match!=3 && ovlp->list[cID].is_match!=4) continue;
            w_list_id = get_adjust_winid(&(ovlp->list[cID]), window_start, w_inf.window_length);
            if(w_list_id >= 0) break;///a matched window
        }
        if(i < (int64_t)du->length) continue;///if there is a matched window

        for (i = 0, mm = 0; i < (int64_t)du->length; i++) {///all windows are unmatched
            cID = (uint32_t)du->overlapID[i];
            if(ovlp->list[cID].is_match!=3 && ovlp->list[cID].is_match!=4) continue;
            ovlp->list[cID].is_match = 4; 
            ovlp->list[cID].align_length += window_end + 1 - window_start;
            mm++;
        }
        if(mm > 0) {
            kv_push(uint64_t, v_idx->a, (((uint64_t)window_start)<<32)|((uint64_t)window_end));
            v_idx->a.a[idx_i-1]++;
        }


        ///shorter than blockLen
        for (i = du->size-du->lengthNT, mLen = du->size-du->lengthNT, fc = 0; i < (int64_t)du->size; i++) {
            cID = (uint32_t)du->overlapID[i];
            if(ovlp->list[cID].is_match!=3 && ovlp->list[cID].is_match!=4) continue;
            get_win_se_by_normalize_xs(&(ovlp->list[cID]), window_start, blockLen, &ws, &we);
            w_list_id = get_adjust_winid(&(ovlp->list[cID]), ws, blockLen);
            if (w_list_id >= 0) {///matched
                cID = w_list_id; cID <<= 32; cID += (uint32_t)du->overlapID[i]; du->overlapID[i] = cID;
                if(mLen != i) {
                    mm = du->overlapID[i]; du->overlapID[i] = du->overlapID[mLen]; du->overlapID[mLen] = mm;
                }
                mLen++;
            } else {///unmatched
                cID = (uint32_t)-1; cID <<= 32; cID += (uint32_t)du->overlapID[i]; du->overlapID[i] = cID;
                fc++;
            }
        }
        // if(mLen == (int64_t)du->size) continue;///if all windows shorter than blockLen are matched
        if(fc == 0) continue;///no unmatched windows that are shorter than blockLen
        for (i = mLen; i < (int64_t)du->size; i++){///check the remaining unmatched windows that are shorter than blockLen
            cID = (uint32_t)du->overlapID[i];
            if(ovlp->list[cID].is_match!=3 && ovlp->list[cID].is_match!=4) continue;
            assert((du->overlapID[i]>>32)==(uint32_t)-1);
            get_win_se_by_normalize_xs(&(ovlp->list[cID]), window_start, blockLen, &ws, &we);
            for (k = du->size-du->lengthNT; k < mLen; k++) {///all matched windows
                fc = (uint32_t)du->overlapID[k]; fw = du->overlapID[k]>>32;
                assert(fw!=(uint32_t)-1); assert(ovlp->list[fc].is_match == 3 || ovlp->list[fc].is_match == 4);
                // if (ovlp->list[fc].w_list[fw].y_end == -1 || (ovlp->list[fc].is_match!=3 && ovlp->list[fc].is_match!=4)) fprintf(stderr, "ERROR\n");        
                ///if there is one matched window can cover the unmatched window
                if(ovlp->list[fc].w_list.a[fw].x_start<=ws && ovlp->list[fc].w_list.a[fw].x_end>=we) { 
                        break;
                }
            }

            if(k >= mLen) {///no matched window can cover the unmatched window
                ovlp->list[cID].is_match = 4; 
                ovlp->list[cID].align_length += we + 1 - ws;
                kv_push(uint64_t, v_idx->a, (((uint64_t)ws)<<32)|((uint64_t)we));
                v_idx->a.a[idx_i-1]++;
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x6c(%rbp)
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movsd 0x34a975(%rip), %xmm0   # 0x382000
divsd -0x20(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movslq %eax, %rcx
leaq -0x68(%rbp), %rdi
callq 0x9f470
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
callq 0x340c0
movq %rax, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x98(%rbp), %rax
jae 0x377a2
movq -0x98(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0x18(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x377a4
movq -0x98(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
leaq -0x68(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x9f520
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xe1(%rbp)
je 0x377e5
cmpl $-0x2, -0x6c(%rbp)
setne %al
movb %al, -0xe1(%rbp)
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x377f4
jmp 0x38103
movq -0x10(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rcx
movq -0x60(%rbp), %r8
callq 0x9f600
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0xe8(%rbp)
subl $-0x2, %eax
je 0x3785b
jmp 0x3783e
movl -0xe8(%rbp), %eax
testl %eax, %eax
je 0x37859
jmp 0x3784a
movl -0xe8(%rbp), %eax
subl $0x1, %eax
jne 0x3785d
jmp 0x37857
jmp 0x3785d
jmp 0x3785d
jmp 0x3785d
movq -0x18(%rbp), %rax
movq (%rax), %rdx
shlq $0x20, %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0xa0(%rbp)
movq %rdx, (%rax,%rcx,8)
movq $0x0, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jge 0x37948
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x3, %eax
je 0x378fa
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x4, %eax
je 0x378fa
jmp 0x37931
movq -0x8(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x78(%rbp), %rax
addq %rax, %rdi
movq -0xa8(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x37520
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0xd0(%rbp)
jl 0x3792f
jmp 0x37948
jmp 0x37931
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
jmp 0x37894
movq -0xb8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jge 0x3795e
jmp 0x377b2
movq $0x0, -0xb8(%rbp)
movq $0x0, -0x80(%rbp)
movq -0xb8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jge 0x37a3d
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x3, %eax
je 0x379d7
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x4, %eax
je 0x379d7
jmp 0x37a26
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movb $0x4, 0x2c(%rax)
movq -0xb0(%rbp), %rdx
addq $0x1, %rdx
subq -0xa8(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %ecx
addq %rdx, %rcx
movl %ecx, 0x28(%rax)
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
jmp 0x37971
cmpq $0x0, -0x80(%rbp)
jbe 0x37b09
jmp 0x37a4a
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x37abb
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x37a7a
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xf0(%rbp)
jmp 0x37a88
movl $0x2, %eax
movq %rax, -0xf0(%rbp)
jmp 0x37a88
movq -0xf0(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xa8(%rbp), %rdx
shlq $0x20, %rdx
orq -0xb0(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xa0(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0x38(%rcx), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0x38(%rcx), %rax
movq %rax, -0xc8(%rbp)
movq $0x0, -0x88(%rbp)
movq -0xb8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x40(%rcx), %rax
jge 0x37d49
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x3, %eax
je 0x37bab
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x4, %eax
je 0x37bab
jmp 0x37d32
movq -0x8(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x78(%rbp), %rax
addq %rax, %rdi
movq -0xa8(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
leaq -0xe0(%rbp), %r8
callq 0x9e0f0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x78(%rbp), %rax
addq %rax, %rdi
movq -0xd8(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x37520
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0xd0(%rbp)
jl 0x37cd5
movq -0xd0(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0xc8(%rbp), %rax
cmpq -0xb8(%rbp), %rax
je 0x37cc1
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xc8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x80(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xc8(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0x37d30
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x37d32
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
jmp 0x37b42
cmpq $0x0, -0x88(%rbp)
jne 0x37d58
jmp 0x377b2
movq -0xc8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x40(%rcx), %rax
jge 0x380fe
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x3, %eax
je 0x37dcf
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x4, %eax
je 0x37dcf
jmp 0x380e7
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
jne 0x37df2
jmp 0x37e11
leaq 0x34a710(%rip), %rdi    # 0x382509
leaq 0x34a51b(%rip), %rsi    # 0x38231b
movl $0xc5c, %edx            # imm = 0xC5C
leaq 0x34a722(%rip), %rcx    # 0x38252e
callq 0x2130
movq -0x8(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x78(%rbp), %rax
addq %rax, %rdi
movq -0xa8(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
leaq -0xe0(%rbp), %r8
callq 0x9e0f0
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
subq 0x38(%rcx), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jge 0x37fcf
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xc0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0xc0(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x90(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x90(%rbp)
je 0x37eb6
jmp 0x37ed5
leaq 0x34a6da(%rip), %rdi    # 0x382597
leaq 0x34a457(%rip), %rsi    # 0x38231b
movl $0xc60, %edx            # imm = 0xC60
leaq 0x34a65e(%rip), %rcx    # 0x38252e
callq 0x2130
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %ecx
movb $0x1, %al
cmpl $0x3, %ecx
movb %al, -0xf1(%rbp)
je 0x37f20
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x4, %eax
sete %al
movb %al, -0xf1(%rbp)
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x37f2c
jmp 0x37f2e
jmp 0x37f4d
leaq 0x34a673(%rip), %rdi    # 0x3825a8
leaq 0x34a3df(%rip), %rsi    # 0x38231b
movl $0xc60, %edx            # imm = 0xC60
leaq 0x34a5e6(%rip), %rcx    # 0x38252e
callq 0x2130
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movq 0x58(%rax), %rax
movq -0x90(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq (%rax), %rax
cmpq -0xd8(%rbp), %rax
jg 0x37fb6
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x88(%rbp), %rcx
addq %rcx, %rax
movq 0x58(%rax), %rax
movq -0x90(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rax
cmpq -0xe0(%rbp), %rax
jl 0x37fb6
jmp 0x37fcf
jmp 0x37fb8
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0x37e58
movq -0xc0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jl 0x380e5
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movb $0x4, 0x2c(%rax)
movq -0xe0(%rbp), %rdx
addq $0x1, %rdx
subq -0xd8(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x78(%rbp), %rcx
addq %rcx, %rax
movl 0x28(%rax), %ecx
addq %rdx, %rcx
movl %ecx, 0x28(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x38097
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x38056
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x100(%rbp)
jmp 0x38064
movl $0x2, %eax
movq %rax, -0x100(%rbp)
jmp 0x38064
movq -0x100(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xd8(%rbp), %rdx
shlq $0x20, %rdx
orq -0xe0(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xa0(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x380e7
movq -0xb8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb8(%rbp)
jmp 0x37d66
jmp 0x377b2
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax)