// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/htscodecs/htscodecs/fqzcomp_qual.c
// Function: fqz_qual_stats
void fqz_qual_stats(fqz_slice *s,
                    unsigned char *in, size_t in_size,
                    fqz_param *pm,
                    uint32_t qhist[256],
                    int one_param) {
#define NP 32
    uint32_t qhistb[NP][256] = {{0}};  // both
    uint32_t qhist1[NP][256] = {{0}};  // READ1 only
    uint32_t qhist2[NP][256] = {{0}};  // READ2 only
    uint64_t t1[NP] = {0};             // Count for READ1
    uint64_t t2[NP] = {0};             // COUNT for READ2
    uint32_t avg[2560] = {0};          // Avg qual *and later* avg-to-selector map.

    int dir = 0;
    int last_len = 0;
    int do_dedup = 0;
    size_t rec;
    size_t i, j;
    int num_rec = 0;

    // See what info we've been given.
    // Do we have READ1 / READ2?
    // Do we have selector hidden in the top bits of flag?
    int max_sel = 0;
    int has_r2 = 0;
    for (rec = 0; rec < s->num_records; rec++) {
        if (one_param >= 0 && (s->flags[rec] >> 16) != one_param)
            continue;
        num_rec++;
        if (max_sel < (s->flags[rec] >> 16))
            max_sel = (s->flags[rec] >> 16);
        if (s->flags[rec] & FQZ_FREAD2)
            has_r2 = 1;
    }

    // Dedup detection and histogram stats gathering
    int *avg_qual = calloc((s->num_records+1), sizeof(int));
    if (!avg_qual)
        return;

    rec = i = j = 0;
    while (i < in_size) {
        if (one_param >= 0 && (s->flags[rec] >> 16) != one_param) {
            avg_qual[rec] = 0;
            i += s->len[rec++];
            continue;
        }
        if (rec < s->num_records) {
            j = s->len[rec];
            dir = s->flags[rec] & FQZ_FREAD2 ? 1 : 0;
            if (i > 0 && j == last_len
                && !memcmp(in+i-last_len, in+i, j))
                do_dedup++; // cache which records are dup?
        } else {
            j = in_size - i;
            dir = 0;
        }
        last_len = j;

        uint32_t (*qh)[256] = dir ? qhist2 : qhist1;
        uint64_t *th        = dir ? t2     : t1;

        uint32_t tot = 0;
        for (; i < in_size && j > 0; i++, j--) {
            tot += in[i];
            qhist[in[i]]++;
            qhistb[j & (NP-1)][in[i]]++;
            qh[j & (NP-1)][in[i]]++;
            th[j & (NP-1)]++;
        }
        tot = last_len ? (tot*10.0)/last_len+.5 : 0;

        avg_qual[rec] = tot;
        avg[MIN(2559, tot)]++;

        rec++;
    }
    pm->do_dedup = ((rec+1)/(do_dedup+1) < 500);

    last_len = 0;

    // Unique symbol count
    for (i = pm->max_sym = pm->nsym = 0; i < 256; i++) {
        if (qhist[i])
            pm->max_sym = i, pm->nsym++;
    }


    // Auto tune: does average quality helps us?
    if (pm->do_qa != 0) {
        // Histogram of average qual in avg[]
        // NB: we convert avg[] from count to selector index

        // Few symbols means high compression which means
        // selector bits become more significant fraction.
        // Reduce selector bits by skewing the distribution
        // to not be even binning.
        double qf0 = pm->nsym > 8 ? 0.2 : 0.05;
        double qf1 = pm->nsym > 8 ? 0.5 : 0.22;
        double qf2 = pm->nsym > 8 ? 0.8 : 0.60;

        int total = 0;
        i = 0;
        while (i < 2560) {
            total += avg[i];
            if (total > qf0 * num_rec) {
                //fprintf(stderr, "Q1=%d\n", (int)i);
                break;
            }
            avg[i++] = 0;
        }
        while (i < 2560) {
            total += avg[i];
            if (total > qf1 * num_rec) {
                //fprintf(stderr, "Q2=%d\n", (int)i);
                break;
            }
            avg[i++] = 1;
        }
        while (i < 2560) {
            total += avg[i];
            if (total > qf2 * num_rec) {
                //fprintf(stderr, "Q3=%d\n", (int)i);
                break;
            }
            avg[i++] = 2;
        }
        while (i < 2560)
            avg[i++] = 3;

        // Compute simple entropy of merged signal vs split signal.
        i = 0;
        rec = 0;

        int qbin4[4][NP][256] = {{{0}}};
        int qbin2[2][NP][256] = {{{0}}};
        int qbin1   [NP][256] = {{0}};
        int qcnt4[4][NP] = {{0}};
        int qcnt2[4][NP] = {{0}};
        int qcnt1   [NP] = {0};
        while (i < in_size) {
            if (one_param >= 0 && (s->flags[rec] >> 16) != one_param) {
                i += s->len[rec++];
                continue;
            }
            if ((rec & 7) && rec < s->num_records) {
                // subsample for speed
                i += s->len[rec++];
                continue;
            }
            if (rec < s->num_records)
                j = s->len[rec];
            else
                j = in_size - i;
            last_len = j;

            uint32_t tot = avg_qual[rec];
            int qb4 = avg[MIN(2559, tot)];
            int qb2 = qb4/2;

            for (; i < in_size && j > 0; i++, j--) {
                int x = j & (NP-1);
                qbin4[qb4][x][in[i]]++;  qcnt4[qb4][x]++;
                qbin2[qb2][x][in[i]]++;  qcnt2[qb2][x]++;
                qbin1     [x][in[i]]++;  qcnt1     [x]++;
            }
            rec++;
        }

        double e1 = 0, e2 = 0, e4 = 0;
        for (j = 0; j < NP; j++) {
            for (i = 0; i < 256; i++) {
                if (qbin1   [j][i]) e1 += qbin1   [j][i] * fast_log(qbin1   [j][i] / (double)qcnt1   [j]);
                if (qbin2[0][j][i]) e2 += qbin2[0][j][i] * fast_log(qbin2[0][j][i] / (double)qcnt2[0][j]);
                if (qbin2[1][j][i]) e2 += qbin2[1][j][i] * fast_log(qbin2[1][j][i] / (double)qcnt2[1][j]);
                if (qbin4[0][j][i]) e4 += qbin4[0][j][i] * fast_log(qbin4[0][j][i] / (double)qcnt4[0][j]);
                if (qbin4[1][j][i]) e4 += qbin4[1][j][i] * fast_log(qbin4[1][j][i] / (double)qcnt4[1][j]);
                if (qbin4[2][j][i]) e4 += qbin4[2][j][i] * fast_log(qbin4[2][j][i] / (double)qcnt4[2][j]);
                if (qbin4[3][j][i]) e4 += qbin4[3][j][i] * fast_log(qbin4[3][j][i] / (double)qcnt4[3][j]);
            }
        }
        e1 /= -log(2)/8;
        e2 /= -log(2)/8;
        e4 /= -log(2)/8;
        //fprintf(stderr, "E1=%f E2=%f E4=%f %f\n", e1, e2+s->num_records/8, e4+s->num_records/4, (e4+s->num_records/4)/(e2+s->num_records/8));

        // Note by using the selector we're robbing bits from elsewhere in
        // the context, which may reduce compression better.
        // We don't know how much by, so this is basically a guess!
        // For now we just say need 5% saving here.
        double qm = pm->do_qa > 0 ? 1 : 0.98;
        if ((pm->do_qa == -1 || pm->do_qa >= 4) &&
            e4 + s->num_records/4 < e2*qm + s->num_records/8 &&
            e4 + s->num_records/4 < e1*qm) {
            //fprintf(stderr, "do q4\n");
            for (i = 0; i < s->num_records; i++) {
                //fprintf(stderr, "%d -> %d -> %d, %d\n", (int)i, avg_qual[i], avg[MIN(2559, avg_qual[i])], s->flags[i]>>16);
                s->flags[i] |= avg[MIN(2559, avg_qual[i])] <<16;
            }
            pm->do_sel = 1;
            max_sel = 3;
        } else if ((pm->do_qa == -1 || pm->do_qa >= 2) && e2 + s->num_records/8 < e1*qm) {
            //fprintf(stderr, "do q2\n");
            for (i = 0; i < s->num_records; i++)
                s->flags[i] |= (avg[MIN(2559, avg_qual[i])]>>1) <<16;
            pm->do_sel = 1;
            max_sel = 1;
        }

        if (pm->do_qa == -1) {
            // assume qual, pos, delta in that order.
            if (pm->pbits > 0 && pm->dbits > 0) {
                // 1 from pos/delta
                pm->sloc = pm->dloc-1;
                pm->pbits--;
                pm->dbits--;
                pm->dloc++;
            } else if (pm->dbits >= 2) {
                // 2 from delta
                pm->sloc = pm->dloc;
                pm->dbits -= 2;
                pm->dloc += 2;
            } else if (pm->qbits >= 2) {
                pm->qbits -= 2;
                pm->ploc -= 2;
                pm->sloc = 16-2 - pm->do_r2;
                if (pm->qbits == 6 && pm->qshift == 5)
                    pm->qbits--;
            }
            pm->do_qa = 4;
        }
    }

    // Auto tune: does splitting up READ1 and READ2 help us?
    if (has_r2 || pm->do_r2) { // FIXME: && but debug for now
        double e1 = 0, e2 = 0; // entropy sum

        for (j = 0; j < NP; j++) {
            if (!t1[j] || !t2[j]) continue;
            for (i = 0; i < 256; i++) {
                if (!qhistb[j][i]) continue;
                e1 -= (qhistb[j][i])*log(qhistb[j][i] / (double)(t1[j]+t2[j]));
                if (qhist1[j][i])
                    e2 -= qhist1[j][i] * log(qhist1[j][i] / (double)t1[j]);
                if (qhist2[j][i])
                    e2 -= qhist2[j][i] * log(qhist2[j][i] / (double)t2[j]);
            }
        }
        e1 /= log(2)*8; // bytes
        e2 /= log(2)*8;

        //fprintf(stderr, "read1/2 entropy merge %f split %f\n", e1, e2);

        // Note by using the selector we're robbing bits from elsewhere in
        // the context, which may reduce compression better.
        // We don't know how much by, so this is basically a guess!
        // For now we just say need 5% saving here.
        double qm = pm->do_r2 > 0 ? 1 : 0.95;
        if (e2 + (8+s->num_records/8) < e1*qm) {
            for (rec = 0; rec < s->num_records; rec++) {
                if (one_param >= 0 && (s->flags[rec] >> 16) != one_param)
                    continue;
                int sel = s->flags[rec] >> 16;
                s->flags[rec] =  (s->flags[rec] & 0xffff)
                    | ((s->flags[rec] & FQZ_FREAD2)
                       ? ((sel*2)+1) << 16
                       : ((sel*2)+0) << 16);
                if (max_sel < (s->flags[rec]>>16))
                    max_sel = (s->flags[rec]>>16);
            }
        }
    }

    // We provided explicit selector data or auto-tuned it
    if (max_sel > 0) {
        pm->do_sel = 1;
        pm->max_sel = max_sel;
    }

    free(avg_qual);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x53060, %rsp          # imm = 0x53060
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
leaq -0x8030(%rbp), %rdi
xorl %esi, %esi
movl $0x8000, %edx           # imm = 0x8000
callq 0x4250
leaq -0x10030(%rbp), %rdi
xorl %esi, %esi
movl $0x8000, %edx           # imm = 0x8000
callq 0x4250
leaq -0x18030(%rbp), %rdi
xorl %esi, %esi
movl $0x8000, %edx           # imm = 0x8000
callq 0x4250
leaq -0x18130(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x4250
leaq -0x18230(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x4250
leaq -0x1aa30(%rbp), %rdi
xorl %esi, %esi
movl $0x2800, %edx           # imm = 0x2800
callq 0x4250
movl $0x0, -0x1aa34(%rbp)
movl $0x0, -0x1aa38(%rbp)
movl $0x0, -0x1aa3c(%rbp)
movl $0x0, -0x1aa5c(%rbp)
movl $0x0, -0x1aa60(%rbp)
movl $0x0, -0x1aa64(%rbp)
movq $0x0, -0x1aa48(%rbp)
movq -0x1aa48(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jae 0x866dd
cmpl $0x0, -0x2c(%rbp)
jl 0x86655
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x10, %eax
cmpl -0x2c(%rbp), %eax
je 0x86655
jmp 0x866c6
movl -0x1aa5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1aa5c(%rbp)
movl -0x1aa60(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x1aa48(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shrl $0x10, %ecx
cmpl %ecx, %eax
jae 0x8669e
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x10, %eax
movl %eax, -0x1aa60(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x866c4
movl $0x1, -0x1aa64(%rbp)
jmp 0x866c6
movq -0x1aa48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa48(%rbp)
jmp 0x8661c
movq -0x8(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x42f0
movq %rax, -0x1aa70(%rbp)
cmpq $0x0, -0x1aa70(%rbp)
jne 0x86709
jmp 0x88101
movq $0x0, -0x1aa58(%rbp)
movq $0x0, -0x1aa50(%rbp)
movq $0x0, -0x1aa48(%rbp)
movq -0x1aa50(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x86ae0
cmpl $0x0, -0x2c(%rbp)
jl 0x867a0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x10, %eax
cmpl -0x2c(%rbp), %eax
je 0x867a0
movq -0x1aa70(%rbp), %rax
movq -0x1aa48(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x1aa48(%rbp)
movl (%rax,%rcx,4), %eax
addq -0x1aa50(%rbp), %rax
movq %rax, -0x1aa50(%rbp)
jmp 0x8672a
movq -0x1aa48(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jae 0x8685f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, -0x1aa58(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %edx
andl $0x80, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x1aa34(%rbp)
cmpq $0x0, -0x1aa50(%rbp)
jbe 0x8685d
movq -0x1aa58(%rbp), %rax
movslq -0x1aa38(%rbp), %rcx
cmpq %rcx, %rax
jne 0x8685d
movq -0x10(%rbp), %rdi
addq -0x1aa50(%rbp), %rdi
movslq -0x1aa38(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq -0x1aa50(%rbp), %rsi
movq -0x1aa58(%rbp), %rdx
callq 0x41c0
cmpl $0x0, %eax
jne 0x8685d
movl -0x1aa3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1aa3c(%rbp)
jmp 0x8687b
movq -0x18(%rbp), %rax
subq -0x1aa50(%rbp), %rax
movq %rax, -0x1aa58(%rbp)
movl $0x0, -0x1aa34(%rbp)
movq -0x1aa58(%rbp), %rax
movl %eax, -0x1aa38(%rbp)
cmpl $0x0, -0x1aa34(%rbp)
je 0x868a1
leaq -0x18030(%rbp), %rax
movq %rax, -0x52f88(%rbp)
jmp 0x868af
leaq -0x10030(%rbp), %rax
movq %rax, -0x52f88(%rbp)
movq -0x52f88(%rbp), %rax
movq %rax, -0x1aa78(%rbp)
cmpl $0x0, -0x1aa34(%rbp)
je 0x868d6
leaq -0x18230(%rbp), %rax
movq %rax, -0x52f90(%rbp)
jmp 0x868e4
leaq -0x18130(%rbp), %rax
movq %rax, -0x52f90(%rbp)
movq -0x52f90(%rbp), %rax
movq %rax, -0x1aa80(%rbp)
movl $0x0, -0x1aa84(%rbp)
movq -0x1aa50(%rbp), %rcx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0x52f91(%rbp)
jae 0x86922
cmpq $0x0, -0x1aa58(%rbp)
seta %al
movb %al, -0x52f91(%rbp)
movb -0x52f91(%rbp), %al
testb $0x1, %al
jne 0x86931
jmp 0x86a11
movq -0x10(%rbp), %rax
movq -0x1aa50(%rbp), %rcx
movzbl (%rax,%rcx), %eax
addl -0x1aa84(%rbp), %eax
movl %eax, -0x1aa84(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x1aa50(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x1aa58(%rbp), %rcx
andq $0x1f, %rcx
leaq -0x8030(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq -0x1aa50(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x1aa78(%rbp), %rax
movq -0x1aa58(%rbp), %rcx
andq $0x1f, %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq -0x1aa50(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x1aa80(%rbp), %rax
movq -0x1aa58(%rbp), %rcx
andq $0x1f, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x1aa50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa50(%rbp)
movq -0x1aa58(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x1aa58(%rbp)
jmp 0x868fc
cmpl $0x0, -0x1aa38(%rbp)
je 0x86a53
movl -0x1aa84(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0x67fab(%rip), %xmm1    # 0xee9d8
mulsd %xmm1, %xmm0
cvtsi2sdl -0x1aa38(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd 0x665d3(%rip), %xmm1    # 0xed018
addsd %xmm1, %xmm0
movsd %xmm0, -0x52fa0(%rbp)
jmp 0x86a60
xorps %xmm0, %xmm0
movsd %xmm0, -0x52fa0(%rbp)
jmp 0x86a60
movsd -0x52fa0(%rbp), %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x1aa84(%rbp)
movl -0x1aa84(%rbp), %edx
movq -0x1aa70(%rbp), %rax
movq -0x1aa48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl $0x9ff, %eax            # imm = 0x9FF
cmpl -0x1aa84(%rbp), %eax
jae 0x86aa4
movl $0x9ff, %eax            # imm = 0x9FF
movl %eax, -0x52fa4(%rbp)
jmp 0x86ab0
movl -0x1aa84(%rbp), %eax
movl %eax, -0x52fa4(%rbp)
movl -0x52fa4(%rbp), %eax
movl %eax, %eax
movl -0x1aa30(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x1aa30(%rbp,%rax,4)
movq -0x1aa48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa48(%rbp)
jmp 0x8672a
movq -0x1aa48(%rbp), %rax
addq $0x1, %rax
movl -0x1aa3c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
xorl %edx, %edx
divq %rcx
cmpq $0x1f4, %rax            # imm = 0x1F4
setb %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
movl $0x0, -0x1aa38(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x3c(%rax)
movq $0x0, -0x1aa50(%rbp)
cmpq $0x100, -0x1aa50(%rbp) # imm = 0x100
jae 0x86b8d
movq -0x28(%rbp), %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x86b77
movq -0x1aa50(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x20(%rbp), %rax
movl 0x40(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x40(%rax)
jmp 0x86b79
movq -0x1aa50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa50(%rbp)
jmp 0x86b3c
movq -0x20(%rbp), %rax
cmpl $0x0, 0x1c60(%rax)
je 0x87b9b
movq -0x20(%rbp), %rax
movl 0x40(%rax), %eax
movsd 0x6e98b(%rip), %xmm0    # 0xf5538
movsd 0x6f69b(%rip), %xmm1    # 0xf6250
movsd %xmm1, -0x52fb8(%rbp)
cmpl $0x8, %eax
movsd %xmm0, -0x52fb0(%rbp)
jg 0x86bda
movsd -0x52fb8(%rbp), %xmm0
movsd %xmm0, -0x52fb0(%rbp)
movsd -0x52fb0(%rbp), %xmm0
movsd %xmm0, -0x1aa90(%rbp)
movq -0x20(%rbp), %rax
movl 0x40(%rax), %eax
movsd 0x6641f(%rip), %xmm0    # 0xed018
movsd 0x6f647(%rip), %xmm1    # 0xf6248
movsd %xmm1, -0x52fc8(%rbp)
cmpl $0x8, %eax
movsd %xmm0, -0x52fc0(%rbp)
jg 0x86c26
movsd -0x52fc8(%rbp), %xmm0
movsd %xmm0, -0x52fc0(%rbp)
movsd -0x52fc0(%rbp), %xmm0
movsd %xmm0, -0x1aa98(%rbp)
movq -0x20(%rbp), %rax
movl 0x40(%rax), %eax
movsd 0x6af1b(%rip), %xmm0    # 0xf1b60
movsd 0x6f5f3(%rip), %xmm1    # 0xf6240
movsd %xmm1, -0x52fd8(%rbp)
cmpl $0x8, %eax
movsd %xmm0, -0x52fd0(%rbp)
jg 0x86c72
movsd -0x52fd8(%rbp), %xmm0
movsd %xmm0, -0x52fd0(%rbp)
movsd -0x52fd0(%rbp), %xmm0
movsd %xmm0, -0x1aaa0(%rbp)
movl $0x0, -0x1aaa4(%rbp)
movq $0x0, -0x1aa50(%rbp)
cmpq $0xa00, -0x1aa50(%rbp) # imm = 0xA00
jae 0x86d04
movq -0x1aa50(%rbp), %rax
movl -0x1aa30(%rbp,%rax,4), %eax
addl -0x1aaa4(%rbp), %eax
movl %eax, -0x1aaa4(%rbp)
cvtsi2sdl -0x1aaa4(%rbp), %xmm0
movsd -0x1aa90(%rbp), %xmm1
cvtsi2sdl -0x1aa5c(%rbp), %xmm2
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x86ce2
jmp 0x86d04
movq -0x1aa50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x1aa50(%rbp)
movl $0x0, -0x1aa30(%rbp,%rax,4)
jmp 0x86c97
jmp 0x86d06
cmpq $0xa00, -0x1aa50(%rbp) # imm = 0xA00
jae 0x86d73
movq -0x1aa50(%rbp), %rax
movl -0x1aa30(%rbp,%rax,4), %eax
addl -0x1aaa4(%rbp), %eax
movl %eax, -0x1aaa4(%rbp)
cvtsi2sdl -0x1aaa4(%rbp), %xmm0
movsd -0x1aa98(%rbp), %xmm1
cvtsi2sdl -0x1aa5c(%rbp), %xmm2
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x86d51
jmp 0x86d73
movq -0x1aa50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x1aa50(%rbp)
movl $0x1, -0x1aa30(%rbp,%rax,4)
jmp 0x86d06
jmp 0x86d75
cmpq $0xa00, -0x1aa50(%rbp) # imm = 0xA00
jae 0x86de2
movq -0x1aa50(%rbp), %rax
movl -0x1aa30(%rbp,%rax,4), %eax
addl -0x1aaa4(%rbp), %eax
movl %eax, -0x1aaa4(%rbp)
cvtsi2sdl -0x1aaa4(%rbp), %xmm0
movsd -0x1aaa0(%rbp), %xmm1
cvtsi2sdl -0x1aa5c(%rbp), %xmm2
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x86dc0
jmp 0x86de2
movq -0x1aa50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x1aa50(%rbp)
movl $0x2, -0x1aa30(%rbp,%rax,4)
jmp 0x86d75
jmp 0x86de4
cmpq $0xa00, -0x1aa50(%rbp) # imm = 0xA00
jae 0x86e13
movq -0x1aa50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x1aa50(%rbp)
movl $0x3, -0x1aa30(%rbp,%rax,4)
jmp 0x86de4
movq $0x0, -0x1aa50(%rbp)
movq $0x0, -0x1aa48(%rbp)
leaq -0x3aab0(%rbp), %rdi
xorl %esi, %esi
movl $0x20000, %edx          # imm = 0x20000
callq 0x4250
leaq -0x4aab0(%rbp), %rdi
xorl %esi, %esi
movl $0x10000, %edx          # imm = 0x10000
callq 0x4250
leaq -0x52ab0(%rbp), %rdi
xorl %esi, %esi
movl $0x8000, %edx           # imm = 0x8000
callq 0x4250
leaq -0x52cb0(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x4250
leaq -0x52eb0(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x4250
leaq -0x52f30(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x4250
movq -0x1aa50(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x87191
cmpl $0x0, -0x2c(%rbp)
jl 0x86efc
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x10, %eax
cmpl -0x2c(%rbp), %eax
je 0x86efc
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x1aa48(%rbp)
movl (%rax,%rcx,4), %eax
addq -0x1aa50(%rbp), %rax
movq %rax, -0x1aa50(%rbp)
jmp 0x86e9b
movq -0x1aa48(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0x86f53
movq -0x1aa48(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jae 0x86f53
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x1aa48(%rbp)
movl (%rax,%rcx,4), %eax
addq -0x1aa50(%rbp), %rax
movq %rax, -0x1aa50(%rbp)
jmp 0x86e9b
movq -0x1aa48(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jae 0x86f81
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, -0x1aa58(%rbp)
jmp 0x86f93
movq -0x18(%rbp), %rax
subq -0x1aa50(%rbp), %rax
movq %rax, -0x1aa58(%rbp)
movq -0x1aa58(%rbp), %rax
movl %eax, -0x1aa38(%rbp)
movq -0x1aa70(%rbp), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x52f34(%rbp)
movl $0x9ff, %eax            # imm = 0x9FF
cmpl -0x52f34(%rbp), %eax
jae 0x86fd1
movl $0x9ff, %eax            # imm = 0x9FF
movl %eax, -0x52fdc(%rbp)
jmp 0x86fdd
movl -0x52f34(%rbp), %eax
movl %eax, -0x52fdc(%rbp)
movl -0x52fdc(%rbp), %eax
movl %eax, %eax
movl -0x1aa30(%rbp,%rax,4), %eax
movl %eax, -0x52f38(%rbp)
movl -0x52f38(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x52f3c(%rbp)
movq -0x1aa50(%rbp), %rcx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0x52fdd(%rbp)
jae 0x8702c
cmpq $0x0, -0x1aa58(%rbp)
seta %al
movb %al, -0x52fdd(%rbp)
movb -0x52fdd(%rbp), %al
testb $0x1, %al
jne 0x8703b
jmp 0x8717a
movq -0x1aa58(%rbp), %rax
andq $0x1f, %rax
movl %eax, -0x52f40(%rbp)
movslq -0x52f38(%rbp), %rcx
leaq -0x3aab0(%rbp), %rax
shlq $0xf, %rcx
addq %rcx, %rax
movslq -0x52f40(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq -0x1aa50(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movslq -0x52f38(%rbp), %rcx
leaq -0x52cb0(%rbp), %rax
shlq $0x7, %rcx
addq %rcx, %rax
movslq -0x52f40(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movslq -0x52f3c(%rbp), %rcx
leaq -0x4aab0(%rbp), %rax
shlq $0xf, %rcx
addq %rcx, %rax
movslq -0x52f40(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq -0x1aa50(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movslq -0x52f3c(%rbp), %rcx
leaq -0x52eb0(%rbp), %rax
shlq $0x7, %rcx
addq %rcx, %rax
movslq -0x52f40(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movslq -0x52f40(%rbp), %rcx
leaq -0x52ab0(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq -0x1aa50(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movslq -0x52f40(%rbp), %rax
movl -0x52f30(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x52f30(%rbp,%rax,4)
movq -0x1aa50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa50(%rbp)
movq -0x1aa58(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x1aa58(%rbp)
jmp 0x87006
movq -0x1aa48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa48(%rbp)
jmp 0x86e9b
xorps %xmm0, %xmm0
movsd %xmm0, -0x52f48(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x52f50(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x52f58(%rbp)
movq $0x0, -0x1aa58(%rbp)
cmpq $0x20, -0x1aa58(%rbp)
jae 0x87715
movq $0x0, -0x1aa50(%rbp)
cmpq $0x100, -0x1aa50(%rbp) # imm = 0x100
jae 0x876fc
movq -0x1aa58(%rbp), %rcx
leaq -0x52ab0(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x87293
movq -0x1aa58(%rbp), %rcx
leaq -0x52ab0(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x52fe8(%rbp)
movq -0x1aa58(%rbp), %rcx
leaq -0x52ab0(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq -0x1aa58(%rbp), %rax
cvtsi2sdl -0x52f30(%rbp,%rax,4), %xmm1
divsd %xmm1, %xmm0
callq 0x88110
movaps %xmm0, %xmm2
movsd -0x52fe8(%rbp), %xmm0
movsd -0x52f48(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f48(%rbp)
leaq -0x4aab0(%rbp), %rax
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x8733f
leaq -0x4aab0(%rbp), %rax
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x52ff0(%rbp)
leaq -0x4aab0(%rbp), %rax
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq -0x1aa58(%rbp), %rax
cvtsi2sdl -0x52eb0(%rbp,%rax,4), %xmm1
divsd %xmm1, %xmm0
callq 0x88110
movaps %xmm0, %xmm2
movsd -0x52ff0(%rbp), %xmm0
movsd -0x52f50(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f50(%rbp)
leaq -0x4aab0(%rbp), %rax
addq $0x8000, %rax           # imm = 0x8000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x873fd
leaq -0x4aab0(%rbp), %rax
addq $0x8000, %rax           # imm = 0x8000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x52ff8(%rbp)
leaq -0x4aab0(%rbp), %rax
addq $0x8000, %rax           # imm = 0x8000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq -0x1aa58(%rbp), %rax
cvtsi2sdl -0x52e30(%rbp,%rax,4), %xmm1
divsd %xmm1, %xmm0
callq 0x88110
movaps %xmm0, %xmm2
movsd -0x52ff8(%rbp), %xmm0
movsd -0x52f50(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f50(%rbp)
leaq -0x3aab0(%rbp), %rax
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x874a9
leaq -0x3aab0(%rbp), %rax
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x53000(%rbp)
leaq -0x3aab0(%rbp), %rax
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq -0x1aa58(%rbp), %rax
cvtsi2sdl -0x52cb0(%rbp,%rax,4), %xmm1
divsd %xmm1, %xmm0
callq 0x88110
movaps %xmm0, %xmm2
movsd -0x53000(%rbp), %xmm0
movsd -0x52f58(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f58(%rbp)
leaq -0x3aab0(%rbp), %rax
addq $0x8000, %rax           # imm = 0x8000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x87567
leaq -0x3aab0(%rbp), %rax
addq $0x8000, %rax           # imm = 0x8000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x53008(%rbp)
leaq -0x3aab0(%rbp), %rax
addq $0x8000, %rax           # imm = 0x8000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq -0x1aa58(%rbp), %rax
cvtsi2sdl -0x52c30(%rbp,%rax,4), %xmm1
divsd %xmm1, %xmm0
callq 0x88110
movaps %xmm0, %xmm2
movsd -0x53008(%rbp), %xmm0
movsd -0x52f58(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f58(%rbp)
leaq -0x3aab0(%rbp), %rax
addq $0x10000, %rax          # imm = 0x10000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x87625
leaq -0x3aab0(%rbp), %rax
addq $0x10000, %rax          # imm = 0x10000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x53010(%rbp)
leaq -0x3aab0(%rbp), %rax
addq $0x10000, %rax          # imm = 0x10000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq -0x1aa58(%rbp), %rax
cvtsi2sdl -0x52bb0(%rbp,%rax,4), %xmm1
divsd %xmm1, %xmm0
callq 0x88110
movaps %xmm0, %xmm2
movsd -0x53010(%rbp), %xmm0
movsd -0x52f58(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f58(%rbp)
leaq -0x3aab0(%rbp), %rax
addq $0x18000, %rax          # imm = 0x18000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x876e3
leaq -0x3aab0(%rbp), %rax
addq $0x18000, %rax          # imm = 0x18000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x53018(%rbp)
leaq -0x3aab0(%rbp), %rax
addq $0x18000, %rax          # imm = 0x18000
movq -0x1aa58(%rbp), %rcx
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq -0x1aa58(%rbp), %rax
cvtsi2sdl -0x52b30(%rbp,%rax,4), %xmm1
divsd %xmm1, %xmm0
callq 0x88110
movaps %xmm0, %xmm2
movsd -0x53018(%rbp), %xmm0
movsd -0x52f58(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f58(%rbp)
jmp 0x876e5
movq -0x1aa50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa50(%rbp)
jmp 0x871d6
jmp 0x876fe
movq -0x1aa58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa58(%rbp)
jmp 0x871bd
movsd 0x6de33(%rip), %xmm0    # 0xf5550
callq 0x4380
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x6eb1f(%rip), %xmm0    # 0xf6260
divsd %xmm0, %xmm1
movsd -0x52f48(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x52f48(%rbp)
movsd 0x6ddef(%rip), %xmm0    # 0xf5550
callq 0x4380
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x6eadb(%rip), %xmm0    # 0xf6260
divsd %xmm0, %xmm1
movsd -0x52f50(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x52f50(%rbp)
movsd 0x6ddab(%rip), %xmm0    # 0xf5550
callq 0x4380
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x6ea97(%rip), %xmm0    # 0xf6260
divsd %xmm0, %xmm1
movsd -0x52f58(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x52f58(%rbp)
movq -0x20(%rbp), %rax
movl 0x1c60(%rax), %eax
movsd 0x65815(%rip), %xmm0    # 0xed008
movsd 0x6ea5d(%rip), %xmm1    # 0xf6258
movsd %xmm1, -0x53028(%rbp)
cmpl $0x0, %eax
movsd %xmm0, -0x53020(%rbp)
jg 0x87820
movsd -0x53028(%rbp), %xmm0
movsd %xmm0, -0x53020(%rbp)
movsd -0x53020(%rbp), %xmm0
movsd %xmm0, -0x52f60(%rbp)
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x1c60(%rax)
je 0x8784e
movq -0x20(%rbp), %rax
cmpl $0x4, 0x1c60(%rax)
jl 0x8798a
movsd -0x52f58(%rbp), %xmm1
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm0
addsd %xmm0, %xmm1
movsd -0x52f50(%rbp), %xmm0
movsd -0x52f60(%rbp), %xmm3
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm2
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8798a
movsd -0x52f58(%rbp), %xmm1
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm0
addsd %xmm0, %xmm1
movsd -0x52f48(%rbp), %xmm0
mulsd -0x52f60(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8798a
movq $0x0, -0x1aa50(%rbp)
movq -0x1aa50(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jae 0x87970
movq -0x1aa70(%rbp), %rcx
movq -0x1aa50(%rbp), %rdx
movl $0x9ff, %eax            # imm = 0x9FF
cmpl (%rcx,%rdx,4), %eax
jge 0x8791b
movl $0x9ff, %eax            # imm = 0x9FF
movl %eax, -0x5302c(%rbp)
jmp 0x87932
movq -0x1aa70(%rbp), %rax
movq -0x1aa50(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5302c(%rbp)
movl -0x5302c(%rbp), %eax
cltq
movl -0x1aa30(%rbp,%rax,4), %edx
shll $0x10, %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa50(%rbp), %rcx
orl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movq -0x1aa50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa50(%rbp)
jmp 0x878e3
movq -0x20(%rbp), %rax
movl $0x1, 0x8(%rax)
movl $0x3, -0x1aa60(%rbp)
jmp 0x87a91
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x1c60(%rax)
je 0x879a8
movq -0x20(%rbp), %rax
cmpl $0x2, 0x1c60(%rax)
jl 0x87a8f
movsd -0x52f50(%rbp), %xmm1
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm0
addsd %xmm0, %xmm1
movsd -0x52f48(%rbp), %xmm0
mulsd -0x52f60(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x87a8f
movq $0x0, -0x1aa50(%rbp)
movq -0x1aa50(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jae 0x87a7a
movq -0x1aa70(%rbp), %rcx
movq -0x1aa50(%rbp), %rdx
movl $0x9ff, %eax            # imm = 0x9FF
cmpl (%rcx,%rdx,4), %eax
jge 0x87a23
movl $0x9ff, %eax            # imm = 0x9FF
movl %eax, -0x53030(%rbp)
jmp 0x87a3a
movq -0x1aa70(%rbp), %rax
movq -0x1aa50(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x53030(%rbp)
movl -0x53030(%rbp), %eax
cltq
movl -0x1aa30(%rbp,%rax,4), %edx
shrl %edx
shll $0x10, %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa50(%rbp), %rcx
orl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movq -0x1aa50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa50(%rbp)
jmp 0x879eb
movq -0x20(%rbp), %rax
movl $0x1, 0x8(%rax)
movl $0x1, -0x1aa60(%rbp)
jmp 0x87a91
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x1c60(%rax)
jne 0x87b99
movq -0x20(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jbe 0x87af3
movq -0x20(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
jbe 0x87af3
movq -0x20(%rbp), %rax
movl 0x30(%rax), %ecx
subl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x20(%rbp), %rax
movl 0x24(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x24(%rax)
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
movq -0x20(%rbp), %rax
movl 0x30(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x30(%rax)
jmp 0x87b8b
movq -0x20(%rbp), %rax
cmpl $0x2, 0x2c(%rax)
jb 0x87b27
movq -0x20(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
subl $0x2, %ecx
movl %ecx, 0x2c(%rax)
movq -0x20(%rbp), %rax
movl 0x30(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x30(%rax)
jmp 0x87b89
movq -0x20(%rbp), %rax
cmpl $0x2, 0x1c(%rax)
jb 0x87b87
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %ecx
subl $0x2, %ecx
movl %ecx, 0x1c(%rax)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %ecx
subl $0x2, %ecx
movl %ecx, 0x28(%rax)
movq -0x20(%rbp), %rax
movl $0xe, %ecx
subl 0x1c5c(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x20(%rbp), %rax
cmpl $0x6, 0x1c(%rax)
jne 0x87b85
movq -0x20(%rbp), %rax
cmpl $0x5, 0x1c48(%rax)
jne 0x87b85
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x1c(%rax)
jmp 0x87b87
jmp 0x87b89
jmp 0x87b8b
movq -0x20(%rbp), %rax
movl $0x4, 0x1c60(%rax)
jmp 0x87b9b
cmpl $0x0, -0x1aa64(%rbp)
jne 0x87bb5
movq -0x20(%rbp), %rax
cmpl $0x0, 0x1c5c(%rax)
je 0x880d4
xorps %xmm0, %xmm0
movsd %xmm0, -0x52f68(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x52f70(%rbp)
movq $0x0, -0x1aa58(%rbp)
cmpq $0x20, -0x1aa58(%rbp)
jae 0x87eae
movq -0x1aa58(%rbp), %rax
cmpq $0x0, -0x18130(%rbp,%rax,8)
je 0x87c08
movq -0x1aa58(%rbp), %rax
cmpq $0x0, -0x18230(%rbp,%rax,8)
jne 0x87c0d
jmp 0x87e97
movq $0x0, -0x1aa50(%rbp)
cmpq $0x100, -0x1aa50(%rbp) # imm = 0x100
jae 0x87e95
movq -0x1aa58(%rbp), %rcx
leaq -0x8030(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x87c50
jmp 0x87e7e
movq -0x1aa58(%rbp), %rcx
movq %rcx, %rax
shlq $0xa, %rax
leaq -0x8030(%rbp,%rax), %rax
movq -0x1aa50(%rbp), %rdx
movl (%rax,%rdx,4), %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x53038(%rbp)
movq -0x18130(%rbp,%rcx,8), %rax
movq -0x18230(%rbp,%rcx,8), %rcx
addq %rcx, %rax
movq %rax, %xmm1
movaps 0x67c64(%rip), %xmm2    # 0xef900
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x67c68(%rip), %xmm2    # 0xef910
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x4380
movaps %xmm0, %xmm2
movsd -0x53038(%rbp), %xmm0
movsd -0x52f68(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f68(%rbp)
movq -0x1aa58(%rbp), %rcx
leaq -0x10030(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x87dbb
movq -0x1aa58(%rbp), %rax
movq %rax, %rcx
shlq $0xa, %rcx
leaq -0x10030(%rbp,%rcx), %rcx
movq -0x1aa50(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
cvtsi2sd %rcx, %xmm0
movsd %xmm0, -0x53040(%rbp)
movq -0x18130(%rbp,%rax,8), %xmm1
movaps 0x67ba3(%rip), %xmm2    # 0xef900
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x67ba7(%rip), %xmm2    # 0xef910
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x4380
movaps %xmm0, %xmm2
movsd -0x53040(%rbp), %xmm0
movsd -0x52f70(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f70(%rbp)
movq -0x1aa58(%rbp), %rcx
leaq -0x18030(%rbp), %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq -0x1aa50(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x87e7c
movq -0x1aa58(%rbp), %rax
movq %rax, %rcx
shlq $0xa, %rcx
leaq -0x18030(%rbp,%rcx), %rcx
movq -0x1aa50(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
cvtsi2sd %rcx, %xmm0
movsd %xmm0, -0x53048(%rbp)
movq -0x18230(%rbp,%rax,8), %xmm1
movaps 0x67ae2(%rip), %xmm2    # 0xef900
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x67ae6(%rip), %xmm2    # 0xef910
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x4380
movaps %xmm0, %xmm2
movsd -0x53048(%rbp), %xmm0
movsd -0x52f70(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x52f70(%rbp)
jmp 0x87e7e
movq -0x1aa50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa50(%rbp)
jmp 0x87c18
jmp 0x87e97
movq -0x1aa58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa58(%rbp)
jmp 0x87bd6
movsd 0x6d69a(%rip), %xmm0    # 0xf5550
callq 0x4380
movaps %xmm0, %xmm1
movsd 0x6e39a(%rip), %xmm0    # 0xf6260
mulsd %xmm0, %xmm1
movsd -0x52f68(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x52f68(%rbp)
movsd 0x6d66a(%rip), %xmm0    # 0xf5550
callq 0x4380
movaps %xmm0, %xmm1
movsd 0x6e36a(%rip), %xmm0    # 0xf6260
mulsd %xmm0, %xmm1
movsd -0x52f70(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x52f70(%rbp)
movq -0x20(%rbp), %rax
movl 0x1c5c(%rax), %eax
movsd 0x650e8(%rip), %xmm0    # 0xed008
movsd 0x6e340(%rip), %xmm1    # 0xf6268
movsd %xmm1, -0x53058(%rbp)
cmpl $0x0, %eax
movsd %xmm0, -0x53050(%rbp)
jg 0x87f4d
movsd -0x53058(%rbp), %xmm0
movsd %xmm0, -0x53050(%rbp)
movsd -0x53050(%rbp), %xmm0
movsd %xmm0, -0x52f78(%rbp)
movsd -0x52f70(%rbp), %xmm1
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
addl $0x8, %eax
cvtsi2sd %eax, %xmm0
addsd %xmm0, %xmm1
movsd -0x52f68(%rbp), %xmm0
mulsd -0x52f78(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x880d2
movq $0x0, -0x1aa48(%rbp)
movq -0x1aa48(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jae 0x880d0
cmpl $0x0, -0x2c(%rbp)
jl 0x87fdf
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x10, %eax
cmpl -0x2c(%rbp), %eax
je 0x87fdf
jmp 0x880b9
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x10, %eax
movl %eax, -0x52f7c(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x5305c(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x88049
movl -0x52f7c(%rbp), %eax
shll %eax
addl $0x1, %eax
shll $0x10, %eax
movl %eax, -0x53060(%rbp)
jmp 0x8805d
movl -0x52f7c(%rbp), %eax
shll %eax
addl $0x0, %eax
shll $0x10, %eax
movl %eax, -0x53060(%rbp)
movl -0x5305c(%rbp), %edx
movl -0x53060(%rbp), %eax
orl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x1aa60(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x1aa48(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shrl $0x10, %ecx
cmpl %ecx, %eax
jae 0x880b7
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1aa48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl $0x10, %eax
movl %eax, -0x1aa60(%rbp)
jmp 0x880b9
movq -0x1aa48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1aa48(%rbp)
jmp 0x87fa3
jmp 0x880d2
jmp 0x880d4
cmpl $0x0, -0x1aa60(%rbp)
jle 0x880f5
movq -0x20(%rbp), %rax
movl $0x1, 0x8(%rax)
movl -0x1aa60(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x1aa70(%rbp), %rdi
callq 0x45a0
addq $0x53060, %rsp          # imm = 0x53060
popq %rbp
retq
nopw (%rax,%rax)