// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/rANS_static.c
// Function: rans_compress_O1
static
unsigned char *rans_compress_O1(unsigned char *in, unsigned int in_size,
                                unsigned int *out_size) {
    unsigned char *out_buf = NULL, *out_end, *cp;
    unsigned int tab_size, rle_i, rle_j;


    if (in_size < 4)
        return rans_compress_O0(in, in_size, out_size);

    int (*F)[256];
    RansEncSymbol (*syms)[256];

    uint8_t *mem = htscodecs_tls_alloc(256 * (sizeof(*syms) + sizeof(*F)));
    if (!mem)
        return NULL;
    syms = (RansEncSymbol (*)[256])mem;
    F = (int (*)[256])(mem + 256*sizeof(*syms));
    memset(F, 0, 256*sizeof(*F));

    if (!syms) goto cleanup;
    int T[256+MAGIC] = {0};
    int i, j;

    out_buf = malloc(1.05*in_size + 257*257*3 + 9);
    if (!out_buf) goto cleanup;

    out_end = out_buf + (uint32_t)(1.05*in_size) + 257*257*3 + 9;
    cp = out_buf+9;

    if (hist1_4(in, in_size, (uint32_t (*)[256])F, (uint32_t *)T) < 0) {
        free(out_buf);
        out_buf = NULL;
        goto cleanup;
    }

    F[0][in[1*(in_size>>2)]]++;
    F[0][in[2*(in_size>>2)]]++;
    F[0][in[3*(in_size>>2)]]++;
    T[0]+=3;

    
    // Normalise so T[i] == TOTFREQ
    for (rle_i = i = 0; i < 256; i++) {
        int t2, m, M;
        unsigned int x;

        if (T[i] == 0)
            continue;

        //uint64_t p = (TOTFREQ * TOTFREQ) / t;
        double p = ((double)TOTFREQ)/T[i];
    normalise_harder:
        for (t2 = m = M = j = 0; j < 256; j++) {
            if (!F[i][j])
                continue;

            if (m < F[i][j])
                m = F[i][j], M = j;

            //if ((F[i][j] = (F[i][j] * p) / TOTFREQ) == 0)
            if ((F[i][j] *= p) == 0)
                F[i][j] = 1;
            t2 += F[i][j];
        }

        t2++;
        if (t2 < TOTFREQ) {
            F[i][M] += TOTFREQ-t2;
        } else if (t2-TOTFREQ >= F[i][M]/2) {
            // Corner case to avoid excessive frequency reduction
            p = .98; goto normalise_harder;
        } else {
            F[i][M] -= t2-TOTFREQ;
        }

        // Store frequency table
        // i
        if (rle_i) {
            rle_i--;
        } else {
            *cp++ = i;
            // FIXME: could use order-0 statistics to observe which alphabet
            // symbols are present and base RLE on that ordering instead.
            if (i && T[i-1]) {
                for(rle_i=i+1; rle_i<256 && T[rle_i]; rle_i++)
                    ;
                rle_i -= i+1;
                *cp++ = rle_i;
            }
        }

        int *F_i_ = F[i];
        x = 0;
        rle_j = 0;
        for (j = 0; j < 256; j++) {
            if (F_i_[j]) {
                //fprintf(stderr, "F[%d][%d]=%d, x=%d\n", i, j, F_i_[j], x);

                // j
                if (rle_j) {
                    rle_j--;
                } else {
                    *cp++ = j;
                    if (!rle_j && j && F_i_[j-1]) {
                        for(rle_j=j+1; rle_j<256 && F_i_[rle_j]; rle_j++)
                            ;
                        rle_j -= j+1;
                        *cp++ = rle_j;
                    }
                }

                // F_i_[j]
                if (F_i_[j]<128) {
                    *cp++ = F_i_[j];
                } else {
                    *cp++ = 128 | (F_i_[j]>>8);
                    *cp++ = F_i_[j]&0xff;
                }

                RansEncSymbolInit(&syms[i][j], x, F_i_[j], TF_SHIFT);
                x += F_i_[j];
            }
        }
        *cp++ = 0;
    }
    *cp++ = 0;

    //write(2, out_buf+4, cp-(out_buf+4));
    tab_size = cp - out_buf;
    assert(tab_size < 257*257*3);
    
    RansState rans0, rans1, rans2, rans3;
    RansEncInit(&rans0);
    RansEncInit(&rans1);
    RansEncInit(&rans2);
    RansEncInit(&rans3);

    uint8_t* ptr = out_end;

    int isz4 = in_size>>2;
    int i0 = 1*isz4-2;
    int i1 = 2*isz4-2;
    int i2 = 3*isz4-2;
    int i3 = 4*isz4-2;

    unsigned char l0 = in[i0+1];
    unsigned char l1 = in[i1+1];
    unsigned char l2 = in[i2+1];
    unsigned char l3 = in[i3+1];

    // Deal with the remainder
    l3 = in[in_size-1];
    for (i3 = in_size-2; i3 > 4*isz4-2; i3--) {
        unsigned char c3 = in[i3];
        RansEncPutSymbol(&rans3, &ptr, &syms[c3][l3]);
        l3 = c3;
    }

    for (; likely(i0 >= 0); i0--, i1--, i2--, i3--) {
        unsigned char c3 = in[i3];
        unsigned char c2 = in[i2];
        unsigned char c1 = in[i1];
        unsigned char c0 = in[i0];

        RansEncSymbol *s3 = &syms[c3][l3];
        RansEncSymbol *s2 = &syms[c2][l2];
        RansEncSymbol *s1 = &syms[c1][l1];
        RansEncSymbol *s0 = &syms[c0][l0];

        RansEncPutSymbol4(&rans3, &rans2, &rans1, &rans0, &ptr,
                          s3, s2, s1, s0);

        l3 = c3;
        l2 = c2;
        l1 = c1;
        l0 = c0;
    }

    RansEncPutSymbol(&rans3, &ptr, &syms[0][l3]);
    RansEncPutSymbol(&rans2, &ptr, &syms[0][l2]);
    RansEncPutSymbol(&rans1, &ptr, &syms[0][l1]);
    RansEncPutSymbol(&rans0, &ptr, &syms[0][l0]);

    RansEncFlush(&rans3, &ptr);
    RansEncFlush(&rans2, &ptr);
    RansEncFlush(&rans1, &ptr);
    RansEncFlush(&rans0, &ptr);

    *out_size = (out_end - ptr) + tab_size;

    cp = out_buf;
    *cp++ = 1; // order

    *cp++ = ((*out_size-9)>> 0) & 0xff;
    *cp++ = ((*out_size-9)>> 8) & 0xff;
    *cp++ = ((*out_size-9)>>16) & 0xff;
    *cp++ = ((*out_size-9)>>24) & 0xff;

    *cp++ = (in_size>> 0) & 0xff;
    *cp++ = (in_size>> 8) & 0xff;
    *cp++ = (in_size>>16) & 0xff;
    *cp++ = (in_size>>24) & 0xff;

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

 cleanup:
    htscodecs_tls_free(syms);

    return out_buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x520, %rsp            # imm = 0x520
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpl $0x4, -0x14(%rbp)
jae 0xc3c7d
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0xc49b0
movq %rax, -0x8(%rbp)
jmp 0xc49a2
movl $0x140000, %edi         # imm = 0x140000
callq 0xce6a0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0xc3c9f
movq $0x0, -0x8(%rbp)
jmp 0xc49a2
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rax
addq $0x100000, %rax         # imm = 0x100000
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x40000, %edx          # imm = 0x40000
callq 0x4250
cmpq $0x0, -0x58(%rbp)
jne 0xc3cd1
jmp 0xc4991
leaq -0x480(%rbp), %rdi
xorl %esi, %esi
movl $0x420, %edx            # imm = 0x420
callq 0x4250
movl -0x14(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x3188c(%rip), %xmm1    # 0xf5580
mulsd %xmm1, %xmm0
movsd 0x324e8(%rip), %xmm1    # 0xf61e8
addsd %xmm1, %xmm0
movsd 0x32b74(%rip), %xmm1    # 0xf6880
addsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rdi
movq %rdi, %rcx
sarq $0x3f, %rcx
movsd 0x2bbb9(%rip), %xmm1    # 0xef8e0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rcx, %rax
orq %rax, %rdi
callq 0x4650
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xc3d4b
jmp 0xc4991
movq -0x28(%rbp), %rax
movl -0x14(%rbp), %ecx
cvtsi2sd %rcx, %xmm0
movsd 0x31821(%rip), %xmm1    # 0xf5580
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movl %ecx, %ecx
addq %rcx, %rax
addq $0x30603, %rax          # imm = 0x30603
addq $0x9, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
addq $0x9, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x50(%rbp), %rdx
leaq -0x480(%rbp), %rcx
callq 0xc66b0
cmpl $0x0, %eax
jge 0xc3db9
movq -0x28(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x28(%rbp)
jmp 0xc4991
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
shrl $0x2, %edx
shll $0x0, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
shrl $0x2, %edx
shll %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
shrl $0x2, %edx
imull $0x3, %edx, %edx
movl %edx, %edx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x480(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x480(%rbp)
movl $0x0, -0x484(%rbp)
movl $0x0, -0x40(%rbp)
cmpl $0x100, -0x484(%rbp)    # imm = 0x100
jge 0xc43ae
movslq -0x484(%rbp), %rax
cmpl $0x0, -0x480(%rbp,%rax,4)
jne 0xc3e5e
jmp 0xc439a
movslq -0x484(%rbp), %rax
cvtsi2sdl -0x480(%rbp,%rax,4), %xmm1
movsd 0x325aa(%rip), %xmm0    # 0xf6420
divsd %xmm1, %xmm0
movsd %xmm0, -0x4a0(%rbp)
movl $0x0, -0x488(%rbp)
movl $0x0, -0x494(%rbp)
movl $0x0, -0x490(%rbp)
movl $0x0, -0x48c(%rbp)
cmpl $0x100, -0x488(%rbp)    # imm = 0x100
jge 0xc3fc2
movq -0x50(%rbp), %rax
movslq -0x484(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x488(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0xc3ede
jmp 0xc3fae
movl -0x490(%rbp), %eax
movq -0x50(%rbp), %rcx
movslq -0x484(%rbp), %rdx
shlq $0xa, %rdx
addq %rdx, %rcx
movslq -0x488(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xc3f30
movq -0x50(%rbp), %rax
movslq -0x484(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x488(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x490(%rbp)
movl -0x488(%rbp), %eax
movl %eax, -0x494(%rbp)
movsd -0x4a0(%rbp), %xmm1
movq -0x50(%rbp), %rcx
movslq -0x484(%rbp), %rax
shlq $0xa, %rax
addq %rax, %rcx
movslq -0x488(%rbp), %rdx
cvtsi2sdl (%rcx,%rdx,4), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, (%rcx,%rdx,4)
cmpl $0x0, %eax
jne 0xc3f86
movq -0x50(%rbp), %rax
movslq -0x484(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x488(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x50(%rbp), %rax
movslq -0x484(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x488(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x48c(%rbp), %eax
movl %eax, -0x48c(%rbp)
movl -0x488(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x488(%rbp)
jmp 0xc3eaa
movl -0x48c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48c(%rbp)
cmpl $0x1000, -0x48c(%rbp)   # imm = 0x1000
jge 0xc400c
movl $0x1000, %edx           # imm = 0x1000
subl -0x48c(%rbp), %edx
movq -0x50(%rbp), %rax
movslq -0x484(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x494(%rbp), %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
jmp 0xc4091
movl -0x48c(%rbp), %eax
subl $0x1000, %eax           # imm = 0x1000
movl %eax, -0x504(%rbp)
movq -0x50(%rbp), %rax
movslq -0x484(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x494(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x504(%rbp), %eax
cmpl %ecx, %eax
jl 0xc4062
movsd 0x32203(%rip), %xmm0    # 0xf6258
movsd %xmm0, -0x4a0(%rbp)
jmp 0xc3e82
movl -0x48c(%rbp), %esi
subl $0x1000, %esi           # imm = 0x1000
movq -0x50(%rbp), %rax
movslq -0x484(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movslq -0x494(%rbp), %rcx
movl (%rax,%rcx,4), %edx
subl %esi, %edx
movl %edx, (%rax,%rcx,4)
jmp 0xc4091
cmpl $0x0, -0x40(%rbp)
je 0xc40a5
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xc4153
movl -0x484(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
cmpl $0x0, -0x484(%rbp)
je 0xc4151
movl -0x484(%rbp), %eax
subl $0x1, %eax
cltq
cmpl $0x0, -0x480(%rbp,%rax,4)
je 0xc4151
movl -0x484(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
xorl %eax, %eax
cmpl $0x100, -0x40(%rbp)     # imm = 0x100
movb %al, -0x505(%rbp)
jae 0xc4111
movl -0x40(%rbp), %eax
cmpl $0x0, -0x480(%rbp,%rax,4)
setne %al
movb %al, -0x505(%rbp)
movb -0x505(%rbp), %al
testb $0x1, %al
jne 0xc411d
jmp 0xc412a
jmp 0xc411f
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xc40ec
movl -0x484(%rbp), %ecx
addl $0x1, %ecx
movl -0x40(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0xc4153
movq -0x50(%rbp), %rax
movslq -0x484(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq %rax, -0x4a8(%rbp)
movl $0x0, -0x498(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x488(%rbp)
cmpl $0x100, -0x488(%rbp)    # imm = 0x100
jge 0xc4388
movq -0x4a8(%rbp), %rax
movslq -0x488(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xc4372
cmpl $0x0, -0x44(%rbp)
je 0xc41c3
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xc4282
movl -0x488(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
cmpl $0x0, -0x44(%rbp)
jne 0xc4280
cmpl $0x0, -0x488(%rbp)
je 0xc4280
movq -0x4a8(%rbp), %rax
movl -0x488(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xc4280
movl -0x488(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
xorl %eax, %eax
cmpl $0x100, -0x44(%rbp)     # imm = 0x100
movb %al, -0x506(%rbp)
jae 0xc4240
movq -0x4a8(%rbp), %rax
movl -0x44(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
setne %al
movb %al, -0x506(%rbp)
movb -0x506(%rbp), %al
testb $0x1, %al
jne 0xc424c
jmp 0xc4259
jmp 0xc424e
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xc4218
movl -0x488(%rbp), %ecx
addl $0x1, %ecx
movl -0x44(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0xc4282
movq -0x4a8(%rbp), %rax
movslq -0x488(%rbp), %rcx
cmpl $0x80, (%rax,%rcx,4)
jge 0xc42bf
movq -0x4a8(%rbp), %rax
movslq -0x488(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0xc4314
movq -0x4a8(%rbp), %rax
movslq -0x488(%rbp), %rcx
movl (%rax,%rcx,4), %eax
sarl $0x8, %eax
orl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x4a8(%rbp), %rax
movslq -0x488(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x58(%rbp), %rdi
movslq -0x484(%rbp), %rax
shlq $0xc, %rax
addq %rax, %rdi
movslq -0x488(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movl -0x498(%rbp), %esi
movq -0x4a8(%rbp), %rax
movslq -0x488(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movl $0xc, %ecx
callq 0xc6b70
movq -0x4a8(%rbp), %rax
movslq -0x488(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x498(%rbp), %eax
movl %eax, -0x498(%rbp)
jmp 0xc4374
movl -0x488(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x488(%rbp)
jmp 0xc4187
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x0, (%rax)
movl -0x484(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x484(%rbp)
jmp 0xc3e38
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x0, (%rax)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x3c(%rbp)
cmpl $0x30603, -0x3c(%rbp)   # imm = 0x30603
jae 0xc43d9
jmp 0xc43f8
leaq 0x324b8(%rip), %rdi     # 0xf6898
leaq 0x324c6(%rip), %rsi     # 0xf68ad
movl $0x204, %edx            # imm = 0x204
leaq 0x324dc(%rip), %rcx     # 0xf68cf
callq 0x42e0
leaq -0x4ac(%rbp), %rdi
callq 0xc6d10
leaq -0x4b0(%rbp), %rdi
callq 0xc6d10
leaq -0x4b4(%rbp), %rdi
callq 0xc6d10
leaq -0x4b8(%rbp), %rdi
callq 0xc6d10
movq -0x30(%rbp), %rax
movq %rax, -0x4c0(%rbp)
movl -0x14(%rbp), %eax
shrl $0x2, %eax
movl %eax, -0x4c4(%rbp)
movl -0x4c4(%rbp), %eax
shll $0x0, %eax
subl $0x2, %eax
movl %eax, -0x4c8(%rbp)
movl -0x4c4(%rbp), %eax
shll %eax
subl $0x2, %eax
movl %eax, -0x4cc(%rbp)
imull $0x3, -0x4c4(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x4d0(%rbp)
movl -0x4c4(%rbp), %eax
shll $0x2, %eax
subl $0x2, %eax
movl %eax, -0x4d4(%rbp)
movq -0x10(%rbp), %rax
movl -0x4c8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d5(%rbp)
movq -0x10(%rbp), %rax
movl -0x4cc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d6(%rbp)
movq -0x10(%rbp), %rax
movl -0x4d0(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d7(%rbp)
movq -0x10(%rbp), %rax
movl -0x4d4(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d8(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %al
movb %al, -0x4d8(%rbp)
movl -0x14(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x4d4(%rbp)
movl -0x4d4(%rbp), %eax
movl -0x4c4(%rbp), %ecx
shll $0x2, %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jle 0xc4583
movq -0x10(%rbp), %rax
movslq -0x4d4(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x4d9(%rbp)
movq -0x58(%rbp), %rdx
movzbl -0x4d9(%rbp), %eax
shlq $0xc, %rax
addq %rax, %rdx
movzbl -0x4d8(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0x4b8(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xc6d30
movb -0x4d9(%rbp), %al
movb %al, -0x4d8(%rbp)
movl -0x4d4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4d4(%rbp)
jmp 0xc4509
jmp 0xc4585
cmpl $0x0, -0x4c8(%rbp)
setge %al
andb $0x1, %al
movzbl %al, %eax
cltq
cmpq $0x0, %rax
je 0xc474f
movq -0x10(%rbp), %rax
movslq -0x4d4(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x4da(%rbp)
movq -0x10(%rbp), %rax
movslq -0x4d0(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x4db(%rbp)
movq -0x10(%rbp), %rax
movslq -0x4cc(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x4dc(%rbp)
movq -0x10(%rbp), %rax
movslq -0x4c8(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x4dd(%rbp)
movq -0x58(%rbp), %rax
movzbl -0x4da(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movzbl -0x4d8(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x4e8(%rbp)
movq -0x58(%rbp), %rax
movzbl -0x4db(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movzbl -0x4d7(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x4f0(%rbp)
movq -0x58(%rbp), %rax
movzbl -0x4dc(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movzbl -0x4d6(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x4f8(%rbp)
movq -0x58(%rbp), %rax
movzbl -0x4dd(%rbp), %ecx
shlq $0xc, %rcx
addq %rcx, %rax
movzbl -0x4d5(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x500(%rbp)
movq -0x4e8(%rbp), %r9
movq -0x4f0(%rbp), %r11
movq -0x4f8(%rbp), %r10
movq -0x500(%rbp), %rax
leaq -0x4b8(%rbp), %rdi
leaq -0x4b4(%rbp), %rsi
leaq -0x4b0(%rbp), %rdx
leaq -0x4ac(%rbp), %rcx
leaq -0x4c0(%rbp), %r8
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0xc6e60
movb -0x4da(%rbp), %al
movb %al, -0x4d8(%rbp)
movb -0x4db(%rbp), %al
movb %al, -0x4d7(%rbp)
movb -0x4dc(%rbp), %al
movb %al, -0x4d6(%rbp)
movb -0x4dd(%rbp), %al
movb %al, -0x4d5(%rbp)
movl -0x4c8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4c8(%rbp)
movl -0x4cc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4cc(%rbp)
movl -0x4d0(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4d0(%rbp)
movl -0x4d4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4d4(%rbp)
jmp 0xc4585
movq -0x58(%rbp), %rdx
movzbl -0x4d8(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0x4b8(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xc6d30
movq -0x58(%rbp), %rdx
movzbl -0x4d7(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0x4b4(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xc6d30
movq -0x58(%rbp), %rdx
movzbl -0x4d6(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0x4b0(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xc6d30
movq -0x58(%rbp), %rdx
movzbl -0x4d5(%rbp), %eax
shlq $0x4, %rax
addq %rax, %rdx
leaq -0x4ac(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xc6d30
leaq -0x4b8(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xc7250
leaq -0x4b4(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xc7250
leaq -0x4b0(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xc7250
leaq -0x4ac(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xc7250
movq -0x30(%rbp), %rax
movq -0x4c0(%rbp), %rcx
subq %rcx, %rax
movl -0x3c(%rbp), %ecx
addq %rcx, %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x1, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl $0x9, %eax
shrl $0x0, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl $0x9, %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl $0x9, %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl $0x9, %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
shrl $0x0, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movq -0x28(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
movq -0x4c0(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x4c0(%rbp), %rax
subq %rax, %rdx
callq 0x4810
movq -0x58(%rbp), %rdi
callq 0xce8f0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x520, %rsp            # imm = 0x520
popq %rbp
retq
nop