// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %rsp
movq %r8, 0x58(%rsp)
movq %rcx, 0x38(%rsp)
movq %rdx, 0x28(%rsp)
cmpq $0x3, 0xc0(%rsp)
jne 0x184f1c
movq 0xd0(%rsp), %rcx
movq 0xc8(%rsp), %r14
movq 0xb8(%rsp), %rax
movq %rdi, 0x10(%rsp)
movq (%rdi), %rdx
movq %rdx, 0x30(%rsp)
cmpq %rsi, %rdx
jle 0x184803
movq %r9, %rbp
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rcx
xorl %edx, %edx
movl $0xfff, %edi            # imm = 0xFFF
movl $0x1, %r8d
xorl %eax, %eax
movq %r14, %r12
movq 0x30(%rsp), %rbx
movq %r14, %r15
xorl %r13d, %r13d
movzwl -0x2(%rcx,%rbx,2), %r11d
cmpl $0x4000, %r11d          # imm = 0x4000
jb 0x18409e
movzwl %r11w, %r10d
shrl $0xe, %r10d
movl $0x3ff, %r9d            # imm = 0x3FF
cmpw $0x1, %r10w
je 0x184063
movl $0x3fff, %r9d           # imm = 0x3FFF
decq %rbx
testw %r11w, %r11w
cmovsl %edi, %r9d
andl %r11d, %r9d
cmpw $0x2, %r10w
movq %r9, %r11
cmoveq %rdx, %r11
addq %r11, %r15
cmpw $0x3, %r10w
movq %r9, %r10
cmoveq %rdx, %r10
cmovnel %r8d, %eax
addq %r10, %r13
addq %r9, %r12
cmpq %rsi, %rbx
jg 0x184039
movq %rsi, %rbx
testl %eax, %eax
movq 0xd0(%rsp), %rcx
movq 0xb8(%rsp), %rax
je 0x184803
testq %r15, %r15
je 0x184803
testq %r13, %r13
je 0x184803
movq (%rbp), %rax
cmpq %r13, 0x10(%rbp)
jge 0x1840ed
movq %rax, %rdi
movq %r13, %rsi
callq 0x2370
movq 0xd0(%rsp), %rcx
movq %rax, (%rbp)
movq %r13, 0x10(%rbp)
addq %r14, %rcx
movq %rcx, 0x60(%rsp)
movq %rcx, %rdx
subq %r15, %rdx
js 0x184f3b
movq %r15, 0x40(%rsp)
movq %r14, 0x8(%rsp)
movq 0x58(%rsp), %rcx
movq %rdx, 0x68(%rsp)
addq %rdx, %rcx
movq %rcx, 0x50(%rsp)
cmpq 0x30(%rsp), %rbx
movq %rax, 0x48(%rsp)
jge 0x184874
addq $0xf, %rax
movq %rax, 0x70(%rsp)
xorl %edi, %edi
movdqa 0xb1b9f(%rip), %xmm8    # 0x235ce0
movdqa 0xb1ba6(%rip), %xmm9    # 0x235cf0
movdqa 0xb1bad(%rip), %xmm10   # 0x235d00
movdqa 0xb1bb4(%rip), %xmm11   # 0x235d10
movdqa 0xad13b(%rip), %xmm12   # 0x2312a0
movdqa 0xad142(%rip), %xmm13   # 0x2312b0
movdqa 0xad149(%rip), %xmm14   # 0x2312c0
movdqa 0xad150(%rip), %xmm15   # 0x2312d0
xorl %esi, %esi
movq %rbx, %r15
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdx
movl %r15d, %eax
movzwl (%rdx,%rax,2), %r9d
movl %r9d, %r8d
shrl $0xe, %r8d
movw $0xffff, %ax            # imm = 0xFFFF
movw %ax, 0x6(%rsp)
movw %ax, 0x1e(%rsp)
leal -0x2(%r8), %eax
movzwl %r9w, %ebp
cmpl $0x2, %eax
jae 0x1841c7
movw $0xfff, %ax             # imm = 0xFFF
movw $0xc, %cx
leaq 0x6(%rsp), %r10
jmp 0x1841eb
movw $0x3fff, %ax            # imm = 0x3FFF
testl %r8d, %r8d
je 0x1841f9
movl %r9d, %eax
shrl $0xc, %eax
andl $0x3, %eax
movw %ax, 0x6(%rsp)
movw $0x3ff, %ax             # imm = 0x3FF
movw $0xa, %cx
leaq 0x1e(%rsp), %r10
movl %ebp, %r11d
shrl %cl, %r11d
andl $0x3, %r11d
movw %r11w, (%r10)
movl %ebp, 0x20(%rsp)
movzwl %ax, %ecx
andl %r9d, %ecx
movq 0x10(%rsp), %rax
movq (%rax), %r9
incl %r15d
cmpq %r15, %r9
jbe 0x184292
movzwl 0x1e(%rsp), %r10d
movzwl 0x6(%rsp), %r11d
movzwl (%rdx,%r15,2), %r14d
movl %r14d, %eax
shrl $0xe, %eax
cmpl %r8d, %eax
jne 0x184292
movzwl %r8w, %eax
leal -0x2(%rax), %ebp
cmpl $0x2, %ebp
jae 0x18424d
movl %r14d, %eax
shrl $0xc, %eax
andl $0x3, %eax
andl $0xfff, %r14d           # imm = 0xFFF
jmp 0x18425c
testl %eax, %eax
jne 0x184263
andl $0x3fff, %r14d          # imm = 0x3FFF
movw $0xffff, %ax            # imm = 0xFFFF
movl $0xffff, %ebp           # imm = 0xFFFF
jmp 0x18427c
movl %r14d, %eax
shrl $0xc, %eax
andl $0x3, %eax
movl %r14d, %ebp
shrl $0xa, %ebp
andl $0x3, %ebp
andl $0x3ff, %r14d           # imm = 0x3FF
cmpl %r10d, %ebp
jne 0x184292
cmpw %ax, %r11w
jne 0x184292
addl %r14d, %ecx
incl %r15d
cmpq %r15, %r9
ja 0x18421f
movl %ecx, %edx
cmpw $0x3, %r8w
jne 0x1842b7
movzwl 0x6(%rsp), %eax
movw %ax, 0x1e(%rsp)
movw $0xffff, 0x6(%rsp)      # imm = 0xFFFF
addq %rdx, %rsi
movq %rsi, %r14
jmp 0x1847f0
cmpw $0x2, %r8w
movl $0x0, %r14d
cmovneq %rdx, %r14
addq %rsi, %r14
leaq (%rdi,%rdx), %rbp
cmpl $0x4000, 0x20(%rsp)     # imm = 0x4000
jae 0x184333
addq 0x48(%rsp), %rdi
addq 0x50(%rsp), %rsi
callq 0x2160
movdqa 0xacfe1(%rip), %xmm15   # 0x2312d0
movdqa 0xacfc8(%rip), %xmm14   # 0x2312c0
movdqa 0xacfaf(%rip), %xmm13   # 0x2312b0
movdqa 0xacf96(%rip), %xmm12   # 0x2312a0
movdqa 0xb19fd(%rip), %xmm11   # 0x235d10
movdqa 0xb19e4(%rip), %xmm10   # 0x235d00
movdqa 0xb19cb(%rip), %xmm9    # 0x235cf0
movdqa 0xb19b2(%rip), %xmm8    # 0x235ce0
jmp 0x1847ed
testl %ecx, %ecx
je 0x1847ed
movzwl 0x6(%rsp), %eax
leaq 0x1113e9(%rip), %rcx    # 0x295730
movb (%rcx,%rax), %al
leaq 0x1(%rdi), %rdx
cmpq %rdx, %rbp
cmovgq %rbp, %rdx
subq %rdi, %rdx
leaq 0xf(%rdx), %rcx
andq $-0x10, %rcx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
addq 0x70(%rsp), %rdi
xorl %edx, %edx
movq %rdx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa %xmm1, %xmm3
por %xmm15, %xmm3
movdqa %xmm0, %xmm2
movdqa 0xacf4d(%rip), %xmm4    # 0x2312e0
pxor %xmm4, %xmm2
pxor %xmm4, %xmm3
movdqa %xmm3, %xmm5
pcmpgtd %xmm2, %xmm5
pshufd $0xa0, %xmm5, %xmm4     # xmm4 = xmm5[0,0,2,2]
pshuflw $0xe8, %xmm4, %xmm6     # xmm6 = xmm4[0,2,2,3,4,5,6,7]
pcmpeqd %xmm2, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pshuflw $0xe8, %xmm3, %xmm7     # xmm7 = xmm3[0,2,2,3,4,5,6,7]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pshuflw $0xe8, %xmm5, %xmm6     # xmm6 = xmm5[0,2,2,3,4,5,6,7]
por %xmm7, %xmm6
pcmpeqd %xmm7, %xmm7
pxor %xmm7, %xmm6
packssdw %xmm6, %xmm6
movd %xmm6, %esi
testb $0x1, %sil
je 0x1843e7
movb %al, -0xf(%rdi,%rdx)
pand %xmm4, %xmm3
por %xmm5, %xmm3
packssdw %xmm3, %xmm3
pxor %xmm7, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
movd %xmm3, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x184410
movb %al, -0xe(%rdi,%rdx)
movdqa %xmm1, %xmm4
por %xmm14, %xmm4
pxor 0xacebf(%rip), %xmm4    # 0x2312e0
movdqa %xmm4, %xmm5
pcmpgtd %xmm2, %xmm5
pshufd $0xa0, %xmm5, %xmm3     # xmm3 = xmm5[0,0,2,2]
pcmpeqd %xmm2, %xmm4
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
movdqa %xmm4, %xmm6
pand %xmm3, %xmm6
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
por %xmm5, %xmm6
packssdw %xmm6, %xmm6
pxor %xmm7, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
movd %xmm6, %esi
shrl $0x10, %esi
testb $0x1, %sil
je 0x184469
movb %al, -0xd(%rdi,%rdx)
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,4,5,4,6]
pand %xmm3, %xmm4
pshufhw $0x84, %xmm5, %xmm3     # xmm3 = xmm5[0,1,2,3,4,5,4,6]
por %xmm4, %xmm3
pxor %xmm7, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
movd %xmm3, %esi
shrl $0x18, %esi
testb $0x1, %sil
je 0x18449d
movb %al, -0xc(%rdi,%rdx)
movdqa %xmm1, %xmm3
por %xmm13, %xmm3
pxor 0xace32(%rip), %xmm3    # 0x2312e0
movdqa %xmm3, %xmm5
pcmpgtd %xmm2, %xmm5
pshufd $0xa0, %xmm5, %xmm4     # xmm4 = xmm5[0,0,2,2]
pshuflw $0xe8, %xmm4, %xmm6     # xmm6 = xmm4[0,2,2,3,4,5,6,7]
pcmpeqd %xmm2, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pshuflw $0xe8, %xmm3, %xmm7     # xmm7 = xmm3[0,2,2,3,4,5,6,7]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pshuflw $0xe8, %xmm5, %xmm6     # xmm6 = xmm5[0,2,2,3,4,5,6,7]
por %xmm7, %xmm6
pcmpeqd %xmm7, %xmm7
pxor %xmm7, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrw $0x2, %xmm6, %esi
testb $0x1, %sil
je 0x1844ff
movb %al, -0xb(%rdi,%rdx)
pand %xmm4, %xmm3
por %xmm5, %xmm3
packssdw %xmm3, %xmm3
pxor %xmm7, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
pextrw $0x2, %xmm3, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x184529
movb %al, -0xa(%rdi,%rdx)
movdqa %xmm1, %xmm4
por %xmm12, %xmm4
pxor 0xacda6(%rip), %xmm4    # 0x2312e0
movdqa %xmm4, %xmm5
pcmpgtd %xmm2, %xmm5
pshufd $0xa0, %xmm5, %xmm3     # xmm3 = xmm5[0,0,2,2]
pcmpeqd %xmm2, %xmm4
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
movdqa %xmm4, %xmm6
pand %xmm3, %xmm6
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
por %xmm5, %xmm6
packssdw %xmm6, %xmm6
pxor %xmm7, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrw $0x3, %xmm6, %esi
testb $0x1, %sil
je 0x184580
movb %al, -0x9(%rdi,%rdx)
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,4,5,4,6]
pand %xmm3, %xmm4
pshufhw $0x84, %xmm5, %xmm3     # xmm3 = xmm5[0,1,2,3,4,5,4,6]
por %xmm4, %xmm3
pxor %xmm7, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
pextrw $0x3, %xmm3, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1845b5
movb %al, -0x8(%rdi,%rdx)
movdqa %xmm1, %xmm3
por %xmm11, %xmm3
pxor 0xacd1a(%rip), %xmm3    # 0x2312e0
movdqa %xmm3, %xmm5
pcmpgtd %xmm2, %xmm5
pshufd $0xa0, %xmm5, %xmm4     # xmm4 = xmm5[0,0,2,2]
pshuflw $0xe8, %xmm4, %xmm6     # xmm6 = xmm4[0,2,2,3,4,5,6,7]
pcmpeqd %xmm2, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pshuflw $0xe8, %xmm3, %xmm7     # xmm7 = xmm3[0,2,2,3,4,5,6,7]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pshuflw $0xe8, %xmm5, %xmm6     # xmm6 = xmm5[0,2,2,3,4,5,6,7]
por %xmm7, %xmm6
pcmpeqd %xmm7, %xmm7
pxor %xmm7, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x184617
movb %al, -0x7(%rdi,%rdx)
pand %xmm4, %xmm3
por %xmm5, %xmm3
packssdw %xmm3, %xmm3
pxor %xmm7, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
pextrw $0x4, %xmm3, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x184641
movb %al, -0x6(%rdi,%rdx)
movdqa %xmm1, %xmm4
por %xmm10, %xmm4
pxor 0xacc8e(%rip), %xmm4    # 0x2312e0
movdqa %xmm4, %xmm5
pcmpgtd %xmm2, %xmm5
pshufd $0xa0, %xmm5, %xmm3     # xmm3 = xmm5[0,0,2,2]
pcmpeqd %xmm2, %xmm4
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
movdqa %xmm4, %xmm6
pand %xmm3, %xmm6
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
por %xmm5, %xmm6
packssdw %xmm6, %xmm6
pxor %xmm7, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrw $0x5, %xmm6, %esi
testb $0x1, %sil
je 0x184698
movb %al, -0x5(%rdi,%rdx)
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm4, %xmm4     # xmm4 = xmm4[0,1,2,3,4,5,4,6]
pand %xmm3, %xmm4
pshufhw $0x84, %xmm5, %xmm3     # xmm3 = xmm5[0,1,2,3,4,5,4,6]
por %xmm4, %xmm3
pxor %xmm7, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
pextrw $0x5, %xmm3, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1846cd
movb %al, -0x4(%rdi,%rdx)
movdqa %xmm1, %xmm3
por %xmm9, %xmm3
pxor 0xacc02(%rip), %xmm3    # 0x2312e0
movdqa %xmm3, %xmm5
pcmpgtd %xmm2, %xmm5
pshufd $0xa0, %xmm5, %xmm4     # xmm4 = xmm5[0,0,2,2]
pshuflw $0xe8, %xmm4, %xmm6     # xmm6 = xmm4[0,2,2,3,4,5,6,7]
pcmpeqd %xmm2, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pshuflw $0xe8, %xmm3, %xmm7     # xmm7 = xmm3[0,2,2,3,4,5,6,7]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pshuflw $0xe8, %xmm5, %xmm6     # xmm6 = xmm5[0,2,2,3,4,5,6,7]
por %xmm7, %xmm6
pcmpeqd %xmm7, %xmm7
pxor %xmm7, %xmm6
packssdw %xmm6, %xmm6
packsswb %xmm6, %xmm6
pextrw $0x6, %xmm6, %esi
testb $0x1, %sil
je 0x18472f
movb %al, -0x3(%rdi,%rdx)
pand %xmm4, %xmm3
por %xmm5, %xmm3
packssdw %xmm3, %xmm3
pxor %xmm7, %xmm3
packssdw %xmm3, %xmm3
packsswb %xmm3, %xmm3
pextrw $0x6, %xmm3, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x184759
movb %al, -0x2(%rdi,%rdx)
por %xmm8, %xmm1
pxor 0xacb7a(%rip), %xmm1    # 0x2312e0
movdqa %xmm1, %xmm4
pcmpgtd %xmm2, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pcmpeqd %xmm2, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
movdqa %xmm1, %xmm5
pand %xmm3, %xmm5
pshufd $0xf5, %xmm4, %xmm2     # xmm2 = xmm4[1,1,3,3]
por %xmm2, %xmm5
packssdw %xmm5, %xmm4
pxor %xmm7, %xmm4
packssdw %xmm4, %xmm4
packsswb %xmm4, %xmm4
pextrw $0x7, %xmm4, %esi
testb $0x1, %sil
je 0x1847ac
movb %al, -0x1(%rdi,%rdx)
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,4,5,4,6]
pand %xmm3, %xmm1
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
por %xmm1, %xmm2
pxor %xmm7, %xmm2
packssdw %xmm2, %xmm1
packsswb %xmm1, %xmm1
pextrw $0x7, %xmm1, %esi
shrl $0x8, %esi
testb $0x1, %sil
je 0x1847e0
movb %al, (%rdi,%rdx)
addq $0x10, %rdx
cmpq %rdx, %rcx
jne 0x184374
movq %rbp, %rdi
movl %r15d, %r15d
movq %r14, %rsi
cmpq %r15, 0x30(%rsp)
jg 0x184185
jmp 0x184879
testq %r14, %r14
jle 0x184df3
addq %rax, %rcx
movq 0x28(%rsp), %r15
movl 0x1c(%r15), %eax
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rbx
movq %r14, 0x8(%rsp)
movq 0x10(%rsp), %r12
movq 0x38(%rsp), %r13
movq 0x10(%r13), %rcx
movl (%rcx,%rbx), %edx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
andl $0x3, %edx
movq %r12, %rdi
movl $0x3, %esi
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r8d
callq 0x1967e1
movl (%r12), %eax
subl 0x18(%r15), %eax
movl %eax, 0x1c(%r15)
addq $0x28, %rbx
decq %r14
jne 0x18482f
jmp 0x184dfc
xorl %r14d, %r14d
xorl %edi, %edi
movq 0xc8(%rsp), %r15
addq %r15, %r14
cmpq 0x40(%rsp), %r14
jne 0x184f5a
cmpq %r13, %rdi
movq 0x50(%rsp), %rdx
jne 0x184f79
cmpq $0x1, %r13
movq 0x48(%rsp), %rdi
jne 0x1848f5
cmpq $0x1, 0x40(%rsp)
jne 0x1848f5
movq 0x10(%rsp), %r14
movq %rbx, (%r14)
movsbq (%rdx), %rcx
movsbq (%rdi), %rax
cmpb %al, %cl
jne 0x184d36
xorl %r9d, %r9d
movq 0x28(%rsp), %rbx
cmpl $0x0, 0x1c(%rbx)
setne %r9b
movq $0x0, 0x8(%rsp)
movq %r14, %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
movl $0xffff, %ecx           # imm = 0xFFFF
jmp 0x184d6b
movq 0x40(%rsp), %rcx
cmpq %r13, %rcx
movq %r13, %r14
cmovgq %rcx, %r14
cmpq $0x1f, %r14
movl $0x1f, %r8d
cmovbq %r14, %r8
movq 0xb0(%rsp), %rbp
movl $0x7fffffff, 0x2c(%rbp) # imm = 0x7FFFFFFF
movl %r13d, %esi
movq %rbp, %r9
callq 0x63d6a
movl 0x2c(%rbp), %eax
cmpl 0x28(%rbp), %eax
jle 0x184981
cmpq $0x20, %r14
jb 0x184c91
cmpq $0x3f, %r14
movl $0x3f, %r8d
cmovbq %r14, %r8
movq 0xb0(%rsp), %rbp
movl $0x7fffffff, 0x2c(%rbp) # imm = 0x7FFFFFFF
movq 0x48(%rsp), %rdi
movl %r13d, %esi
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq %rbp, %r9
callq 0x63d6a
movl 0x2c(%rbp), %eax
cmpl 0x28(%rbp), %eax
jg 0x184c91
cltq
cmpq %rax, %r12
jle 0x184c91
movq 0x10(%rsp), %rax
movq %rbx, (%rax)
movq 0xb0(%rsp), %rax
movq 0xa8(%rax), %rax
testq %rax, %rax
jle 0x184df3
xorl %r14d, %r14d
leaq 0x110c7a(%rip), %r10    # 0x295630
movq $0x0, 0x8(%rsp)
xorl %r15d, %r15d
xorl %r11d, %r11d
xorl %ebx, %ebx
movq %rax, 0x20(%rsp)
movq 0xb0(%rsp), %rax
movq 0xa8(%rax), %rdx
movq 0xb8(%rax), %rsi
movzwl (%rsi,%r15,2), %ecx
movl %ecx, %edi
shrl $0xe, %edi
andl $0x3fff, %ecx           # imm = 0x3FFF
incl %r15d
movzwl %di, %eax
cmpq %r15, %rdx
jbe 0x184a1d
movzwl (%rsi,%r15,2), %r8d
movl %r8d, %r9d
shrl $0xe, %r9d
cmpl %edi, %r9d
jne 0x184a4c
andl $0x3fff, %r8d           # imm = 0x3FFF
addl %r8d, %ecx
incl %r15d
jmp 0x1849f8
cmpw $0x2, %ax
movl %ecx, %r12d
movq %r12, %rbp
cmoveq %r14, %rbp
addq %r11, %rbp
cmpw $0x3, %ax
movq %r12, %r13
cmoveq %r14, %r13
addq %rbx, %r13
leaq 0xb953d(%rip), %rcx     # 0x23df80
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpw $0x2, %ax
movl %ecx, %r12d
movq %r12, %rbp
cmoveq %r14, %rbp
addq %r11, %rbp
cmpw $0x3, %ax
movq %r12, %r13
cmoveq %r14, %r13
movl %r15d, %r15d
addq %rbx, %r13
leaq 0xb950b(%rip), %rcx     # 0x23df80
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %r9d, %r9d
movq 0x28(%rsp), %rbx
cmpl $0x0, 0x1c(%rbx)
setne %r9b
movq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
movl $0xffff, %ecx           # imm = 0xFFFF
movl %r12d, %r8d
callq 0x1967e1
leaq 0x110b7f(%rip), %r10    # 0x295630
movl (%r14), %eax
xorl %r14d, %r14d
subl 0x18(%rbx), %eax
movl %eax, 0x1c(%rbx)
jmp 0x184c78
testq %r12, %r12
je 0x184c78
movq %r13, 0x38(%rsp)
movq %rbp, 0x30(%rsp)
addq 0x48(%rsp), %rbx
movq 0x28(%rsp), %r13
movl 0x1c(%r13), %eax
xorl %r14d, %r14d
movq 0x10(%rsp), %rbp
movsbq (%rbx,%r14), %rcx
movl %ecx, %ecx
movzbl (%r10,%rcx), %ecx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
movq %rbp, %rdi
movl $0x2, %esi
movl $0xffff, %edx           # imm = 0xFFFF
movl $0x1, %r8d
callq 0x1967e1
leaq 0x110b11(%rip), %r10    # 0x295630
movl (%rbp), %eax
subl 0x18(%r13), %eax
movl %eax, 0x1c(%r13)
incq %r14
cmpq %r14, %r12
jne 0x184aeb
jmp 0x184c5a
testq %r12, %r12
je 0x184c78
movq %r13, 0x38(%rsp)
movq %rbp, 0x30(%rsp)
addq 0x50(%rsp), %r11
movq 0x28(%rsp), %r14
movl 0x1c(%r14), %eax
xorl %ebx, %ebx
movq 0x10(%rsp), %r13
movsbq (%r11,%rbx), %rcx
movl %ecx, %ecx
movzbl (%r10,%rcx), %edx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
movq %r13, %rdi
movl $0x3, %esi
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r8d
movq %r11, %rbp
callq 0x1967e1
movq %rbp, %r11
leaq 0x110a97(%rip), %r10    # 0x295630
movl (%r13), %eax
subl 0x18(%r14), %eax
movl %eax, 0x1c(%r14)
incq %rbx
cmpq %rbx, %r12
jne 0x184b5f
addl 0x8(%rsp), %r12d
movq %r12, 0x8(%rsp)
xorl %r14d, %r14d
movq 0x30(%rsp), %rbp
movq 0x20(%rsp), %rax
jmp 0x184c71
testq %r12, %r12
je 0x184c78
movq %r13, 0x38(%rsp)
movq %rbp, 0x30(%rsp)
addq 0x50(%rsp), %r11
addq 0x48(%rsp), %rbx
movq 0x28(%rsp), %rax
movl 0x1c(%rax), %eax
xorl %r14d, %r14d
movq 0x10(%rsp), %r13
movsbq (%r11,%r14), %rcx
movl %ecx, %ecx
movzbl (%r10,%rcx), %edx
movsbq (%rbx,%r14), %rcx
movl %ecx, %ecx
movzbl (%r10,%rcx), %ecx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
movq %r13, %rdi
movl $0x1, %esi
movl $0x1, %r8d
movq %r12, %rbp
movq %rbx, %r12
movq %r11, %rbx
callq 0x1967e1
movq %rbx, %r11
movq %r12, %rbx
movq %rbp, %r12
leaq 0x1109ed(%rip), %r10    # 0x295630
movl (%r13), %eax
movq 0x28(%rsp), %rcx
subl 0x18(%rcx), %eax
movl %eax, 0x1c(%rcx)
incq %r14
cmpq %r14, %rbp
jne 0x184bf6
addl 0x8(%rsp), %r12d
movq %r12, 0x8(%rsp)
movq 0x20(%rsp), %rax
xorl %r14d, %r14d
movq 0x30(%rsp), %rbp
movq 0x38(%rsp), %r13
jmp 0x184c7d
movq 0x20(%rsp), %rax
movq %rbp, %r11
movq %r13, %rbx
cmpq %r15, %rax
jg 0x1849cc
jmp 0x184dfc
cmpq %r12, %r14
jge 0x184d81
movq 0x10(%rsp), %rax
movq %rbx, (%rax)
movq 0x40(%rsp), %rcx
cmpq %r13, %rcx
movq %r13, %rdx
cmovlq %rcx, %rdx
testq %rdx, %rdx
jle 0x184e0f
movq 0x28(%rsp), %r12
movl 0x1c(%r12), %eax
xorl %r14d, %r14d
movq 0x10(%rsp), %rbp
movq 0x50(%rsp), %r15
movsbq (%r15,%r14), %rcx
movl %ecx, %ecx
movq %rdx, %rbx
leaq 0x11094e(%rip), %rsi    # 0x295630
movzbl (%rsi,%rcx), %edx
movq 0x48(%rsp), %rcx
movsbq (%rcx,%r14), %rcx
movl %ecx, %ecx
movzbl (%rsi,%rcx), %ecx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
movq %rbp, %rdi
movl $0x1, %esi
movl $0x1, %r8d
callq 0x1967e1
movq %rbx, %rdx
movl (%rbp), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
incq %r14
cmpq %r14, %rbx
jne 0x184cd1
movl %edx, %eax
movq 0x40(%rsp), %rcx
jmp 0x184e11
movl %ecx, %ecx
leaq 0x1108f1(%rip), %rsi    # 0x295630
movzbl (%rsi,%rcx), %edx
movl %eax, %eax
movzbl (%rsi,%rax), %ecx
xorl %r9d, %r9d
movq 0x28(%rsp), %rbx
cmpl $0x0, 0x1c(%rbx)
setne %r9b
movl $0x1, %eax
movq %rax, 0x8(%rsp)
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %r8d
callq 0x1967e1
movl (%r14), %eax
subl 0x18(%rbx), %eax
movl %eax, 0x1c(%rbx)
jmp 0x184dfc
testq %r15, %r15
jle 0x184df3
movq 0x68(%rsp), %rcx
addq 0xb8(%rsp), %rcx
movq %r15, %r14
movq 0x28(%rsp), %r15
movl 0x1c(%r15), %eax
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rbx
movq 0x10(%rsp), %r12
movq 0x38(%rsp), %r13
movq 0x10(%r13), %rcx
movl (%rcx,%rbx), %edx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
andl $0x3, %edx
movq %r12, %rdi
movl $0x3, %esi
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r8d
callq 0x1967e1
movl (%r12), %eax
subl 0x18(%r15), %eax
movl %eax, 0x1c(%r15)
addq $0x28, %rbx
decq %r14
jne 0x184db1
jmp 0x184dfc
movq $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
cmpq %rcx, %r13
movq 0x58(%rsp), %rbx
jge 0x184e96
movq %rax, %rbp
movq 0x28(%rsp), %r12
movl 0x1c(%r12), %eax
movq %rdx, 0x20(%rsp)
movq %rdx, %r14
subq %rcx, %r14
addq 0x60(%rsp), %rbx
leaq 0x1107f1(%rip), %r15    # 0x295630
movq 0x10(%rsp), %r13
movsbq (%rbx,%r14), %rcx
movl %ecx, %ecx
movzbl (%r15,%rcx), %edx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
movq %r13, %rdi
movl $0x3, %esi
movl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %r8d
callq 0x1967e1
movl (%r13), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
incq %r14
jne 0x184e44
addl 0x40(%rsp), %ebp
subl 0x20(%rsp), %ebp
movq %rbp, 0x8(%rsp)
jmp 0x184dfc
movq %rax, 0x8(%rsp)
jle 0x184dfc
movq 0x28(%rsp), %r12
movl 0x1c(%r12), %eax
leaq 0x11077e(%rip), %r14    # 0x295630
movq %rdx, 0x20(%rsp)
movq %rdx, %r15
movq 0x10(%rsp), %rbp
movq 0x48(%rsp), %rbx
movsbq (%rbx,%r15), %rcx
movl %ecx, %ecx
movzbl (%r14,%rcx), %ecx
xorl %r9d, %r9d
testl %eax, %eax
setne %r9b
movq %rbp, %rdi
movl $0x2, %esi
movl $0xffff, %edx           # imm = 0xFFFF
movl $0x1, %r8d
callq 0x1967e1
movl (%rbp), %eax
subl 0x18(%r12), %eax
movl %eax, 0x1c(%r12)
incq %r15
cmpq %r15, %r13
jne 0x184ec4
movq 0x8(%rsp), %rax
addl %r13d, %eax
subl 0x20(%rsp), %eax
movq %rax, 0x8(%rsp)
jmp 0x184dfc
leaq 0xb93e9(%rip), %rdi     # 0x23e30c
leaq 0xb9111(%rip), %rsi     # 0x23e03b
leaq 0xb93e3(%rip), %rcx     # 0x23e314
movl $0x655, %edx            # imm = 0x655
callq 0x2110
leaq 0xb946c(%rip), %rdi     # 0x23e3ae
leaq 0xb90f2(%rip), %rsi     # 0x23e03b
leaq 0xb93c4(%rip), %rcx     # 0x23e314
movl $0x688, %edx            # imm = 0x688
callq 0x2110
leaq 0xb9456(%rip), %rdi     # 0x23e3b7
leaq 0xb90d3(%rip), %rsi     # 0x23e03b
leaq 0xb93a5(%rip), %rcx     # 0x23e314
movl $0x69e, %edx            # imm = 0x69E
callq 0x2110
leaq 0xb9449(%rip), %rdi     # 0x23e3c9
leaq 0xb90b4(%rip), %rsi     # 0x23e03b
leaq 0xb9386(%rip), %rcx     # 0x23e314
movl $0x69f, %edx            # imm = 0x69F
callq 0x2110