// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hts.c
// Function: hts_itr_multi_next
int hts_itr_multi_next(htsFile *fd, hts_itr_t *iter, void *r)
{
    void *fp;
    int ret, tid, i, cr, ci;
    hts_pos_t beg, end;
    hts_reglist_t *found_reg;

    if (iter == NULL || iter->finished) return -1;

    if (iter->is_cram) {
        fp = fd->fp.cram;
    } else {
        fp = fd->fp.bgzf;
    }

    if (iter->read_rest) {
        if (iter->curr_off) { // seek to the start
            if (iter->seek(fp, iter->curr_off, SEEK_SET) < 0) {
                hts_log_error("Seek at offset %" PRIu64 " failed.", iter->curr_off);
                return -2;
            }
            iter->curr_off = 0; // only seek once
        }

        ret = iter->readrec(fp, fd, r, &tid, &beg, &end);
        if (ret < 0)
            iter->finished = 1;

        iter->curr_tid = tid;
        iter->curr_beg = beg;
        iter->curr_end = end;

        return ret;
    }
    // A NULL iter->off should always be accompanied by iter->finished.
    assert(iter->off != NULL || iter->nocoor != 0);

    int next_range = 0;
    for (;;) {
        // Note that due to the way bam indexing works, iter->off may contain
        // file chunks that are not actually needed as they contain data
        // beyond the end of the requested region.  These are filtered out
        // by comparing the tid and index into hts_reglist_t::intervals
        // (packed for reasons of convenience into iter->off[iter->i].max)
        // associated with the file region with iter->curr_tid and
        // iter->curr_intv.

        if (next_range
            || iter->curr_off == 0
            || iter->i >= iter->n_off
            || iter->curr_off >= iter->off[iter->i].v
            || (iter->off[iter->i].max >> 32 == iter->curr_tid
                && (iter->off[iter->i].max & 0xffffffff) < iter->curr_intv)) {

            // Jump to the next chunk.  It may be necessary to skip more
            // than one as the iter->off list can include overlapping entries.
            do {
                iter->i++;
            } while (iter->i < iter->n_off
                     && (iter->curr_off >= iter->off[iter->i].v
                         || (iter->off[iter->i].max >> 32 == iter->curr_tid
                             && (iter->off[iter->i].max & 0xffffffff) < iter->curr_intv)));

            if (iter->is_cram && iter->i < iter->n_off) {
                // Ensure iter->curr_reg is correct.
                //
                // We need this for CRAM as we shortcut some of the later
                // logic by getting an end-of-range and continuing to the
                // next offset.
                //
                // We cannot do this for BAM (and fortunately do not need to
                // either) because in BAM world a query to genomic positions
                // GX and GY leading to a seek offsets PX and PY may have
                // GX > GY and PX < PY.  (This is due to the R-tree and falling
                // between intervals, bumping up to a higher bin.)
                // CRAM strictly follows PX >= PY if GX >= GY, so this logic
                // works.
                int want_tid = iter->off[iter->i].max >> 32;
                if (!(iter->curr_reg < iter->n_reg &&
                      iter->reg_list[iter->curr_reg].tid == want_tid)) {
                    int j;
                    for (j = 0; j < iter->n_reg; j++)
                        if (iter->reg_list[j].tid == want_tid)
                            break;
                    if (j == iter->n_reg)
                        return -1;
                    iter->curr_reg = j;
                    iter->curr_tid = iter->reg_list[iter->curr_reg].tid;
                };
                iter->curr_intv = iter->off[iter->i].max & 0xffffffff;
            }

            if (iter->i >= iter->n_off) { // no more chunks, except NOCOORs
                if (iter->nocoor) {
                    next_range = 0;
                    if (iter->seek(fp, iter->nocoor_off, SEEK_SET) < 0) {
                        hts_log_error("Seek at offset %" PRIu64 " failed.", iter->nocoor_off);
                        return -2;
                    }
                    if (iter->is_cram) {
                        cram_range r = { HTS_IDX_NOCOOR };
                        cram_set_option(fp, CRAM_OPT_RANGE_NOSEEK, &r);
                    }

                    // The first slice covering the unmapped reads might
                    // contain a few mapped reads, so scroll
                    // forward until finding the first unmapped read.
                    do {
                        ret = iter->readrec(fp, fd, r, &tid, &beg, &end);
                    } while (tid >= 0 && ret >=0);

                    if (ret < 0)
                        iter->finished = 1;
                    else
                        iter->read_rest = 1;

                    iter->curr_off = 0; // don't seek any more
                    iter->curr_tid = tid;
                    iter->curr_beg = beg;
                    iter->curr_end = end;

                    return ret;
                } else {
                    ret = -1; break;
                }
            } else if (iter->i < iter->n_off) {
                // New chunk may overlap the last one, so ensure we
                // only seek forwards.
                if (iter->curr_off < iter->off[iter->i].u || next_range) {
                    iter->curr_off = iter->off[iter->i].u;

                    // CRAM has the capability of setting an end location.
                    // This means multi-threaded decodes can stop once they
                    // reach that point, rather than pointlessly decoding
                    // more slices than we'll be using.
                    //
                    // We have to be careful here.  Whenever we set the cram
                    // range we need a corresponding seek in order to ensure
                    // we can safely decode at that offset.  We use next_range
                    // var to ensure this is always true; this is set on
                    // end-of-range condition. It's never modified for BAM.
                    if (iter->is_cram) {
                        // Next offset.[uv] tuple, but it's already been
                        // included in our cram range, so don't seek and don't
                        // reset range so we can efficiently multi-thread.
                        if (next_range || iter->curr_off >= iter->end) {
                            if (iter->seek(fp, iter->curr_off, SEEK_SET) < 0) {
                                hts_log_error("Seek at offset %" PRIu64
                                        " failed.", iter->curr_off);
                                return -2;
                            }

                            // Find the genomic range matching this interval.
                            int j;
                            hts_reglist_t *rl = &iter->reg_list[iter->curr_reg];
                            cram_range r = {
                                    rl->tid,
                                    rl->intervals[iter->curr_intv].beg,
                                    rl->intervals[iter->curr_intv].end
                            };

                            // Expand it up to cover neighbouring intervals.
                            // Note we can only have a single chromosome in a
                            // range, so if we detect our blocks span chromosomes
                            // or we have a multi-ref mode slice, we just use
                            // HTS_IDX_START refid instead.  This doesn't actually
                            // seek (due to CRAM_OPT_RANGE_NOSEEK) and is simply
                            // and indicator of decoding with no end limit.
                            //
                            // That isn't as efficient as it could be, but it's
                            // no poorer than before and it works.
                            int tid = r.refid;
                            int64_t end = r.end;
                            int64_t v = iter->off[iter->i].v;
                            j = iter->i+1;
                            while (j < iter->n_off) {
                                if (iter->off[j].u > v)
                                    break;

                                uint64_t max = iter->off[j].max;
                                if ((max>>32) != tid) {
                                    tid = HTS_IDX_START; // => no range limit
                                } else {
                                    if (end < rl->intervals[max & 0xffffffff].end)
                                        end = rl->intervals[max & 0xffffffff].end;
                                }
                                if (v < iter->off[j].v)
                                    v = iter->off[j].v;
                                j++;
                            }
                            r.refid = tid;
                            r.end = end;

                            // Remember maximum 'v' here so we don't do
                            // unnecessary subsequent seeks for the next
                            // regions.  We can't change curr_off, but
                            // beg/end are used only by single region iterator so
                            // we cache it there to avoid changing the struct.
                            iter->end = v;

                            cram_set_option(fp, CRAM_OPT_RANGE_NOSEEK, &r);
                            next_range = 0;
                        }
                    } else { // Not CRAM
                        if (iter->seek(fp, iter->curr_off, SEEK_SET) < 0) {
                            hts_log_error("Seek at offset %" PRIu64 " failed.",
                                          iter->curr_off);
                            return -2;
                        }
                    }
                }
            }
        }

        ret = iter->readrec(fp, fd, r, &tid, &beg, &end);
        if (ret < 0) {
            if (iter->is_cram && cram_eof(fp)) {
                // Skip to end of range
                //
                // We should never be adjusting curr_off manually unless
                // we also can guarantee we'll be doing a seek after to
                // a new location.  Otherwise we'll be reading wrong offset
                // for the next container.
                //
                // We ensure this by adjusting our CRAM_OPT_RANGE
                // accordingly above, but to double check we also
                // set the skipped_block flag to enforce a seek also.
                iter->curr_off = iter->off[iter->i].v;
                next_range = 1;

                // Next region
                if (++iter->curr_intv >= iter->reg_list[iter->curr_reg].count){
                    if (++iter->curr_reg >= iter->n_reg)
                        break;
                    iter->curr_intv = 0;
                    iter->curr_tid = iter->reg_list[iter->curr_reg].tid;
                }
                continue;
            } else {
                break;
            }
        }

        iter->curr_off = iter->tell(fp);

        if (tid != iter->curr_tid) {
            hts_reglist_t key;
            key.tid = tid;

            found_reg = (hts_reglist_t *)bsearch(&key, iter->reg_list,
                                                 iter->n_reg,
                                                 sizeof(hts_reglist_t),
                                                 compare_regions);
            if (!found_reg)
                continue;

            iter->curr_reg = (found_reg - iter->reg_list);
            iter->curr_tid = tid;
            iter->curr_intv = 0;
        }

        cr = iter->curr_reg;
        ci = iter->curr_intv;

        for (i = ci; i < iter->reg_list[cr].count; i++) {
            if (end > iter->reg_list[cr].intervals[i].beg &&
                iter->reg_list[cr].intervals[i].end > beg) {
                iter->curr_beg = beg;
                iter->curr_end = end;
                iter->curr_intv = i;

                return ret;
            }

            // Check if the read starts beyond intervals[i].end
            // If so, the interval is finished so move on to the next.
            if (beg > iter->reg_list[cr].intervals[i].end)
                iter->curr_intv = i + 1;

            // No need to keep searching if the read ends before intervals[i].beg
            if (end < iter->reg_list[cr].intervals[i].beg)
                break;
        }
    }
    iter->finished = 1;

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2476e
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2477a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x25362
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x2, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x24799
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x247a5
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2487f
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x24819
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq 0x50(%rcx), %rsi
xorl %edx, %edx
callq *%rax
cmpl $0x0, %eax
jge 0x2480d
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movl $0x1, %edi
leaq 0xcc306(%rip), %rsi     # 0xf0af9
leaq 0xcc312(%rip), %rdx     # 0xf0b0c
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x25362
movq -0x18(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x48(%rbp), %r8
leaq -0x50(%rbp), %r9
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0x24852
movq -0x18(%rbp), %rax
movl (%rax), %ecx
andl $-0x3, %ecx
orl $0x2, %ecx
movl %ecx, (%rax)
movl -0x30(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x25362
movq -0x18(%rbp), %rax
cmpq $0x0, 0x60(%rax)
jne 0x2489b
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x3, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2489d
jmp 0x248bc
leaq 0xcc283(%rip), %rdi     # 0xf0b27
leaq 0xcbd2d(%rip), %rsi     # 0xf05d8
movl $0x10d6, %edx           # imm = 0x10D6
leaq 0xcc297(%rip), %rcx     # 0xf0b4e
callq 0x42e0
movl $0x0, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x2497b
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x2497b
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2497b
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
movq -0x18(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jae 0x2497b
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
shrq $0x20, %rax
movq -0x18(%rbp), %rcx
movslq 0x30(%rcx), %rcx
cmpq %rcx, %rax
jne 0x2507f
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x18(%rbp), %rax
movslq 0xc(%rax), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq 0x10(%rcx), %rax
movq -0x18(%rbp), %rcx
movslq 0x38(%rcx), %rcx
cmpq %rcx, %rax
jae 0x2507f
jmp 0x2497d
movq -0x18(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rdx
xorl %eax, %eax
cmpl 0x8(%rdx), %ecx
movb %al, -0xf1(%rbp)
jge 0x24a58
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdx
movq -0x18(%rbp), %rax
movslq 0xc(%rax), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdx
movb $0x1, %al
cmpq 0x8(%rdx), %rcx
movb %al, -0xf2(%rbp)
jae 0x24a4c
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
shrq $0x20, %rcx
movq -0x18(%rbp), %rax
movslq 0x30(%rax), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0xf3(%rbp)
jne 0x24a40
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x18(%rbp), %rax
movslq 0xc(%rax), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq 0x10(%rcx), %rax
movq -0x18(%rbp), %rcx
movslq 0x38(%rcx), %rcx
cmpq %rcx, %rax
setb %al
movb %al, -0xf3(%rbp)
movb -0xf3(%rbp), %al
movb %al, -0xf2(%rbp)
movb -0xf2(%rbp), %al
movb %al, -0xf1(%rbp)
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x2497d
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x2, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x24b92
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x24b92
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
shrq $0x20, %rax
movl %eax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x24ae4
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0x34(%rcx), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpl -0x60(%rbp), %eax
je 0x24b64
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x24b21
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x64(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpl -0x60(%rbp), %eax
jne 0x24b14
jmp 0x24b21
jmp 0x24b16
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x24aeb
movl -0x64(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x24b39
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x25362
movl -0x64(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0x34(%rcx), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x18(%rbp), %rax
movslq 0xc(%rax), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq 0x10(%rcx), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jl 0x24d08
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x3, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x24cfc
movl $0x0, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq 0x58(%rcx), %rsi
xorl %edx, %edx
callq *%rax
cmpl $0x0, %eax
jge 0x24c0d
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rcx
movl $0x1, %edi
leaq 0xcbf06(%rip), %rsi     # 0xf0af9
leaq 0xcbf12(%rip), %rdx     # 0xf0b0c
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x25362
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x2, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x24c53
movq 0xcb093(%rip), %rax     # 0xefcb8
movq %rax, -0x80(%rbp)
movq 0xcb090(%rip), %rax     # 0xefcc0
movq %rax, -0x78(%rbp)
movq 0xcb08d(%rip), %rax     # 0xefcc8
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rdi
movl $0x17, %esi
leaq -0x80(%rbp), %rdx
movb $0x0, %al
callq 0x79f60
jmp 0x24c55
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x48(%rbp), %r8
leaq -0x50(%rbp), %r9
callq *%rax
movl %eax, -0x2c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x30(%rbp)
movb %al, -0xf4(%rbp)
jl 0x24c95
cmpl $0x0, -0x2c(%rbp)
setge %al
movb %al, -0xf4(%rbp)
movb -0xf4(%rbp), %al
testb $0x1, %al
jne 0x24c55
cmpl $0x0, -0x2c(%rbp)
jge 0x24cb5
movq -0x18(%rbp), %rax
movl (%rax), %ecx
andl $-0x3, %ecx
orl $0x2, %ecx
movl %ecx, (%rax)
jmp 0x24cc3
movq -0x18(%rbp), %rax
movl (%rax), %ecx
andl $-0x2, %ecx
orl $0x1, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x50(%rax)
movl -0x30(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x25362
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
jmp 0x2534e
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x2507b
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
movq -0x18(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jb 0x24d4a
cmpl $0x0, -0x5c(%rbp)
je 0x25079
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x2, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2502a
cmpl $0x0, -0x5c(%rbp)
jne 0x24d9d
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jb 0x25028
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq 0x50(%rcx), %rsi
xorl %edx, %edx
callq *%rax
cmpl $0x0, %eax
jge 0x24de8
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movl $0x1, %edi
leaq 0xcbd2b(%rip), %rsi     # 0xf0af9
leaq 0xcbd37(%rip), %rdx     # 0xf0b0c
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x25362
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0x34(%rcx), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0xa8(%rbp)
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0x38(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0x38(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x98(%rbp)
movl -0xa8(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x24fe1
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x84(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
cmpq -0xc0(%rbp), %rax
jbe 0x24ee5
jmp 0x24fe1
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x84(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
shrq $0x20, %rax
movslq -0xac(%rbp), %rcx
cmpq %rcx, %rax
je 0x24f29
movl $0xfffffffd, -0xac(%rbp) # imm = 0xFFFFFFFD
jmp 0x24f89
movq -0xb8(%rbp), %rax
movq -0x90(%rbp), %rcx
movq 0x8(%rcx), %rcx
movabsq $0xffffffff, %rdx       # imm = 0xFFFFFFFF
andq -0xc8(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jge 0x24f87
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
movabsq $0xffffffff, %rcx       # imm = 0xFFFFFFFF
andq -0xc8(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0xb8(%rbp)
jmp 0x24f89
movq -0xc0(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
movslq -0x84(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jae 0x24fcd
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x84(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0xc0(%rbp)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x24eab
movl -0xac(%rbp), %eax
movl %eax, -0xa8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0xc0(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rdi
movl $0x17, %esi
leaq -0xa8(%rbp), %rdx
movb $0x0, %al
callq 0x79f60
movl $0x0, -0x5c(%rbp)
jmp 0x25077
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq 0x50(%rcx), %rsi
xorl %edx, %edx
callq *%rax
cmpl $0x0, %eax
jge 0x25075
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movl $0x1, %edi
leaq 0xcba9e(%rip), %rsi     # 0xf0af9
leaq 0xcbaaa(%rip), %rdx     # 0xf0b0c
movb $0x0, %al
callq 0x1b030
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x25362
jmp 0x25077
jmp 0x25079
jmp 0x2507b
jmp 0x2507d
jmp 0x2507f
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x48(%rbp), %r8
leaq -0x50(%rbp), %r9
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0x25179
movq -0x18(%rbp), %rax
movl (%rax), %eax
shrl $0x2, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x25174
movq -0x28(%rbp), %rdi
callq 0x79f40
cmpl $0x0, %eax
je 0x25174
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movl $0x1, -0x5c(%rbp)
movq -0x18(%rbp), %rcx
movl 0x38(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x38(%rcx)
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x18(%rbp), %rdx
movslq 0x34(%rdx), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jb 0x2516f
movq -0x18(%rbp), %rcx
movl 0x34(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x34(%rcx)
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jl 0x25143
jmp 0x2534e
movq -0x18(%rbp), %rax
movl $0x0, 0x38(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0x34(%rcx), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x248c3
jmp 0x2534e
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movl -0x30(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x30(%rcx), %eax
je 0x25216
movl -0x30(%rbp), %eax
movl %eax, -0xe0(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x18(%rbp), %rax
movslq 0x10(%rax), %rdx
leaq -0xf0(%rbp), %rdi
movl $0x28, %ecx
leaq -0xeea(%rip), %r8       # 0x242e0
callq 0x4610
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x251df
jmp 0x248c3
movq -0x58(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
subq %rcx, %rax
movl $0x28, %ecx
cqto
idivq %rcx
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
movl -0x30(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x38(%rax)
movq -0x18(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jae 0x25349
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movslq -0x34(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jle 0x252d3
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
cmpq -0x48(%rbp), %rax
jle 0x252d3
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movl -0x34(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x38(%rax)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x25362
movq -0x48(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movslq -0x34(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jle 0x2530c
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x50(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x28(%rcx), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
movslq -0x34(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jge 0x25339
jmp 0x25349
jmp 0x2533b
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x25230
jmp 0x248c3
movq -0x18(%rbp), %rax
movl (%rax), %ecx
andl $-0x3, %ecx
orl $0x2, %ecx
movl %ecx, (%rax)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nop