// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/htscodecs/htscodecs/rANS_static4x16pr.c
// Function: rans_uncompress_to_4x16
unsigned char *rans_uncompress_to_4x16(unsigned char *in,  unsigned int in_size,
                                       unsigned char *out, unsigned int *out_size) {
    unsigned char *in_end = in + in_size;
    unsigned char *out_free = NULL, *tmp_free = NULL, *meta_free = NULL;

    if (in_size == 0)
        return NULL;

    if (*in & RANS_ORDER_STRIPE) {
        unsigned int ulen, olen, c_meta_len = 1;
        int i;
        uint64_t clen_tot = 0;

        // Decode lengths
        c_meta_len += var_get_u32(in+c_meta_len, in_end, &ulen);
        if (c_meta_len >= in_size)
            return NULL;
        unsigned int N = in[c_meta_len++];
        if (N < 1)  // Must be at least one stripe
            return NULL;
        unsigned int clenN[256], ulenN[256], idxN[256];
        if (!out) {
            if (ulen >= INT_MAX)
                return NULL;
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
            if (ulen > 100000)
                return NULL;
#endif
            if (!(out_free = out = malloc(ulen))) {
                return NULL;
            }
            *out_size = ulen;
        }
        if (ulen != *out_size) {
            free(out_free);
            return NULL;
        }

        for (i = 0; i < N; i++) {
            ulenN[i] = ulen / N + ((ulen % N) > i);
            idxN[i] = i ? idxN[i-1] + ulenN[i-1] : 0;
            c_meta_len += var_get_u32(in+c_meta_len, in_end, &clenN[i]);
            clen_tot += clenN[i];
            if (c_meta_len > in_size || clenN[i] > in_size || clenN[i] < 1) {
                free(out_free);
                return NULL;
            }
        }

        // We can call this with a larger buffer, but once we've determined
        // how much we really use we limit it so the recursion becomes easier
        // to limit.
        if (c_meta_len + clen_tot > in_size) {
            free(out_free);
            return NULL;
        }
        in_size = c_meta_len + clen_tot;

        //fprintf(stderr, "    stripe meta %d\n", c_meta_len); //c-size

        // Uncompress the N streams
        unsigned char *outN = malloc(ulen);
        if (!outN) {
            free(out_free);
            return NULL;
        }
        for (i = 0; i < N; i++) {
            olen = ulenN[i];
            if (in_size < c_meta_len) {
                free(out_free);
                free(outN);
                return NULL;
            }
            if (!rans_uncompress_to_4x16(in+c_meta_len, in_size-c_meta_len, outN + idxN[i], &olen)
                || olen != ulenN[i]) {
                free(out_free);
                free(outN);
                return NULL;
            }
            c_meta_len += clenN[i];
        }

        unstripe(out, outN, ulen, N, idxN);

        free(outN);
        *out_size = ulen;
        return out;
    }

    int order = *in++;  in_size--;
    int do_pack = order & RANS_ORDER_PACK;
    int do_rle  = order & RANS_ORDER_RLE;
    int do_cat  = order & RANS_ORDER_CAT;
    int no_size = order & RANS_ORDER_NOSZ;
    int do_simd = order & RANS_ORDER_X32;
    order &= 1;

    int sz = 0;
    unsigned int osz;
    if (!no_size) {
        sz = var_get_u32(in, in_end, &osz);
    } else
        sz = 0, osz = *out_size;
    in += sz;
    in_size -= sz;

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

    if (no_size && !out)
        goto err; // Need one or the other

    if (!out) {
        *out_size = osz;
        if (!(out = out_free = malloc(*out_size)))
            return NULL;
    } else {
        if (*out_size < osz)
        goto err;
        *out_size = osz;
    }

//    if (do_pack || do_rle) {
//      in += sz; // size field not needed when pure rANS
//      in_size -= sz;
//    }

    uint32_t c_meta_size = 0;
    unsigned int tmp1_size = *out_size;
    unsigned int tmp2_size = *out_size;
    unsigned int tmp3_size = *out_size;
    unsigned char *tmp1 = NULL, *tmp2 = NULL, *tmp3 = NULL, *tmp = NULL;

    // Need In, Out and Tmp buffers with temporary buffer of the same size
    // as output.  All use rANS, but with optional transforms (none, RLE,
    // Pack, or both).
    //
    //                    rans   unrle  unpack
    // If none:     in -> out
    // If RLE:      in -> tmp -> out
    // If Pack:     in -> tmp        -> out
    // If RLE+Pack: in -> out -> tmp -> out
    //                    tmp1   tmp2   tmp3
    //
    // So rans is in   -> tmp1
    // RLE     is tmp1 -> tmp2
    // Unpack  is tmp2 -> tmp3

    // Format is meta data (Pack and RLE in that order if present),
    // followed by rANS compressed data.

    if (do_pack || do_rle) {
        if (!(tmp = tmp_free = malloc(*out_size)))
            goto err;
        if (do_pack && do_rle) {
            tmp1 = out;
            tmp2 = tmp;
            tmp3 = out;
        } else if (do_pack) {
            tmp1 = tmp;
            tmp2 = tmp1;
            tmp3 = out;
        } else if (do_rle) {
            tmp1 = tmp;
            tmp2 = out;
            tmp3 = out;
        }
    } else {
        // neither
        tmp  = NULL;
        tmp1 = out;
        tmp2 = out;
        tmp3 = out;
    }

    // Decode the bit-packing map.
    uint8_t map[16] = {0};
    int npacked_sym = 0;
    uint64_t unpacked_sz = 0; // FIXME: rename to packed_per_byte
    if (do_pack) {
        c_meta_size = hts_unpack_meta(in, in_size, *out_size, map, &npacked_sym);
        if (c_meta_size == 0)
            goto err;

        unpacked_sz = osz;
        in      += c_meta_size;
        in_size -= c_meta_size;

        // New unpacked size.  We could derive this bit from *out_size
        // and npacked_sym.
        unsigned int osz;
        sz = var_get_u32(in, in_end, &osz);
        in += sz;
        in_size -= sz;
        if (osz > tmp1_size)
            goto err;
        tmp1_size = osz;
    }

    uint8_t *meta = NULL;
    uint32_t u_meta_size = 0;
    if (do_rle) {
        // Uncompress meta data
        uint32_t c_meta_size, rle_len, sz;
        sz  = var_get_u32(in,    in_end, &u_meta_size);
        sz += var_get_u32(in+sz, in_end, &rle_len);
        if (rle_len > tmp1_size) // should never grow
            goto err;
        if (u_meta_size & 1) {
            meta = in + sz;
            u_meta_size = u_meta_size/2 > (in_end-meta) ? (in_end-meta) : u_meta_size/2;
            c_meta_size = u_meta_size;
        } else {
            sz += var_get_u32(in+sz, in_end, &c_meta_size);
            u_meta_size /= 2;

            meta_free = meta = rans_dec_func(do_simd, 0)(in+sz, in_size-sz, NULL, u_meta_size);
            if (!meta)
                goto err;
        }
        if (c_meta_size+sz > in_size)
            goto err;
        in      += c_meta_size+sz;
        in_size -= c_meta_size+sz;
        tmp1_size = rle_len;
    }
    //fprintf(stderr, "    meta_size %d bytes\n", (int)(in - orig_in)); //c-size

    // uncompress RLE data.  in -> tmp1
    if (in_size) {
        if (do_cat) {
            //fprintf(stderr, "    CAT %d\n", tmp1_size); //c-size
            if (tmp1_size > in_size)
                goto err;
            if (tmp1_size > *out_size)
                goto err;
            memcpy(tmp1, in, tmp1_size);
        } else {
            tmp1 = rans_dec_func(do_simd, order)(in, in_size, tmp1, tmp1_size);
            if (!tmp1)
                goto err;
        }
    } else {
        tmp1_size = 0;
    }
    tmp2_size = tmp3_size = tmp1_size;

    if (do_rle) {
        // Unpack RLE.  tmp1 -> tmp2.
        if (u_meta_size == 0)
            goto err;
        uint64_t unrle_size = *out_size;
        int rle_nsyms = *meta ? *meta : 256;
        if (u_meta_size < 1+rle_nsyms)
            goto err;
        if (!hts_rle_decode(tmp1, tmp1_size,
                            meta+1+rle_nsyms, u_meta_size-(1+rle_nsyms),
                            meta+1, rle_nsyms, tmp2, &unrle_size))
            goto err;
        tmp3_size = tmp2_size = unrle_size;
        free(meta_free);
        meta_free = NULL;
    }
    if (do_pack) {
        // Unpack bits via pack-map.  tmp2 -> tmp3
        if (npacked_sym == 1)
            unpacked_sz = tmp2_size;
        //uint8_t *porig = unpack(tmp2, tmp2_size, unpacked_sz, npacked_sym, map);
        //memcpy(tmp3, porig, unpacked_sz);
        if (!hts_unpack(tmp2, tmp2_size, tmp3, unpacked_sz, npacked_sym, map))
            goto err;
        tmp3_size = unpacked_sz;
    }

    if (tmp)
        free(tmp);

    *out_size = tmp3_size;
    return tmp3;

 err:
    free(meta_free);
    free(out_free);
    free(tmp_free);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc78, %rsp            # imm = 0xC78
testl %esi, %esi
je 0x64da3
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
movl %esi, %edi
leaq (%r15,%rdi), %r12
movzbl (%r15), %ebp
testb $0x8, %bpl
jne 0x645fa
leaq 0x1(%r15), %rdi
testb $0x10, %bpl
jne 0x6463a
xorl %r13d, %r13d
cmpl $0x7, %r14d
jb 0x647e7
movl $0x1, %eax
movzbl (%r15,%rax), %edx
movl %r13d, %esi
shll $0x7, %esi
movl %edx, %r13d
andl $0x7f, %r13d
orl %esi, %r13d
leaq 0x1(%rax), %rsi
testb %dl, %dl
jns 0x645f2
cmpl $0x6, %eax
movq %rsi, %rax
jne 0x645cd
addq %rsi, %r15
subl %edi, %r15d
jmp 0x64640
leaq 0x1(%r15), %rax
cmpl $0x7, %r14d
jb 0x64667
movq %rdi, %r8
xorl %ebp, %ebp
movl $0x1, %edi
movzbl (%r15,%rdi), %edx
movl %ebp, %esi
shll $0x7, %esi
movl %edx, %ebp
andl $0x7f, %ebp
orl %esi, %ebp
leaq 0x1(%rdi), %r13
testb %dl, %dl
jns 0x6462f
cmpl $0x6, %edi
movq %r13, %rdi
jne 0x6460e
addq %r15, %r13
movq %r8, %rdi
subl %eax, %r13d
jmp 0x64686
movl (%rcx), %r13d
xorl %r15d, %r15d
movl %ebp, %eax
andl $0x10, %eax
shrl $0x4, %eax
testq %rbx, %rbx
sete %dl
testb %al, %dl
jne 0x6481c
movslq %r15d, %rax
notl %r15d
addl %r14d, %r15d
addq %rax, %rdi
jmp 0x64812
xorl %ebp, %ebp
movl $0x0, %r13d
cmpl $0x1, %r14d
je 0x64686
movsbl (%rax), %ebp
testl %ebp, %ebp
js 0x64994
movl $0x1, %r13d
leal 0x1(%r13), %eax
cmpl %r14d, %eax
jae 0x64da3
movl %eax, %eax
movzbl (%r15,%rax), %esi
testl %esi, %esi
je 0x64da3
testq %rbx, %rbx
je 0x6494f
movl (%rcx), %edx
movq $0x0, 0x8(%rsp)
cmpl %edx, %ebp
jne 0x64b98
movq %rcx, 0x40(%rsp)
movq %rbx, 0x20(%rsp)
movl %ebp, %eax
xorl %edx, %edx
divl %esi
addl $0x2, %r13d
xorl %ecx, %ecx
movq %rdi, 0x10(%rsp)
movl %esi, %r8d
leaq -0x5(%rdi), %rsi
movl %r8d, 0x28(%rsp)
movl %r8d, %edi
movq %rdi, 0x18(%rsp)
xorl %ebx, %ebx
cmpq %rdx, %rcx
movl %eax, %edi
adcl $0x0, %edi
movl %edi, 0x870(%rsp,%rcx,4)
movl $0x0, %edi
testq %rcx, %rcx
je 0x64716
movl 0x86c(%rsp,%rcx,4), %edi
addl 0x46c(%rsp,%rcx,4), %edi
movl %edi, 0x470(%rsp,%rcx,4)
movl %r13d, %edi
leaq (%r15,%rdi), %r8
cmpq %rdi, %rsi
jle 0x64761
xorl %r10d, %r10d
xorl %edi, %edi
movzbl (%r8,%r10), %r11d
movl %edi, %r9d
shll $0x7, %r9d
movl %r11d, %edi
andl $0x7f, %edi
orl %r9d, %edi
leaq 0x1(%r10), %r9
testb %r11b, %r11b
jns 0x64755
cmpl $0x5, %r10d
movq %r9, %r10
jne 0x6472e
addq %r8, %r9
movl %edi, 0x70(%rsp,%rcx,4)
subl %r8d, %r9d
jmp 0x64787
cmpl %r14d, %r13d
jae 0x6477a
movsbl (%r8), %edi
testl %edi, %edi
js 0x647b8
movl %edi, 0x70(%rsp,%rcx,4)
movl $0x1, %r9d
jmp 0x64787
movl $0x0, 0x70(%rsp,%rcx,4)
xorl %edi, %edi
xorl %r9d, %r9d
addl %r9d, %r13d
cmpl %r14d, %r13d
ja 0x64b98
leal -0x1(%rdi), %r8d
cmpl %r14d, %r8d
jae 0x64b98
movl %edi, %edi
addq %rdi, %rbx
incq %rcx
cmpq 0x18(%rsp), %rcx
jne 0x646ef
jmp 0x64ae0
xorl %edi, %edi
movq %r8, %r9
movzbl (%r9), %r10d
incq %r9
movl %edi, %r11d
shll $0x7, %r11d
movl %r10d, %edi
andl $0x7f, %edi
orl %r11d, %edi
testb %r10b, %r10b
jns 0x64758
cmpq %r12, %r9
jb 0x647bd
jmp 0x64758
movl $0x0, %r15d
cmpl $0x1, %r14d
je 0x64806
movsbl (%rdi), %r13d
testl %r13d, %r13d
js 0x64ba2
movl $0x1, %r15d
movl %r15d, %eax
addq %rax, %rdi
notl %r15d
addl %r14d, %r15d
testq %rbx, %rbx
je 0x64829
cmpl %r13d, (%rcx)
jae 0x6484e
xorl %ecx, %ecx
xorl %r15d, %r15d
xorl %r14d, %r14d
jmp 0x64d8b
movq %rdi, 0x18(%rsp)
movq %rcx, 0x40(%rsp)
movl %r13d, (%rcx)
movl %r13d, %edi
callq 0x4680
movq %rax, %r14
movq %rax, %rbx
testq %rax, %rax
jne 0x6485e
jmp 0x64da3
movq %rdi, 0x18(%rsp)
movq %rcx, 0x40(%rsp)
movl %r13d, (%rcx)
xorl %r14d, %r14d
testb %bpl, %bpl
setns %al
testb $0x40, %bpl
sete %cl
testb %cl, %al
jne 0x648b8
movl %r13d, %edi
movq %rdi, 0x28(%rsp)
callq 0x4680
testq %rax, %rax
je 0x649c0
movq %rax, %rcx
testb $0x40, %bpl
cmovneq %rbx, %rax
testb %bpl, %bpl
cmovnsq %rcx, %rax
movq %rcx, 0x8(%rsp)
js 0x64bd1
xorl %eax, %eax
testb $0x40, %bpl
cmoveq %rax, %rcx
movq %rbx, %r10
cmoveq %rax, %r10
movq %rcx, %rbx
jmp 0x648c4
movq $0x0, 0x8(%rsp)
movq %rbx, %r10
movq 0x18(%rsp), %rdi
movq %rbx, %r8
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movl $0x0, 0x54(%rsp)
movq $0x0, 0x28(%rsp)
movq %r10, %rbx
movl %ebp, %r9d
andl $0x4, %r9d
xorl %ecx, %ecx
testb $0x40, %bpl
movq %r14, 0x10(%rsp)
je 0x64944
movq %rbx, 0x20(%rsp)
movq %r12, %rax
subq %rdi, %rax
cmpq $0x6, %rax
jl 0x649ca
xorl %eax, %eax
xorl %r14d, %r14d
movzbl (%rdi,%rax), %ecx
movl %r14d, %edx
shll $0x7, %edx
movl %ecx, %r14d
andl $0x7f, %r14d
orl %edx, %r14d
leaq 0x1(%rax), %rbx
testb %cl, %cl
jns 0x6493a
cmpl $0x5, %eax
movq %rbx, %rax
jne 0x64916
addq %rdi, %rbx
subl %edi, %ebx
jmp 0x649e9
xorl %r14d, %r14d
xorl %r11d, %r11d
jmp 0x64c76
cmpl $0x7ffffffe, %ebp       # imm = 0x7FFFFFFE
ja 0x64da3
movl %esi, 0x28(%rsp)
movq %rdi, 0x10(%rsp)
movq %rcx, %rbx
movl %ebp, %edi
callq 0x4680
testq %rax, %rax
je 0x64da3
movq %rbx, %rcx
movl %ebp, (%rbx)
movl %ebp, %edx
movq %rax, 0x8(%rsp)
movq %rax, %rbx
movq 0x10(%rsp), %rdi
movl 0x28(%rsp), %esi
jmp 0x646b6
xorl %ebp, %ebp
movq %rax, %r13
movzbl (%r13), %esi
incq %r13
movl %ebp, %edx
shll $0x7, %edx
movl %esi, %ebp
andl $0x7f, %ebp
orl %edx, %ebp
testb %sil, %sil
jns 0x64635
cmpq %r12, %r13
jb 0x64999
jmp 0x64635
xorl %ecx, %ecx
xorl %r15d, %r15d
jmp 0x64d8b
xorl %r14d, %r14d
movl $0x0, %ebx
cmpq %r12, %rdi
jae 0x649e9
movsbl (%rdi), %r14d
testl %r14d, %r14d
js 0x64e85
movl $0x1, %ebx
movl %ebp, 0x34(%rsp)
movl %ebx, %eax
addq %rdi, %rax
movq %r12, %rcx
subq %rax, %rcx
cmpq $0x6, %rcx
jl 0x64a2a
xorl %edx, %edx
xorl %ebp, %ebp
movzbl (%rax,%rdx), %esi
movl %ebp, %ecx
shll $0x7, %ecx
movl %esi, %ebp
andl $0x7f, %ebp
orl %ecx, %ebp
leaq 0x1(%rdx), %rcx
testb %sil, %sil
jns 0x64a23
cmpl $0x5, %edx
movq %rcx, %rdx
jne 0x64a02
addq %rax, %rcx
subl %eax, %ecx
jmp 0x64a41
xorl %ebp, %ebp
cmpq %r12, %rax
jae 0x64a4e
movsbl (%rax), %ebp
testl %ebp, %ebp
js 0x64eb3
movl $0x1, %ecx
cmpl %r13d, %ebp
ja 0x64c3f
addl %ebx, %ecx
movl %ecx, %ebx
movl %ebx, %r11d
addq %rdi, %r11
testb $0x1, %r14b
jne 0x64c46
movq %r8, 0x38(%rsp)
movq %r10, 0x48(%rsp)
leaq 0x70(%rsp), %rdx
movq %rdi, 0x18(%rsp)
movq %r11, %rdi
movq %r12, %rsi
movl %r9d, %r12d
callq 0x64ee9
movl %eax, %r13d
addl %ebx, %r13d
shrl %r14d
movl %r12d, 0x5c(%rsp)
movl %r12d, %edi
xorl %esi, %esi
callq 0x6515c
movq 0x18(%rsp), %rcx
leaq (%rcx,%r13), %rdi
movl %r15d, %esi
subl %r13d, %esi
xorl %edx, %edx
movl %r14d, %ecx
callq *%rax
xorl %ecx, %ecx
testq %rax, %rax
je 0x64d81
movq %rax, %r11
movl 0x70(%rsp), %r12d
movq %rax, %rcx
movl %r13d, %ebx
movq 0x18(%rsp), %rdi
movq 0x48(%rsp), %r10
movq 0x38(%rsp), %r8
movl 0x5c(%rsp), %r9d
jmp 0x64c58
movl %r13d, %eax
addq %rax, %rbx
cmpq 0x10(%rsp), %rbx
ja 0x64b98
movl %ebp, %edi
callq 0x4680
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x64b98
xorl %r12d, %r12d
movl 0x870(%rsp,%r12,4), %r14d
movl %r14d, 0x58(%rsp)
movl %ebx, %esi
subl %r13d, %esi
jb 0x64e0f
movl %r13d, %edi
addq %r15, %rdi
movl 0x470(%rsp,%r12,4), %edx
addq 0x10(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0x6457f
testq %rax, %rax
je 0x64e0f
cmpl %r14d, 0x58(%rsp)
jne 0x64e0f
addl 0x70(%rsp,%r12,4), %r13d
incq %r12
cmpq %r12, 0x18(%rsp)
jne 0x64b09
leaq 0x470(%rsp), %r8
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
movl %ebp, %edx
movl 0x28(%rsp), %ecx
callq 0x64f74
movq %r14, %rdi
callq 0x45c0
movq 0x40(%rsp), %rax
movl %ebp, (%rax)
jmp 0x64da5
movq 0x8(%rsp), %rdi
jmp 0x64d9e
xorl %r13d, %r13d
movq %rdi, %r15
movzbl (%r15), %eax
incq %r15
movl %r13d, %edx
shll $0x7, %edx
movl %eax, %r13d
andl $0x7f, %r13d
orl %edx, %r13d
testb %al, %al
jns 0x645f5
cmpq %r12, %r15
jb 0x64ba8
jmp 0x645f5
movq %rax, 0x38(%rsp)
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rcx
movaps %xmm0, (%rcx)
leaq 0x54(%rsp), %r8
movl $0x0, (%r8)
movq 0x18(%rsp), %rdi
movl %r15d, %esi
movq 0x28(%rsp), %rdx
callq 0x6189d
testb %al, %al
je 0x64e08
movq %r14, 0x10(%rsp)
movl %ebp, 0x34(%rsp)
movq %rbx, 0x20(%rsp)
movzbl %al, %ebx
movq 0x18(%rsp), %rdi
addq %rbx, %rdi
leaq 0x70(%rsp), %r14
movq %rdi, %rbp
movq %r12, %rsi
movq %r14, %rdx
callq 0x64ee9
movl (%r14), %ecx
cmpl %r13d, %ecx
jbe 0x64e23
xorl %ecx, %ecx
jmp 0x64d81
shrl %r14d
subq %r11, %r12
cmpq %r14, %r12
cmovgel %r14d, %r12d
xorl %ecx, %ecx
movl %r12d, %r14d
addl %ebx, %r12d
subl %r12d, %r15d
jb 0x64d81
movl %r12d, %eax
addq %rax, %rdi
movl %ebp, %r13d
movq 0x20(%rsp), %rbx
movl 0x34(%rsp), %ebp
testl %r15d, %r15d
je 0x64cd5
movq %r8, 0x38(%rsp)
testb $0x20, %bpl
jne 0x64d6e
movl %ebp, %esi
andl $0x1, %esi
movq %rdi, %r12
movl %r9d, %edi
movq %r10, 0x48(%rsp)
movq %rcx, 0x20(%rsp)
movq %r11, 0x18(%rsp)
callq 0x6515c
movq %r12, %rdi
movl %r15d, %esi
movq 0x38(%rsp), %rdx
movl %r13d, %ecx
callq *%rax
movq 0x18(%rsp), %r11
movq 0x20(%rsp), %rcx
movq 0x48(%rsp), %r10
movq %rax, %r8
testq %rax, %rax
jne 0x64cd8
jmp 0x64d81
xorl %r13d, %r13d
testb $0x40, %bpl
je 0x64d5a
testl %r14d, %r14d
je 0x64d81
movq 0x40(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x70(%rsp)
movzbl (%r11), %eax
testl %eax, %eax
movl $0x100, %r9d            # imm = 0x100
cmovnel %eax, %r9d
cmpl %r9d, %r14d
jbe 0x64d81
movl %r9d, %eax
notl %eax
movl %r13d, %esi
movq %rcx, %r15
movl %r9d, %ecx
leaq (%r11,%rcx), %rdx
incq %rdx
incq %r11
addl %eax, %r14d
leaq 0x70(%rsp), %rax
movq %r8, %rdi
movq %r14, %rcx
movq %r11, %r8
pushq %rax
pushq %r10
movq %r10, %r14
callq 0x7adbb
movq %r15, %rcx
addq $0x10, %rsp
testq %rax, %rax
je 0x64d81
movl 0x70(%rsp), %r13d
movq %rcx, %rdi
callq 0x45c0
movq %r14, %r10
xorl %ecx, %ecx
testb %bpl, %bpl
movq 0x40(%rsp), %r14
js 0x64dba
movq 0x8(%rsp), %r15
jmp 0x64df6
cmpl %r15d, %r13d
movq 0x40(%rsp), %rax
ja 0x64d81
cmpl (%rax), %r13d
jbe 0x64e50
movq 0x10(%rsp), %r14
movq 0x8(%rsp), %r15
movq %rcx, %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq %r15, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0xc78, %rsp            # imm = 0xC78
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, %rbp
movl 0x54(%rsp), %r8d
cmpl $0x1, %r8d
movl %r13d, %esi
movq 0x28(%rsp), %r12
cmoveq %rsi, %r12
leaq 0x60(%rsp), %r9
movq %r10, %rdi
movq %rbx, %rdx
movq %r12, %rcx
callq 0x61913
testq %rax, %rax
movq 0x8(%rsp), %r15
je 0x64edc
movl %r12d, %r13d
testq %r15, %r15
je 0x64e03
movq %r15, %rdi
callq 0x45c0
movl %r13d, (%r14)
jmp 0x64da5
xorl %ecx, %ecx
jmp 0x64d86
movq 0x8(%rsp), %rdi
callq 0x45c0
movq 0x10(%rsp), %rdi
jmp 0x64d9e
cltq
movq %rbp, %rdi
addq %rax, %rdi
addl %ebx, %eax
subl %eax, %r15d
movq 0x8(%rsp), %r10
movl %ecx, %r13d
movq 0x20(%rsp), %rbx
movl 0x34(%rsp), %ebp
movq 0x10(%rsp), %r14
movq 0x38(%rsp), %r8
jmp 0x648e8
movl %r13d, %edx
movq %rdi, %rsi
movq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r10, 0x48(%rsp)
movq %rcx, %r15
movq %r11, 0x18(%rsp)
callq 0x43c0
movq 0x18(%rsp), %r11
movq %r15, %rcx
movq %r12, %r8
movq 0x48(%rsp), %r10
jmp 0x64cd8
xorl %r14d, %r14d
movq %rdi, %rbx
movzbl (%rbx), %eax
incq %rbx
movl %r14d, %ecx
shll $0x7, %ecx
movl %eax, %r14d
andl $0x7f, %r14d
orl %ecx, %r14d
testb %al, %al
jns 0x6493d
cmpq %r12, %rbx
jb 0x64e8b
jmp 0x6493d
xorl %ebp, %ebp
movq %rax, %rcx
movzbl (%rcx), %edx
incq %rcx
movl %ebp, %esi
shll $0x7, %esi
movl %edx, %ebp
andl $0x7f, %ebp
orl %esi, %ebp
testb %dl, %dl
jns 0x64a26
cmpq %r12, %rcx
jb 0x64eb8
jmp 0x64a26
movq 0x10(%rsp), %r14
movq %rbp, %rcx
jmp 0x64d8b