// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/htscodecs/htscodecs/rANS_static32x16pr.c
// Function: rans_compress_O0_32x16
unsigned char *rans_compress_O0_32x16(unsigned char *in,
                                      unsigned int in_size,
                                      unsigned char *out,
                                      unsigned int *out_size) {
    unsigned char *cp, *out_end, *out_free = NULL;
    RansEncSymbol syms[256];
    RansState ransN[NX];
    uint8_t* ptr;
    uint32_t F[256+MAGIC] = {0};
    int i, j, tab_size = 0, x, z;
    // -20 for order/size/meta
    unsigned int bound = rans_compress_bound_4x16(in_size,0)-20;

    if (!out) {
        *out_size = bound;
        out = out_free = malloc(*out_size);
    }
    if (!out || bound > *out_size)
        return NULL;

    // If "out" isn't word aligned, tweak out_end/ptr to ensure it is.
    // We already added more round in bound to allow for this.
    if (((size_t)out)&1)
        bound--;
    ptr = out_end = out + bound;

    if (in_size == 0)
        goto empty;

    // Compute statistics
    double e = hist8e(in, in_size, F);
    int low_ent = e < 2;

    // Normalise so frequences sum to power of 2
    uint32_t fsum = in_size;
    uint32_t max_val = round2(fsum);
    if (max_val > TOTFREQ)
        max_val = TOTFREQ;

    if (normalise_freq(F, fsum, max_val) < 0) {
        free(out_free);
        return NULL;
    }
    fsum=max_val;

    cp = out;
    cp += encode_freq(cp, F);
    tab_size = cp-out;
    //write(2, out+4, cp-(out+4));

    if (normalise_freq(F, fsum, TOTFREQ) < 0) {
        free(out_free);
        return NULL;
    }

    // Encode statistics.
    for (x = j = 0; j < 256; j++) {
        if (F[j]) {
            RansEncSymbolInit(&syms[j], x, F[j], TF_SHIFT);
            x += F[j];
        }
    }

    for (z = 0; z < NX; z++)
      RansEncInit(&ransN[z]);

    z = i = in_size&(NX-1);
    while (z-- > 0)
      RansEncPutSymbol(&ransN[z], &ptr, &syms[in[in_size-(i-z)]]);

    if (low_ent) {
        // orig
        // gcc   446
        // clang 427
        for (i=(in_size &~(NX-1)); likely(i>0); i-=NX) {
            for (z = NX-1; z >= 0; z-=4) {
                RansEncSymbol *s0 = &syms[in[i-(NX-z+0)]];
                RansEncSymbol *s1 = &syms[in[i-(NX-z+1)]];
                RansEncSymbol *s2 = &syms[in[i-(NX-z+2)]];
                RansEncSymbol *s3 = &syms[in[i-(NX-z+3)]];
                RansEncPutSymbol_branched(&ransN[z-0], &ptr, s0);
                RansEncPutSymbol_branched(&ransN[z-1], &ptr, s1);
                RansEncPutSymbol_branched(&ransN[z-2], &ptr, s2);
                RansEncPutSymbol_branched(&ransN[z-3], &ptr, s3);
                if (NX%8 == 0) {
                    z -= 4;
                    RansEncSymbol *s0 = &syms[in[i-(NX-z+0)]];
                    RansEncSymbol *s1 = &syms[in[i-(NX-z+1)]];
                    RansEncSymbol *s2 = &syms[in[i-(NX-z+2)]];
                    RansEncSymbol *s3 = &syms[in[i-(NX-z+3)]];
                    RansEncPutSymbol_branched(&ransN[z-0], &ptr, s0);
                    RansEncPutSymbol_branched(&ransN[z-1], &ptr, s1);
                    RansEncPutSymbol_branched(&ransN[z-2], &ptr, s2);
                    RansEncPutSymbol_branched(&ransN[z-3], &ptr, s3);
                }
            }
            if (z < -1) abort();
        }
    } else {
        // Branchless version optimises poorly with gcc unless we have
        // AVX2 capability, so have a custom rewrite of it.
        uint16_t* ptr16 = (uint16_t *)ptr;
        for (i=(in_size &~(NX-1)); likely(i>0); i-=NX) {
            // Unrolled copy of below, because gcc doesn't optimise this
            // well in the original form.
            //
            // Gcc11:   328 MB/s (this) vs 208 MB/s (orig)
            // Clang10: 352 MB/s (this) vs 340 MB/s (orig)
            //
            // for (z = NX-1; z >= 0; z-=4) {
            //  RansEncSymbol *s0 = &syms[in[i-(NX-z+0)]];
            //  RansEncSymbol *s1 = &syms[in[i-(NX-z+1)]];
            //  RansEncSymbol *s2 = &syms[in[i-(NX-z+2)]];
            //  RansEncSymbol *s3 = &syms[in[i-(NX-z+3)]];
            //  RansEncPutSymbol(&ransN[z-0], &ptr, s0);
            //  RansEncPutSymbol(&ransN[z-1], &ptr, s1);
            //  RansEncPutSymbol(&ransN[z-2], &ptr, s2);
            //  RansEncPutSymbol(&ransN[z-3], &ptr, s3);
            // }

            for (z = NX-1; z >= 0; z-=4) {
                // RansEncPutSymbol added in-situ
                RansState *rp = &ransN[z]-3;
                RansEncSymbol *sy[4];
                uint8_t *C = &in[i-(NX-z)]-3;

                sy[0] = &syms[C[3]];
                sy[1] = &syms[C[2]];

                int c0  = rp[3-0] > sy[0]->x_max;
                int c1  = rp[3-1] > sy[1]->x_max;

#ifdef HTSCODECS_LITTLE_ENDIAN
                ptr16[-1] = rp[3-0]; ptr16 -= c0;
                ptr16[-1] = rp[3-1]; ptr16 -= c1;
#else
                ((uint8_t *)&ptr16[-1])[0] = rp[3-0];
                ((uint8_t *)&ptr16[-1])[1] = rp[3-0]>>8;
                ptr16 -= c0;
                ((uint8_t *)&ptr16[-1])[0] = rp[3-1];
                ((uint8_t *)&ptr16[-1])[1] = rp[3-1]>>8;
                ptr16 -= c1;
#endif

                rp[3-0] = c0 ? rp[3-0]>>16 : rp[3-0];
                rp[3-1] = c1 ? rp[3-1]>>16 : rp[3-1];

                sy[2] = &syms[C[1]];
                sy[3] = &syms[C[0]];

                int c2  = rp[3-2] > sy[2]->x_max;
                int c3  = rp[3-3] > sy[3]->x_max;
#ifdef HTSCODECS_LITTLE_ENDIAN
                ptr16[-1] = rp[3-2]; ptr16 -= c2;
                ptr16[-1] = rp[3-3]; ptr16 -= c3;
#else
                ((uint8_t *)&ptr16[-1])[0] = rp[3-2];
                ((uint8_t *)&ptr16[-1])[1] = rp[3-2]>>8;
                ptr16 -= c2;
                ((uint8_t *)&ptr16[-1])[0] = rp[3-3];
                ((uint8_t *)&ptr16[-1])[1] = rp[3-3]>>8;
                ptr16 -= c3;
#endif
                rp[3-2] = c2 ? rp[3-2]>>16 : rp[3-2];
                rp[3-3] = c3 ? rp[3-3]>>16 : rp[3-3];

                int k;
                for (k = 0; k < 4; k++) {
                    uint64_t r64 = (uint64_t)rp[3-k];
                    uint32_t q = (r64 * sy[k]->rcp_freq) >> sy[k]->rcp_shift;
                    rp[3-k] += sy[k]->bias + q*sy[k]->cmpl_freq;
                }
            }
            if (z < -1) abort();
        }
        ptr = (uint8_t *)ptr16;
    }
    for (z = NX-1; z >= 0; z--)
        RansEncFlush(&ransN[z], &ptr);

 empty:
    // Finalise block size and return it
    *out_size = (out_end - ptr) + tab_size;

    memmove(out + tab_size, ptr, out_end-ptr);

    return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2d18, %rsp           # imm = 0x2D18
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, %r13d
movq %rdi, %r12
leaq 0x450(%rsp), %rdi
movl $0x420, %edx            # imm = 0x420
xorl %esi, %esi
callq 0x4260
movl %r13d, %edi
xorl %esi, %esi
callq 0x64798
movl %eax, %edx
leal -0x14(%rdx), %ebp
testq %rbx, %rbx
je 0x76feb
movq $0x0, 0x20(%rsp)
movq %r14, %r15
jmp 0x77006
movq %r14, %r15
movl %ebp, (%r14)
movl %ebp, %edi
movq %rdx, %rbx
callq 0x4680
movq %rbx, %rdx
movq %rax, %rbx
movq %rax, 0x20(%rsp)
testq %rbx, %rbx
je 0x77b1a
movq $0x0, 0x10(%rsp)
cmpl (%r15), %ebp
ja 0x77b1a
movq %r15, %rcx
addl $-0x15, %edx
testb $0x1, %bl
cmovel %ebp, %edx
addq %rbx, %rdx
movq %rdx, %rsi
testl %r13d, %r13d
movq %rbx, 0x8(%rsp)
je 0x77cd1
movq %rdx, 0x18(%rsp)
movq %rcx, 0x28(%rsp)
leaq 0xc90(%rsp), %rdi
xorl %r14d, %r14d
movl $0x420, %edx            # imm = 0x420
xorl %esi, %esi
callq 0x4260
leaq 0x30(%rsp), %rdi
movl $0x420, %edx            # imm = 0x420
xorl %esi, %esi
callq 0x4260
leaq 0x870(%rsp), %rdi
movl $0x420, %edx            # imm = 0x420
xorl %esi, %esi
callq 0x4260
leaq 0x28f0(%rsp), %rdi
movl $0x420, %edx            # imm = 0x420
xorl %esi, %esi
callq 0x4260
leaq 0x24d0(%rsp), %rdi
movl $0x420, %edx            # imm = 0x420
xorl %esi, %esi
callq 0x4260
leaq 0x20b0(%rsp), %rdi
movl $0x420, %edx            # imm = 0x420
xorl %esi, %esi
callq 0x4260
leaq 0x1c90(%rsp), %rdi
movl $0x420, %edx            # imm = 0x420
xorl %esi, %esi
callq 0x4260
movl %r13d, %ebp
cvtsi2sd %rbp, %xmm1
movsd 0x1ef29(%rip), %xmm0    # 0x96010
movsd %xmm1, 0x10(%rsp)
divsd %xmm1, %xmm0
callq 0x4390
movl %r13d, %eax
andl $-0x8, %eax
movq 0x20(%rsp), %rdi
je 0x77175
movl %eax, %eax
xorl %r14d, %r14d
movzbl (%r12,%r14), %ecx
incl 0x450(%rsp,%rcx,4)
movzbl 0x1(%r12,%r14), %ecx
incl 0xc90(%rsp,%rcx,4)
movzbl 0x2(%r12,%r14), %ecx
incl 0x30(%rsp,%rcx,4)
movzbl 0x3(%r12,%r14), %ecx
incl 0x870(%rsp,%rcx,4)
movzbl 0x4(%r12,%r14), %ecx
incl 0x28f0(%rsp,%rcx,4)
movzbl 0x5(%r12,%r14), %ecx
incl 0x24d0(%rsp,%rcx,4)
movzbl 0x6(%r12,%r14), %ecx
incl 0x20b0(%rsp,%rcx,4)
movzbl 0x7(%r12,%r14), %ecx
incl 0x1c90(%rsp,%rcx,4)
addq $0x8, %r14
cmpq %rax, %r14
jb 0x77108
cmpl %r13d, %r14d
jae 0x77191
movl %r14d, %eax
movzbl (%r12,%rax), %ecx
incq %rax
incl 0x450(%rsp,%rcx,4)
cmpq %rax, %rbp
jne 0x7717d
divsd 0x276ef(%rip), %xmm0    # 0x9e888
xorpd %xmm1, %xmm1
xorl %eax, %eax
movl 0x30(%rsp,%rax), %ecx
addl 0xc90(%rsp,%rax), %ecx
addl 0x870(%rsp,%rax), %ecx
addl 0x28f0(%rsp,%rax), %ecx
addl 0x24d0(%rsp,%rax), %ecx
addl 0x20b0(%rsp,%rax), %ecx
addl 0x1c90(%rsp,%rax), %ecx
addl 0x450(%rsp,%rax), %ecx
xorps %xmm2, %xmm2
cvtsi2sd %rcx, %xmm2
movl %ecx, 0x450(%rsp,%rax)
orl $0x1, %ecx
bsrl %ecx, %ecx
xorl $-0x20, %ecx
addl $0x21, %ecx
xorps %xmm3, %xmm3
cvtsi2sd %ecx, %xmm3
addsd %xmm0, %xmm3
mulsd %xmm2, %xmm3
subsd %xmm3, %xmm1
addq $0x4, %rax
cmpq $0x400, %rax            # imm = 0x400
jne 0x7719f
divsd 0x10(%rsp), %xmm1
leal -0x1(%r13), %eax
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %r9d
shrl $0x10, %r9d
orl %eax, %r9d
incl %r9d
movl $0x1000, %r8d           # imm = 0x1000
cmpl %r8d, %r9d
cmovbl %r9d, %r8d
movq %r8, %rcx
shlq $0x1f, %rcx
movb $0x1, %bl
movl $0x1, %r10d
movl %r13d, %esi
movslq %esi, %r14
xorl %r11d, %r11d
movq %rcx, %rax
xorl %edx, %edx
divq %r14
movq %rax, %rsi
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
idivl %r14d
cltq
addq %rsi, %rax
xorl %esi, %esi
xorl %edx, %edx
xorl %ebp, %ebp
movl 0x450(%rsp,%r11,4), %r14d
testq %r14, %r14
je 0x772bb
cmpl %r14d, %edx
cmovbl %r11d, %ebp
cmovbel %r14d, %edx
imulq %rax, %r14
shrq $0x1f, %r14
cmpl $0x2, %r14d
cmovbl %r10d, %r14d
movl %r14d, 0x450(%rsp,%r11,4)
addl %esi, %r14d
movl %r14d, %esi
incq %r11
cmpq $0x100, %r11            # imm = 0x100
jne 0x77285
movl %r8d, %edx
subl %esi, %edx
movslq %ebp, %rax
testl %edx, %edx
jg 0x77363
jns 0x77384
movl 0x450(%rsp,%rax,4), %r11d
movl %edx, %ebp
negl %ebp
cmpl %ebp, %r11d
jbe 0x77300
movl %r11d, %r14d
shrl %r14d
cmpl %ebp, %r14d
setb %bpl
testb %bpl, %bl
je 0x77373
testb $0x1, %bl
movl $0x0, %ebx
jne 0x7725f
addl %r11d, %edx
movl $0x1, 0x450(%rsp,%rax,4)
decl %edx
je 0x77384
xorl %ecx, %ecx
movl 0x450(%rsp,%rcx,4), %esi
cmpl $0x2, %esi
jb 0x77351
movl %edx, %r11d
negl %r11d
movl $0x1, %r10d
subl %esi, %r10d
cmpl %r11d, %esi
cmoval %edx, %r10d
addl %r10d, %esi
movl %esi, 0x450(%rsp,%rcx,4)
subl %r10d, %edx
cmpq $0xfe, %rcx
ja 0x77384
incq %rcx
testl %edx, %edx
jne 0x77322
jmp 0x77384
leaq (%rsp,%rax,4), %rcx
addq $0x450, %rcx            # imm = 0x450
movl (%rcx), %r11d
jmp 0x7737e
leaq (%rsp,%rax,4), %rcx
addq $0x450, %rcx            # imm = 0x450
addl %edx, %r11d
movl %r11d, (%rcx)
cmpl $0x0, 0x450(%rsp,%rax,4)
je 0x77b15
xorl %eax, %eax
movl $0x1, %ecx
xorl %edx, %edx
movq 0x8(%rsp), %r10
movq %r10, %r11
movq %r11, %rsi
cmpl $0x0, 0x450(%rsp,%rax,4)
je 0x773b6
testl %edx, %edx
je 0x773c9
decl %edx
movq %rsi, %r11
incq %rax
incq %rcx
cmpq $0x100, %rax            # imm = 0x100
jne 0x773a3
jmp 0x77419
leaq 0x1(%rsi), %r11
movb %al, (%rsi)
xorl %edx, %edx
testq %rax, %rax
je 0x773b9
cmpl $0x0, 0x44c(%rsp,%rax,4)
je 0x773b9
leal 0x1(%rax), %r11d
movl %r11d, %edx
cmpq $0xfe, %rax
ja 0x7740d
movq %rcx, %rdx
cmpl $0x0, 0x450(%rsp,%rdx,4)
je 0x7740d
incq %rdx
cmpq $0x100, %rdx            # imm = 0x100
jne 0x773f2
movl $0x100, %edx            # imm = 0x100
subl %r11d, %edx
movb %dl, 0x1(%rsi)
addq $0x2, %rsi
jmp 0x773b6
movb $0x0, (%r11)
subl %r10d, %r11d
incl %r11d
movslq %r11d, %rbx
addq %r10, %rbx
xorl %eax, %eax
movl 0x450(%rsp,%rax,4), %ecx
testl %ecx, %ecx
je 0x774ff
cmpl $0x7f, %ecx
ja 0x7744b
movb %cl, (%rbx)
movl $0x1, %ecx
jmp 0x774fc
movl %ecx, %edx
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x7746d
shrl $0x7, %edx
orb $-0x80, %dl
movb %dl, (%rbx)
andb $0x7f, %cl
movb %cl, 0x1(%rbx)
movl $0x2, %ecx
jmp 0x774fc
cmpl $0x1fffff, %ecx         # imm = 0x1FFFFF
ja 0x77495
shrl $0xe, %edx
orb $-0x80, %dl
movb %dl, (%rbx)
movl %ecx, %edx
shrl $0x7, %edx
orb $-0x80, %dl
movb %dl, 0x1(%rbx)
andb $0x7f, %cl
movb %cl, 0x2(%rbx)
movl $0x3, %ecx
jmp 0x774fc
cmpl $0xfffffff, %ecx        # imm = 0xFFFFFFF
ja 0x774c8
shrl $0x15, %edx
orb $-0x80, %dl
movb %dl, (%rbx)
movl %ecx, %edx
shrl $0xe, %edx
orb $-0x80, %dl
movb %dl, 0x1(%rbx)
movl %ecx, %edx
shrl $0x7, %edx
orb $-0x80, %dl
movb %dl, 0x2(%rbx)
andb $0x7f, %cl
movb %cl, 0x3(%rbx)
movl $0x4, %ecx
jmp 0x774fc
shrl $0x1c, %edx
orb $-0x80, %dl
movb %dl, (%rbx)
movl %ecx, %edx
shrl $0x15, %edx
orb $-0x80, %dl
movb %dl, 0x1(%rbx)
movl %ecx, %edx
shrl $0xe, %edx
orb $-0x80, %dl
movb %dl, 0x2(%rbx)
movl %ecx, %edx
shrl $0x7, %edx
orb $-0x80, %dl
movb %dl, 0x3(%rbx)
andb $0x7f, %cl
movb %cl, 0x4(%rbx)
movl $0x5, %ecx
addq %rcx, %rbx
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x7742b
testl %r9d, %r9d
je 0x77669
movb $0x1, %r9b
movabsq $0x80000000000, %rcx    # imm = 0x80000000000
movl $0x1, %r10d
movslq %r8d, %r8
xorl %r11d, %r11d
movq %rcx, %rax
xorl %edx, %edx
divq %r8
movq %rax, %rsi
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
idivl %r8d
movslq %eax, %rdx
addq %rsi, %rdx
xorl %r8d, %r8d
xorl %esi, %esi
xorl %eax, %eax
movl 0x450(%rsp,%r11,4), %r14d
testq %r14, %r14
je 0x77588
cmpl %r14d, %esi
cmovbl %r11d, %eax
cmovbel %r14d, %esi
imulq %rdx, %r14
shrq $0x1f, %r14
cmpl $0x2, %r14d
cmovbl %r10d, %r14d
movl %r14d, 0x450(%rsp,%r11,4)
addl %r8d, %r14d
movl %r14d, %r8d
incq %r11
cmpq $0x100, %r11            # imm = 0x100
jne 0x77552
leal -0x1000(%r8), %r11d
movl $0x1000, %esi           # imm = 0x1000
subl %r8d, %esi
cltq
testl %esi, %esi
jg 0x77638
jns 0x77656
movl 0x450(%rsp,%rax,4), %edx
cmpl %r11d, %edx
jbe 0x775cf
movl %edx, %ebp
shrl %ebp
cmpl %r11d, %ebp
setb %r11b
testb %r11b, %r9b
je 0x77647
testb $0x1, %r9b
movl $0x0, %r9d
jne 0x7752a
subl %r8d, %edx
movl $0x1, 0x450(%rsp,%rax,4)
addl $0xfff, %edx            # imm = 0xFFF
je 0x77656
xorl %ecx, %ecx
movl 0x450(%rsp,%rcx,4), %esi
cmpl $0x2, %esi
jb 0x77626
movl %edx, %r8d
negl %r8d
movl $0x1, %r9d
subl %esi, %r9d
cmpl %r8d, %esi
cmoval %edx, %r9d
addl %r9d, %esi
movl %esi, 0x450(%rsp,%rcx,4)
subl %r9d, %edx
cmpq $0xfe, %rcx
ja 0x77656
incq %rcx
testl %edx, %edx
jne 0x775f7
jmp 0x77656
leaq (%rsp,%rax,4), %rcx
addq $0x450, %rcx            # imm = 0x450
movl (%rcx), %edx
jmp 0x77652
leaq (%rsp,%rax,4), %rcx
addq $0x450, %rcx            # imm = 0x450
addl %esi, %edx
movl %edx, (%rcx)
cmpl $0x0, 0x450(%rsp,%rax,4)
movq 0x8(%rsp), %r10
je 0x77b15
subl %r10d, %ebx
xorl %r8d, %r8d
xorl %r9d, %r9d
movl 0x450(%rsp,%r8,4), %r10d
testq %r10, %r10
je 0x77733
cmpl $0x1001, %r9d           # imm = 0x1001
jae 0x77cfd
movl $0x1000, %eax           # imm = 0x1000
subl %r9d, %eax
cmpl %r10d, %eax
jb 0x77d1c
movq %r8, %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %r11
addq $0xc90, %r11            # imm = 0xC90
movl $0x1000, %eax           # imm = 0x1000
subl %r10d, %eax
movl %r10d, %ecx
shll $0x13, %ecx
decl %ecx
movl %ecx, (%r11)
movw %ax, 0xc(%r11)
cmpq $0x1, %r10
jne 0x776e9
movl $0xffffffff, 0x4(%r11)  # imm = 0xFFFFFFFF
movw $0x0, 0xe(%r11)
leal 0xfff(%r9), %eax
jmp 0x77723
movl $0x1e, %esi
leal -0x1e(%rsi), %ecx
movl $0x1, %eax
shll %cl, %eax
incl %esi
cmpl %r10d, %eax
jb 0x776ee
movl $0x1, %eax
movl %esi, %ecx
shlq %cl, %rax
addq %r10, %rax
decq %rax
xorl %edx, %edx
divq %r10
movl %eax, 0x4(%r11)
addl $-0x20, %esi
movw %si, 0xe(%r11)
movl %r9d, %eax
movl %eax, 0x8(%r11)
addw $0x20, 0xe(%r11)
addl %r9d, %r10d
movl %r10d, %r9d
incq %r8
cmpq $0x100, %r8             # imm = 0x100
jne 0x77672
xorl %eax, %eax
movl $0x8000, 0x30(%rsp,%rax,4) # imm = 0x8000
incq %rax
cmpq $0x20, %rax
jne 0x77745
movq 0x18(%rsp), %rsi
testb $0x1f, %r13b
je 0x777ec
movl %r13d, %eax
andl $0x1f, %eax
decq %rax
movl %r13d, %edx
andl $-0x20, %edx
movq 0x18(%rsp), %rsi
leal (%rdx,%rax), %ecx
movzbl (%r12,%rcx), %r8d
shll $0x4, %r8d
movl 0x30(%rsp,%rax,4), %r9d
xorl %ecx, %ecx
cmpl 0xc90(%rsp,%r8), %r9d
seta %cl
leal (%rcx,%rcx), %r10d
movw %r9w, -0x2(%rsi)
shll $0x4, %ecx
shrl %cl, %r9d
movl 0xc94(%rsp,%r8), %r11d
imulq %r9, %r11
movb 0xc9e(%rsp,%r8), %cl
shrq %cl, %r11
subq %r10, %rsi
addl 0xc98(%rsp,%r8), %r9d
movzwl 0xc9c(%rsp,%r8), %ecx
imull %r11d, %ecx
addl %r9d, %ecx
movl %ecx, 0x30(%rsp,%rax,4)
leaq -0x1(%rax), %rcx
incq %rax
cmpq $0x1, %rax
movq %rcx, %rax
jg 0x77779
andl $-0x20, %r13d
movsd 0x26390(%rip), %xmm0    # 0x9db88
ucomisd %xmm1, %xmm0
movq %rbx, 0x10(%rsp)
jbe 0x77b21
testl %r13d, %r13d
jle 0x77ca8
leal -0x20(%r13), %eax
cltq
leaq (%rax,%r12), %rdx
addq $0x1f, %rdx
addq $0x18, %rax
xorl %r8d, %r8d
movzbl (%rdx,%r8), %ecx
shll $0x4, %ecx
movzbl -0x1(%rdx,%r8), %r11d
movzbl -0x2(%rdx,%r8), %r10d
movzbl -0x3(%rdx,%r8), %r9d
movl 0xac(%rsp,%r8,4), %ebp
cmpl 0xc90(%rsp,%rcx), %ebp
jbe 0x7785b
movw %bp, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %ebp
leaq (%rsp,%rcx), %r14
addq $0xc90, %r14            # imm = 0xC90
movl %ebp, %ecx
movl 0x4(%r14), %r15d
imulq %rcx, %r15
movb 0xe(%r14), %cl
shrq %cl, %r15
shll $0x4, %r11d
addl 0x8(%r14), %ebp
addq %rsp, %r11
addq $0xc90, %r11            # imm = 0xC90
movzwl 0xc(%r14), %ecx
imull %r15d, %ecx
addl %ebp, %ecx
movl %ecx, 0xac(%rsp,%r8,4)
movl 0xa8(%rsp,%r8,4), %ebp
cmpl (%r11), %ebp
jbe 0x778b4
movw %bp, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %ebp
movl %ebp, %ecx
movl 0x4(%r11), %r14d
imulq %rcx, %r14
movb 0xe(%r11), %cl
shrq %cl, %r14
shll $0x4, %r10d
addl 0x8(%r11), %ebp
addq %rsp, %r10
addq $0xc90, %r10            # imm = 0xC90
movzwl 0xc(%r11), %ecx
imull %r14d, %ecx
addl %ebp, %ecx
movl %ecx, 0xa8(%rsp,%r8,4)
movl 0xa4(%rsp,%r8,4), %r11d
cmpl (%r10), %r11d
jbe 0x77904
movw %r11w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r11d
movl %r11d, %ecx
movl 0x4(%r10), %r14d
imulq %rcx, %r14
movb 0xe(%r10), %cl
shrq %cl, %r14
shll $0x4, %r9d
addl 0x8(%r10), %r11d
addq %rsp, %r9
addq $0xc90, %r9             # imm = 0xC90
movzwl 0xc(%r10), %ecx
imull %r14d, %ecx
addl %r11d, %ecx
movl %ecx, 0xa4(%rsp,%r8,4)
movl 0xa0(%rsp,%r8,4), %r10d
cmpl (%r9), %r10d
jbe 0x77956
movw %r10w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r10d
movl %r10d, %ecx
movl 0x4(%r9), %r11d
imulq %rcx, %r11
movb 0xe(%r9), %cl
shrq %cl, %r11
addl 0x8(%r9), %r10d
movzwl 0xc(%r9), %ecx
imull %r11d, %ecx
addl %r10d, %ecx
movl %ecx, 0xa0(%rsp,%r8,4)
movzbl -0x4(%rdx,%r8), %ecx
shll $0x4, %ecx
movzbl -0x5(%rdx,%r8), %r11d
movzbl -0x6(%rdx,%r8), %r10d
leal (%rax,%r8), %r9d
movslq %r9d, %r9
movzbl (%r12,%r9), %r9d
movl 0x9c(%rsp,%r8,4), %ebp
cmpl 0xc90(%rsp,%rcx), %ebp
jbe 0x779bd
movw %bp, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %ebp
leaq (%rsp,%rcx), %r14
addq $0xc90, %r14            # imm = 0xC90
movl %ebp, %ecx
movl 0x4(%r14), %r15d
imulq %rcx, %r15
movb 0xe(%r14), %cl
shrq %cl, %r15
shll $0x4, %r11d
addl 0x8(%r14), %ebp
addq %rsp, %r11
addq $0xc90, %r11            # imm = 0xC90
movzwl 0xc(%r14), %ecx
imull %r15d, %ecx
addl %ebp, %ecx
movl %ecx, 0x9c(%rsp,%r8,4)
movl 0x98(%rsp,%r8,4), %ebp
cmpl (%r11), %ebp
jbe 0x77a16
movw %bp, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %ebp
movl %ebp, %ecx
movl 0x4(%r11), %r14d
imulq %rcx, %r14
movb 0xe(%r11), %cl
shrq %cl, %r14
shll $0x4, %r10d
addl 0x8(%r11), %ebp
addq %rsp, %r10
addq $0xc90, %r10            # imm = 0xC90
movzwl 0xc(%r11), %ecx
imull %r14d, %ecx
addl %ebp, %ecx
movl %ecx, 0x98(%rsp,%r8,4)
movl 0x94(%rsp,%r8,4), %r11d
cmpl (%r10), %r11d
jbe 0x77a66
movw %r11w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r11d
movl %r11d, %ecx
movl 0x4(%r10), %r14d
imulq %rcx, %r14
movb 0xe(%r10), %cl
shrq %cl, %r14
shll $0x4, %r9d
addl 0x8(%r10), %r11d
addq %rsp, %r9
addq $0xc90, %r9             # imm = 0xC90
movzwl 0xc(%r10), %ecx
imull %r14d, %ecx
addl %r11d, %ecx
movl %ecx, 0x94(%rsp,%r8,4)
movl 0x90(%rsp,%r8,4), %r10d
cmpl (%r9), %r10d
jbe 0x77ab8
movw %r10w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r10d
movl %r10d, %ecx
movl 0x4(%r9), %r11d
imulq %rcx, %r11
movb 0xe(%r9), %cl
shrq %cl, %r11
addl 0x8(%r9), %r10d
movzwl 0xc(%r9), %ecx
imull %r11d, %ecx
addl %r10d, %ecx
movl %ecx, 0x90(%rsp,%r8,4)
leaq -0x8(%r8), %rcx
addq $0x1f, %r8
cmpq $0x7, %r8
movq %rcx, %r8
ja 0x77825
leal -0x20(%r13), %ecx
addq $-0x20, %rdx
addq $-0x20, %rax
cmpl $0x20, %r13d
movl %ecx, %r13d
jg 0x77822
jmp 0x77ca8
callq 0x45c0
xorl %eax, %eax
jmp 0x77ceb
testl %r13d, %r13d
jle 0x77ca8
leal -0x20(%r13), %edx
movl $0x1f, %r9d
leaq 0xac(%rsp), %r8
leal (%rdx,%r9), %ecx
movslq %ecx, %rcx
movzbl (%r12,%rcx), %r10d
shll $0x4, %r10d
leaq (%rsp,%r10), %r14
addq $0xc90, %r14            # imm = 0xC90
movq %r14, 0x870(%rsp)
movzbl -0x1(%r12,%rcx), %r10d
shll $0x4, %r10d
leaq (%rsp,%r10), %r15
addq $0xc90, %r15            # imm = 0xC90
movl 0x2c(%rsp,%r9,4), %ebp
movl 0x30(%rsp,%r9,4), %r10d
movl %r10d, %ebx
shrl $0x10, %ebx
movl %ebp, %r11d
shrl $0x10, %r11d
xorl %edi, %edi
cmpl (%r15), %ebp
seta %dil
cmovbel %ebp, %r11d
xorl %eax, %eax
cmpl (%r14), %r10d
seta %al
cmovbel %r10d, %ebx
movq %r15, 0x878(%rsp)
movw %r10w, -0x2(%rsi)
addl %eax, %eax
subq %rax, %rsi
movw %bp, -0x2(%rsi)
addl %edi, %edi
subq %rdi, %rsi
movl %ebx, 0x30(%rsp,%r9,4)
movl %r11d, 0x2c(%rsp,%r9,4)
movzbl -0x2(%r12,%rcx), %eax
shll $0x4, %eax
addq %rsp, %rax
addq $0xc90, %rax            # imm = 0xC90
movq %rax, 0x880(%rsp)
movzbl -0x3(%r12,%rcx), %ecx
shll $0x4, %ecx
addq %rsp, %rcx
addq $0xc90, %rcx            # imm = 0xC90
movq %rcx, 0x888(%rsp)
movl 0x24(%rsp,%r9,4), %edi
movl 0x28(%rsp,%r9,4), %r11d
movl %r11d, %ebx
shrl $0x10, %ebx
movl %edi, %ebp
shrl $0x10, %ebp
xorl %r10d, %r10d
cmpl (%rcx), %edi
seta %r10b
cmovbel %edi, %ebp
xorl %ecx, %ecx
cmpl (%rax), %r11d
seta %cl
movw %r11w, -0x2(%rsi)
cmovbel %r11d, %ebx
addl %ecx, %ecx
subq %rcx, %rsi
movw %di, -0x2(%rsi)
negq %r10
movl %ebx, 0x28(%rsp,%r9,4)
movl %ebp, 0x24(%rsp,%r9,4)
movq %r8, %r11
xorl %r14d, %r14d
movl (%r11), %eax
movq 0x870(%rsp,%r14,8), %rdi
movl 0x4(%rdi), %ebx
imulq %rax, %rbx
movb 0xe(%rdi), %cl
shrq %cl, %rbx
movzwl 0xc(%rdi), %ecx
imull %ebx, %ecx
movl 0x8(%rdi), %edi
addl %eax, %edi
addl %ecx, %edi
movl %edi, (%r11)
incq %r14
addq $-0x4, %r11
cmpq $0x4, %r14
jne 0x77c4c
leaq (%rsi,%r10,2), %rsi
leaq -0x4(%r9), %rax
addq $-0x10, %r8
cmpq $0x3, %r9
movq %rax, %r9
ja 0x77b3c
cmpl $0x20, %r13d
movl %edx, %r13d
jg 0x77b2a
xorl %eax, %eax
movl 0xac(%rsp,%rax), %ecx
movl %ecx, -0x4(%rsi,%rax)
addq $-0x4, %rax
cmpq $-0x80, %rax
jne 0x77caa
addq %rax, %rsi
movq 0x8(%rsp), %rbx
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rdx
subq %rsi, %rdx
movslq 0x10(%rsp), %rdi
leal (%rdi,%rdx), %eax
movl %eax, (%rcx)
addq %rbx, %rdi
callq 0x4830
movq 0x8(%rsp), %rax
addq $0x2d18, %rsp           # imm = 0x2D18
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26f12(%rip), %rdi     # 0x9ec16
leaq 0x26ea5(%rip), %rsi     # 0x9ebb0
leaq 0x26ebe(%rip), %rcx     # 0x9ebd0
movl $0xcc, %edx
callq 0x42f0
leaq 0x26f0f(%rip), %rdi     # 0x9ec32
leaq 0x26e86(%rip), %rsi     # 0x9ebb0
leaq 0x26e9f(%rip), %rcx     # 0x9ebd0
movl $0xcd, %edx
callq 0x42f0