// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/fqzcomp_qual.c
// Function: compress_block_fqz2f
static
unsigned char *compress_block_fqz2f(int vers,
                                    int strat,
                                    fqz_slice *s,
                                    unsigned char *in,
                                    size_t in_size,
                                    size_t *out_size,
                                    fqz_gparams *gp) {
    fqz_gparams local_gp;
    int free_params = 0;

    unsigned int last = 0;
    size_t i, j;
    ssize_t rec = 0;

    int comp_idx = 0;
    RangeCoder rc;

    // Pick and store params
    if (!gp) {
        gp = &local_gp;
        if (fqz_pick_parameters(gp, vers, strat, s, in, in_size) < 0)
            return NULL;
        free_params = 1;
    }

    // Worst case scenario assuming random input data and no way to compress
    // is NBytes*growth for some small growth factor (arith_dynamic uses 1.05),
    // plus fixed overheads for the header / params.  Growth can be high
    // here as we're modelling things and pathological cases may trigger a
    // bad probability model.
    //
    // Per read is 4-byte len if not fixed length (but less if avg smaller)
    //             up to 1 byte for selection state (log2(max_sel) bits)
    //             1-bit for reverse flag
    //             1-bit for dup-last flag (but then no quals)
    // Per qual is 1-byte (assuming QMAX==256)
    //
    // Header size is total guess, as depends on params, but it's almost
    // always tiny, so a few K extra should be sufficient.
    //
    // => Total of (s->num_records*4.25 + in_size)*growth + hdr
    int sel_bits = 0, sel = gp->max_sel;
    while (sel) {
        sel_bits++;
        sel >>= 1;
    }
    double len_sz = gp->p[0].fixed_len ? 0.25 : 4.25;
    len_sz += sel_bits / 8.0;
    size_t comp_sz = (s->num_records*len_sz + in_size)*1.1 + 10000;

    unsigned char *comp = (unsigned char *)malloc(comp_sz);
    unsigned char *compe = comp + (size_t)comp_sz;
    if (!comp)
        return NULL;

    //dump_params(gp);
    comp_idx = var_put_u32(comp, compe, in_size);
    comp_idx += fqz_store_parameters(gp, comp+comp_idx);

    fqz_param *pm;

    // Optimise tables to remove shifts in loop (NB: cannot do this in next vers)
    for (j = 0; j < gp->nparam; j++) {
        pm = &gp->p[j];

        for (i = 0; i < 1024; i++)
            pm->ptab[i] <<= pm->ploc;

        for (i = 0; i < 256; i++)
            pm->dtab[i] <<= pm->dloc;
    }

    // Create models and initialise range coder
    fqz_model model;
    if (fqz_create_models(&model, gp) < 0)
        return NULL;

    RC_SetOutput(&rc, (char *)comp+comp_idx);
    RC_SetOutputEnd(&rc, (char *)comp+comp_sz);
    RC_StartEncode(&rc);

    // For CRAM3.1, reverse upfront if needed
    pm = &gp->p[0];
    if (gp->gflags & GFLAG_DO_REV) {
        i = rec = j = 0;
        while (i < in_size) {
            int len = rec < s->num_records-1
                ? s->len[rec] : in_size - i;

            if (s->flags[rec] & FQZ_FREVERSE) {
                // Reverse complement sequence - note: modifies buffer
                int I,J;
                unsigned char *cp = in+i;
                for (I = 0, J = len-1; I < J; I++, J--) {
                    unsigned char c;
                    c = cp[I];
                    cp[I] = cp[J];
                    cp[J] = c;
                }
            }

            i += len;
            rec++;
        }
        rec = 0;
    }

    fqz_state state = {0};
    pm = &gp->p[0];
    state.p = 0;
    state.first_len = 1;
    state.last_len = 0;
    state.rec = rec;

    for (i = 0; i < in_size; i++) {
        if (state.p == 0) {
            if (state.rec >= s->num_records || s->len[state.rec] <= 0) {
                free(comp);
                comp = NULL;
                goto err;
            }

            if (compress_new_read(s, &state, gp, pm, &model, &rc,
                                  in, &i, /*&rec,*/ &last))
                continue;
        }

#if 0
        //                        fqz_qual_stats imp.
        // q40 6.876  6.852       5.96
        // q4  6.566              5.07
        // _Q  1.383              1.11
        unsigned char q = in[i];
        unsigned char qm = pm->qmap[q];

        SIMPLE_MODEL(QMAX,_encodeSymbol)(&model.qual[last], &rc, qm);
        last = fqz_update_ctx(pm, &state, qm);
#else
        //     gcc    clang            gcc+fqz_qual_stats imp.
        // q40 5.033  5.026     -27%   4.137 -38%
        // q4  5.595            -15%   4.011 -36%
        // _Q  1.225            -11%   0.956
        int j = -1;

        while (state.p >= 4 && i+j+4 < in_size) {
            int l1 = last, l2, l3, l4;
            // Model has symbols sorted by frequency, so most common are at
            // start.  So while model is approx 1Kb, the first cache line is
            // a big win.
            mm_prefetch(&model.qual[l1]);
            unsigned char qm1 = pm->qmap[in[i + ++j]];
            last = fqz_update_ctx(pm, &state, qm1); l2 = last;

            mm_prefetch(&model.qual[l2]);
            unsigned char qm2 = pm->qmap[in[i + ++j]];
            last = fqz_update_ctx(pm, &state, qm2); l3 = last;

            mm_prefetch(&model.qual[l3]);
            unsigned char qm3 = pm->qmap[in[i + ++j]];
            last = fqz_update_ctx(pm, &state, qm3); l4 = last;

            mm_prefetch(&model.qual[l4]);
            unsigned char qm4 = pm->qmap[in[i + ++j]];
            last = fqz_update_ctx(pm, &state, qm4);

            SIMPLE_MODEL(QMAX,_encodeSymbol)(&model.qual[l1], &rc, qm1);
            SIMPLE_MODEL(QMAX,_encodeSymbol)(&model.qual[l2], &rc, qm2);
            SIMPLE_MODEL(QMAX,_encodeSymbol)(&model.qual[l3], &rc, qm3);
            SIMPLE_MODEL(QMAX,_encodeSymbol)(&model.qual[l4], &rc, qm4);
        }

        while (state.p > 0) {
            int l2 = last;
            mm_prefetch(&model.qual[last]);
            unsigned char qm = pm->qmap[in[i + ++j]];
            last = fqz_update_ctx(pm, &state, qm);
            SIMPLE_MODEL(QMAX,_encodeSymbol)(&model.qual[l2], &rc, qm);
        }
        i += j;
#endif
    }

    if (RC_FinishEncode(&rc) < 0) {
        free(comp);
        comp = NULL;
        *out_size = 0;
        goto err;
    }

    // For CRAM3.1, undo our earlier reversal step
    rec = state.rec;
    if (gp->gflags & GFLAG_DO_REV) {
        i = rec = j = 0;
        while (i < in_size) {
            int len = rec < s->num_records-1
                ? s->len[rec]
                : in_size - i;

            if (s->flags[rec] & FQZ_FREVERSE) {
                // Reverse complement sequence - note: modifies buffer
                int I,J;
                unsigned char *cp = in+i;
                for (I = 0, J = len-1; I < J; I++, J--) {
                    unsigned char c;
                    c = cp[I];
                    cp[I] = cp[J];
                    cp[J] = c;
                }
            }

            i += len;
            rec++;
        }
    }

    // Clear selector abuse of flags
    for (rec = 0; rec < s->num_records; rec++)
        s->flags[rec] &= 0xffff;

    *out_size = comp_idx + RC_OutSize(&rc);
    //fprintf(stderr, "%d -> %d\n", (int)in_size, (int)*out_size);

 err:
    fqz_destroy_models(&model);
    if (free_params)
        fqz_free_parameters(gp);

    return comp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a50, %rsp           # imm = 0x1A50
movq 0x10(%rbp), %rax
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x454(%rbp)
movl $0x0, -0x458(%rbp)
movq $0x0, -0x470(%rbp)
movl $0x0, -0x474(%rbp)
cmpq $0x0, 0x10(%rbp)
jne 0x88267
leaq -0x450(%rbp), %rax
movq %rax, 0x10(%rbp)
movq 0x10(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
callq 0x89750
cmpl $0x0, %eax
jge 0x8825d
movq $0x0, -0x8(%rbp)
jmp 0x88ea4
movl $0x1, -0x454(%rbp)
movl $0x0, -0x4bc(%rbp)
movq 0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x4c0(%rbp)
cmpl $0x0, -0x4c0(%rbp)
je 0x882a6
movl -0x4bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4bc(%rbp)
movl -0x4c0(%rbp), %eax
sarl %eax
movl %eax, -0x4c0(%rbp)
jmp 0x8827e
movq 0x10(%rbp), %rax
movq 0x418(%rax), %rax
movl 0x14(%rax), %eax
testl %eax, %eax
setne %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x6dfcb(%rip), %rax     # 0xf6290
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x4c8(%rbp)
cvtsi2sdl -0x4bc(%rbp), %xmm1
movsd 0x6df96(%rip), %xmm0    # 0xf6278
mulsd %xmm0, %xmm1
movsd -0x4c8(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x4c8(%rbp)
movq -0x18(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
movsd -0x4c8(%rbp), %xmm2
movaps 0x675ef(%rip), %xmm3    # 0xef900
movq -0x28(%rbp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
movapd 0x675ee(%rip), %xmm3    # 0xef910
subpd %xmm3, %xmm1
movaps %xmm1, %xmm3
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x6df3f(%rip), %xmm1    # 0xf6280
mulsd %xmm1, %xmm0
movsd 0x666a3(%rip), %xmm1    # 0xee9f0
addsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x67578(%rip), %xmm1    # 0xef8e0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x4d0(%rbp)
movq -0x4d0(%rbp), %rdi
callq 0x4650
movq %rax, -0x4d8(%rbp)
movq -0x4d8(%rbp), %rax
addq -0x4d0(%rbp), %rax
movq %rax, -0x4e0(%rbp)
cmpq $0x0, -0x4d8(%rbp)
jne 0x883bd
movq $0x0, -0x8(%rbp)
jmp 0x88ea4
movq -0x4d8(%rbp), %rdi
movq -0x4e0(%rbp), %rsi
movq -0x28(%rbp), %rax
movl %eax, %edx
callq 0x8a330
movl %eax, -0x474(%rbp)
movq 0x10(%rbp), %rdi
movq -0x4d8(%rbp), %rsi
movslq -0x474(%rbp), %rax
addq %rax, %rsi
callq 0x8a5a0
addl -0x474(%rbp), %eax
movl %eax, -0x474(%rbp)
movq $0x0, -0x468(%rbp)
movq -0x468(%rbp), %rax
movq 0x10(%rbp), %rcx
movslq 0x8(%rcx), %rcx
cmpq %rcx, %rax
jae 0x88522
movq 0x10(%rbp), %rax
movq 0x418(%rax), %rax
imulq $0x1c64, -0x468(%rbp), %rcx # imm = 0x1C64
addq %rcx, %rax
movq %rax, -0x4e8(%rbp)
movq $0x0, -0x460(%rbp)
cmpq $0x400, -0x460(%rbp) # imm = 0x400
jae 0x884a7
movq -0x4e8(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x4e8(%rbp), %rax
movq -0x460(%rbp), %rdx
movq %rdx, -0x1a10(%rbp)
movl 0x848(%rax,%rdx,4), %edx
shll %cl, %edx
movq -0x1a10(%rbp), %rcx
movl %edx, 0x848(%rax,%rcx,4)
movq -0x460(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x460(%rbp)
jmp 0x88450
movq $0x0, -0x460(%rbp)
cmpq $0x100, -0x460(%rbp) # imm = 0x100
jae 0x88509
movq -0x4e8(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x4e8(%rbp), %rax
movq -0x460(%rbp), %rdx
movq %rdx, -0x1a18(%rbp)
movl 0x1848(%rax,%rdx,4), %edx
shll %cl, %edx
movq -0x1a18(%rbp), %rcx
movl %edx, 0x1848(%rax,%rcx,4)
movq -0x460(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x460(%rbp)
jmp 0x884b2
jmp 0x8850b
movq -0x468(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x468(%rbp)
jmp 0x8840d
movq 0x10(%rbp), %rsi
leaq -0x1970(%rbp), %rdi
callq 0x8a6d0
cmpl $0x0, %eax
jge 0x88544
movq $0x0, -0x8(%rbp)
jmp 0x88ea4
movq -0x4d8(%rbp), %rsi
movslq -0x474(%rbp), %rax
addq %rax, %rsi
leaq -0x4b8(%rbp), %rdi
callq 0x8a7e0
movq -0x4d8(%rbp), %rsi
addq -0x4d0(%rbp), %rsi
leaq -0x4b8(%rbp), %rdi
callq 0x8a810
leaq -0x4b8(%rbp), %rdi
callq 0x8a830
movq 0x10(%rbp), %rax
movq 0x418(%rax), %rax
movq %rax, -0x4e8(%rbp)
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x88730
movq $0x0, -0x468(%rbp)
movq $0x0, -0x470(%rbp)
movq $0x0, -0x460(%rbp)
movq -0x460(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x88725
movq -0x470(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x88611
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x470(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, -0x1a20(%rbp)
jmp 0x88623
movq -0x28(%rbp), %rax
subq -0x460(%rbp), %rax
movq %rax, -0x1a20(%rbp)
movq -0x1a20(%rbp), %rax
movl %eax, -0x1974(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x470(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x886f9
movq -0x20(%rbp), %rax
addq -0x460(%rbp), %rax
movq %rax, -0x1988(%rbp)
movl $0x0, -0x1978(%rbp)
movl -0x1974(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x197c(%rbp)
movl -0x1978(%rbp), %eax
cmpl -0x197c(%rbp), %eax
jge 0x886f7
movq -0x1988(%rbp), %rax
movslq -0x1978(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x1989(%rbp)
movq -0x1988(%rbp), %rax
movslq -0x197c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x1988(%rbp), %rax
movslq -0x1978(%rbp), %rcx
movb %dl, (%rax,%rcx)
movb -0x1989(%rbp), %dl
movq -0x1988(%rbp), %rax
movslq -0x197c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x1978(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1978(%rbp)
movl -0x197c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x197c(%rbp)
jmp 0x88679
jmp 0x886f9
movslq -0x1974(%rbp), %rax
addq -0x460(%rbp), %rax
movq %rax, -0x460(%rbp)
movq -0x470(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x470(%rbp)
jmp 0x885cd
movq $0x0, -0x470(%rbp)
leaq -0x19c8(%rbp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x4250
movq 0x10(%rbp), %rax
movq 0x418(%rax), %rax
movq %rax, -0x4e8(%rbp)
movl $0x0, -0x19c4(%rbp)
movl $0x1, -0x19ac(%rbp)
movl $0x0, -0x19a8(%rbp)
movq -0x470(%rbp), %rax
movq %rax, -0x19a0(%rbp)
movq $0x0, -0x460(%rbp)
movq -0x460(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x88c2f
cmpl $0x0, -0x19c4(%rbp)
jne 0x88843
movq -0x19a0(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jge 0x887d2
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x19a0(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
ja 0x887ee
movq -0x4d8(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x4d8(%rbp)
jmp 0x88e7b
movq -0x18(%rbp), %rdi
movq 0x10(%rbp), %rdx
movq -0x4e8(%rbp), %rcx
movq -0x20(%rbp), %r11
leaq -0x19c8(%rbp), %rsi
leaq -0x1970(%rbp), %r8
leaq -0x4b8(%rbp), %r9
leaq -0x460(%rbp), %r10
leaq -0x458(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x8a890
cmpl $0x0, %eax
je 0x88841
jmp 0x88c18
jmp 0x88843
movl $0xffffffff, -0x19cc(%rbp) # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $0x4, -0x19c4(%rbp)
movb %al, -0x1a21(%rbp)
jb 0x88880
movq -0x460(%rbp), %rax
movslq -0x19cc(%rbp), %rcx
addq %rcx, %rax
addq $0x4, %rax
cmpq -0x28(%rbp), %rax
setb %al
movb %al, -0x1a21(%rbp)
movb -0x1a21(%rbp), %al
testb $0x1, %al
jne 0x8888f
jmp 0x88b44
movl -0x458(%rbp), %eax
movl %eax, -0x19d0(%rbp)
movq -0x1970(%rbp), %rdi
movslq -0x19d0(%rbp), %rax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
callq 0x8ac00
movq -0x4e8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x460(%rbp), %rdx
movl -0x19cc(%rbp), %esi
addl $0x1, %esi
movl %esi, -0x19cc(%rbp)
movslq %esi, %rsi
addq %rsi, %rdx
movzbl (%rcx,%rdx), %ecx
movl 0x48(%rax,%rcx,4), %eax
movb %al, -0x19dd(%rbp)
movq -0x4e8(%rbp), %rdi
movzbl -0x19dd(%rbp), %edx
leaq -0x19c8(%rbp), %rsi
callq 0x8ac10
movl %eax, -0x458(%rbp)
movl -0x458(%rbp), %eax
movl %eax, -0x19d4(%rbp)
movq -0x1970(%rbp), %rdi
movslq -0x19d4(%rbp), %rax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
callq 0x8ac00
movq -0x4e8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x460(%rbp), %rdx
movl -0x19cc(%rbp), %esi
addl $0x1, %esi
movl %esi, -0x19cc(%rbp)
movslq %esi, %rsi
addq %rsi, %rdx
movzbl (%rcx,%rdx), %ecx
movl 0x48(%rax,%rcx,4), %eax
movb %al, -0x19de(%rbp)
movq -0x4e8(%rbp), %rdi
movzbl -0x19de(%rbp), %edx
leaq -0x19c8(%rbp), %rsi
callq 0x8ac10
movl %eax, -0x458(%rbp)
movl -0x458(%rbp), %eax
movl %eax, -0x19d8(%rbp)
movq -0x1970(%rbp), %rdi
movslq -0x19d8(%rbp), %rax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
callq 0x8ac00
movq -0x4e8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x460(%rbp), %rdx
movl -0x19cc(%rbp), %esi
addl $0x1, %esi
movl %esi, -0x19cc(%rbp)
movslq %esi, %rsi
addq %rsi, %rdx
movzbl (%rcx,%rdx), %ecx
movl 0x48(%rax,%rcx,4), %eax
movb %al, -0x19df(%rbp)
movq -0x4e8(%rbp), %rdi
movzbl -0x19df(%rbp), %edx
leaq -0x19c8(%rbp), %rsi
callq 0x8ac10
movl %eax, -0x458(%rbp)
movl -0x458(%rbp), %eax
movl %eax, -0x19dc(%rbp)
movq -0x1970(%rbp), %rdi
movslq -0x19dc(%rbp), %rax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
callq 0x8ac00
movq -0x4e8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x460(%rbp), %rdx
movl -0x19cc(%rbp), %esi
addl $0x1, %esi
movl %esi, -0x19cc(%rbp)
movslq %esi, %rsi
addq %rsi, %rdx
movzbl (%rcx,%rdx), %ecx
movl 0x48(%rax,%rcx,4), %eax
movb %al, -0x19e0(%rbp)
movq -0x4e8(%rbp), %rdi
movzbl -0x19e0(%rbp), %edx
leaq -0x19c8(%rbp), %rsi
callq 0x8ac10
movl %eax, -0x458(%rbp)
movq -0x1970(%rbp), %rdi
movslq -0x19d0(%rbp), %rax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
movzbl -0x19dd(%rbp), %eax
leaq -0x4b8(%rbp), %rsi
movzwl %ax, %edx
callq 0x8ad50
movq -0x1970(%rbp), %rdi
movslq -0x19d4(%rbp), %rax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
movzbl -0x19de(%rbp), %eax
leaq -0x4b8(%rbp), %rsi
movzwl %ax, %edx
callq 0x8ad50
movq -0x1970(%rbp), %rdi
movslq -0x19d8(%rbp), %rax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
movzbl -0x19df(%rbp), %eax
leaq -0x4b8(%rbp), %rsi
movzwl %ax, %edx
callq 0x8ad50
movq -0x1970(%rbp), %rdi
movslq -0x19dc(%rbp), %rax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
movzbl -0x19e0(%rbp), %eax
leaq -0x4b8(%rbp), %rsi
movzwl %ax, %edx
callq 0x8ad50
jmp 0x8884d
jmp 0x88b46
cmpl $0x0, -0x19c4(%rbp)
jbe 0x88c03
movl -0x458(%rbp), %eax
movl %eax, -0x19e4(%rbp)
movq -0x1970(%rbp), %rdi
movl -0x458(%rbp), %eax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
callq 0x8ac00
movq -0x4e8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x460(%rbp), %rdx
movl -0x19cc(%rbp), %esi
addl $0x1, %esi
movl %esi, -0x19cc(%rbp)
movslq %esi, %rsi
addq %rsi, %rdx
movzbl (%rcx,%rdx), %ecx
movl 0x48(%rax,%rcx,4), %eax
movb %al, -0x19e5(%rbp)
movq -0x4e8(%rbp), %rdi
movzbl -0x19e5(%rbp), %edx
leaq -0x19c8(%rbp), %rsi
callq 0x8ac10
movl %eax, -0x458(%rbp)
movq -0x1970(%rbp), %rdi
movslq -0x19e4(%rbp), %rax
imulq $0x410, %rax, %rax      # imm = 0x410
addq %rax, %rdi
movzbl -0x19e5(%rbp), %eax
leaq -0x4b8(%rbp), %rsi
movzwl %ax, %edx
callq 0x8ad50
jmp 0x88b46
movslq -0x19cc(%rbp), %rax
addq -0x460(%rbp), %rax
movq %rax, -0x460(%rbp)
movq -0x460(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x460(%rbp)
jmp 0x8878c
leaq -0x4b8(%rbp), %rdi
callq 0x8ae30
cmpl $0x0, %eax
jge 0x88c67
movq -0x4d8(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x4d8(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
jmp 0x88e7b
movq -0x19a0(%rbp), %rax
movq %rax, -0x470(%rbp)
movq 0x10(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x88e03
movq $0x0, -0x468(%rbp)
movq $0x0, -0x470(%rbp)
movq $0x0, -0x460(%rbp)
movq -0x460(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x88e01
movq -0x470(%rbp), %rax
movq -0x18(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x88ced
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x470(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, -0x1a30(%rbp)
jmp 0x88cff
movq -0x28(%rbp), %rax
subq -0x460(%rbp), %rax
movq %rax, -0x1a30(%rbp)
movq -0x1a30(%rbp), %rax
movl %eax, -0x19ec(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x470(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x88dd5
movq -0x20(%rbp), %rax
addq -0x460(%rbp), %rax
movq %rax, -0x1a00(%rbp)
movl $0x0, -0x19f0(%rbp)
movl -0x19ec(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x19f4(%rbp)
movl -0x19f0(%rbp), %eax
cmpl -0x19f4(%rbp), %eax
jge 0x88dd3
movq -0x1a00(%rbp), %rax
movslq -0x19f0(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x1a01(%rbp)
movq -0x1a00(%rbp), %rax
movslq -0x19f4(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x1a00(%rbp), %rax
movslq -0x19f0(%rbp), %rcx
movb %dl, (%rax,%rcx)
movb -0x1a01(%rbp), %dl
movq -0x1a00(%rbp), %rax
movslq -0x19f4(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x19f0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x19f0(%rbp)
movl -0x19f4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x19f4(%rbp)
jmp 0x88d55
jmp 0x88dd5
movslq -0x19ec(%rbp), %rax
addq -0x460(%rbp), %rax
movq %rax, -0x460(%rbp)
movq -0x470(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x470(%rbp)
jmp 0x88ca9
jmp 0x88e03
movq $0x0, -0x470(%rbp)
movq -0x470(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jge 0x88e50
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x470(%rbp), %rcx
movl (%rax,%rcx,4), %edx
andl $0xffff, %edx           # imm = 0xFFFF
movl %edx, (%rax,%rcx,4)
movq -0x470(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x470(%rbp)
jmp 0x88e0e
movslq -0x474(%rbp), %rax
movq %rax, -0x1a38(%rbp)
leaq -0x4b8(%rbp), %rdi
callq 0x8ae70
movq -0x1a38(%rbp), %rcx
addq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
leaq -0x1970(%rbp), %rdi
callq 0x8ae90
cmpl $0x0, -0x454(%rbp)
je 0x88e99
movq 0x10(%rbp), %rdi
callq 0x8aeb0
movq -0x4d8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1a50, %rsp           # imm = 0x1A50
popq %rbp
retq
nopw %cs:(%rax,%rax)