// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/ecovlp.cpp
// Function: push_correct1_fhc_indel_exz(asg16_v*, long, window_list*, cns_gfa*, char*, UC_Read*, bit_extz_t*, unsigned long, unsigned long, long, long)
uint64_t push_correct1_fhc_indel_exz(asg16_v *sc, int64_t sc0, window_list *idx, cns_gfa *cns, char *ostr, UC_Read* tu, bit_extz_t *exz, uint64_t gbeg, uint64_t c0, int64_t cl0, int64_t ok0)
{
    int64_t ck = sc->n, k, ok = 0, nk = 0, cn, cn0, nl, ol, diff, diff0, ml, ml0, e0 = 0; uint32_t on, f = 0, nec = 0; uint16_t bq, bt, op; 
    assert(c0 == 3);

    ///debug
    // char cm[4]; cm[0] = 'M'; cm[1] = 'S'; cm[2] = 'I'; cm[3] = 'D';

    // if(c0 != 2) ok += cl0;
    // if(c0 != 3) nk += cl0;
    ok += cl0; e0 += cl0;

    // fprintf(stderr, "\n%lu%c", cl0, cm[c0]);

    for (ck--; ck >= sc0/**0**/; ck--) {
        op = sc->a[ck]>>14;
        if(!op) break;

        if((op == 2) || (op == 3)) {
            on = sc->a[ck]&(0xfff);
        } else if(op == 1) {
            on = sc->a[ck]&(0x3ff);
        } else {
            on = sc->a[ck]&(0x3fff);
        }
        if(op != 2) ok += on;
        if(op != 3) nk += on;
        if(op != 0) e0 += on;
        if(c0 != op) f = 1;

        // fprintf(stderr, "%u%c(%c)", on, cm[op], "ACGT"[((sc->a[ck]>>12)&3)]);
    }
    cn0 = ck + 1; cn = sc->n;
    // fprintf(stderr, "\n");

    // fprintf(stderr, "+[M::%s] cn0::%ld, cn::%ld, ok::%ld, sc->n::%u, ok0::%ld, cl0::%ld\n", __func__, cn0, cn, ok, (uint32_t)sc->n, ok0, cl0);
    // f = 0;

    if((!f) || (!ok) || (!nk)) {
        for (k = 0, ck = ok0 + gbeg; k < cl0; k++, ck++) {
            push_trace_bp_f(sc, c0, cns->a[ck].c, (uint16_t)-1,  1, ((idx->clen>0)?1:0));
            idx->clen = sc->n - idx->cidx; nec++;
            // fprintf(stderr, "%c\n", "ACGT"[cns->a[ck].c]);
        }
    } else {
        char *oseq = NULL, *nseq = NULL; int64_t wo[2], wn[2];
        UC_Read_resize((*tu), nk); nseq = tu->seq; wo[0] = wo[1] = wn[0] = wn[1] = 0; 
        // if(c0 != 2) ok0 += cl0;
        ok0 += cl0;

        ok0 -= ok; 
        // if(!(ok0 >= 0)) {
        //     fprintf(stderr, "+[M::%s] rid::%u, cn0::%ld, cn::%ld, ok0::%ld, ok::%ld, sc->n::%u\n", __func__, rid, cn0, cn, ok0, ok, (uint32_t)sc->n);
        // }
        assert(ok0 >= 0);
        
        oseq = ostr + ok0;
        ol = ok; nl = nk; 
        ck = cn0; ok = nk = 0;
        while (ck < cn) {
            wo[0] = ok; wn[0] = nk;
            ck = pop_trace_bp_f(sc, ck, &op, &bq, &bt, &on);
            if(op != 2) ok += on;
            if(op != 3) nk += on;
            wo[1] = ok; wn[1] = nk;

            if(op == 0) {
                memcpy(nseq + wn[0], oseq + wo[0], (wo[1]-wo[0])*sizeof((*nseq)));
            } else if(op == 1 || op == 2) {
                for (k = wn[0]; k < wn[1]; k++) nseq[k] = s_H[bt];
            }
            // fprintf(stderr, "[M::%s] ck::%ld, wo::[%ld, %ld), wn::[%ld, %ld)\n", __func__, ck, wo[0], wo[1], wn[0], wn[1]);
        }
        // fprintf(stderr, "[M::%s] qstr::%.*s*\n", __func__, (int32_t)ol, oseq);
        // fprintf(stderr, "[M::%s] tstr::%.*s*\n", __func__, (int32_t)nl, nseq);
        
        assert(wo[1] + cl0 == ol); 
        assert(wn[1] == nl); ///since c0 must be 3
        // memcpy(nseq + wn[1], oseq + wo[1], cl0*sizeof((*nseq)));
        if(nl == ol && nl == 1) {
            sc->n = cn0;
            if(oseq[0] == nseq[0]) {
                push_trace_bp_f(sc, 0, (uint16_t)-1, (uint16_t)-1, 1, ((idx->clen>0)?1:0)); 
                idx->clen = sc->n - idx->cidx; 
            } else {
                push_trace_bp_f(sc, 1, seq_nt6_table[(uint32_t)(oseq[0])], seq_nt6_table[(uint32_t)(nseq[0])], 1, ((idx->clen>0)?1:0)); 
                idx->clen = sc->n - idx->cidx; nec++;
            }
        } else {
            ml = MAX(ol, nl); f = 0;
            
            diff = 31;
            if(diff > ml) diff = ml; 
            diff0 = diff; clear_align(*exz);
            cal_exz_global(nseq, nl, oseq, ol, diff, exz);
            if(is_align(*exz)) f = 1; 

            if(!f) {
                diff = 63;
                if(diff > ml) diff = ml; 
                if(diff > diff0) {
                    diff0 = diff; clear_align(*exz);
                    cal_exz_global(nseq, nl, oseq, ol, diff, exz);
                    if(is_align(*exz)) f = 1; 
                }
            }

            // fprintf(stderr, "[M::%s] f::%u, exz->err::%d, e0::%ld\n", __func__, f, exz->err, e0);

            if(f && exz->err < e0) {
                sc->n = cn0;
                cn = exz->cigar.n; ok = nk = 0;
                for (ck = 0; ck < cn;) {
                    wo[0] = ok; wn[0] = nk;
                    ck = pop_trace(&(exz->cigar), ck, &op, &on);
                    if(op!=2) ok += on;
                    if(op!=3) nk += on; 
                    wo[1] = ok; wn[1] = nk;

                    // fprintf(stderr, "%u%c(", on, cm[op]);

                    if(op == 0) {
                        push_trace_bp_f(sc, op, (uint16_t)-1, (uint16_t)-1, on, ((idx->clen>0)?1:0)); 
                        idx->clen = sc->n - idx->cidx; 
                    } else if(op == 1) {
                        for (k = 0; k < on; k++) {
                            push_trace_bp_f(sc, op, seq_nt6_table[(uint32_t)(oseq[wo[0]+k])], seq_nt6_table[(uint32_t)(nseq[wn[0]+k])], 1, ((idx->clen>0)?1:0)); 
                            idx->clen = sc->n - idx->cidx; nec++;
                            // fprintf(stderr, "<%c|%c>)", oseq[wo[0]+k], nseq[wn[0]+k]);
                        }
                    } else if(op == 2) {
                        for (k = 0; k < on; k++) {
                            push_trace_bp_f(sc, op, (uint16_t)-1, seq_nt6_table[(uint32_t)(nseq[wn[0]+k])], 1, ((idx->clen>0)?1:0)); 
                            idx->clen = sc->n - idx->cidx; nec++;
                            // fprintf(stderr, "<|%c>)", nseq[wn[0]+k]);
                        }
                    } else if(op == 3) {
                        for (k = 0; k < on; k++) {
                            push_trace_bp_f(sc, op, seq_nt6_table[(uint32_t)(oseq[wo[0]+k])], (uint16_t)-1, 1, ((idx->clen>0)?1:0)); 
                            idx->clen = sc->n - idx->cidx; nec++;
                            // fprintf(stderr, "<%c|>)", oseq[wo[0]+k]);
                        }
                    }
                    // fprintf(stderr, ")");
                }
                // fprintf(stderr, "\n");
            } else {
                if(ml < e0) {
                    sc->n = cn0;
                    ml0 = MIN(ol, nl); op = 1;
                    for (k = 0; k < ml0; k++) {
                        push_trace_bp_f(sc, op, seq_nt6_table[(uint32_t)(oseq[k])], seq_nt6_table[(uint32_t)(nseq[k])], 1, ((idx->clen>0)?1:0)); 
                        idx->clen = sc->n - idx->cidx; nec++;
                    }
                    
                    if(ol > ml0) {///op = 3
                        for (k = ml0, op = 3; k < ol; k++) {
                            push_trace_bp_f(sc, op, seq_nt6_table[(uint32_t)(oseq[k])], (uint16_t)-1, 1, ((idx->clen>0)?1:0)); 
                            idx->clen = sc->n - idx->cidx; nec++;
                        }
                    } else if(nl > ml0) {///op = 2
                        for (k = ml0, op = 2; k < nl; k++) {
                            push_trace_bp_f(sc, op, (uint16_t)-1, seq_nt6_table[(uint32_t)(nseq[k])], 1, ((idx->clen>0)?1:0)); 
                            idx->clen = sc->n - idx->cidx; nec++;
                        }
                    }
                } else {
                    for (k = 0, ck = ok0 + gbeg; k < cl0; k++, ck++) {
                        push_trace_bp_f(sc, c0, cns->a[ck].c, (uint16_t)-1,  1, ((idx->clen>0)?1:0));
                        idx->clen = sc->n - idx->cidx; nec++;
                    }
                }
            }
        }
    }

    // fprintf(stderr, "-[M::%s] cn0::%ld, cn::%ld, ok::%ld, sc->n::%u\n", __func__, cn0, cn, ok, (uint32_t)sc->n);
    return nec;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r9, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %rcx, 0x18(%rsp)
cmpq $0x3, 0xd0(%rsp)
jne 0x140b70
movq %rdx, %r12
movq %rdi, %r13
movq 0xe0(%rsp), %r15
movq 0xd8(%rsp), %rbp
movq (%rdi), %r10
xorl %eax, %eax
pushq $0x1
popq %r9
xorl %r14d, %r14d
movq %rbp, %rbx
movq %r10, 0x50(%rsp)
movq %rbp, %r11
xorl %ecx, %ecx
cmpq %rsi, %r10
jle 0x1403bb
movq 0x10(%r13), %rdi
movzwl -0x2(%rdi,%r10,2), %r8d
movl %r8d, %edx
shrl $0xe, %edx
movw %dx, 0xa(%rsp)
cmpw $0x4000, %r8w           # imm = 0x4000
jb 0x1403bb
testw %r8w, %r8w
js 0x140379
movzwl -0x2(%rdi,%r10,2), %edi
cmpw $0x1, %dx
jne 0x140387
andl $0x3ff, %edi            # imm = 0x3FF
jmp 0x14038d
movzwl -0x2(%rdi,%r10,2), %edi
andl $0xfff, %edi            # imm = 0xFFF
jmp 0x14038d
andl $0x3fff, %edi           # imm = 0x3FFF
movl %edi, 0xc(%rsp)
cmpw $0x2, %dx
movl %edi, %edi
movq %rdi, %r8
cmoveq %rax, %r8
addq %r8, %rbx
cmpw $0x3, %dx
movq %rdi, %rdx
cmoveq %rax, %rdx
cmovnel %r9d, %ecx
addq %rdx, %r14
addq %rdi, %r11
decq %r10
jmp 0x14033d
testl %ecx, %ecx
je 0x140511
testq %rbx, %rbx
je 0x140511
testq %r14, %r14
je 0x140511
movq 0x30(%rsp), %rcx
movq (%rcx), %rax
cmpq %r14, 0x10(%rcx)
movq %r10, 0x10(%rsp)
movq %r11, 0x70(%rsp)
jge 0x140410
movq %rax, %rdi
movq %r14, %rsi
movq %rcx, %rbp
callq 0x2370
movq 0x10(%rsp), %r10
movq %rax, (%rbp)
movq %r14, 0x10(%rbp)
movq 0xd8(%rsp), %rbp
movq %r14, 0x38(%rsp)
movq %rax, 0x20(%rsp)
movq %r13, 0x30(%rsp)
movq %r12, 0x58(%rsp)
addq %rbp, %r15
movq %r15, 0x78(%rsp)
movq %rbx, 0x60(%rsp)
subq %rbx, %r15
js 0x140b8f
movq 0x28(%rsp), %rax
movq %r15, 0x80(%rsp)
addq %r15, %rax
movq %rax, 0x40(%rsp)
leaq 0x1132da(%rip), %r14    # 0x253730
movq %r10, %rbp
xorl %r12d, %r12d
xorl %ebx, %ebx
movq %rbx, %r13
cmpq 0x50(%rsp), %rbp
jge 0x14057f
movq 0x30(%rsp), %rdi
movl %ebp, %esi
leaq 0xa(%rsp), %rdx
leaq 0x6e(%rsp), %rcx
leaq 0x4e(%rsp), %r8
leaq 0xc(%rsp), %r9
callq 0xeeaa9
movzwl 0xa(%rsp), %ecx
cmpw $0x2, %cx
movl 0xc(%rsp), %edx
movq %rdx, %r15
movl $0x0, %esi
cmoveq %rsi, %r15
movl %eax, %ebp
addq %r12, %r15
cmpw $0x3, %cx
movq %rdx, %rbx
cmoveq %rsi, %rbx
addq %r13, %rbx
testw %cx, %cx
je 0x1404e7
movq %r15, %r12
cmpw $0x2, %cx
movq 0x10(%rsp), %r10
ja 0x14045e
movq 0x20(%rsp), %rcx
cmpq %rbx, %r13
jae 0x140509
movzwl 0x4e(%rsp), %eax
movb (%r14,%rax), %al
movb %al, (%rcx,%r13)
incq %r13
jmp 0x1404d0
addq 0x20(%rsp), %r13
addq 0x40(%rsp), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x2160
movq %r15, %r12
movq 0x10(%rsp), %r10
jmp 0x14045e
movq %r15, %r12
jmp 0x14045e
addq 0xc8(%rsp), %r15
xorl %r14d, %r14d
testq %rbp, %rbp
cmovgq %rbp, %r14
imulq $0x28, %r15, %rbx
pushq $0x3
popq %rbp
pushq $0x1
popq %r15
movq %r14, 0x10(%rsp)
subq $0x1, %r14
jb 0x140a5d
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax,%rbx), %edx
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%r12)
setne %r9b
andl $0x3, %edx
movq %r13, %rdi
movl %ebp, %esi
movl $0xffff, %ecx           # imm = 0xFFFF
movl %r15d, %r8d
callq 0x14f542
movl (%r13), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
addq $0x28, %rbx
jmp 0x140533
addq 0xd8(%rsp), %r12
movq 0x60(%rsp), %r15
cmpq %r15, %r12
jne 0x140bae
movq 0x38(%rsp), %rbp
cmpq %rbp, %r13
pushq $0x1
popq %r14
jne 0x140bcd
cmpq $0x1, %rbp
movq 0x58(%rsp), %r12
movq 0x30(%rsp), %r13
jne 0x140603
cmpq $0x1, %r15
jne 0x140603
movq %r10, (%r13)
movq 0x40(%rsp), %rax
movsbq (%rax), %rcx
movq 0x20(%rsp), %rax
movsbq (%rax), %rax
cmpb %al, %cl
jne 0x1409a5
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%r12)
setne %r9b
xorl %r14d, %r14d
pushq $0x1
popq %r8
movq %r13, %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
movl $0xffff, %ecx           # imm = 0xFFFF
jmp 0x1409ce
cmpq %rbp, %r15
movq %rbp, %r14
cmovgq %r15, %r14
cmpq $0x1f, %r14
pushq $0x1f
popq %r8
cmovbq %r14, %r8
movq 0xc0(%rsp), %rbx
movl $0x7fffffff, 0x2c(%rbx) # imm = 0x7FFFFFFF
movq 0x20(%rsp), %rdi
movl %ebp, %esi
movq 0x40(%rsp), %rdx
movl %r15d, %ecx
movq %rbx, %r9
callq 0x335d2
movl 0x2c(%rbx), %eax
cmpl 0x28(%rbx), %eax
movq 0x70(%rsp), %rcx
jle 0x140699
cmpq $0x20, %r14
jb 0x14090c
cmpq $0x3f, %r14
pushq $0x3f
popq %r8
cmovbq %r14, %r8
movq 0xc0(%rsp), %rbx
movl $0x7fffffff, 0x2c(%rbx) # imm = 0x7FFFFFFF
movq 0x20(%rsp), %rdi
movl %ebp, %esi
movq 0x40(%rsp), %rdx
movl %r15d, %ecx
movq %rbx, %r9
callq 0x335d2
movq 0x70(%rsp), %rcx
movl 0x2c(%rbx), %eax
cmpl 0x28(%rbx), %eax
jg 0x14090c
cltq
cmpq %rax, %rcx
jle 0x14090c
movq 0x10(%rsp), %rax
movq %rax, (%r13)
movq 0xc0(%rsp), %r14
movq 0xa8(%r14), %r15
addq $0xa8, %r14
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
movq $0x0, 0x10(%rsp)
movq %r14, 0x38(%rsp)
movq %r15, 0x28(%rsp)
movl %esi, %eax
cmpq %rax, %r15
jle 0x140a5d
movq %rdi, %rbp
movq %rbx, %r13
movq %r14, %rdi
leaq 0xa(%rsp), %rdx
leaq 0xc(%rsp), %rcx
callq 0x53a7d
movzwl 0xa(%rsp), %ecx
cmpq $0x2, %rcx
movl 0xc(%rsp), %r8d
movq %r8, %rdi
movl $0x0, %edx
cmoveq %rdx, %rdi
movl %eax, %esi
addq %rbp, %rdi
cmpq $0x3, %rcx
movq %r8, %rbx
cmoveq %rdx, %rbx
addq %r13, %rbx
cmpq $0x3, %rcx
ja 0x1406dc
movq %rdi, 0x50(%rsp)
movl %esi, 0x18(%rsp)
leaq 0xaf6fe(%rip), %rdx     # 0x1efe40
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
xorl %r9d, %r9d
movq 0x58(%rsp), %r12
cmpl $0x0, 0x1c(%r12)
setne %r9b
movq 0x30(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
movl $0xffff, %ecx           # imm = 0xFFFF
callq 0x14f542
movl (%r15), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
movq 0x28(%rsp), %r15
movl 0x18(%rsp), %esi
movq 0x50(%rsp), %rdi
jmp 0x1406dc
movq %r14, %r15
addq 0x40(%rsp), %rbp
xorl %r12d, %r12d
movq 0x58(%rsp), %r13
movl %r8d, %eax
cmpq %rax, %r12
jae 0x1407fd
movzwl 0xa(%rsp), %esi
movsbq (%rbp,%r12), %rax
movl %eax, %eax
leaq 0x112e6e(%rip), %rcx    # 0x253630
movzbl (%rcx,%rax), %edx
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%r13)
setne %r9b
movq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0xffff, %ecx           # imm = 0xFFFF
pushq $0x1
popq %r8
callq 0x14f542
movl (%r14), %eax
subl 0x18(%r13), %eax
movl %eax, 0x1c(%r13)
incq %r12
movl 0xc(%rsp), %r8d
jmp 0x1407a6
movq 0x10(%rsp), %rax
addl %r12d, %eax
movq %rax, 0x10(%rsp)
movq %r15, %r14
jmp 0x140783
addq 0x40(%rsp), %rbp
addq 0x20(%rsp), %r13
xorl %r12d, %r12d
movl %r8d, %eax
cmpq %rax, %r12
jae 0x140882
movzwl 0xa(%rsp), %esi
movsbq (%rbp,%r12), %rax
movl %eax, %eax
leaq 0x112df5(%rip), %rcx    # 0x253630
movzbl (%rcx,%rax), %edx
movsbq (%r13,%r12), %rax
movl %eax, %eax
movzbl (%rcx,%rax), %ecx
xorl %r9d, %r9d
movq 0x58(%rsp), %r15
cmpl $0x0, 0x1c(%r15)
setne %r9b
movq 0x30(%rsp), %r14
movq %r14, %rdi
pushq $0x1
popq %r8
callq 0x14f542
movl (%r14), %eax
subl 0x18(%r15), %eax
movl %eax, 0x1c(%r15)
incq %r12
movl 0xc(%rsp), %r8d
jmp 0x14081f
movq 0x10(%rsp), %rax
addl %r12d, %eax
movq %rax, 0x10(%rsp)
jmp 0x140902
addq 0x20(%rsp), %r13
xorl %r12d, %r12d
movq 0x10(%rsp), %rbp
movl %r8d, %eax
cmpq %rax, %r12
jae 0x1408fa
movzwl 0xa(%rsp), %esi
movsbq (%r13,%r12), %rax
movl %eax, %eax
leaq 0x112d76(%rip), %rcx    # 0x253630
movzbl (%rcx,%rax), %ecx
xorl %r9d, %r9d
movq 0x58(%rsp), %r15
cmpl $0x0, 0x1c(%r15)
setne %r9b
movq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0xffff, %edx           # imm = 0xFFFF
pushq $0x1
popq %r8
callq 0x14f542
movl (%r14), %eax
subl 0x18(%r15), %eax
movl %eax, 0x1c(%r15)
incq %r12
movl 0xc(%rsp), %r8d
jmp 0x14089e
addl %r12d, %ebp
movq %rbp, 0x10(%rsp)
movq 0x38(%rsp), %r14
jmp 0x140783
cmpq %rcx, %r14
jge 0x1409e3
movq 0x10(%rsp), %rax
movq %rax, (%r13)
cmpq %rbp, %r15
cmovlq %r15, %rbp
movw $0x1, 0xa(%rsp)
xorl %r15d, %r15d
testq %rbp, %rbp
movl $0x0, %ebx
movq %rbp, 0x18(%rsp)
cmovgq %rbp, %rbx
leaq 0x112ce9(%rip), %r14    # 0x253630
pushq $0x1
popq %rbp
cmpq %r15, %rbx
movq 0x20(%rsp), %rcx
je 0x140a77
movzwl 0xa(%rsp), %esi
movq 0x40(%rsp), %rax
movsbq (%rax,%r15), %rax
movl %eax, %eax
movzbl (%r14,%rax), %edx
movsbq (%rcx,%r15), %rax
movl %eax, %eax
movzbl (%r14,%rax), %ecx
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%r12)
setne %r9b
movq %r13, %rdi
movl %ebp, %r8d
callq 0x14f542
movl (%r13), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
incq %r15
jmp 0x14094a
movl %ecx, %ecx
leaq 0x112c82(%rip), %rsi    # 0x253630
movzbl (%rsi,%rcx), %edx
movl %eax, %eax
movzbl (%rsi,%rax), %ecx
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%r12)
setne %r9b
movq %r13, %rdi
movl %r14d, %esi
movl %r14d, %r8d
callq 0x14f542
movl (%r13), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
jmp 0x140a62
movq 0x80(%rsp), %rcx
addq 0xc8(%rsp), %rcx
xorl %r14d, %r14d
movq 0xd8(%rsp), %rax
testq %rax, %rax
cmovgq %rax, %r14
imulq $0x28, %rcx, %rbx
pushq $0x3
popq %rbp
pushq $0x1
popq %r15
movq %r14, 0x10(%rsp)
subq $0x1, %r14
jb 0x140a5d
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax,%rbx), %edx
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%r12)
setne %r9b
andl $0x3, %edx
movq %r13, %rdi
movl %ebp, %esi
movl $0xffff, %ecx           # imm = 0xFFFF
movl %r15d, %r8d
callq 0x14f542
movl (%r13), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
addq $0x28, %rbx
jmp 0x140a15
movq 0x10(%rsp), %r14
movl %r14d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x60(%rsp), %rax
cmpq %rax, 0x38(%rsp)
jge 0x140aee
movw $0x3, 0xa(%rsp)
movq 0x18(%rsp), %r15
subq %rax, %r15
movq 0x78(%rsp), %rax
addq %rax, 0x28(%rsp)
pushq $0x1
popq %rbp
testq %r15, %r15
je 0x140b4c
movzwl 0xa(%rsp), %esi
movq 0x28(%rsp), %rax
movsbq (%rax,%r15), %rax
movl %eax, %eax
movzbl (%r14,%rax), %edx
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%r12)
setne %r9b
movq %r13, %rdi
movl $0xffff, %ecx           # imm = 0xFFFF
movl %ebp, %r8d
callq 0x14f542
movl (%r13), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
incq %r15
jmp 0x140a9f
jle 0x140b56
movw $0x2, 0xa(%rsp)
pushq $0x1
popq %rbp
movq 0x18(%rsp), %r15
cmpq %r15, 0x38(%rsp)
je 0x140b5e
movzwl 0xa(%rsp), %esi
movsbq (%rcx,%r15), %rax
movl %eax, %eax
movzbl (%r14,%rax), %ecx
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%r12)
setne %r9b
movq %r13, %rdi
movl $0xffff, %edx           # imm = 0xFFFF
movl %ebp, %r8d
callq 0x14f542
movq 0x20(%rsp), %rcx
movl (%r13), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
incq %r15
jmp 0x140aff
movq %rbx, %r14
addl 0x60(%rsp), %r14d
jmp 0x140b66
movq %rbx, %r14
jmp 0x140a62
movq %rbx, %r14
addl 0x38(%rsp), %r14d
subl 0x18(%rsp), %r14d
jmp 0x140a62
leaq 0xaf655(%rip), %rdi     # 0x1f01cc
leaq 0xaf37d(%rip), %rsi     # 0x1efefb
leaq 0xaf64f(%rip), %rcx     # 0x1f01d4
movl $0x655, %edx            # imm = 0x655
callq 0x2110
leaq 0xaf6d8(%rip), %rdi     # 0x1f026e
leaq 0xaf35e(%rip), %rsi     # 0x1efefb
leaq 0xaf630(%rip), %rcx     # 0x1f01d4
movl $0x688, %edx            # imm = 0x688
callq 0x2110
leaq 0xaf6c2(%rip), %rdi     # 0x1f0277
leaq 0xaf33f(%rip), %rsi     # 0x1efefb
leaq 0xaf611(%rip), %rcx     # 0x1f01d4
movl $0x69e, %edx            # imm = 0x69E
callq 0x2110
leaq 0xaf6b5(%rip), %rdi     # 0x1f0289
leaq 0xaf320(%rip), %rsi     # 0x1efefb
leaq 0xaf5f2(%rip), %rcx     # 0x1f01d4
movl $0x69f, %edx            # imm = 0x69F
callq 0x2110