// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/htscodecs/htscodecs/rANS_static32x16pr.c
// Function: rans_uncompress_O1_32x16
unsigned char *rans_uncompress_O1_32x16(unsigned char *in,
                                        unsigned int in_size,
                                        unsigned char *out,
                                        unsigned int out_sz) {
    if (in_size < NX*4) // 4-states at least
        return NULL;

    if (out_sz >= INT_MAX)
        return NULL; // protect against some overflow cases

#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    if (out_sz > 100000)
        return NULL;
#endif

    /* Load in the static tables */
    unsigned char *cp = in, *cp_end = in+in_size, *out_free = NULL;
    unsigned char *c_freq = NULL;
    int i;

    /*
     * Somewhat complex memory layout.
     * With shift==12 (TF_SHIFT_O1) we fill out use both sfb and fb.
     * With shift==10 (...O1_FAST)  we fill out and use s3 only.
     *
     * sfb+fb is larger, therefore we allocate this much memory.
     */
    uint8_t *sfb_ = htscodecs_tls_alloc(256*
                                        ((TOTFREQ_O1+MAGIC2)*sizeof(*sfb_)
                                         +256 * sizeof(fb_t)));
    if (!sfb_)
        return NULL;

    // sfb and fb are consecutive
    uint8_t *sfb[257];
    if ((*cp >> 4) == TF_SHIFT_O1) {
        for (i = 0; i <= 256; i++)
            sfb[i]=  sfb_ + i*(TOTFREQ_O1+MAGIC2);
    } else {
        for (i = 0; i <= 256; i++)
            sfb[i]=  sfb_ + i*(TOTFREQ_O1_FAST+MAGIC2);
    }
    fb_t (*fb)[256] = (fb_t (*)[256]) sfb[256];

    // NOTE: s3 overlaps sfb/fb
    uint32_t (*s3)[TOTFREQ_O1_FAST] = (uint32_t (*)[TOTFREQ_O1_FAST])sfb_;

    if (!out)
        out_free = out = malloc(out_sz);

    if (!out)
        goto err;

    //fprintf(stderr, "out_sz=%d\n", out_sz);

    // compressed header? If so uncompress it
    unsigned char *tab_end = NULL;
    unsigned char *c_freq_end = cp_end;
    unsigned int shift = *cp >> 4;
    if (*cp++ & 1) {
        uint32_t u_freq_sz, c_freq_sz;
        cp += var_get_u32(cp, cp_end, &u_freq_sz);
        cp += var_get_u32(cp, cp_end, &c_freq_sz);
        if (c_freq_sz > cp_end - cp)
            goto err;
        tab_end = cp + c_freq_sz;
        if (!(c_freq = rans_uncompress_O0_4x16(cp, c_freq_sz, NULL,u_freq_sz)))
            goto err;
        cp = c_freq;
        c_freq_end = c_freq + u_freq_sz;
    }

    // Decode order-0 symbol list; avoids needing in order-1 tables
    cp += decode_freq1(cp, c_freq_end, shift, NULL, s3, sfb, fb);

    if (tab_end)
        cp = tab_end;
    free(c_freq);
    c_freq = NULL;

    if (cp_end - cp < NX * 4)
        goto err;

    RansState R[NX];
    uint8_t *ptr = cp, *ptr_end = in + in_size - 2*NX;
    int z;
    for (z = 0; z < NX; z++) {
        RansDecInit(&R[z], &ptr);
        if (R[z] < RANS_BYTE_L)
            goto err;
    }

    int isz4 = out_sz/NX;
    int i4[NX], l[NX] = {0};
    for (z = 0; z < NX; z++)
        i4[z] = z*isz4;

    const int low_ent = in_size < 0.2 * out_sz;

    // Around 15% faster to specialise for 10/12 than to have one
    // loop with shift as a variable.
    if (shift == TF_SHIFT_O1) {
        // TF_SHIFT_O1 = 12
        const uint32_t mask = ((1u << TF_SHIFT_O1)-1);
        for (; likely(i4[0] < isz4);) {
            for (z = 0; z < NX; z+=4) {
                uint16_t m[4], c[4];

                c[0] = sfb[l[z+0]][m[0] = R[z+0] & mask];
                c[1] = sfb[l[z+1]][m[1] = R[z+1] & mask];
                c[2] = sfb[l[z+2]][m[2] = R[z+2] & mask];
                c[3] = sfb[l[z+3]][m[3] = R[z+3] & mask];

                R[z+0] = fb[l[z+0]][c[0]].f * (R[z+0]>>TF_SHIFT_O1);
                R[z+0] += m[0] - fb[l[z+0]][c[0]].b;

                R[z+1] = fb[l[z+1]][c[1]].f * (R[z+1]>>TF_SHIFT_O1);
                R[z+1] += m[1] - fb[l[z+1]][c[1]].b;

                R[z+2] = fb[l[z+2]][c[2]].f * (R[z+2]>>TF_SHIFT_O1);
                R[z+2] += m[2] - fb[l[z+2]][c[2]].b;

                R[z+3] = fb[l[z+3]][c[3]].f * (R[z+3]>>TF_SHIFT_O1);
                R[z+3] += m[3] - fb[l[z+3]][c[3]].b;

                out[i4[z+0]++] = l[z+0] = c[0];
                out[i4[z+1]++] = l[z+1] = c[1];
                out[i4[z+2]++] = l[z+2] = c[2];
                out[i4[z+3]++] = l[z+3] = c[3];

                if (!low_ent && likely(ptr < ptr_end)) {
                    RansDecRenorm(&R[z+0], &ptr);
                    RansDecRenorm(&R[z+1], &ptr);
                    RansDecRenorm(&R[z+2], &ptr);
                    RansDecRenorm(&R[z+3], &ptr);
                } else {
                    RansDecRenormSafe(&R[z+0], &ptr, ptr_end+2*NX);
                    RansDecRenormSafe(&R[z+1], &ptr, ptr_end+2*NX);
                    RansDecRenormSafe(&R[z+2], &ptr, ptr_end+2*NX);
                    RansDecRenormSafe(&R[z+3], &ptr, ptr_end+2*NX);
                }
            }
        }

        // Remainder
        for (; i4[NX-1] < out_sz; i4[NX-1]++) {
            uint32_t m = R[NX-1] & ((1u<<TF_SHIFT_O1)-1);
            unsigned char c = sfb[l[NX-1]][m];
            out[i4[NX-1]] = c;
            R[NX-1] = fb[l[NX-1]][c].f * (R[NX-1]>>TF_SHIFT_O1) +
                m - fb[l[NX-1]][c].b;
            RansDecRenormSafe(&R[NX-1], &ptr, ptr_end + 2*NX);
            l[NX-1] = c;
        }
    } else {
        // TF_SHIFT_O1 = 10
        const uint32_t mask = ((1u << TF_SHIFT_O1_FAST)-1);
        for (; likely(i4[0] < isz4);) {
            for (z = 0; z < NX; z+=4) {
                // Merged sfb and fb into single s3 lookup.
                // The m[4] array completely vanishes in this method.
                uint32_t S[4] = {
                    s3[l[z+0]][R[z+0] & mask],
                    s3[l[z+1]][R[z+1] & mask],
                    s3[l[z+2]][R[z+2] & mask],
                    s3[l[z+3]][R[z+3] & mask],
                };

                l[z+0] = out[i4[z+0]++] = S[0];
                l[z+1] = out[i4[z+1]++] = S[1];
                l[z+2] = out[i4[z+2]++] = S[2];
                l[z+3] = out[i4[z+3]++] = S[3];

                uint32_t F[4] = {
                    S[0]>>(TF_SHIFT_O1_FAST+8),
                    S[1]>>(TF_SHIFT_O1_FAST+8),
                    S[2]>>(TF_SHIFT_O1_FAST+8),
                    S[3]>>(TF_SHIFT_O1_FAST+8),
                };
                uint32_t B[4] = {
                    (S[0]>>8) & mask,
                    (S[1]>>8) & mask,
                    (S[2]>>8) & mask,
                    (S[3]>>8) & mask,
                };

                R[z+0] = F[0] * (R[z+0]>>TF_SHIFT_O1_FAST) + B[0];
                R[z+1] = F[1] * (R[z+1]>>TF_SHIFT_O1_FAST) + B[1];
                R[z+2] = F[2] * (R[z+2]>>TF_SHIFT_O1_FAST) + B[2];
                R[z+3] = F[3] * (R[z+3]>>TF_SHIFT_O1_FAST) + B[3];

                if (!low_ent && (ptr < ptr_end)) {
                    // branchless & asm
                    RansDecRenorm(&R[z+0], &ptr);
                    RansDecRenorm(&R[z+1], &ptr);
                    RansDecRenorm(&R[z+2], &ptr);
                    RansDecRenorm(&R[z+3], &ptr);
                } else {
                    // branched, but better when predictable
                    RansDecRenormSafe(&R[z+0], &ptr, ptr_end+2*NX);
                    RansDecRenormSafe(&R[z+1], &ptr, ptr_end+2*NX);
                    RansDecRenormSafe(&R[z+2], &ptr, ptr_end+2*NX);
                    RansDecRenormSafe(&R[z+3], &ptr, ptr_end+2*NX);
                }
            }
        }

        // Remainder
        for (; i4[NX-1] < out_sz; i4[NX-1]++) {
            uint32_t S = s3[l[NX-1]][R[NX-1] & ((1u<<TF_SHIFT_O1_FAST)-1)];
            out[i4[NX-1]] = l[NX-1] = S&0xff;
            R[NX-1] = (S>>(TF_SHIFT_O1_FAST+8)) * (R[NX-1]>>TF_SHIFT_O1_FAST)
                + ((S>>8) & ((1u<<TF_SHIFT_O1_FAST)-1));
            RansDecRenormSafe(&R[NX-1], &ptr, ptr_end + 2*NX);
        }
    }
    //fprintf(stderr, "    1 Decoded %d bytes\n", (int)(ptr-in)); //c-size

    htscodecs_tls_free(sfb_);
    return out;

 err:
    htscodecs_tls_free(sfb_);
    free(out_free);
    free(c_freq);

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1208, %rsp           # imm = 0x1208
movq %rdx, 0x38(%rsp)
cmpl $0x80, %esi
setb %al
movl %ecx, 0x4(%rsp)
cmpl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
setae %cl
orb %al, %cl
jne 0x77aba
movl %esi, %ebp
movq %rdi, %r14
movl $0x14b300, %edi         # imm = 0x14B300
callq 0x7e144
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x77aba
movzbl (%r14), %eax
movl %eax, 0x10(%rsp)
andb $-0x10, %al
cmpb $-0x40, %al
jne 0x77485
xorl %eax, %eax
movq 0x20(%rsp), %rcx
movq %rcx, 0xa00(%rsp,%rax,8)
incq %rax
addq $0x10b3, %rcx           # imm = 0x10B3
cmpq $0x101, %rax            # imm = 0x101
jne 0x77469
jmp 0x774a6
xorl %eax, %eax
movq 0x20(%rsp), %rcx
movq %rcx, 0xa00(%rsp,%rax,8)
incq %rax
addq $0x4b3, %rcx            # imm = 0x4B3
cmpq $0x101, %rax            # imm = 0x101
jne 0x7748c
movq 0x1200(%rsp), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x774bf
xorl %ecx, %ecx
jmp 0x774d9
movl 0x4(%rsp), %edi
callq 0x4680
movq %rax, %rcx
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0x7759a
movq %rcx, 0x30(%rsp)
movl %ebp, %r8d
leaq (%r14,%r8), %rbx
leaq 0x1(%r14), %r15
xorl %ebp, %ebp
testb $0x1, 0x10(%rsp)
jne 0x77508
movq %r8, 0x60(%rsp)
movq %rbx, %r14
movq $0x0, 0x8(%rsp)
jmp 0x775fc
xorl %ecx, %ecx
movzbl (%r15,%rcx), %edx
movl %ebp, %eax
shll $0x7, %eax
movl %edx, %ebp
andl $0x7f, %ebp
orl %eax, %ebp
leaq 0x1(%rcx), %rax
testb %dl, %dl
jns 0x7752b
cmpl $0x5, %ecx
movq %rax, %rcx
jne 0x7750a
movq %rax, %rcx
notq %rcx
addq %r8, %rcx
cmpq $0x6, %rcx
jl 0x77579
xorl %esi, %esi
xorl %ecx, %ecx
leaq (%r15,%rsi), %rdx
movzbl (%rax,%rdx), %edi
movl %ecx, %edx
shll $0x7, %edx
movl %edi, %ecx
andl $0x7f, %ecx
orl %edx, %ecx
leaq 0x1(%rsi), %rdx
testb %dil, %dil
jns 0x77563
cmpl $0x5, %esi
movq %rdx, %rsi
jne 0x7753e
addq %r15, %rdx
addq %rax, %rdx
movq %r15, %rsi
notl %r14d
addl %r14d, %edx
subl %eax, %edx
movslq %edx, %r14
jmp 0x775a9
leaq (%r15,%rax), %rdx
cmpq %rbx, %rdx
jae 0x775a1
movsbl (%r15,%rax), %ecx
testl %ecx, %ecx
js 0x783c4
movq %r15, %rsi
movl $0x1, %r14d
jmp 0x775a9
xorl %ebx, %ebx
jmp 0x77aa8
movq %r15, %rsi
xorl %ecx, %ecx
xorl %r14d, %r14d
movl %ecx, %r15d
movq %r14, %rcx
notq %rcx
addq %r8, %rcx
subq %rax, %rcx
cmpq %r15, %rcx
jl 0x77aa3
movq %r8, 0x60(%rsp)
movq %rsi, %r12
addq %rax, %r12
leaq (%r12,%r14), %rdi
movl %r15d, %esi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x629f9
testq %rax, %rax
je 0x77aa3
addq %r15, %r14
addq %r14, %r12
movl %ebp, %r14d
addq %rax, %r14
movq %r12, %rbp
movq %rax, 0x8(%rsp)
movq %rax, %r15
shrl $0x4, 0x10(%rsp)
leaq 0x600(%rsp), %rdi
xorl %r12d, %r12d
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4260
cmpq %r14, %r15
je 0x77a81
movq %r14, %r9
leaq 0x1(%r15), %rax
movzbl (%r15), %ecx
leaq 0x3(%r15), %rdx
cmpq %r14, %rdx
jae 0x77686
xorl %r12d, %r12d
movl %ecx, %edx
movl $0x1, 0x600(%rsp,%rdx,4)
testl %r12d, %r12d
je 0x7765d
cmpl $0xfe, %ecx
jg 0x77a7e
decl %r12d
incl %ecx
jmp 0x77679
incl %ecx
movzbl (%rax), %edx
cmpl %edx, %ecx
jne 0x77671
movzbl 0x1(%rax), %r12d
addq $0x2, %rax
jmp 0x77679
incq %rax
xorl %r12d, %r12d
movl %edx, %ecx
testl %ecx, %ecx
je 0x77686
leaq 0x2(%rax), %rdx
cmpq %r9, %rdx
jb 0x77638
testl %ecx, %ecx
je 0x776ea
movl %ecx, %edx
movl $0x1, 0x600(%rsp,%rdx,4)
cmpq %r9, %rax
jae 0x77a7e
testl %r12d, %r12d
je 0x776b8
cmpl $0xfe, %ecx
jg 0x77a7e
decl %r12d
incl %ecx
jmp 0x776e1
incl %ecx
movzbl (%rax), %edx
leaq 0x1(%rax), %rsi
xorl %r12d, %r12d
cmpl %edx, %ecx
jne 0x776dc
cmpq %r9, %rsi
jae 0x77a7e
movzbl 0x1(%rax), %r12d
addq $0x2, %rax
jmp 0x776e1
movq %rsi, %rax
movl %edx, %ecx
testl %ecx, %ecx
je 0x776ea
cmpq %r9, %rax
jb 0x7768a
subq %r15, %rax
testl %eax, %eax
je 0x77a7e
cltq
addq %r15, %rax
movq %rax, 0x40(%rsp)
cmpq %r9, %rax
jae 0x77a7e
cmpq $0x0, 0x48(%rsp)
je 0x7771b
movq 0x48(%rsp), %rax
movw $0x0, 0x2(%rax)
movl $0x1, %r10d
movl 0x10(%rsp), %ecx
shll %cl, %r10d
movq 0x20(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rax, %r14
movq 0x8(%rsp), %rdi
movq %r9, 0xf0(%rsp)
movl %r10d, 0x54(%rsp)
cmpl $0x0, 0x600(%rsp,%rcx,4)
je 0x77a5a
movq %rcx, 0x68(%rsp)
movl $0x400, %edx            # imm = 0x400
leaq 0x200(%rsp), %rdi
xorl %esi, %esi
callq 0x4260
movdqa 0x1f787(%rip), %xmm7    # 0x96f00
pcmpeqd %xmm6, %xmm6
movdqa 0x1d10b(%rip), %xmm5    # 0x94890
movl 0x54(%rsp), %r10d
movq 0xf0(%rsp), %r9
cmpq %r9, 0x40(%rsp)
jae 0x77a7e
xorl %ecx, %ecx
xorl %eax, %eax
xorl %esi, %esi
movq 0x40(%rsp), %r11
cmpl $0x0, 0x600(%rsp,%rcx,4)
je 0x77819
testl %esi, %esi
je 0x777bc
decl %esi
xorl %edx, %edx
jmp 0x77810
movq %r9, %rdx
subq %r11, %rdx
cmpq $0x6, %rdx
jl 0x777fa
xorl %edi, %edi
xorl %edx, %edx
movzbl (%r11,%rdi), %r8d
movl %edx, %esi
shll $0x7, %esi
movl %r8d, %edx
andl $0x7f, %edx
orl %esi, %edx
leaq 0x1(%rdi), %rsi
testb %r8b, %r8b
jns 0x777ef
cmpl $0x5, %edi
movq %rsi, %rdi
jne 0x777cc
addq %r11, %rsi
subl %r11d, %esi
movslq %esi, %rsi
jmp 0x77807
movsbl (%r11), %edx
testl %edx, %edx
js 0x77845
movl $0x1, %esi
addq %rsi, %r11
xorl %esi, %esi
testl %edx, %edx
je 0x77830
movl %edx, 0x200(%rsp,%rcx,4)
addl %edx, %eax
cmpq $0xfe, %rcx
ja 0x7786b
incq %rcx
cmpq %r9, %r11
jb 0x777a8
jmp 0x7786b
cmpq %r9, %r11
jae 0x77a7e
movzbl (%r11), %esi
incq %r11
jmp 0x777b8
xorl %edx, %edx
movq %r11, %rsi
movzbl (%rsi), %edi
incq %rsi
movl %edx, %r8d
shll $0x7, %r8d
movl %edi, %edx
andl $0x7f, %edx
orl %r8d, %edx
testb %dil, %dil
jns 0x777f2
cmpq %r9, %rsi
jb 0x7784a
jmp 0x777f2
subq 0x40(%rsp), %r11
testl %r11d, %r11d
je 0x77a7e
testl %eax, %eax
je 0x77a48
cmpl %r10d, %eax
je 0x778c7
xorl %ecx, %ecx
cmpl %r10d, %eax
jae 0x77898
xorl %ecx, %ecx
addl %eax, %eax
incl %ecx
cmpl %r10d, %eax
jb 0x7788f
movd %ecx, %xmm1
xorps %xmm0, %xmm0
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
xorl %eax, %eax
movdqa 0x200(%rsp,%rax,4), %xmm1
pslld %xmm0, %xmm1
movdqa %xmm1, 0x200(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x778a5
xorl %esi, %esi
xorl %r13d, %r13d
movq %r14, 0xf8(%rsp)
movl 0x200(%rsp,%rsi,4), %edi
testq %rdi, %rdi
je 0x77a33
movl %r10d, %eax
subl %r13d, %eax
cmpl %eax, %edi
ja 0x77a7e
cmpl $0xa, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
je 0x7797d
cmpl $0xc, 0x10(%rsp)
jne 0x77a28
movslq %r13d, %rdi
movq 0x68(%rsp), %r14
addq 0xa00(%rsp,%r14,8), %rdi
movq 0x18(%rsp), %r12
movq %r12, %rdx
movl %r13d, 0x58(%rsp)
movq %rsi, 0x28(%rsp)
movq %r11, %r13
callq 0x4260
movq %r13, %r11
movq 0x28(%rsp), %rsi
movl 0x58(%rsp), %r13d
movdqa 0x1f5b8(%rip), %xmm7    # 0x96f00
pcmpeqd %xmm6, %xmm6
movdqa 0x1cf3c(%rip), %xmm5    # 0x94890
movl 0x54(%rsp), %r10d
movq %r14, %rax
movq 0xf8(%rsp), %r14
shlq $0xa, %rax
addq 0x48(%rsp), %rax
movw %r12w, (%rax,%rsi,4)
movw %r13w, 0x2(%rax,%rsi,4)
jmp 0x77a28
movl %edi, %ecx
shll $0x12, %ecx
movslq %r13d, %rdx
movl %esi, %eax
orl %ecx, %eax
leaq 0x1(%rdi), %rcx
andq $-0x2, %rcx
decq %rdi
movq %rdi, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (%r14,%rdx,4), %rdx
movl $0x100, %r12d           # imm = 0x100
pxor %xmm5, %xmm0
xorl %edi, %edi
movdqa 0x1ceca(%rip), %xmm1    # 0x94880
movdqa %xmm1, %xmm2
pxor %xmm5, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm0, %xmm3
pcmpeqd %xmm0, %xmm2
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm4, %xmm2
movd %xmm2, %r8d
notl %r8d
testb $0x1, %r8b
je 0x779f9
leal -0x100(%r12), %r8d
orl %eax, %r8d
movl %r8d, (%rdx,%rdi,4)
pxor %xmm6, %xmm2
pextrw $0x4, %xmm2, %r8d
testb $0x1, %r8b
je 0x77a14
movl %eax, %r8d
orl %r12d, %r8d
movl %r8d, 0x4(%rdx,%rdi,4)
addq $0x2, %rdi
paddq %xmm7, %xmm1
addl $0x200, %r12d           # imm = 0x200
cmpq %rdi, %rcx
jne 0x779b6
movq 0x18(%rsp), %rax
addl %r13d, %eax
movl %eax, %r13d
incq %rsi
cmpq $0x100, %rsi            # imm = 0x100
jne 0x778d4
cmpl %r10d, %r13d
jne 0x77a7e
movslq %r11d, %rax
addq %rax, 0x40(%rsp)
movq 0x8(%rsp), %rdi
movq 0x68(%rsp), %rcx
incq %rcx
addq $0x1000, %r14           # imm = 0x1000
cmpq $0x100, %rcx            # imm = 0x100
jne 0x7774a
movq 0x40(%rsp), %rax
subl %r15d, %eax
movslq %eax, %r12
jmp 0x77a86
xorl %r12d, %r12d
movq 0x8(%rsp), %rdi
addq %r12, %r15
testq %rbp, %rbp
cmovneq %rbp, %r15
callq 0x45c0
movq %rbx, %rax
subq %r15, %rax
cmpq $0x80, %rax
jge 0x77ad2
movq 0x30(%rsp), %rbx
movq 0x20(%rsp), %rdi
callq 0x7e26a
movq %rbx, %rdi
callq 0x45c0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x1208, %rsp           # imm = 0x1208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x40(%rbx), %rax
movq %rax, 0x58(%rsp)
xorl %eax, %eax
movq 0x60(%rsp), %rdx
movl (%r15,%rax), %ecx
movl %ecx, 0x70(%rsp,%rax)
cmpl $0x8000, %ecx           # imm = 0x8000
jb 0x77aa3
addq $0x4, %rax
cmpq $0x80, %rax
jne 0x77ae2
movl 0x4(%rsp), %ecx
movl %ecx, %esi
shrl $0x5, %esi
movl %esi, 0x28(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x170(%rsp)
movaps %xmm0, 0x160(%rsp)
movaps %xmm0, 0x150(%rsp)
movaps %xmm0, 0x140(%rsp)
movaps %xmm0, 0x130(%rsp)
movaps %xmm0, 0x120(%rsp)
movaps %xmm0, 0x110(%rsp)
movaps %xmm0, 0x100(%rsp)
movd %ecx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
psrld $0x5, %xmm0
addq %rax, %r15
movdqa 0x230e9(%rip), %xmm1    # 0x9ac50
xorl %eax, %eax
pshufd $0xf5, %xmm0, %xmm2     # xmm2 = xmm0[1,1,3,3]
movdqa 0x230ea(%rip), %xmm3    # 0x9ac60
movdqa %xmm0, %xmm4
pmuludq %xmm1, %xmm4
pshufd $0xe8, %xmm4, %xmm4     # xmm4 = xmm4[0,2,2,3]
pshufd $0xf5, %xmm1, %xmm5     # xmm5 = xmm1[1,1,3,3]
pmuludq %xmm2, %xmm5
pshufd $0xe8, %xmm5, %xmm5     # xmm5 = xmm5[0,2,2,3]
punpckldq %xmm5, %xmm4    # xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1]
movdqa %xmm4, 0x180(%rsp,%rax,4)
addq $0x4, %rax
paddd %xmm3, %xmm1
cmpq $0x20, %rax
jne 0x77b76
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x4(%rsp), %xmm1
mulsd 0x231a3(%rip), %xmm1    # 0x9ad68
movl 0x180(%rsp), %eax
cmpl $0xc, 0x10(%rsp)
movq %rbx, 0x10(%rsp)
movq %r15, 0x18(%rsp)
jne 0x77fea
cmpl 0x28(%rsp), %eax
jge 0x77f30
xorl %r8d, %r8d
pcmpeqd %xmm2, %xmm2
movslq 0x100(%rsp,%r8,4), %rsi
movq 0xa00(%rsp,%rsi,8), %rax
movl 0x70(%rsp,%r8,4), %ebp
movl 0x74(%rsp,%r8,4), %r11d
movq %rbp, %r13
movl $0xfff, %ecx            # imm = 0xFFF
andq %rcx, %r13
movl $0xfff, %edx            # imm = 0xFFF
movzbl (%rax,%r13), %r9d
movslq 0x104(%rsp,%r8,4), %rdi
movq 0xa00(%rsp,%rdi,8), %rax
movq %r11, %rcx
andq %rdx, %rcx
movzbl (%rax,%rcx), %eax
movq %rax, 0x60(%rsp)
movslq 0x108(%rsp,%r8,4), %rbx
movq 0xa00(%rsp,%rbx,8), %rax
movl 0x78(%rsp,%r8,4), %r10d
movq %r10, %r12
andq %rdx, %r12
movzbl (%rax,%r12), %eax
movq %rax, 0x8(%rsp)
movslq 0x10c(%rsp,%r8,4), %r14
movq 0xa00(%rsp,%r14,8), %rdx
shlq $0xa, %rsi
movq 0x48(%rsp), %rax
addq %rax, %rsi
movq %r9, %r15
movq %r9, 0x30(%rsp)
movzwl (%rsi,%r9,4), %r9d
shrl $0xc, %ebp
imull %r9d, %ebp
movl 0x7c(%rsp,%r8,4), %r9d
movzwl 0x2(%rsi,%r15,4), %esi
subl %esi, %r13d
movq %r9, %r15
movl $0xfff, %esi            # imm = 0xFFF
andq %rsi, %r15
movzbl (%rdx,%r15), %edx
addl %ebp, %r13d
movl %r13d, 0x70(%rsp,%r8,4)
shlq $0xa, %rdi
addq %rax, %rdi
movq 0x60(%rsp), %rbp
movzwl (%rdi,%rbp,4), %esi
shrl $0xc, %r11d
imull %esi, %r11d
movzwl 0x2(%rdi,%rbp,4), %edi
subl %edi, %ecx
addl %r11d, %ecx
movl %ecx, 0x74(%rsp,%r8,4)
shlq $0xa, %rbx
addq %rax, %rbx
movq 0x8(%rsp), %rsi
movzwl (%rbx,%rsi,4), %edi
shrl $0xc, %r10d
imull %edi, %r10d
movzwl 0x2(%rbx,%rsi,4), %edi
subl %edi, %r12d
addl %r10d, %r12d
movl %r12d, 0x78(%rsp,%r8,4)
shlq $0xa, %r14
addq %rax, %r14
movzwl (%r14,%rdx,4), %edi
shrl $0xc, %r9d
imull %edi, %r9d
movzwl 0x2(%r14,%rdx,4), %edi
subl %edi, %r15d
addl %r9d, %r15d
movl %r15d, 0x7c(%rsp,%r8,4)
movq 0x30(%rsp), %rax
movl %eax, 0x100(%rsp,%r8,4)
movl %ebp, 0x104(%rsp,%r8,4)
movl %esi, 0x108(%rsp,%r8,4)
movl %edx, 0x10c(%rsp,%r8,4)
movdqa 0x180(%rsp,%r8,4), %xmm3
movslq 0x180(%rsp,%r8,4), %rdi
movslq 0x184(%rsp,%r8,4), %r9
movslq 0x188(%rsp,%r8,4), %r10
movslq 0x18c(%rsp,%r8,4), %r11
movq 0x38(%rsp), %rbx
movb %al, (%rbx,%rdi)
movb %bpl, (%rbx,%r9)
movb %sil, (%rbx,%r10)
psubd %xmm2, %xmm3
movdqa %xmm3, 0x180(%rsp,%r8,4)
movb %dl, (%rbx,%r11)
movq %r8, %r10
orq $0x1, %r10
movq %r8, %rdi
orq $0x2, %rdi
ucomisd %xmm0, %xmm1
movq 0x18(%rsp), %r9
ja 0x77e62
cmpq 0x58(%rsp), %r9
jae 0x77e62
movzwl (%r9), %eax
movl %r13d, %edx
shll $0x10, %edx
orl %eax, %edx
xorl %eax, %eax
cmpl $0x8000, %r13d          # imm = 0x8000
cmovbl %edx, %r13d
leaq 0x2(%r9), %rax
cmovbq %rax, %r9
movl %r13d, 0x70(%rsp,%r8,4)
movzwl (%r9), %eax
movl %ecx, %edx
shll $0x10, %edx
orl %eax, %edx
xorl %eax, %eax
cmpl $0x8000, %ecx           # imm = 0x8000
cmovbl %edx, %ecx
leaq 0x2(%r9), %rax
cmovbq %rax, %r9
movl %ecx, 0x70(%rsp,%r10,4)
movzwl (%r9), %eax
movl %r12d, %edx
shll $0x10, %edx
orl %eax, %edx
xorl %eax, %eax
cmpl $0x8000, %r12d          # imm = 0x8000
cmovbl %edx, %r12d
leaq 0x2(%r9), %rax
cmovbq %rax, %r9
movl %r12d, 0x70(%rsp,%rdi,4)
movzwl (%r9), %eax
movl %r15d, %edx
shll $0x10, %edx
orl %eax, %edx
xorl %eax, %eax
cmpl $0x8000, %r15d          # imm = 0x8000
cmovbl %edx, %r15d
leaq 0x2(%r9), %rax
cmovbq %rax, %r9
movq 0x10(%rsp), %rbx
jmp 0x77ef7
cmpl $0x7fff, %r13d          # imm = 0x7FFF
movq 0x10(%rsp), %rbx
ja 0x77e8d
leaq 0x1(%r9), %rax
cmpq %rbx, %rax
jae 0x77e8d
movzwl (%r9), %eax
shll $0x10, %r13d
orl %eax, %r13d
addq $0x2, %r9
movl %r13d, 0x70(%rsp,%r8,4)
cmpl $0x7fff, %ecx           # imm = 0x7FFF
ja 0x77eb0
leaq 0x1(%r9), %rax
cmpq %rbx, %rax
jae 0x77eb0
movzwl (%r9), %eax
shll $0x10, %ecx
orl %eax, %ecx
addq $0x2, %r9
movl %ecx, 0x70(%rsp,%r10,4)
cmpl $0x7fff, %r12d          # imm = 0x7FFF
ja 0x77ed6
leaq 0x1(%r9), %rax
cmpq %rbx, %rax
jae 0x77ed6
movzwl (%r9), %eax
shll $0x10, %r12d
orl %eax, %r12d
addq $0x2, %r9
movl %r12d, 0x70(%rsp,%rdi,4)
cmpl $0x7fff, %r15d          # imm = 0x7FFF
ja 0x77f03
leaq 0x1(%r9), %rax
cmpq %rbx, %rax
jae 0x77f03
movzwl (%r9), %eax
shll $0x10, %r15d
orl %eax, %r15d
addq $0x2, %r9
movq %r8, %rax
orq $0x3, %rax
movl %r15d, 0x70(%rsp,%rax,4)
movq %r9, 0x18(%rsp)
leaq 0x4(%r8), %rax
cmpq $0x1c, %r8
movq %rax, %r8
jb 0x77bf2
movl $0x0, %r8d
movl 0x28(%rsp), %eax
cmpl %eax, 0x180(%rsp)
jl 0x77bf2
movl 0x1fc(%rsp), %eax
cmpl 0x4(%rsp), %eax
movq 0x38(%rsp), %r14
movq 0x48(%rsp), %r10
jae 0x783b5
movl 0xec(%rsp), %ecx
movl 0x17c(%rsp), %esi
movl 0x4(%rsp), %edx
movl %ecx, %edi
andl $0xfff, %edi            # imm = 0xFFF
movslq %esi, %r8
movq 0xa00(%rsp,%r8,8), %rsi
movzbl (%rsi,%rdi), %esi
movb %sil, (%r14,%rax)
shlq $0xa, %r8
addq %r10, %r8
movzwl (%r8,%rsi,4), %r9d
shrl $0xc, %ecx
imull %r9d, %ecx
addl %edi, %ecx
movzwl 0x2(%r8,%rsi,4), %edi
subl %edi, %ecx
movl %ecx, 0xec(%rsp)
cmpl $0x7fff, %ecx           # imm = 0x7FFF
ja 0x77fcb
movq 0x18(%rsp), %r8
leaq 0x1(%r8), %rdi
cmpq %rbx, %rdi
jae 0x77fcb
movzwl (%r8), %edi
shll $0x10, %ecx
orl %edi, %ecx
addq $0x2, %r8
movq %r8, 0x18(%rsp)
movl %ecx, 0xec(%rsp)
movl %esi, 0x17c(%rsp)
incq %rax
movl %eax, 0x1fc(%rsp)
cmpq %rax, %rdx
jne 0x77f5d
jmp 0x783b5
cmpl 0x28(%rsp), %eax
jge 0x782f7
xorl %r9d, %r9d
pcmpeqd %xmm2, %xmm2
movl $0x3ff, %edi            # imm = 0x3FF
movslq 0x100(%rsp,%r9,4), %rax
movl 0x70(%rsp,%r9,4), %r12d
movl 0x74(%rsp,%r9,4), %ebp
movl %r12d, %ecx
andl %edi, %ecx
shlq $0xc, %rax
movq 0x20(%rsp), %r8
addq %r8, %rax
movl (%rax,%rcx,4), %edx
movslq 0x104(%rsp,%r9,4), %rax
movl %ebp, %ecx
andl %edi, %ecx
shlq $0xc, %rax
addq %r8, %rax
movl (%rax,%rcx,4), %esi
movslq 0x108(%rsp,%r9,4), %rax
movl 0x78(%rsp,%r9,4), %r11d
movl %r11d, %ecx
andl %edi, %ecx
shlq $0xc, %rax
addq %r8, %rax
movl (%rax,%rcx,4), %r15d
movslq 0x10c(%rsp,%r9,4), %rax
movl 0x7c(%rsp,%r9,4), %r10d
movl %r10d, %ecx
andl %edi, %ecx
shlq $0xc, %rax
addq %r8, %rax
movl (%rax,%rcx,4), %eax
movl %edx, %ecx
movl $0xff, %r8d
andl %r8d, %ecx
movl %esi, %ebx
andl %r8d, %ebx
movl %r15d, %r14d
andl %r8d, %r14d
movl %ecx, 0x100(%rsp,%r9,4)
movl %ebx, 0x104(%rsp,%r9,4)
movl %r14d, 0x108(%rsp,%r9,4)
movdqa 0x180(%rsp,%r9,4), %xmm3
movslq 0x180(%rsp,%r9,4), %rbx
movslq 0x184(%rsp,%r9,4), %r14
movslq 0x188(%rsp,%r9,4), %r13
movslq 0x18c(%rsp,%r9,4), %rcx
movq 0x38(%rsp), %r8
movb %dl, (%r8,%rbx)
movl %edx, %ebx
shrl $0x12, %ebx
shrl $0xa, %r12d
imull %ebx, %r12d
shrl $0x8, %edx
andl %edi, %edx
addl %edx, %r12d
movb %sil, (%r8,%r14)
movl %esi, %edx
shrl $0x12, %edx
shrl $0xa, %ebp
imull %edx, %ebp
shrl $0x8, %esi
andl %edi, %esi
addl %esi, %ebp
movb %r15b, (%r8,%r13)
movl %r15d, %edx
shrl $0x12, %edx
shrl $0xa, %r11d
imull %edx, %r11d
shrl $0x8, %r15d
andl %edi, %r15d
addl %r15d, %r11d
movl %eax, %edx
shrl $0x12, %edx
shrl $0xa, %r10d
imull %edx, %r10d
movl %eax, %edx
shrl $0x8, %edx
andl %edi, %edx
addl %edx, %r10d
psubd %xmm2, %xmm3
movdqa %xmm3, 0x180(%rsp,%r9,4)
movb %al, (%r8,%rcx)
movq %r9, %rcx
orq $0x1, %rcx
movl $0xff, %edx
andl %edx, %eax
movl %eax, 0x10c(%rsp,%r9,4)
movq %r9, %rsi
orq $0x2, %rsi
ucomisd %xmm0, %xmm1
movl %r12d, 0x70(%rsp,%r9,4)
movl %ebp, 0x74(%rsp,%r9,4)
movl %r11d, 0x78(%rsp,%r9,4)
movl %r10d, 0x7c(%rsp,%r9,4)
movq 0x18(%rsp), %r8
ja 0x7822a
cmpq 0x58(%rsp), %r8
jae 0x7822a
movzwl (%r8), %eax
movl %r12d, %edx
shll $0x10, %edx
orl %eax, %edx
xorl %eax, %eax
cmpl $0x8000, %r12d          # imm = 0x8000
cmovbl %edx, %r12d
leaq 0x2(%r8), %rax
cmovbq %rax, %r8
movl %r12d, 0x70(%rsp,%r9,4)
movzwl (%r8), %eax
movl %ebp, %edx
shll $0x10, %edx
orl %eax, %edx
xorl %eax, %eax
cmpl $0x8000, %ebp           # imm = 0x8000
cmovbl %edx, %ebp
leaq 0x2(%r8), %rax
cmovbq %rax, %r8
movl %ebp, 0x70(%rsp,%rcx,4)
movzwl (%r8), %eax
movl %r11d, %edx
shll $0x10, %edx
orl %eax, %edx
xorl %eax, %eax
cmpl $0x8000, %r11d          # imm = 0x8000
cmovbl %edx, %r11d
leaq 0x2(%r8), %rax
cmovbq %rax, %r8
movl %r11d, 0x70(%rsp,%rsi,4)
movzwl (%r8), %eax
movl %r10d, %edx
shll $0x10, %edx
orl %eax, %edx
xorl %eax, %eax
cmpl $0x8000, %r10d          # imm = 0x8000
cmovbl %edx, %r10d
leaq 0x2(%r8), %rax
cmovbq %rax, %r8
movq 0x10(%rsp), %rbx
jmp 0x782be
cmpl $0x7fff, %r12d          # imm = 0x7FFF
movq 0x10(%rsp), %rbx
ja 0x78255
leaq 0x1(%r8), %rax
cmpq %rbx, %rax
jae 0x78255
movzwl (%r8), %eax
shll $0x10, %r12d
orl %eax, %r12d
addq $0x2, %r8
movl %r12d, 0x70(%rsp,%r9,4)
cmpl $0x7fff, %ebp           # imm = 0x7FFF
ja 0x78277
leaq 0x1(%r8), %rax
cmpq %rbx, %rax
jae 0x78277
movzwl (%r8), %eax
shll $0x10, %ebp
orl %eax, %ebp
addq $0x2, %r8
movl %ebp, 0x70(%rsp,%rcx,4)
cmpl $0x7fff, %r11d          # imm = 0x7FFF
ja 0x7829d
leaq 0x1(%r8), %rax
cmpq %rbx, %rax
jae 0x7829d
movzwl (%r8), %eax
shll $0x10, %r11d
orl %eax, %r11d
addq $0x2, %r8
movl %r11d, 0x70(%rsp,%rsi,4)
cmpl $0x7fff, %r10d          # imm = 0x7FFF
ja 0x782ca
leaq 0x1(%r8), %rax
cmpq %rbx, %rax
jae 0x782ca
movzwl (%r8), %eax
shll $0x10, %r10d
orl %eax, %r10d
addq $0x2, %r8
movq %r9, %rax
orq $0x3, %rax
movl %r10d, 0x70(%rsp,%rax,4)
movq %r8, 0x18(%rsp)
leaq 0x4(%r9), %rax
cmpq $0x1c, %r9
movq %rax, %r9
jb 0x78000
movl $0x0, %r9d
movl 0x28(%rsp), %eax
cmpl %eax, 0x180(%rsp)
jl 0x78000
movl 0x1fc(%rsp), %eax
cmpl 0x4(%rsp), %eax
movq 0x38(%rsp), %r14
jae 0x783b5
movslq %eax, %rcx
movl 0x17c(%rsp), %edi
movl 0xec(%rsp), %esi
addq %r14, %rcx
movl $0x3ff, %edx            # imm = 0x3FF
movslq %edi, %rdi
movl %esi, %r8d
andl %edx, %r8d
shlq $0xc, %rdi
addq 0x20(%rsp), %rdi
movl (%rdi,%r8,4), %r8d
movzbl %r8b, %edi
movl %edi, 0x17c(%rsp)
movb %r8b, (%rcx)
movl %r8d, %r9d
shrl $0x12, %r9d
shrl $0xa, %esi
movl %esi, %r10d
imull %r9d, %r10d
shrl $0x8, %r8d
andl %edx, %r8d
movl %r8d, %esi
addl %r10d, %esi
movl %esi, 0xec(%rsp)
cmpl $0x7fff, %esi           # imm = 0x7FFF
ja 0x7839f
movq 0x18(%rsp), %r9
leaq 0x1(%r9), %r8
cmpq %rbx, %r8
jae 0x7839f
movzwl (%r9), %r8d
shll $0x10, %esi
orl %r8d, %esi
addq $0x2, %r9
movq %r9, 0x18(%rsp)
movl %esi, 0xec(%rsp)
incl %eax
movl %eax, 0x1fc(%rsp)
incq %rcx
cmpl 0x4(%rsp), %eax
jb 0x78326
movq 0x20(%rsp), %rdi
callq 0x7e26a
jmp 0x77abd
xorl %ecx, %ecx
movzbl (%rdx), %esi
incq %rdx
movl %ecx, %edi
shll $0x7, %edi
movl %esi, %ecx
andl $0x7f, %ecx
orl %edi, %ecx
testb %sil, %sil
jns 0x77569
cmpq %rbx, %rdx
jb 0x783c6
jmp 0x77569
nop