// File: /workspace/github_c_makefile_star2_O3/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, %r15
movq %rdx, %r14
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 0x61e28
movl %eax, %edx
leal -0x14(%rdx), %ebx
movq %r14, 0x8(%rsp)
testq %r14, %r14
je 0x7501e
xorl %ebp, %ebp
cmpl (%r15), %ebx
jbe 0x7503f
jmp 0x75ca5
movl %ebx, (%r15)
movl %ebx, %edi
movq %rdx, %r14
callq 0x4680
movq %r14, %rdx
movq %rax, %rbp
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x75ad5
addl $-0x15, %edx
movq 0x8(%rsp), %rax
testb $0x1, %al
cmovel %ebx, %edx
addq %rax, %rdx
testl %r13d, %r13d
je 0x7536a
movq %rdx, 0x10(%rsp)
leaq 0xc90(%rsp), %rdi
xorl %ebx, %ebx
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, %r14d
cvtsi2sd %r14, %xmm1
movsd 0x1df18(%rip), %xmm0    # 0x93010
movsd %xmm1, 0x18(%rsp)
divsd %xmm1, %xmm0
callq 0x4390
movl %r13d, %eax
andl $-0x8, %eax
je 0x75180
movl %eax, %eax
xorl %ebx, %ebx
movzbl (%r12,%rbx), %ecx
incl 0x450(%rsp,%rcx,4)
movzbl 0x1(%r12,%rbx), %ecx
incl 0xc90(%rsp,%rcx,4)
movzbl 0x2(%r12,%rbx), %ecx
incl 0x30(%rsp,%rcx,4)
movzbl 0x3(%r12,%rbx), %ecx
incl 0x870(%rsp,%rcx,4)
movzbl 0x4(%r12,%rbx), %ecx
incl 0x28f0(%rsp,%rcx,4)
movzbl 0x5(%r12,%rbx), %ecx
incl 0x24d0(%rsp,%rcx,4)
movzbl 0x6(%r12,%rbx), %ecx
incl 0x20b0(%rsp,%rcx,4)
movzbl 0x7(%r12,%rbx), %ecx
incl 0x1c90(%rsp,%rcx,4)
addq $0x8, %rbx
cmpq %rax, %rbx
jb 0x75113
cmpl %r13d, %ebx
jae 0x7519b
movl %ebx, %eax
movzbl (%r12,%rax), %ecx
incq %rax
incl 0x450(%rsp,%rcx,4)
cmpq %rax, %r14
jne 0x75187
divsd 0x26905(%rip), %xmm0    # 0x9baa8
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 0x751a9
divsd 0x18(%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, %dil
movl $0x1, %r10d
movl %r13d, %esi
movslq %esi, %rbx
xorl %r11d, %r11d
movq %rcx, %rax
xorl %edx, %edx
divq %rbx
movq %rax, %rsi
movl $0x40000000, %eax       # imm = 0x40000000
xorl %edx, %edx
idivl %ebx
movslq %eax, %rdx
addq %rsi, %rdx
xorl %esi, %esi
xorl %ebx, %ebx
xorl %eax, %eax
movl 0x450(%rsp,%r11,4), %r14d
testq %r14, %r14
je 0x752c6
cmpl %r14d, %ebx
cmovbl %r11d, %eax
cmovbel %r14d, %ebx
imulq %rdx, %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 0x75290
movl %r8d, %edx
subl %esi, %edx
cltq
testl %edx, %edx
jg 0x75374
jns 0x75387
movl 0x450(%rsp,%rax,4), %r11d
movl %edx, %ebx
negl %ebx
cmpl %ebx, %r11d
jbe 0x75309
movl %r11d, %r14d
shrl %r14d
cmpl %ebx, %r14d
setb %bl
testb %bl, %dil
je 0x7537c
testb $0x1, %dil
movl $0x0, %edi
jne 0x7526a
addl %r11d, %edx
movl $0x1, 0x450(%rsp,%rax,4)
decl %edx
je 0x75387
xorl %ecx, %ecx
movl 0x450(%rsp,%rcx,4), %esi
cmpl $0x2, %esi
jb 0x75358
movl %edx, %edi
negl %edi
movl $0x1, %r10d
subl %esi, %r10d
cmpl %edi, %esi
cmoval %edx, %r10d
addl %r10d, %esi
movl %esi, 0x450(%rsp,%rcx,4)
subl %r10d, %edx
cmpq $0xfe, %rcx
ja 0x75387
incq %rcx
testl %edx, %edx
jne 0x7532c
jmp 0x75387
xorl %eax, %eax
movq %rdx, %rsi
jmp 0x75c8c
movl 0x450(%rsp,%rax,4), %r11d
addl %edx, %r11d
movl %r11d, 0x450(%rsp,%rax,4)
cmpl $0x0, 0x450(%rsp,%rax,4)
je 0x75acd
xorl %eax, %eax
movl $0x1, %ecx
xorl %edx, %edx
movq 0x8(%rsp), %rdi
movq %rdi, %rsi
cmpl $0x0, 0x450(%rsp,%rax,4)
je 0x753b6
testl %edx, %edx
je 0x753c9
decl %edx
movq %rsi, %rdi
incq %rax
incq %rcx
cmpq $0x100, %rax            # imm = 0x100
jne 0x753a3
jmp 0x75416
leaq 0x1(%rsi), %rdi
movb %al, (%rsi)
xorl %edx, %edx
testq %rax, %rax
je 0x753b9
cmpl $0x0, 0x44c(%rsp,%rax,4)
je 0x753b9
leal 0x1(%rax), %edi
movl %edi, %edx
cmpq $0xfe, %rax
ja 0x7540b
movq %rcx, %rdx
cmpl $0x0, 0x450(%rsp,%rdx,4)
je 0x7540b
incq %rdx
cmpq $0x100, %rdx            # imm = 0x100
jne 0x753f0
movl $0x100, %edx            # imm = 0x100
subl %edi, %edx
movb %dl, 0x1(%rsi)
addq $0x2, %rsi
jmp 0x753b6
movb $0x0, (%rdi)
movq 0x8(%rsp), %rax
subl %eax, %edi
incl %edi
movslq %edi, %rdi
addq %rax, %rdi
xorl %eax, %eax
movl 0x450(%rsp,%rax,4), %ecx
testl %ecx, %ecx
je 0x754fe
cmpl $0x7f, %ecx
ja 0x7544a
movb %cl, (%rdi)
movl $0x1, %ecx
jmp 0x754fb
movl %ecx, %edx
cmpl $0x3fff, %ecx           # imm = 0x3FFF
ja 0x7546c
shrl $0x7, %edx
orb $-0x80, %dl
movb %dl, (%rdi)
andb $0x7f, %cl
movb %cl, 0x1(%rdi)
movl $0x2, %ecx
jmp 0x754fb
cmpl $0x1fffff, %ecx         # imm = 0x1FFFFF
ja 0x75494
shrl $0xe, %edx
orb $-0x80, %dl
movb %dl, (%rdi)
movl %ecx, %edx
shrl $0x7, %edx
orb $-0x80, %dl
movb %dl, 0x1(%rdi)
andb $0x7f, %cl
movb %cl, 0x2(%rdi)
movl $0x3, %ecx
jmp 0x754fb
cmpl $0xfffffff, %ecx        # imm = 0xFFFFFFF
ja 0x754c7
shrl $0x15, %edx
orb $-0x80, %dl
movb %dl, (%rdi)
movl %ecx, %edx
shrl $0xe, %edx
orb $-0x80, %dl
movb %dl, 0x1(%rdi)
movl %ecx, %edx
shrl $0x7, %edx
orb $-0x80, %dl
movb %dl, 0x2(%rdi)
andb $0x7f, %cl
movb %cl, 0x3(%rdi)
movl $0x4, %ecx
jmp 0x754fb
shrl $0x1c, %edx
orb $-0x80, %dl
movb %dl, (%rdi)
movl %ecx, %edx
shrl $0x15, %edx
orb $-0x80, %dl
movb %dl, 0x1(%rdi)
movl %ecx, %edx
shrl $0xe, %edx
orb $-0x80, %dl
movb %dl, 0x2(%rdi)
movl %ecx, %edx
shrl $0x7, %edx
orb $-0x80, %dl
movb %dl, 0x3(%rdi)
andb $0x7f, %cl
movb %cl, 0x4(%rdi)
movl $0x5, %ecx
addq %rcx, %rdi
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x7542a
testl %r9d, %r9d
je 0x75652
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), %ebx
testq %rbx, %rbx
je 0x75584
cmpl %ebx, %esi
cmovbl %r11d, %eax
cmovbel %ebx, %esi
imulq %rdx, %rbx
shrq $0x1f, %rbx
cmpl $0x2, %ebx
cmovbl %r10d, %ebx
movl %ebx, 0x450(%rsp,%r11,4)
addl %r8d, %ebx
movl %ebx, %r8d
incq %r11
cmpq $0x100, %r11            # imm = 0x100
jne 0x75551
leal -0x1000(%r8), %r11d
movl $0x1000, %esi           # imm = 0x1000
subl %r8d, %esi
cltq
testl %esi, %esi
jg 0x75634
jns 0x75644
movl 0x450(%rsp,%rax,4), %edx
cmpl %r11d, %edx
jbe 0x755cb
movl %edx, %ebx
shrl %ebx
cmpl %r11d, %ebx
setb %r11b
testb %r11b, %r9b
je 0x7563b
testb $0x1, %r9b
movl $0x0, %r9d
jne 0x75529
subl %r8d, %edx
movl $0x1, 0x450(%rsp,%rax,4)
addl $0xfff, %edx            # imm = 0xFFF
je 0x75644
xorl %ecx, %ecx
movl 0x450(%rsp,%rcx,4), %esi
cmpl $0x2, %esi
jb 0x75622
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 0x75644
incq %rcx
testl %edx, %edx
jne 0x755f3
jmp 0x75644
movl 0x450(%rsp,%rax,4), %edx
addl %esi, %edx
movl %edx, 0x450(%rsp,%rax,4)
cmpl $0x0, 0x450(%rsp,%rax,4)
je 0x75acd
subl 0x8(%rsp), %edi
movq %rdi, 0x28(%rsp)
xorl %r8d, %r8d
xorl %r9d, %r9d
movl 0x450(%rsp,%r8,4), %r10d
testq %r10, %r10
je 0x75717
cmpl $0x1001, %r9d           # imm = 0x1001
jae 0x75cba
movl $0x1000, %eax           # imm = 0x1000
subl %r9d, %eax
cmpl %r10d, %eax
jb 0x75cd9
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 0x756d9
movl $0xffffffff, 0x4(%r11)  # imm = 0xFFFFFFFF
leal 0xfff(%r9), %eax
movl %eax, 0x8(%r11)
movw $0x20, %si
jmp 0x7570c
movl $0x1e, %esi
leal -0x1e(%rsi), %ecx
movl $0x1, %eax
shll %cl, %eax
incl %esi
cmpl %r10d, %eax
jb 0x756de
movl $0x1, %eax
movl %esi, %ecx
shlq %cl, %rax
addq %r10, %rax
decq %rax
xorl %edx, %edx
divq %r10
movl %eax, 0x4(%r11)
movl %r9d, 0x8(%r11)
movw %si, 0xe(%r11)
addl %r9d, %r10d
movl %r10d, %r9d
incq %r8
cmpq $0x100, %r8             # imm = 0x100
jne 0x75661
xorl %eax, %eax
movaps 0x2aec0(%rip), %xmm0    # 0xa05f0
movaps %xmm0, 0x30(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0x20, %rax
jne 0x75730
movq 0x10(%rsp), %rsi
testb $0x1f, %r13b
je 0x757d5
movl %r13d, %eax
andl $0x1f, %eax
decq %rax
movl %r13d, %edx
andl $-0x20, %edx
movq 0x10(%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
ja 0x75762
andl $-0x20, %r13d
movsd 0x25597(%rip), %xmm0    # 0x9ad78
ucomisd %xmm1, %xmm0
movq %r15, 0x20(%rsp)
jbe 0x75adc
testl %r13d, %r13d
jle 0x75c63
leal -0x8(%r13), %eax
leal -0x20(%r13), %ecx
movslq %ecx, %rdx
addq %r12, %rdx
movq %r13, 0x18(%rsp)
addl $-0x20, %r13d
movl $0x1f, %r9d
movl $0x27, %r10d
movl %eax, %r11d
movzbl (%rdx,%r9), %ecx
shll $0x4, %ecx
movzbl -0x1(%rdx,%r9), %r14d
movzbl -0x2(%rdx,%r9), %ebx
movzbl -0x3(%rdx,%r9), %ebp
movl 0x30(%rsp,%r9,4), %r15d
cmpl 0xc90(%rsp,%rcx), %r15d
jbe 0x75855
movw %r15w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r15d
leaq (%rsp,%rcx), %rdi
addq $0xc90, %rdi            # imm = 0xC90
movl %r15d, %ecx
movl 0x4(%rdi), %r8d
imulq %rcx, %r8
movb 0xe(%rdi), %cl
shrq %cl, %r8
shll $0x4, %r14d
addl 0x8(%rdi), %r15d
addq %rsp, %r14
addq $0xc90, %r14            # imm = 0xC90
movzwl 0xc(%rdi), %ecx
imull %r8d, %ecx
addl %r15d, %ecx
movl %ecx, 0x30(%rsp,%r9,4)
movl 0x2c(%rsp,%r9,4), %r15d
cmpl (%r14), %r15d
jbe 0x758aa
movw %r15w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r15d
movl %r15d, %ecx
movl 0x4(%r14), %edi
imulq %rcx, %rdi
movb 0xe(%r14), %cl
shrq %cl, %rdi
shll $0x4, %ebx
addl 0x8(%r14), %r15d
addq %rsp, %rbx
addq $0xc90, %rbx            # imm = 0xC90
movzwl 0xc(%r14), %ecx
imull %edi, %ecx
addl %r15d, %ecx
movl %ecx, 0x2c(%rsp,%r9,4)
movl 0x28(%rsp,%r9,4), %r14d
cmpl (%rbx), %r14d
jbe 0x758f4
movw %r14w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r14d
movl %r14d, %ecx
movl 0x4(%rbx), %edi
imulq %rcx, %rdi
movb 0xe(%rbx), %cl
shrq %cl, %rdi
shll $0x4, %ebp
addl 0x8(%rbx), %r14d
leaq (%rsp,%rbp), %r15
addq $0xc90, %r15            # imm = 0xC90
movzwl 0xc(%rbx), %ecx
imull %edi, %ecx
addl %r14d, %ecx
movl %ecx, 0x28(%rsp,%r9,4)
movl 0x24(%rsp,%r9,4), %ebx
cmpl (%r15), %ebx
jbe 0x7593a
movw %bx, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %ebx
movl %ebx, %ecx
movl 0x4(%r15), %edi
imulq %rcx, %rdi
movb 0xe(%r15), %cl
shrq %cl, %rdi
addl 0x8(%r15), %ebx
movzwl 0xc(%r15), %ecx
imull %edi, %ecx
addl %ebx, %ecx
movl %ecx, 0x24(%rsp,%r9,4)
movzbl -0x4(%rdx,%r9), %ecx
shll $0x4, %ecx
movzbl -0x5(%rdx,%r9), %r14d
movzbl -0x6(%rdx,%r9), %ebx
movslq %r11d, %rdi
movzbl (%r12,%rdi), %ebp
movl 0x20(%rsp,%r9,4), %r15d
cmpl 0xc90(%rsp,%rcx), %r15d
jbe 0x75997
movw %r15w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r15d
leaq (%rsp,%rcx), %rdi
addq $0xc90, %rdi            # imm = 0xC90
movl %r15d, %ecx
movl 0x4(%rdi), %r8d
imulq %rcx, %r8
movb 0xe(%rdi), %cl
shrq %cl, %r8
shll $0x4, %r14d
addl 0x8(%rdi), %r15d
addq %rsp, %r14
addq $0xc90, %r14            # imm = 0xC90
movzwl 0xc(%rdi), %ecx
imull %r8d, %ecx
addl %r15d, %ecx
movl %ecx, 0x20(%rsp,%r9,4)
movl 0x1c(%rsp,%r9,4), %r15d
cmpl (%r14), %r15d
jbe 0x759ec
movw %r15w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r15d
movl %r15d, %ecx
movl 0x4(%r14), %edi
imulq %rcx, %rdi
movb 0xe(%r14), %cl
shrq %cl, %rdi
shll $0x4, %ebx
addl 0x8(%r14), %r15d
addq %rsp, %rbx
addq $0xc90, %rbx            # imm = 0xC90
movzwl 0xc(%r14), %ecx
imull %edi, %ecx
addl %r15d, %ecx
movl %ecx, 0x1c(%rsp,%r9,4)
movl 0x18(%rsp,%r9,4), %r14d
cmpl (%rbx), %r14d
jbe 0x75a36
movw %r14w, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %r14d
movl %r14d, %ecx
movl 0x4(%rbx), %edi
imulq %rcx, %rdi
movb 0xe(%rbx), %cl
shrq %cl, %rdi
shll $0x4, %ebp
addl 0x8(%rbx), %r14d
leaq (%rsp,%rbp), %r15
addq $0xc90, %r15            # imm = 0xC90
movzwl 0xc(%rbx), %ecx
imull %edi, %ecx
addl %r14d, %ecx
movl %ecx, 0x18(%rsp,%r9,4)
movl 0x14(%rsp,%r9,4), %ebx
cmpl (%r15), %ebx
jbe 0x75a7c
movw %bx, -0x2(%rsi)
addq $-0x2, %rsi
shrl $0x10, %ebx
movl %ebx, %ecx
movl 0x4(%r15), %edi
imulq %rcx, %rdi
movb 0xe(%r15), %cl
shrq %cl, %rdi
addl 0x8(%r15), %ebx
movzwl 0xc(%r15), %ecx
imull %edi, %ecx
addl %ebx, %ecx
movl %ecx, 0x14(%rsp,%r9,4)
addq $-0x8, %r9
addq $-0x8, %r10
addl $-0x8, %r11d
cmpq $0x7, %r10
ja 0x7581f
addl $-0x20, %eax
addq $-0x20, %rdx
cmpl $0x21, 0x18(%rsp)
jge 0x75807
jmp 0x75c63
movq %rbp, %rdi
callq 0x45c0
xorl %ebp, %ebp
jmp 0x75ca5
testl %r13d, %r13d
jle 0x75c63
movl %r13d, %edx
leal -0x20(%rdx), %r13d
movl $0x1f, %r9d
leaq 0xac(%rsp), %r8
leal (%r9,%r13), %ecx
movslq %ecx, %rcx
movzbl (%r12,%rcx), %edi
shll $0x4, %edi
addq %rsp, %rdi
addq $0xc90, %rdi            # imm = 0xC90
movq %rdi, 0x870(%rsp)
movzbl -0x1(%r12,%rcx), %r10d
shll $0x4, %r10d
leaq (%rsp,%r10), %rbx
addq $0xc90, %rbx            # imm = 0xC90
movl 0x2c(%rsp,%r9,4), %ebp
movl 0x30(%rsp,%r9,4), %r14d
movl %r14d, %r10d
shrl $0x10, %r10d
movl %ebp, %r11d
shrl $0x10, %r11d
xorl %r15d, %r15d
cmpl (%rbx), %ebp
seta %r15b
cmovbel %ebp, %r11d
xorl %eax, %eax
cmpl (%rdi), %r14d
seta %al
cmovbel %r14d, %r10d
movq %rbx, 0x878(%rsp)
movw %r14w, -0x2(%rsi)
addl %eax, %eax
subq %rax, %rsi
movw %bp, -0x2(%rsi)
addl %r15d, %r15d
subq %r15, %rsi
movl %r10d, 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 %ebx, %ebx
movl (%r11), %eax
movq 0x870(%rsp,%rbx,8), %rdi
movl 0x4(%rdi), %r14d
imulq %rax, %r14
movb 0xe(%rdi), %cl
shrq %cl, %r14
movzwl 0xc(%rdi), %ecx
imull %r14d, %ecx
movl 0x8(%rdi), %edi
addl %eax, %edi
addl %ecx, %edi
movl %edi, (%r11)
incq %rbx
addq $-0x4, %r11
cmpq $0x4, %rbx
jne 0x75c09
leaq (%rsi,%r10,2), %rsi
leaq -0x4(%r9), %rax
addq $-0x10, %r8
cmpq $0x3, %r9
movq %rax, %r9
ja 0x75afa
cmpl $0x21, %edx
jge 0x75ae5
xorl %eax, %eax
movl 0xac(%rsp,%rax), %ecx
movl %ecx, -0x4(%rsi,%rax)
addq $-0x4, %rax
cmpq $-0x80, %rax
jne 0x75c65
addq %rax, %rsi
movq 0x20(%rsp), %r15
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rax
subq %rsi, %rdx
movslq %eax, %rdi
leal (%rdi,%rdx), %eax
movl %eax, (%r15)
movq 0x8(%rsp), %rbp
addq %rbp, %rdi
callq 0x4830
movq %rbp, %rax
addq $0x2d18, %rsp           # imm = 0x2D18
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x261f5(%rip), %rdi     # 0x9beb6
leaq 0x26188(%rip), %rsi     # 0x9be50
leaq 0x261a1(%rip), %rcx     # 0x9be70
movl $0xcc, %edx
callq 0x42f0
leaq 0x261f2(%rip), %rdi     # 0x9bed2
leaq 0x26169(%rip), %rsi     # 0x9be50
leaq 0x26182(%rip), %rcx     # 0x9be70
movl $0xcd, %edx
callq 0x42f0