// File: 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
movq %rsp, %rbp
subq $0xf0, %rsp
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x98(%rbp)
movl $0x0, -0xa0(%rbp)
movl $0x0, -0xa4(%rbp)
cmpq $0x3, 0x20(%rbp)
jne 0x25119a
jmp 0x2511b9
leaq 0x13dd48(%rip), %rdi    # 0x38eee9
leaq 0x13da63(%rip), %rsi    # 0x38ec0b
movl $0x655, %edx            # imm = 0x655
leaq 0x13dd3d(%rip), %rcx    # 0x38eef1
callq 0x2130
movq 0x28(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq 0x28(%rbp), %rax
addq -0x98(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
jl 0x251316
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
sarl $0xe, %eax
movw %ax, -0xaa(%rbp)
cmpw $0x0, -0xaa(%rbp)
jne 0x25121a
jmp 0x251316
movzwl -0xaa(%rbp), %eax
cmpl $0x2, %eax
je 0x251232
movzwl -0xaa(%rbp), %eax
cmpl $0x3, %eax
jne 0x25124f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0xfff, %eax            # imm = 0xFFF
movl %eax, -0x9c(%rbp)
jmp 0x251295
movzwl -0xaa(%rbp), %eax
cmpl $0x1, %eax
jne 0x251278
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %eax, -0x9c(%rbp)
jmp 0x251293
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x3fff, %eax           # imm = 0x3FFF
movl %eax, -0x9c(%rbp)
jmp 0x251295
movzwl -0xaa(%rbp), %eax
cmpl $0x2, %eax
je 0x2512af
movl -0x9c(%rbp), %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movzwl -0xaa(%rbp), %eax
cmpl $0x3, %eax
je 0x2512c9
movl -0x9c(%rbp), %eax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movzwl -0xaa(%rbp), %eax
cmpl $0x0, %eax
je 0x2512e9
movl -0x9c(%rbp), %eax
addq -0x98(%rbp), %rax
movq %rax, -0x98(%rbp)
movq 0x20(%rbp), %rax
movzwl -0xaa(%rbp), %ecx
cmpq %rcx, %rax
je 0x251303
movl $0x1, -0xa0(%rbp)
jmp 0x251305
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2511e3
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
cmpl $0x0, -0xa0(%rbp)
je 0x251348
cmpq $0x0, -0x48(%rbp)
je 0x251348
cmpq $0x0, -0x50(%rbp)
jne 0x251401
movq $0x0, -0x40(%rbp)
movq 0x30(%rbp), %rax
addq 0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
cmpq 0x28(%rbp), %rax
jge 0x2513fc
movq -0x8(%rbp), %rdi
movq 0x20(%rbp), %rax
movw %ax, %dx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x3, %eax
movq -0x18(%rbp), %rcx
movl 0x1c(%rcx), %esi
xorl %r9d, %r9d
movl $0x1, %ecx
cmpl $0x0, %esi
cmoval %ecx, %r9d
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r8d
movzwl %dx, %esi
movzwl %ax, %edx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x25135c
jmp 0x25204e
movq $0x0, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x50(%rbp), %rax
jge 0x25144f
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x50(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x251451
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
movq $0x0, -0xd8(%rbp)
movq $0x0, -0xe0(%rbp)
movq $0x0, -0xc8(%rbp)
movq $0x0, -0xd0(%rbp)
movq 0x28(%rbp), %rax
addq 0x30(%rbp), %rax
movq %rax, 0x30(%rbp)
movq -0x48(%rbp), %rcx
movq 0x30(%rbp), %rax
subq %rcx, %rax
movq %rax, 0x30(%rbp)
cmpq $0x0, 0x30(%rbp)
jl 0x2514af
jmp 0x2514ce
leaq 0x13dad5(%rip), %rdi    # 0x38ef8b
leaq 0x13d74e(%rip), %rsi    # 0x38ec0b
movl $0x688, %edx            # imm = 0x688
leaq 0x13da28(%rip), %rcx    # 0x38eef1
callq 0x2130
movq -0x28(%rbp), %rax
addq 0x30(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x58(%rbp), %rax
jge 0x25164d
movq -0x48(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
leaq -0xaa(%rbp), %rdx
leaq -0xa6(%rbp), %rcx
leaq -0xa8(%rbp), %r8
leaq -0x9c(%rbp), %r9
callq 0x1b53f0
movl %eax, %eax
movq %rax, -0x38(%rbp)
movzwl -0xaa(%rbp), %eax
cmpl $0x2, %eax
je 0x251574
movl -0x9c(%rbp), %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movzwl -0xaa(%rbp), %eax
cmpl $0x3, %eax
je 0x25158e
movl -0x9c(%rbp), %eax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xd8(%rbp)
movzwl -0xaa(%rbp), %eax
cmpl $0x0, %eax
jne 0x2515e5
movq -0xc0(%rbp), %rdi
addq -0xe0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
addq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
subq -0xd0(%rbp), %rdx
shlq $0x0, %rdx
callq 0x2180
jmp 0x251648
movzwl -0xaa(%rbp), %eax
cmpl $0x1, %eax
je 0x2515fd
movzwl -0xaa(%rbp), %eax
cmpl $0x2, %eax
jne 0x251646
movq -0xe0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jge 0x251644
movzwl -0xa8(%rbp), %eax
movl %eax, %ecx
leaq 0x17312b(%rip), %rax    # 0x3c4750
movb (%rax,%rcx), %dl
movq -0xc0(%rbp), %rax
movq -0x40(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x251608
jmp 0x251646
jmp 0x251648
jmp 0x251505
movq -0xc8(%rbp), %rax
addq 0x28(%rbp), %rax
cmpq -0x70(%rbp), %rax
jne 0x251660
jmp 0x25167f
leaq 0x13d92d(%rip), %rdi    # 0x38ef94
leaq 0x13d59d(%rip), %rsi    # 0x38ec0b
movl $0x69e, %edx            # imm = 0x69E
leaq 0x13d877(%rip), %rcx    # 0x38eef1
callq 0x2130
movq -0xd8(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x25168e
jmp 0x2516ad
leaq 0x13d911(%rip), %rdi    # 0x38efa6
leaq 0x13d56f(%rip), %rsi    # 0x38ec0b
movl $0x69f, %edx            # imm = 0x69F
leaq 0x13d849(%rip), %rcx    # 0x38eef1
callq 0x2130
movq -0x68(%rbp), %rax
cmpq -0x70(%rbp), %rax
jne 0x2517c7
cmpq $0x1, -0x68(%rbp)
jne 0x2517c7
movq -0x60(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0xb8(%rbp), %rax
movsbl (%rax), %eax
movq -0xc0(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x251736
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %ecx
xorl %r9d, %r9d
movl $0x1, %eax
cmpl $0x0, %ecx
cmoval %eax, %r9d
xorl %esi, %esi
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r8d
movl %ecx, %edx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x2517c2
movq -0x8(%rbp), %rdi
movq -0xb8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x172f01(%rip), %rax    # 0x3c4650
movzbl (%rax,%rcx), %eax
movw %ax, %cx
movq -0xc0(%rbp), %rax
movsbl (%rax), %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x172ee5(%rip), %rax    # 0x3c4650
movzbl (%rax,%rdx), %eax
movq -0x18(%rbp), %rdx
movl 0x1c(%rdx), %esi
xorl %r9d, %r9d
movl $0x1, %edx
cmpl $0x0, %esi
cmoval %edx, %r9d
movl $0x1, %r8d
movl %r8d, %esi
movzwl %cx, %edx
movzwl %ax, %ecx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x25204c
movq -0x70(%rbp), %rax
cmpq -0x68(%rbp), %rax
jl 0x2517de
movq -0x70(%rbp), %rax
movq %rax, -0xe8(%rbp)
jmp 0x2517e9
movq -0x68(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x0, -0xa0(%rbp)
movq $0x1f, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x88(%rbp), %rax
jle 0x251821
movq -0x88(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x10(%rbp), %rax
movl $0x7fffffff, 0x2c(%rax) # imm = 0x7FFFFFFF
movq -0xc0(%rbp), %rdi
movq -0x68(%rbp), %rax
movl %eax, %esi
movq -0xb8(%rbp), %rdx
movq -0x70(%rbp), %rax
movl %eax, %ecx
movq -0x78(%rbp), %rax
movl %eax, %r8d
movq 0x10(%rbp), %r9
callq 0x5e760
movq 0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movq 0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jg 0x251878
movl $0x1, -0xa0(%rbp)
cmpl $0x0, -0xa0(%rbp)
jne 0x25190a
movq $0x3f, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x88(%rbp), %rax
jle 0x2518a5
movq -0x88(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
cmpq -0x80(%rbp), %rax
jle 0x251908
movq -0x78(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x10(%rbp), %rax
movl $0x7fffffff, 0x2c(%rax) # imm = 0x7FFFFFFF
movq -0xc0(%rbp), %rdi
movq -0x68(%rbp), %rax
movl %eax, %esi
movq -0xb8(%rbp), %rdx
movq -0x70(%rbp), %rax
movl %eax, %ecx
movq -0x78(%rbp), %rax
movl %eax, %r8d
movq 0x10(%rbp), %r9
callq 0x5e760
movq 0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movq 0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jg 0x251906
movl $0x1, -0xa0(%rbp)
jmp 0x251908
jmp 0x25190a
cmpl $0x0, -0xa0(%rbp)
je 0x251cdf
movq 0x10(%rbp), %rax
movslq 0x2c(%rax), %rax
cmpq -0x98(%rbp), %rax
jge 0x251cdf
movq -0x60(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq 0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x58(%rbp), %rax
jge 0x251cda
movq -0x48(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq 0x10(%rbp), %rdi
addq $0xa8, %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
leaq -0xaa(%rbp), %rdx
leaq -0x9c(%rbp), %rcx
callq 0xa1ee0
movl %eax, %eax
movq %rax, -0x38(%rbp)
movzwl -0xaa(%rbp), %eax
cmpl $0x2, %eax
je 0x2519c6
movl -0x9c(%rbp), %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movzwl -0xaa(%rbp), %eax
cmpl $0x3, %eax
je 0x2519e0
movl -0x9c(%rbp), %eax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xd8(%rbp)
movzwl -0xaa(%rbp), %eax
cmpl $0x0, %eax
jne 0x251a58
movq -0x8(%rbp), %rdi
movw -0xaa(%rbp), %ax
movl -0x9c(%rbp), %r8d
movq -0x18(%rbp), %rcx
movl 0x1c(%rcx), %edx
xorl %r9d, %r9d
movl $0x1, %ecx
cmpl $0x0, %edx
cmoval %ecx, %r9d
movl $0xffff, %ecx           # imm = 0xFFFF
movzwl %ax, %esi
movl %ecx, %edx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x251cd5
movzwl -0xaa(%rbp), %eax
cmpl $0x1, %eax
jne 0x251b46
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x9c(%rbp), %ecx
cmpq %rcx, %rax
jge 0x251b41
movq -0x8(%rbp), %rdi
movw -0xaa(%rbp), %dx
movq -0xb8(%rbp), %rax
movq -0xd0(%rbp), %rcx
addq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x172ba1(%rip), %rax    # 0x3c4650
movzbl (%rax,%rcx), %eax
movw %ax, %cx
movq -0xc0(%rbp), %rax
movq -0xe0(%rbp), %rsi
addq -0x40(%rbp), %rsi
movsbl (%rax,%rsi), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x172b79(%rip), %rax    # 0x3c4650
movzbl (%rax,%rsi), %eax
movq -0x18(%rbp), %rsi
movl 0x1c(%rsi), %r8d
xorl %r9d, %r9d
movl $0x1, %esi
cmpl $0x0, %r8d
cmoval %esi, %r9d
movl $0x1, %r8d
movzwl %dx, %esi
movzwl %cx, %edx
movzwl %ax, %ecx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x251a70
jmp 0x251cd3
movzwl -0xaa(%rbp), %eax
cmpl $0x2, %eax
jne 0x251c0c
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x9c(%rbp), %ecx
cmpq %rcx, %rax
jge 0x251c07
movq -0x8(%rbp), %rdi
movw -0xaa(%rbp), %cx
movq -0xc0(%rbp), %rax
movq -0xe0(%rbp), %rdx
addq -0x40(%rbp), %rdx
movsbl (%rax,%rdx), %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x172ab3(%rip), %rax    # 0x3c4650
movzbl (%rax,%rdx), %eax
movq -0x18(%rbp), %rdx
movl 0x1c(%rdx), %esi
xorl %r9d, %r9d
movl $0x1, %edx
cmpl $0x0, %esi
cmoval %edx, %r9d
movl $0xffff, %edx           # imm = 0xFFFF
movl $0x1, %r8d
movzwl %cx, %esi
movzwl %ax, %ecx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x251b5e
jmp 0x251cd1
movzwl -0xaa(%rbp), %eax
cmpl $0x3, %eax
jne 0x251ccf
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x9c(%rbp), %ecx
cmpq %rcx, %rax
jge 0x251ccd
movq -0x8(%rbp), %rdi
movw -0xaa(%rbp), %dx
movq -0xb8(%rbp), %rax
movq -0xd0(%rbp), %rcx
addq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x1729ed(%rip), %rax    # 0x3c4650
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movl 0x1c(%rcx), %esi
xorl %r9d, %r9d
movl $0x1, %ecx
cmpl $0x0, %esi
cmoval %ecx, %r9d
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r8d
movzwl %dx, %esi
movzwl %ax, %edx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x251c24
jmp 0x251ccf
jmp 0x251cd1
jmp 0x251cd3
jmp 0x251cd5
jmp 0x25195e
jmp 0x25204a
movq -0x88(%rbp), %rax
cmpq -0x98(%rbp), %rax
jge 0x251f92
movq -0x60(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x70(%rbp), %rax
cmpq -0x68(%rbp), %rax
jg 0x251d15
movq -0x70(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x251d20
movq -0x68(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0x90(%rbp)
movw $0x1, -0xaa(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x90(%rbp), %rax
jge 0x251e00
movq -0x8(%rbp), %rdi
movw -0xaa(%rbp), %dx
movq -0xb8(%rbp), %rax
movq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x1728db(%rip), %rax    # 0x3c4650
movzbl (%rax,%rcx), %eax
movw %ax, %cx
movq -0xc0(%rbp), %rax
movq -0x40(%rbp), %rsi
movsbl (%rax,%rsi), %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x1728ba(%rip), %rax    # 0x3c4650
movzbl (%rax,%rsi), %eax
movq -0x18(%rbp), %rsi
movl 0x1c(%rsi), %r8d
xorl %r9d, %r9d
movl $0x1, %esi
cmpl $0x0, %r8d
cmoval %esi, %r9d
movl $0x1, %r8d
movzwl %dx, %esi
movzwl %cx, %edx
movzwl %ax, %ecx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x251d3f
movq -0x70(%rbp), %rax
cmpq -0x90(%rbp), %rax
jle 0x251ec7
movq -0x90(%rbp), %rax
movq %rax, -0x40(%rbp)
movw $0x3, -0xaa(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x70(%rbp), %rax
jge 0x251ec2
movq -0x8(%rbp), %rdi
movw -0xaa(%rbp), %dx
movq -0xb8(%rbp), %rax
movq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x1727f8(%rip), %rax    # 0x3c4650
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movl 0x1c(%rcx), %esi
xorl %r9d, %r9d
movl $0x1, %ecx
cmpl $0x0, %esi
cmoval %ecx, %r9d
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r8d
movzwl %dx, %esi
movzwl %ax, %edx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x251e25
jmp 0x251f8d
movq -0x68(%rbp), %rax
cmpq -0x90(%rbp), %rax
jle 0x251f8b
movq -0x90(%rbp), %rax
movq %rax, -0x40(%rbp)
movw $0x2, -0xaa(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x68(%rbp), %rax
jge 0x251f89
movq -0x8(%rbp), %rdi
movw -0xaa(%rbp), %cx
movq -0xc0(%rbp), %rax
movq -0x40(%rbp), %rdx
movsbl (%rax,%rdx), %eax
movl %eax, %eax
movl %eax, %edx
leaq 0x172731(%rip), %rax    # 0x3c4650
movzbl (%rax,%rdx), %eax
movq -0x18(%rbp), %rdx
movl 0x1c(%rdx), %esi
xorl %r9d, %r9d
movl $0x1, %edx
cmpl $0x0, %esi
cmoval %edx, %r9d
movl $0xffff, %edx           # imm = 0xFFFF
movl $0x1, %r8d
movzwl %cx, %esi
movzwl %ax, %ecx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x251eec
jmp 0x251f8b
jmp 0x251f8d
jmp 0x252048
movq $0x0, -0x40(%rbp)
movq 0x30(%rbp), %rax
addq 0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rax
cmpq 0x28(%rbp), %rax
jge 0x252046
movq -0x8(%rbp), %rdi
movq 0x20(%rbp), %rax
movw %ax, %dx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x3, %eax
movq -0x18(%rbp), %rcx
movl 0x1c(%rcx), %esi
xorl %r9d, %r9d
movl $0x1, %ecx
cmpl $0x0, %esi
cmoval %ecx, %r9d
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r8d
movzwl %dx, %esi
movzwl %ax, %edx
callq 0x26d790
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x18(%rcx), %ecx
subq %rcx, %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x251fa6
jmp 0x252048
jmp 0x25204a
jmp 0x25204c
jmp 0x25204e
movl -0xa4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)