// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/tokenise_name3.c
// Function: tok3_encode_names
uint8_t *tok3_encode_names(char *blk, int len, int level, int use_arith,
                           int *out_len, int *last_start_p) {
    int last_start = 0, i, j, nreads;

    if (len < 0) {
        *out_len = 0;
        return NULL;
    }

    // Count lines
    for (nreads = i = 0; i < len; i++)
        if (blk[i] <= '\n') // \n or \0 separated entries
            nreads++;

    name_context *ctx = create_context(nreads);
    if (!ctx)
        return NULL;

    // Construct trie
    int ctr = 0;
    for (i = j = 0; i < len; j=++i) {
        while (i < len && blk[i] > '\n')
            i++;
        if (i >= len)
            break;

        //blk[i] = '\0';
        last_start = i+1;
        if (build_trie(ctx, &blk[j], i-j, ctr++) < 0) {
            free_context(ctx);
            return NULL;
        }
    }
    if (last_start_p)
        *last_start_p = last_start;

    //fprintf(stderr, "Processed %d of %d in block, line %d\n", last_start, len, ctr);

    // Encode name
    for (i = j = 0; i < len; j=++i) {
        while (i < len && (signed char)blk[i] >= ' ') // non-ASCII check
            i++;
        if (i >= len)
            break;

        if (blk[i] != '\0' && blk[i] != '\n') {
            // Names must be 7-bit ASCII printable
            free_context(ctx);
            return NULL;
        }

        blk[i] = '\0';
        // try both 0 and 1 and pick best?
        if (encode_name(ctx, &blk[j], i-j, 1) < 0) {
            free_context(ctx);
            return NULL;
        }
    }

#if 0
    for (i = 0; i < ctx->max_tok*16; i++) {
        char fn[1024];
        if (!ctx->desc[i].buf_l) continue;
        sprintf(fn, "_tok.%02d_%02d.%d", i>>4,i&15,i);
        FILE *fp = fopen(fn, "w");
        fwrite(ctx->desc[i].buf, 1, ctx->desc[i].buf_l, fp);
        fclose(fp);
    }
#endif

    //dump_trie(t_head, 0);

    // FIXME: merge descriptors
    //
    // If we see foo7:1 foo7:12 foo7:7 etc then foo: is constant,
    // but it's encoded as alpha<foo>+dig<7>+char<:> instead of alpha<foo7:>.
    // Any time token type 0 is all match beyond the first location we have
    // a candidate for merging in string form.
    //
    // This saves around .1 to 1.3 percent on varying data sets.
    // Cruder hack is dedicated prefix/suffix matching to short-cut this.


    // Drop N_TYPE blocks if they all contain matches bar the first item,
    // as we can regenerate these from the subsequent blocks types during
    // decode.
    for (i = 0; i < ctx->max_tok*16; i+=16) {
        if (!ctx->desc[i].buf_l) continue;

        int z;
        for (z=1; z<ctx->desc[i].buf_l; z++) {
            if (ctx->desc[i].buf[z] != N_MATCH)
                break;
        }
        if (z == ctx->desc[i].buf_l) {
            int k;
            for (k=1; k<16; k++)
                if (ctx->desc[i+k].buf_l)
                    break;

            if (k < 16) {
                ctx->desc[i].buf_l = 0;
                free(ctx->desc[i].buf);
                ctx->desc[i].buf = NULL;
            }
        }
    }

    // Serialise descriptors
    uint32_t tot_size = 9;
    for (i = 0; i < ctx->max_tok*16; i++) {
        if (!ctx->desc[i].buf_l) continue;

        int tnum = i>>4;
        int ttype = i&15;

        uint64_t out_len = 1.5 * arith_compress_bound(ctx->desc[i].buf_l, 1); // guesswork
        uint8_t *out = malloc(out_len);
        if (!out) {
            free_context(ctx);
            return NULL;
        }

        if (compress(ctx->desc[i].buf, ctx->desc[i].buf_l, i&0xf, level,
                     use_arith, out, &out_len) < 0) {
            free_context(ctx);
            free(out);
            return NULL;
        }

        free(ctx->desc[i].buf);
        ctx->desc[i].buf = out;
        ctx->desc[i].buf_l = out_len;
        ctx->desc[i].tnum = tnum;
        ctx->desc[i].ttype = ttype;

        // Find dups
        int j;
        for (j = 0; j < i; j++) {
            if (!ctx->desc[j].buf)
                continue;
            if (ctx->desc[i].buf_l != ctx->desc[j].buf_l || ctx->desc[i].buf_l <= 4)
                continue;
            if (memcmp(ctx->desc[i].buf, ctx->desc[j].buf, ctx->desc[i].buf_l) == 0)
                break;
        }
        if (j < i) {
            ctx->desc[i].dup_from = j;
            tot_size += 3; // flag, dup_from, ttype
        } else {
            ctx->desc[i].dup_from = -1;
            tot_size += out_len + 1; // ttype
        }
    }

#if 0
    for (i = 0; i < ctx->max_tok*16; i++) {
        char fn[1024];
        if (!ctx->desc[i].buf_l && ctx->desc[i].dup_from == -1) continue;
        sprintf(fn, "_tok.%02d_%02d.%d.comp", i>>4,i&15,i);
        FILE *fp = fopen(fn, "w");
        fwrite(ctx->desc[i].buf, 1, ctx->desc[i].buf_l, fp);
        fclose(fp);
    }
#endif

    // Write
    uint8_t *out = malloc(tot_size+13);
    if (!out) {
        free_context(ctx);
        return NULL;
    }

    uint8_t *cp = out;

    *out_len = tot_size;
//    *(uint32_t *)cp = last_start; cp += 4;
//    *(uint32_t *)cp = nreads;     cp += 4;
    *cp++ = (last_start >>  0) & 0xff;
    *cp++ = (last_start >>  8) & 0xff;
    *cp++ = (last_start >> 16) & 0xff;
    *cp++ = (last_start >> 24) & 0xff;
    *cp++ = (nreads     >>  0) & 0xff;
    *cp++ = (nreads     >>  8) & 0xff;
    *cp++ = (nreads     >> 16) & 0xff;
    *cp++ = (nreads     >> 24) & 0xff;
    *cp++ = use_arith;
    //write(1, &nreads, 4);
    int last_tnum = -1;
    for (i = 0; i < ctx->max_tok*16; i++) {
        if (!ctx->desc[i].buf_l) continue;
        uint8_t ttype8 = ctx->desc[i].ttype;
        if (ctx->desc[i].tnum != last_tnum) {
            ttype8 |= 128;
            last_tnum = ctx->desc[i].tnum;
        }
        if (ctx->desc[i].dup_from >= 0) {
            //fprintf(stderr, "Dup %d from %d, sz %d\n", i, ctx->desc[i].dup_from, ctx->desc[i].buf_l);
            *cp++ = ttype8 | 64;
            *cp++ = ctx->desc[i].dup_from >> 4;
            *cp++ = ctx->desc[i].dup_from & 15;
        } else {
            *cp++ = ttype8;
            memcpy(cp, ctx->desc[i].buf, ctx->desc[i].buf_l);
            cp += ctx->desc[i].buf_l;
        }
    }

    //assert(cp-out == tot_size);

    free_context(ctx);

    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0xc8794
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0xc919b
movl $0x0, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xc87d1
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jg 0xc87c4
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xc87c6
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xc87a2
movl -0x40(%rbp), %edi
callq 0xc91b0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xc87f1
movq $0x0, -0x8(%rbp)
jmp 0xc919b
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xc88bc
jmp 0xc8814
movl -0x38(%rbp), %ecx
xorl %eax, %eax
cmpl -0x14(%rbp), %ecx
movb %al, -0x8e(%rbp)
jge 0xc883c
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
setg %al
movb %al, -0x8e(%rbp)
movb -0x8e(%rbp), %al
testb $0x1, %al
jne 0xc8848
jmp 0xc8853
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xc8814
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0xc885d
jmp 0xc88bc
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x3c(%rbp), %rax
addq %rax, %rsi
movl -0x38(%rbp), %eax
subl -0x3c(%rbp), %eax
movslq %eax, %rdx
movl -0x4c(%rbp), %ecx
movl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
callq 0xc9310
cmpl $0x0, %eax
jge 0xc88a9
movq -0x48(%rbp), %rdi
callq 0xc9590
movq $0x0, -0x8(%rbp)
jmp 0xc919b
jmp 0xc88ab
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xc8806
cmpq $0x0, -0x30(%rbp)
je 0xc88cc
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xc89c5
jmp 0xc88e8
movl -0x38(%rbp), %ecx
xorl %eax, %eax
cmpl -0x14(%rbp), %ecx
movb %al, -0x8f(%rbp)
jge 0xc8910
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
setge %al
movb %al, -0x8f(%rbp)
movb -0x8f(%rbp), %al
testb $0x1, %al
jne 0xc891c
jmp 0xc8927
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xc88e8
movl -0x38(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0xc8934
jmp 0xc89c5
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0xc896c
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
je 0xc896c
movq -0x48(%rbp), %rdi
callq 0xc9590
movq $0x0, -0x8(%rbp)
jmp 0xc919b
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x3c(%rbp), %rax
addq %rax, %rsi
movl -0x38(%rbp), %edx
subl -0x3c(%rbp), %edx
movl $0x1, %ecx
callq 0xc9670
cmpl $0x0, %eax
jge 0xc89b2
movq -0x48(%rbp), %rdi
callq 0xc9590
movq $0x0, -0x8(%rbp)
jmp 0xc919b
jmp 0xc89b4
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xc88da
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x48(%rbp), %rcx
movl 0x14420(%rcx), %ecx
shll $0x4, %ecx
cmpl %ecx, %eax
jge 0xc8b1d
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0xc8a03
jmp 0xc8b0f
movl $0x1, -0x50(%rbp)
movslq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
addq $0x20, %rcx
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x10(%rcx), %rax
jae 0xc8a59
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x50(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0xa, %eax
je 0xc8a4c
jmp 0xc8a59
jmp 0xc8a4e
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xc8a0a
movslq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
addq $0x20, %rcx
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x10(%rcx), %rax
jne 0xc8b0d
movl $0x1, -0x54(%rbp)
cmpl $0x10, -0x54(%rbp)
jge 0xc8ab5
movq -0x48(%rbp), %rax
addq $0x20, %rax
movl -0x38(%rbp), %ecx
addl -0x54(%rbp), %ecx
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
je 0xc8aa8
jmp 0xc8ab5
jmp 0xc8aaa
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xc8a81
cmpl $0x10, -0x54(%rbp)
jge 0xc8b0b
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x45a0
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
jmp 0xc8b0d
jmp 0xc8b0f
movl -0x38(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x38(%rbp)
jmp 0xc89cc
movl $0x9, -0x58(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x48(%rbp), %rcx
movl 0x14420(%rcx), %ecx
shll $0x4, %ecx
cmpl %ecx, %eax
jge 0xc8e29
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0xc8b62
jmp 0xc8e1b
movl -0x38(%rbp), %eax
sarl $0x4, %eax
movl %eax, -0x5c(%rbp)
movl -0x38(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movslq -0x38(%rbp), %rcx
leaq (%rcx,%rcx,4), %rcx
movl 0x30(%rax,%rcx,8), %edi
movl $0x1, %esi
callq 0x826c0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0x2b5d3(%rip), %xmm1    # 0xf4170
mulsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x26d28(%rip), %xmm1    # 0xef8e0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x4650
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0xc8bf5
movq -0x48(%rbp), %rdi
callq 0xc9590
movq $0x0, -0x8(%rbp)
jmp 0xc919b
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movl -0x38(%rbp), %edx
andl $0xf, %edx
movl -0x18(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movq -0x70(%rbp), %r9
leaq -0x68(%rbp), %rax
movq %rax, (%rsp)
callq 0xca8a0
cmpl $0x0, %eax
jge 0xc8c64
movq -0x48(%rbp), %rdi
callq 0xc9590
movq -0x70(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x8(%rbp)
jmp 0xc919b
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x45a0
movq -0x70(%rbp), %rcx
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x68(%rbp), %rcx
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl -0x5c(%rbp), %ecx
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movl -0x60(%rbp), %ecx
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xc8dc2
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jne 0xc8d17
jmp 0xc8db4
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
addq $0x20, %rcx
movslq -0x74(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x10(%rcx), %rax
jne 0xc8d61
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x4, 0x10(%rax)
ja 0xc8d63
jmp 0xc8db4
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x74(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdx
callq 0x41c0
cmpl $0x0, %eax
jne 0xc8db2
jmp 0xc8dc2
jmp 0xc8db4
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0xc8ced
movl -0x74(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xc8dee
movl -0x74(%rbp), %ecx
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x20(%rax)
movl -0x58(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x58(%rbp)
jmp 0xc8e19
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
movq -0x68(%rbp), %rcx
addq $0x1, %rcx
movl -0x58(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x58(%rbp)
jmp 0xc8e1b
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xc8b2b
movl -0x58(%rbp), %eax
addl $0xd, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x4650
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0xc8e59
movq -0x48(%rbp), %rdi
callq 0xc9590
movq $0x0, -0x8(%rbp)
jmp 0xc919b
movq -0x80(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x58(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x34(%rbp), %eax
sarl $0x0, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movl -0x34(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movl -0x34(%rbp), %eax
sarl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movl -0x34(%rbp), %eax
sarl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movl -0x40(%rbp), %eax
sarl $0x0, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movl -0x40(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movl -0x40(%rbp), %eax
sarl $0x10, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movl -0x40(%rbp), %eax
sarl $0x18, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movl -0x1c(%rbp), %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movl $0xffffffff, -0x8c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x48(%rbp), %rcx
movl 0x14420(%rcx), %ecx
shll $0x4, %ecx
cmpl %ecx, %eax
jge 0xc918a
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0xc8ff1
jmp 0xc917c
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movb %al, -0x8d(%rbp)
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
cmpl -0x8c(%rbp), %eax
je 0xc9059
movzbl -0x8d(%rbp), %eax
orl $0x80, %eax
movb %al, -0x8d(%rbp)
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x20(%rax)
jl 0xc90ff
movzbl -0x8d(%rbp), %eax
orl $0x40, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
sarl $0x4, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
andl $0xf, %eax
movb %al, %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
jmp 0xc917a
movb -0x8d(%rbp), %cl
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x88(%rbp)
movb %cl, (%rax)
movq -0x88(%rbp), %rdi
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdx
callq 0x43b0
movq -0x48(%rbp), %rax
addq $0x20, %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
addq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0xc917c
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xc8fba
movq -0x48(%rbp), %rdi
callq 0xc9590
movq -0x80(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)