// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/rANS_static4x16pr.c
// Function: rans_compress_to_4x16
unsigned char *rans_compress_to_4x16(unsigned char *in, unsigned int in_size,
                                     unsigned char *out,unsigned int *out_size,
                                     int order) {
    if (in_size > INT_MAX || (out && *out_size == 0)) {
        *out_size = 0;
        return NULL;
    }

#ifdef VALIDATE_RANS
    int orig_order = order;
    int orig_in_size = in_size;
    unsigned char *orig_in = in;
#endif

    unsigned int c_meta_len;
    uint8_t *meta = NULL, *rle = NULL, *packed = NULL;
    uint8_t *out_free = NULL;

    if (!out) {
        *out_size = rans_compress_bound_4x16(in_size, order);
        if (*out_size == 0)
            return NULL;
        if (!(out_free = out = malloc(*out_size))) {
            *out_size = 0;
            return NULL;
        }
    }

    unsigned char *out_end = out + *out_size;

    // Permit 32-way unrolling for large blocks, paving the way for
    // AVX2 and AVX512 SIMD variants.
    if ((order & RANS_ORDER_SIMD_AUTO) && in_size >= 50000
        && !(order & RANS_ORDER_STRIPE))
        order |= X_32;

    if (in_size <= 20)
        order &= ~RANS_ORDER_STRIPE;
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    if (in_size <= 1000)
        order &= ~RANS_ORDER_X32;
#endif
    if (order & RANS_ORDER_STRIPE) {
        int N = (order>>8) & 0xff;
        if (N == 0) N = 4; // default for compatibility with old tests

        if (N > in_size)
            N = in_size;

        unsigned char *transposed = malloc(in_size);
        unsigned int part_len[256];
        unsigned int idx[256];
        if (!transposed) {
            free(out_free);
            *out_size = 0;
            return NULL;
        }
        int i, j, x;

        for (i = 0; i < N; i++) {
            part_len[i] = in_size / N + ((in_size % N) > i);
            idx[i] = i ? idx[i-1] + part_len[i-1] : 0; // cumulative index
        }

#define KN 8
        i = x = 0;
        if (in_size >= N*KN) {
            for (; i < in_size-N*KN;) {
                int k;
                unsigned char *ink = in+i;
                for (j = 0; j < N; j++)
                    for (k = 0; k < KN; k++)
                        transposed[idx[j]+x+k] = ink[j+N*k];
                x += KN; i+=N*KN;
            }
        }
#undef KN
        for (; i < in_size-N; i += N, x++) {
            for (j = 0; j < N; j++)
                transposed[idx[j]+x] = in[i+j];
        }

        for (; i < in_size; i += N, x++) {
            for (j = 0; i+j < in_size; j++)
                transposed[idx[j]+x] = in[i+j];
        }

        unsigned int olen2;
        unsigned char *out2, *out2_start;
        c_meta_len = 1;
        *out = order & ~RANS_ORDER_NOSZ;
        c_meta_len += var_put_u32(out+c_meta_len, out_end, in_size);
        if (c_meta_len >= *out_size) {
            free(out_free);
            free(transposed);
            *out_size = 0;
            return NULL;
        }

        out[c_meta_len++] = N;
        
        unsigned char *out_best = NULL;
        unsigned int out_best_len = 0;

        out2_start = out2 = out+7+5*N; // shares a buffer with c_meta
        for (i = 0; i < N; i++) {
            // Brute force try all methods.
            uint8_t *r;
            int j, m[] = {1,64,128,0}, best_j = 0, best_sz = INT_MAX;
            for (j = 0; j < sizeof(m)/sizeof(*m); j++) {
                if ((order & m[j]) != m[j])
                    continue;

                // order-1 *only*; bit check above cannot elide order-0
                if ((order & RANS_ORDER_STRIPE_NO0) && (m[j]&1) == 0)
                    continue;

                if (out2 - out > *out_size)
                    continue; // an error, but caught in best_sz check later

                olen2 = *out_size - (out2 - out);
                r = rans_compress_to_4x16(transposed+idx[i], part_len[i],
                                          out2, &olen2,
                                          m[j] | RANS_ORDER_NOSZ
                                          | (order&RANS_ORDER_X32));
                if (r && olen2 && best_sz > olen2) {
                    best_sz = olen2;
                    best_j = j;
                    if (j < sizeof(m)/sizeof(*m) && olen2 > out_best_len) {
                        unsigned char *tmp = realloc(out_best, olen2);
                        if (!tmp) {
                            free(out_free);
                            free(transposed);
                            *out_size = 0;
                            return NULL;
                        }
                        out_best = tmp;
                        out_best_len = olen2;
                    }

                    // Cache a copy of the best so far
                    memcpy(out_best, out2, olen2);
                }
            }

            if (best_sz == INT_MAX) {
                free(out_best);
                free(out_free);
                free(transposed);
                *out_size = 0;
                return NULL;
            }

            if (best_j < sizeof(m)/sizeof(*m)) {
                // Copy the best compression to output buffer if not current
                memcpy(out2, out_best, best_sz);
                olen2 = best_sz;
            }

            out2 += olen2;
            c_meta_len += var_put_u32(out+c_meta_len, out_end, olen2);
        }
        if (out_best)
            free(out_best);

        memmove(out+c_meta_len, out2_start, out2-out2_start);
        free(transposed);
        *out_size = c_meta_len + out2-out2_start;
        return out;
    }

    if (order & RANS_ORDER_CAT) {
        out[0] = RANS_ORDER_CAT;
        c_meta_len = 1;
        c_meta_len += var_put_u32(&out[1], out_end, in_size);

        if (c_meta_len + in_size > *out_size) {
            free(out_free);
            *out_size = 0;
            return NULL;
        }
        if (in_size)
            memcpy(out+c_meta_len, in, in_size);
        *out_size = c_meta_len + in_size;
        return out;
    }

    int do_pack = order & RANS_ORDER_PACK;
    int do_rle  = order & RANS_ORDER_RLE;
    int no_size = order & RANS_ORDER_NOSZ;
    int do_simd = order & RANS_ORDER_X32;

    out[0] = order;
    c_meta_len = 1;

    if (!no_size)
        c_meta_len += var_put_u32(&out[1], out_end, in_size);

    order &= 3;

    // Format is compressed meta-data, compressed data.
    // Meta-data can be empty, pack, rle lengths, or pack + rle lengths.
    // Data is either the original data, bit-packed packed, rle literals or
    // packed + rle literals.

    if (do_pack && in_size) {
        // PACK 2, 4 or 8 symbols into one byte.
        int pmeta_len;
        uint64_t packed_len;
        if (c_meta_len + 256 > *out_size) {
            free(out_free);
            *out_size = 0;
            return NULL;
        }
        packed = hts_pack(in, in_size, out+c_meta_len, &pmeta_len, &packed_len);
        if (!packed) {
            out[0] &= ~RANS_ORDER_PACK;
            do_pack = 0;
            free(packed);
            packed = NULL;
        } else {
            in = packed;
            in_size = packed_len;
            c_meta_len += pmeta_len;

            // Could derive this rather than storing verbatim.
            // Orig size * 8/nbits (+1 if not multiple of 8/n)
            int sz = var_put_u32(out+c_meta_len, out_end, in_size);
            c_meta_len += sz;
            *out_size -= sz;

            if (do_simd && in_size < 32) {
                do_simd = 0;
                out[0] &= ~RANS_ORDER_X32;
            }
        }
    } else if (do_pack) {
        out[0] &= ~RANS_ORDER_PACK;
    }

    if (do_rle && in_size) {
        // RLE 'in' -> rle_length + rle_literals arrays
        unsigned int rmeta_len, c_rmeta_len;
        uint64_t rle_len;
        c_rmeta_len = in_size+257;
        if (!(meta = malloc(c_rmeta_len))) {
            free(out_free);
            *out_size = 0;
            return NULL;
        }

        uint8_t rle_syms[256];
        int rle_nsyms = 0;
        uint64_t rmeta_len64;
        rle = hts_rle_encode(in, in_size, meta, &rmeta_len64,
                             rle_syms, &rle_nsyms, NULL, &rle_len);
        memmove(meta+1+rle_nsyms, meta, rmeta_len64);
        meta[0] = rle_nsyms;
        memcpy(meta+1, rle_syms, rle_nsyms);
        rmeta_len = rmeta_len64 + rle_nsyms+1;

        if (!rle || rle_len + rmeta_len >= .99*in_size) {
            // Not worth the speed hit.
            out[0] &= ~RANS_ORDER_RLE;
            do_rle = 0;
            free(rle);
            rle = NULL;
        } else {
            // Compress lengths with O0 and literals with O0/O1 ("order" param)
            int sz = var_put_u32(out+c_meta_len, out_end, rmeta_len*2), sz2;
            sz += var_put_u32(out+c_meta_len+sz, out_end, rle_len);
            if ((c_meta_len+sz+5) > *out_size) {
                free(out_free);
                free(rle);
                free(meta);
                free(packed);
                *out_size = 0;
                return NULL;
            }
            c_rmeta_len = *out_size - (c_meta_len+sz+5);
            if (do_simd && (rmeta_len < 32 || rle_len < 32)) {
                do_simd = 0;
                out[0] &= ~RANS_ORDER_X32;
            }
            if (!rans_enc_func(do_simd, 0)(meta, rmeta_len, out+c_meta_len+sz+5, &c_rmeta_len)) {
                free(out_free);
                free(rle);
                free(meta);
                free(packed);
                *out_size = 0;
                return NULL;
            }
            if (c_rmeta_len < rmeta_len) {
                sz2 = var_put_u32(out+c_meta_len+sz, out_end, c_rmeta_len);
                memmove(out+c_meta_len+sz+sz2, out+c_meta_len+sz+5, c_rmeta_len);
            } else {
                // Uncompressed RLE meta-data as too small
                sz = var_put_u32(out+c_meta_len, out_end, rmeta_len*2+1);
                sz2 = var_put_u32(out+c_meta_len+sz, out_end, rle_len);
                memcpy(out+c_meta_len+sz+sz2, meta, rmeta_len);
                c_rmeta_len = rmeta_len;
            }

            c_meta_len += sz + sz2 + c_rmeta_len;

            in = rle;
            in_size = rle_len;
        }

        free(meta);
    } else if (do_rle) {
        out[0] &= ~RANS_ORDER_RLE;
    }

    if (c_meta_len > *out_size) {
        free(out_free);
        free(rle);
        free(packed);
        *out_size = 0;
        return NULL;
    }

    *out_size -= c_meta_len;
    if (order && in_size < 8) {
        out[0] &= ~1;
        order  &= ~1;
    }

    if (!rans_enc_func(do_simd, order)(in, in_size, out+c_meta_len, out_size)) {
        free(out_free);
        free(rle);
        free(packed);
        *out_size = 0;
        return NULL;
    }

    if (*out_size >= in_size) {
        out[0] &= ~3;
        out[0] |= RANS_ORDER_CAT | no_size;

        if (out + c_meta_len + in_size > out_end) {
            free(out_free);
            free(rle);
            free(packed);
            *out_size = 0;
            return NULL;
        }
        if (in_size)
            memcpy(out+c_meta_len, in, in_size);
        *out_size = in_size;
    }

    free(rle);
    free(packed);

    *out_size += c_meta_len;

// Validation mode
#ifdef VALIDATE_RANS
    unsigned int decoded_size = orig_in_size;
    unsigned char *decoded = malloc(decoded_size);
    decoded = rans_uncompress_to_4x16(out, *out_size,
                                      decoded, &decoded_size);
    if (!decoded ||
        decoded_size != orig_in_size ||
        memcmp(orig_in, decoded, orig_in_size) != 0) {
        fprintf(stderr, "rans round trip failed for order %d. Written to fd 5\n", orig_order);
        if (write(5, orig_in, orig_in_size) < 0)
            abort();
        abort();
    }
    free(decoded);
#endif


    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa50, %rsp            # imm = 0xA50
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
cmpl $0x7fffffff, -0x14(%rbp) # imm = 0x7FFFFFFF
ja 0x90367
cmpq $0x0, -0x20(%rbp)
je 0x9037e
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x9037e
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x90402
movl -0x14(%rbp), %edi
movl -0x2c(%rbp), %esi
callq 0x8e2d0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x903ce
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, %edi
callq 0x4650
movq %rax, -0x20(%rbp)
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x90400
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
jmp 0x90402
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movl -0x2c(%rbp), %eax
andl $0x20000, %eax          # imm = 0x20000
cmpl $0x0, %eax
je 0x9043d
cmpl $0xc350, -0x14(%rbp)    # imm = 0xC350
jb 0x9043d
movl -0x2c(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x9043d
movl -0x2c(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x14, -0x14(%rbp)
ja 0x9044c
movl -0x2c(%rbp), %eax
andl $-0x9, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x3e8, -0x14(%rbp)     # imm = 0x3E8
ja 0x9045e
movl -0x2c(%rbp), %eax
andl $-0x5, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x90bd5
movl -0x2c(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x90488
movl $0x4, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jbe 0x90496
movl -0x14(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %edi
callq 0x4650
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x904cb
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movl $0x0, -0x874(%rbp)
movl -0x874(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x9057c
movl -0x14(%rbp), %eax
xorl %edx, %edx
divl -0x5c(%rbp)
movl %eax, %ecx
movl -0x14(%rbp), %eax
xorl %edx, %edx
divl -0x5c(%rbp)
cmpl -0x874(%rbp), %edx
seta %al
andb $0x1, %al
movzbl %al, %eax
addl %eax, %ecx
movslq -0x874(%rbp), %rax
movl %ecx, -0x470(%rbp,%rax,4)
cmpl $0x0, -0x874(%rbp)
je 0x9054a
movl -0x874(%rbp), %eax
subl $0x1, %eax
cltq
movl -0x870(%rbp,%rax,4), %eax
movl -0x874(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addl -0x470(%rbp,%rcx,4), %eax
movl %eax, -0xa3c(%rbp)
jmp 0x90554
xorl %eax, %eax
movl %eax, -0xa3c(%rbp)
jmp 0x90554
movl -0xa3c(%rbp), %ecx
movslq -0x874(%rbp), %rax
movl %ecx, -0x870(%rbp,%rax,4)
movl -0x874(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x874(%rbp)
jmp 0x904d5
movl $0x0, -0x87c(%rbp)
movl $0x0, -0x874(%rbp)
movl -0x14(%rbp), %eax
movl -0x5c(%rbp), %ecx
shll $0x3, %ecx
cmpl %ecx, %eax
jb 0x9068a
jmp 0x905a3
movl -0x874(%rbp), %eax
movl -0x14(%rbp), %ecx
movl -0x5c(%rbp), %edx
shll $0x3, %edx
subl %edx, %ecx
cmpl %ecx, %eax
jae 0x90688
movq -0x10(%rbp), %rax
movslq -0x874(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x888(%rbp)
movl $0x0, -0x878(%rbp)
movl -0x878(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x90662
movl $0x0, -0x880(%rbp)
cmpl $0x8, -0x880(%rbp)
jge 0x9064c
movq -0x888(%rbp), %rax
movl -0x878(%rbp), %ecx
movl -0x5c(%rbp), %edx
imull -0x880(%rbp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x68(%rbp), %rax
movslq -0x878(%rbp), %rcx
movl -0x870(%rbp,%rcx,4), %ecx
addl -0x87c(%rbp), %ecx
addl -0x880(%rbp), %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x880(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x880(%rbp)
jmp 0x905f0
jmp 0x9064e
movl -0x878(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x878(%rbp)
jmp 0x905db
movl -0x87c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x87c(%rbp)
movl -0x5c(%rbp), %eax
shll $0x3, %eax
addl -0x874(%rbp), %eax
movl %eax, -0x874(%rbp)
jmp 0x905a3
jmp 0x9068a
jmp 0x9068c
movl -0x874(%rbp), %eax
movl -0x14(%rbp), %ecx
subl -0x5c(%rbp), %ecx
cmpl %ecx, %eax
jae 0x9071a
movl $0x0, -0x878(%rbp)
movl -0x878(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x906f5
movq -0x10(%rbp), %rax
movl -0x874(%rbp), %ecx
addl -0x878(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x68(%rbp), %rax
movslq -0x878(%rbp), %rcx
movl -0x870(%rbp,%rcx,4), %ecx
addl -0x87c(%rbp), %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x878(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x878(%rbp)
jmp 0x906a6
jmp 0x906f7
movl -0x5c(%rbp), %eax
addl -0x874(%rbp), %eax
movl %eax, -0x874(%rbp)
movl -0x87c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x87c(%rbp)
jmp 0x9068c
jmp 0x9071c
movl -0x874(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x907af
movl $0x0, -0x878(%rbp)
movl -0x874(%rbp), %eax
addl -0x878(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x9078a
movq -0x10(%rbp), %rax
movl -0x874(%rbp), %ecx
addl -0x878(%rbp), %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x68(%rbp), %rax
movslq -0x878(%rbp), %rcx
movl -0x870(%rbp,%rcx,4), %ecx
addl -0x87c(%rbp), %ecx
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movl -0x878(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x878(%rbp)
jmp 0x90735
jmp 0x9078c
movl -0x5c(%rbp), %eax
addl -0x874(%rbp), %eax
movl %eax, -0x874(%rbp)
movl -0x87c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x87c(%rbp)
jmp 0x9071c
movl $0x1, -0x30(%rbp)
movl -0x2c(%rbp), %eax
andl $-0x11, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x91410
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jb 0x90814
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x68(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movl -0x5c(%rbp), %eax
movb %al, %dl
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x30(%rbp)
movl %ecx, %ecx
movb %dl, (%rax,%rcx)
movq $0x0, -0x8a8(%rbp)
movl $0x0, -0x8ac(%rbp)
movq -0x20(%rbp), %rax
addq $0x7, %rax
imull $0x5, -0x5c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x898(%rbp)
movq %rax, -0x8a0(%rbp)
movl $0x0, -0x874(%rbp)
movl -0x874(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x90b61
movq 0x65bce(%rip), %rax     # 0xf6450
movq %rax, -0x8d0(%rbp)
movq 0x65bc8(%rip), %rax     # 0xf6458
movq %rax, -0x8c8(%rbp)
movl $0x0, -0x8d4(%rbp)
movl $0x7fffffff, -0x8d8(%rbp) # imm = 0x7FFFFFFF
movl $0x0, -0x8bc(%rbp)
movslq -0x8bc(%rbp), %rax
cmpq $0x4, %rax
jae 0x90aa1
movl -0x2c(%rbp), %eax
movslq -0x8bc(%rbp), %rcx
andl -0x8d0(%rbp,%rcx,4), %eax
movslq -0x8bc(%rbp), %rcx
cmpl -0x8d0(%rbp,%rcx,4), %eax
je 0x908ec
jmp 0x90a8d
movl -0x2c(%rbp), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x90914
movslq -0x8bc(%rbp), %rax
movl -0x8d0(%rbp,%rax,4), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x90914
jmp 0x90a8d
movq -0x898(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
cmpq %rcx, %rax
jle 0x90932
jmp 0x90a8d
movq -0x28(%rbp), %rax
movl (%rax), %eax
movq -0x898(%rbp), %rcx
movq -0x20(%rbp), %rdx
subq %rdx, %rcx
subq %rcx, %rax
movl %eax, -0x88c(%rbp)
movq -0x68(%rbp), %rdi
movslq -0x874(%rbp), %rax
movl -0x870(%rbp,%rax,4), %eax
addq %rax, %rdi
movslq -0x874(%rbp), %rax
movl -0x470(%rbp,%rax,4), %esi
movq -0x898(%rbp), %rdx
movslq -0x8bc(%rbp), %rax
movl -0x8d0(%rbp,%rax,4), %r8d
orl $0x10, %r8d
movl -0x2c(%rbp), %eax
andl $0x4, %eax
orl %eax, %r8d
leaq -0x88c(%rbp), %rcx
callq 0x90330
movq %rax, -0x8b8(%rbp)
cmpq $0x0, -0x8b8(%rbp)
je 0x90a8b
cmpl $0x0, -0x88c(%rbp)
je 0x90a8b
movl -0x8d8(%rbp), %eax
cmpl -0x88c(%rbp), %eax
jbe 0x90a8b
movl -0x88c(%rbp), %eax
movl %eax, -0x8d8(%rbp)
movl -0x8bc(%rbp), %eax
movl %eax, -0x8d4(%rbp)
movslq -0x8bc(%rbp), %rax
cmpq $0x4, %rax
jae 0x90a70
movl -0x88c(%rbp), %eax
cmpl -0x8ac(%rbp), %eax
jbe 0x90a70
movq -0x8a8(%rbp), %rdi
movl -0x88c(%rbp), %eax
movl %eax, %esi
callq 0x4820
movq %rax, -0x8e0(%rbp)
cmpq $0x0, -0x8e0(%rbp)
jne 0x90a56
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x68(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movq -0x8e0(%rbp), %rax
movq %rax, -0x8a8(%rbp)
movl -0x88c(%rbp), %eax
movl %eax, -0x8ac(%rbp)
movq -0x8a8(%rbp), %rdi
movq -0x898(%rbp), %rsi
movl -0x88c(%rbp), %eax
movl %eax, %edx
callq 0x43b0
jmp 0x90a8d
movl -0x8bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8bc(%rbp)
jmp 0x908b5
cmpl $0x7fffffff, -0x8d8(%rbp) # imm = 0x7FFFFFFF
jne 0x90ae2
movq -0x8a8(%rbp), %rdi
callq 0x45a0
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x68(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movslq -0x8d4(%rbp), %rax
cmpq $0x4, %rax
jae 0x90b15
movq -0x898(%rbp), %rdi
movq -0x8a8(%rbp), %rsi
movslq -0x8d8(%rbp), %rdx
callq 0x43b0
movl -0x8d8(%rbp), %eax
movl %eax, -0x88c(%rbp)
movl -0x88c(%rbp), %ecx
movq -0x898(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x898(%rbp)
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movl -0x88c(%rbp), %edx
callq 0x91410
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x874(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x874(%rbp)
jmp 0x9086c
cmpq $0x0, -0x8a8(%rbp)
je 0x90b77
movq -0x8a8(%rbp), %rdi
callq 0x45a0
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movq -0x8a0(%rbp), %rsi
movq -0x898(%rbp), %rdx
movq -0x8a0(%rbp), %rax
subq %rax, %rdx
callq 0x4810
movq -0x68(%rbp), %rdi
callq 0x45a0
movl -0x30(%rbp), %ecx
movq -0x898(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq -0x8a0(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x913f4
movl -0x2c(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x90c71
movq -0x20(%rbp), %rax
movb $0x20, (%rax)
movl $0x1, -0x30(%rbp)
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
movq -0x58(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x91410
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
addl -0x14(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jbe 0x90c3a
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
cmpl $0x0, -0x14(%rbp)
je 0x90c58
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %eax
movl %eax, %edx
callq 0x43b0
movl -0x30(%rbp), %ecx
addl -0x14(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x913f4
movl -0x2c(%rbp), %eax
andl $0x80, %eax
movl %eax, -0x8e4(%rbp)
movl -0x2c(%rbp), %eax
andl $0x40, %eax
movl %eax, -0x8e8(%rbp)
movl -0x2c(%rbp), %eax
andl $0x10, %eax
movl %eax, -0x8ec(%rbp)
movl -0x2c(%rbp), %eax
andl $0x4, %eax
movl %eax, -0x8f0(%rbp)
movl -0x2c(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movl $0x1, -0x30(%rbp)
cmpl $0x0, -0x8ec(%rbp)
jne 0x90cd8
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
movq -0x58(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x91410
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
andl $0x3, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x8e4(%rbp)
je 0x90e04
cmpl $0x0, -0x14(%rbp)
je 0x90e04
movl -0x30(%rbp), %eax
addl $0x100, %eax            # imm = 0x100
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jbe 0x90d28
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
movq -0x20(%rbp), %rdx
movl -0x30(%rbp), %eax
addq %rax, %rdx
leaq -0x8f4(%rbp), %rcx
leaq -0x900(%rbp), %r8
callq 0x8ce30
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x90d85
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movb %cl, (%rax)
movl $0x0, -0x8e4(%rbp)
movq -0x48(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x48(%rbp)
jmp 0x90e02
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x900(%rbp), %rax
movl %eax, -0x14(%rbp)
movl -0x8f4(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x91410
movl %eax, -0x904(%rbp)
movl -0x904(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x904(%rbp), %edx
movq -0x28(%rbp), %rax
movl (%rax), %ecx
subl %edx, %ecx
movl %ecx, (%rax)
cmpl $0x0, -0x8f0(%rbp)
je 0x90e00
cmpl $0x20, -0x14(%rbp)
jae 0x90e00
movl $0x0, -0x8f0(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
andl $-0x5, %ecx
movb %cl, (%rax)
jmp 0x90e02
jmp 0x90e1e
cmpl $0x0, -0x8e4(%rbp)
je 0x90e1c
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movb %cl, (%rax)
jmp 0x90e1e
cmpl $0x0, -0x8e8(%rbp)
je 0x91255
cmpl $0x0, -0x14(%rbp)
je 0x91255
movl -0x14(%rbp), %eax
addl $0x101, %eax            # imm = 0x101
movl %eax, -0x90c(%rbp)
movl -0x90c(%rbp), %eax
movl %eax, %edi
callq 0x4650
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x90e7a
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movl $0x0, -0xa24(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
movq -0x38(%rbp), %rdx
leaq -0xa20(%rbp), %r8
leaq -0xa30(%rbp), %rcx
leaq -0xa24(%rbp), %r9
xorl %eax, %eax
leaq -0x918(%rbp), %rax
movq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xc7a20
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
movslq -0xa24(%rbp), %rax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movq -0xa30(%rbp), %rdx
callq 0x4810
movl -0xa24(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
movq -0x38(%rbp), %rdi
addq $0x1, %rdi
leaq -0xa20(%rbp), %rsi
movslq -0xa24(%rbp), %rdx
callq 0x43b0
movq -0xa30(%rbp), %rax
movslq -0xa24(%rbp), %rcx
addq %rcx, %rax
addq $0x1, %rax
movl %eax, -0x908(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x90f83
movq -0x918(%rbp), %rax
movl -0x908(%rbp), %ecx
addq %rcx, %rax
movq %rax, %xmm0
movaps 0x5e9b2(%rip), %xmm1    # 0xef900
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x5e9b6(%rip), %xmm1    # 0xef910
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movl -0x14(%rbp), %eax
cvtsi2sd %rax, %xmm2
movsd 0x654b7(%rip), %xmm1    # 0xf6430
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jb 0x90faf
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
andl $-0x41, %ecx
movb %cl, (%rax)
movl $0x0, -0x8e8(%rbp)
movq -0x40(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x40(%rbp)
jmp 0x9124a
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movl -0x908(%rbp), %edx
shll %edx
callq 0x91410
movl %eax, -0xa34(%rbp)
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movslq -0xa34(%rbp), %rax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movq -0x918(%rbp), %rax
movl %eax, %edx
callq 0x91410
addl -0xa34(%rbp), %eax
movl %eax, -0xa34(%rbp)
movl -0x30(%rbp), %eax
addl -0xa34(%rbp), %eax
addl $0x5, %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jbe 0x91051
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x40(%rbp), %rdi
callq 0x45a0
movq -0x38(%rbp), %rdi
callq 0x45a0
movq -0x48(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl -0x30(%rbp), %ecx
addl -0xa34(%rbp), %ecx
addl $0x5, %ecx
subl %ecx, %eax
movl %eax, -0x90c(%rbp)
cmpl $0x0, -0x8f0(%rbp)
je 0x9109d
cmpl $0x20, -0x908(%rbp)
jb 0x91087
cmpq $0x20, -0x918(%rbp)
jae 0x9109d
movl $0x0, -0x8f0(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
andl $-0x5, %ecx
movb %cl, (%rax)
movl -0x8f0(%rbp), %edi
xorl %esi, %esi
callq 0x91680
movq -0x38(%rbp), %rdi
movl -0x908(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x30(%rbp), %ecx
addq %rcx, %rdx
movslq -0xa34(%rbp), %rcx
addq %rcx, %rdx
addq $0x5, %rdx
leaq -0x90c(%rbp), %rcx
callq *%rax
cmpq $0x0, %rax
jne 0x91116
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x40(%rbp), %rdi
callq 0x45a0
movq -0x38(%rbp), %rdi
callq 0x45a0
movq -0x48(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movl -0x90c(%rbp), %eax
cmpl -0x908(%rbp), %eax
jae 0x91195
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movslq -0xa34(%rbp), %rax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movl -0x90c(%rbp), %edx
callq 0x91410
movl %eax, -0xa38(%rbp)
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movslq -0xa34(%rbp), %rax
addq %rax, %rdi
movslq -0xa38(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movl -0x30(%rbp), %eax
addq %rax, %rsi
movslq -0xa34(%rbp), %rax
addq %rax, %rsi
addq $0x5, %rsi
movl -0x90c(%rbp), %eax
movl %eax, %edx
callq 0x4810
jmp 0x91220
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movl -0x908(%rbp), %edx
shll %edx
addl $0x1, %edx
callq 0x91410
movl %eax, -0xa34(%rbp)
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movslq -0xa34(%rbp), %rax
addq %rax, %rdi
movq -0x58(%rbp), %rsi
movq -0x918(%rbp), %rax
movl %eax, %edx
callq 0x91410
movl %eax, -0xa38(%rbp)
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movslq -0xa34(%rbp), %rax
addq %rax, %rdi
movslq -0xa38(%rbp), %rax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
movl -0x908(%rbp), %eax
movl %eax, %edx
callq 0x43b0
movl -0x908(%rbp), %eax
movl %eax, -0x90c(%rbp)
movl -0xa34(%rbp), %eax
addl -0xa38(%rbp), %eax
addl -0x90c(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x918(%rbp), %rax
movl %eax, -0x14(%rbp)
movq -0x38(%rbp), %rdi
callq 0x45a0
jmp 0x9126c
cmpl $0x0, -0x8e8(%rbp)
je 0x9126a
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
andl $-0x41, %ecx
movb %cl, (%rax)
jmp 0x9126c
movl -0x30(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jbe 0x912a9
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x40(%rbp), %rdi
callq 0x45a0
movq -0x48(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movl -0x30(%rbp), %edx
movq -0x28(%rbp), %rax
movl (%rax), %ecx
subl %edx, %ecx
movl %ecx, (%rax)
cmpl $0x0, -0x2c(%rbp)
je 0x912d7
cmpl $0x8, -0x14(%rbp)
jae 0x912d7
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
andl $-0x2, %ecx
movb %cl, (%rax)
movl -0x2c(%rbp), %eax
andl $-0x2, %eax
movl %eax, -0x2c(%rbp)
movl -0x8f0(%rbp), %edi
movl -0x2c(%rbp), %esi
callq 0x91680
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x30(%rbp), %ecx
addq %rcx, %rdx
movq -0x28(%rbp), %rcx
callq *%rax
cmpq $0x0, %rax
jne 0x91334
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x40(%rbp), %rdi
callq 0x45a0
movq -0x48(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
movq -0x28(%rbp), %rax
movl (%rax), %eax
cmpl -0x14(%rbp), %eax
jb 0x913cf
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
andl $-0x4, %ecx
movb %cl, (%rax)
movl -0x8ec(%rbp), %edx
orl $0x20, %edx
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
orl %edx, %ecx
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addq %rcx, %rax
movl -0x14(%rbp), %ecx
addq %rcx, %rax
cmpq -0x58(%rbp), %rax
jbe 0x913a8
movq -0x50(%rbp), %rdi
callq 0x45a0
movq -0x40(%rbp), %rdi
callq 0x45a0
movq -0x48(%rbp), %rdi
callq 0x45a0
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0x913f4
cmpl $0x0, -0x14(%rbp)
je 0x913c6
movq -0x20(%rbp), %rdi
movl -0x30(%rbp), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %eax
movl %eax, %edx
callq 0x43b0
movl -0x14(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rdi
callq 0x45a0
movq -0x48(%rbp), %rdi
callq 0x45a0
movl -0x30(%rbp), %ecx
movq -0x28(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa50, %rsp            # imm = 0xA50
popq %rbp
retq
nopw %cs:(%rax,%rax)