// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/syncerr.c
// Function: read_error_correction_analysis_thread
static void read_error_correction_analysis_thread(void *_data, long i, int tid) // kt_for() callback
{
    ec_shared_t *shared = (ec_shared_t *) _data;
    sr_t *sr;
    asmg_t *asmg;
    syncmer_t *scms;
    uint32_t *m_pos, beg_pos, end_pos;
    uint64_t *k_mer, beg_utg, end_utg;
    int32_t j, l, r, n, n_scm, kmer_size, beg, end;
    int updated;
    double max_edist;
    long *stats;
    FILE *fo;
    wf_config_t *conf;
    dfs_info_t *dfs;
    kstring_t *seq, *c_seq;
    kvec64_t *c_kmer;
    kvec32_t *c_mpos;

    asmg = shared->g->utg_asmg;
    scms = shared->g->scm_db->a;
    kmer_size = shared->sr_db->k;
    sr = &shared->sr_db->a[i];
    k_mer = sr->k_mer;
    m_pos = sr->m_pos;
    n_scm = sr->n;
    max_edist = shared->max_edist;
    fo = shared->fo;
    stats = shared->cache[tid].stats;
    conf = shared->cache[tid].conf;
    dfs = shared->cache[tid].dfs;
    seq = shared->cache[tid].seq;
    c_seq = shared->cache[tid].c_seq;
    c_kmer = shared->cache[tid].c_kmer;
    c_mpos = shared->cache[tid].c_mpos;

#ifdef DEBUG_SYNCMER_CORRECTION
    // read information for debugging
    fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::%s] %lu %s %u %u:", __func__, 
            sr->sid, sr->sname, sr->hoco_l, sr->n);
    for (j = 0; j < n_scm; ++j) {
        if (j > 0) { // print arc coverage
            fprintf(stderr, " [%u]", asmg_arc(asmg, 
                        (k_mer[j-1]&MASK_ONE) | (m_pos[j-1]&1),
                        (k_mer[j]&MASK_ONE) | (m_pos[j]&1))->cov);
        }
        fprintf(stderr, " (%d u%lu%c %u)", j, k_mer[j]>>1, "+-"[m_pos[j]&1], scms[k_mer[j]>>1].cov);
    }
    fputc('\n', stderr);
    // position of syncmers on read
    fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::%s] %lu %s %u %u:", __func__,
            sr->sid, sr->sname, sr->hoco_l, sr->n);
    for (j = 0; j < n_scm; ++j) fprintf(stderr, " %u", m_pos[j]>>1);
    fputc('\n', stderr);
#endif

    // find error syncmer blocks and do correction
    int err_c1;
    // reset preallocated sequence and path for corrections
    c_seq->l = 0;
    c_kmer->n = 0;
    c_mpos->n = 0;
    updated = 1;
#ifdef DEBUG_SYNCMER_CORRECTION
    int err_block = 0, edist = 0;
#endif
    beg = -1; // beg is a bad syncmer
    while (1) {
        beg_pos = beg < 1? 0 : ((m_pos[beg - 1] >> 1) + kmer_size);
        beg_pos += MIN_ERR_SEQ_LEN;

        // find the rigth boundary - end is a good syncmer
        // the distance between beg and end syncmer is no less than MIN_ERR_SEQ_LEN
        // with this restriction a good syncmer could be included for error correction
        for (end = beg + 1; end < n_scm; ++end)
            if (!scms[k_mer[end]>>1].del && !(k_mer[end]&1) && (m_pos[end] >> 1) >= beg_pos) // good syncmer
                break;

#ifdef DEBUG_SYNCMER_CORRECTION
        fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::%s] RID %lu ERROR BLOCK %d: %d %d\n", __func__, sr->sid, ++err_block, beg, end);
#endif

        // do error correction for reads with at least one syncmer anchor
        if (beg >= 0 || end < n_scm) {
            // do graph search for error correction
            // with restrictions in distance and source and sink utg nodes
            // here assembly utgs are syncmer singletons, i.e., utg_id is scm_id
            // always guarantee the source utg exist
            if (beg < 0) {
                // no left boundary
                // start from end instead
                // also do reverse complementary
                beg = end; // now beg is a good syncmer
                beg_utg = (k_mer[beg]&MASK_ONE) | (!(m_pos[beg]&1));
                beg_pos = 0;
                end_utg = UINT64_MAX;
                l = m_pos[beg] >> 1;
                r = 1;
            } else {
                // beg >= 0
                // in fact beg > 0
                --beg; // now beg is a good syncmer
                beg_utg = (k_mer[beg]&MASK_ONE) | (m_pos[beg]&1);
                // beg is a correct syncmer
                // start from the next base after this sycnmer
                beg_pos = (m_pos[beg]>>1) + kmer_size;
                if (end >= n_scm) {
                    // no right boundary
                    end_utg = UINT64_MAX;
                    l = (int) sr->hoco_l - beg_pos;
                } else {
                    // bounded by correct syncmer
                    end_utg = (k_mer[end]&MASK_ONE) | (m_pos[end]&1);
                    l = (int) (m_pos[end]>>1) - beg_pos;
                }
                r = 0;
            }
            
            // the error sequence to correct
            assert(l >= 0);
            ks_resize(seq, l);
            get_kmer_dna_seq(sr->hoco_s, beg_pos, l, r, seq->s);
            seq->l = l;
            if (l >= MIN_ERR_SEQ_LEN) {
                // do error correction
                // edit distance configuration
                conf->ts = seq->s;
                conf->tl = seq->l;
                conf->score = 0;
                conf->qs = 0;
                conf->ql = 0;
                conf->is_ext = 1;
                conf->bw = ceil(l * max_edist);
                // TODO is this good?
                if (conf->bw < MIN_ERR_BASE)
                    conf->bw = MIN_ERR_BASE;
                if (!conf->wf_diag)
                    MYCALLOC(conf->wf_diag, 1);
                if (conf->wf_diag->m < l * 4) {
                    conf->wf_diag->m = l * 4;
                    MYREALLOC(conf->wf_diag->a, l * 4);
                }
                conf->wf_diag->n = 1;
                conf->wf_diag->a[0].d =  0;
                conf->wf_diag->a[0].k = -1;

                err_c1 = error_correction_by_graph_path_search(asmg, scms, beg_utg, end_utg, conf, dfs);

#ifdef DEBUG_SYNCMER_CORRECTION
                fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::%s] RID %lu ERROR BLOCK %d [%s] (PATH = %d): %u %d (u%lu%c u%lu%c) %.*s\n",
                        __func__, sr->sid, err_block, EC_STATUS[err_c1], dfs->n_path, 
                        beg_pos, l, beg_utg>>1, "+-"[beg_utg&1], end_utg>>1, "+-"[end_utg&1], l, seq->s);
#endif
                if (err_c1)
                    assert(beg_utg == dfs->opt_path.a[0] && (end_utg == UINT64_MAX || end_utg == dfs->opt_path.a[dfs->opt_path.n-1]));

                if (end_utg == UINT64_MAX) {
                    ++stats[0];
                    ++stats[1 + err_c1];
                } else {
                    ++stats[5];
                    ++stats[6 + err_c1];
                }
            } else {
                err_c1 = EC_FAILURE;
                ++stats[10];
#ifdef DEBUG_SYNCMER_CORRECTION
                fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::WARN::%s] RID %lu ERROR BLOCK %d FLANKING SYNCMER OVERLAPPED: %u %d (%lu%c %lu%c)\n",
                        __func__, sr->sid, err_block, beg_pos, l, beg_utg>>1, "+-"[beg_utg&1], end_utg>>1, "+-"[end_utg&1]);
                print_aligned_syncmers_on_seq(sr, kmer_size, 0, UINT32_MAX, stderr);
#endif
            }

            // update c_path
            if (err_c1 == EC_SUCCESS) {
                n = dfs->opt_path.n; // n > 0
                // append the corrected syncmer list
                if (r) {
                    // end_utg == UINT64_MAX
                    for (j = n - 1; j > 0; --j) {
                        kv_push(uint64_t, *c_kmer, (dfs->opt_path.a[j]&MASK_ONE) | 1);
                        kv_push(uint32_t, *c_mpos, UINT32_MAX ^ (dfs->opt_path.a[j]&1));
                    }
                } else {
                    for (j = 1; j < n - 1; ++j) {
                        kv_push(uint64_t, *c_kmer, (dfs->opt_path.a[j]&MASK_ONE) | 1);
                        kv_push(uint32_t, *c_mpos, MASK_ONE | (dfs->opt_path.a[j]&1));
                    }
                    if (end_utg == UINT64_MAX && n > 1) {
                        // j == n-1
                        kv_push(uint64_t, *c_kmer, (dfs->opt_path.a[j]&MASK_ONE) | 1);
                        kv_push(uint32_t, *c_mpos, MASK_ONE | (dfs->opt_path.a[j]&1));
                    }
                }
            } else {
                // append the original sycnmer list
                if (r) {
                    kv_pushn(uint64_t, *c_kmer, k_mer, beg);
                    kv_pushn(uint32_t, *c_mpos, m_pos, beg);
                } else if (beg + 1 < n_scm) {
                    kv_pushn(uint64_t, *c_kmer, &k_mer[beg + 1], end - beg - 1);
                    kv_pushn(uint32_t, *c_mpos, &m_pos[beg + 1], end - beg - 1);
                }
            }
            // update c_seq if necessary
            if (fo) {
                if (err_c1 == EC_SUCCESS || err_c1 == EC_AMBISNQ) {
                    // append the corrected sequence
                    if (r)
                        kputsn_rev(dfs->opt_seq.s, dfs->opt_seq.l, c_seq);
                    else
                        kputsn(dfs->opt_seq.s, dfs->opt_seq.l, c_seq);
                } else {
                    // append the original sequence
                    if (r)
                        kputsn_rev(seq->s, seq->l, c_seq);
                    else
                        kputsn(seq->s, seq->l, c_seq);
                }
            }

#ifdef DEBUG_SYNCMER_CORRECTION
            if (err_c1 == EC_SUCCESS || err_c1 == EC_AMBISNQ)
                edist += dfs->edist;
#endif
        } else {
            // no good syncmers on the read
#ifdef DEBUG_SYNCMER_CORRECTION
            pthread_mutex_lock(&mutex);
            fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::%s] %s RID %lu no correct syncmers L=%u N=%u:", __func__, sr->sname, sr->sid, sr->hoco_l, sr->n);
            for (j = 0; j < n_scm; ++j) fprintf(stderr, " %u", scms[k_mer[j]>>1].cov);
            fputc('\n', stderr);
            pthread_mutex_unlock(&mutex);
#endif
            updated = 0;
        }

        // end is always a good syncmer
        // find next bad syncmer as beg
        for (beg = end + 1; beg < n_scm; ++beg)
            if (scms[k_mer[beg]>>1].del || (k_mer[end]&1))
                // bad syncmer
                break;
        
        if (beg > n_scm) break;

        // append kmer and mpos between [end, beg-1]
        kv_pushn(uint64_t, *c_kmer, &k_mer[end], beg - end);
        kv_pushn(uint32_t, *c_mpos, &m_pos[end], beg - end);

        // append sequence between [end, beg-1]
        if (fo) {
            beg_pos = m_pos[end] >> 1;
            end_pos = m_pos[beg-1] >> 1;
            l = end_pos + kmer_size - beg_pos;
            ks_resize(c_seq, c_seq->l + l);
            get_kmer_dna_seq(sr->hoco_s, beg_pos, l, 0, &c_seq->s[c_seq->l]);
            c_seq->l += l;
        }
    }
    
    if (updated) {
        // here is to update syncmer seq for the read
        // TODO need to consider data consistency
        size_t s, n_c = c_kmer->n;
        MYREALLOC(sr->k_mer, n_c);
        memcpy(sr->k_mer, c_kmer->a, sizeof(uint64_t) * n_c);
        MYREALLOC(sr->m_pos, n_c);
        memcpy(sr->m_pos, c_mpos->a, sizeof(uint32_t) * n_c);
        MYREALLOC(sr->s_mer, n_c);
        for (s = 0; s < n_c; ++s)
            sr->s_mer[s] = scms[sr->k_mer[s]>>1].s;
        sr->n = n_c;
    }

    if (fo) {
        if (!updated) {
            l = sr->hoco_l;
            ks_resize(c_seq, l);
            get_kmer_dna_seq(sr->hoco_s, 0, l, 0, c_seq->s);
            c_seq->l = l;
        }
        pthread_mutex_lock(&mutex);
        fprintf(fo, ">%s\n%.*s\n", sr->sname, (int) c_seq->l, c_seq->s);
        pthread_mutex_unlock(&mutex);
    }

#ifdef DEBUG_SYNCMER_CORRECTION
    // read information for debugging
    fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::%s] ERROR CORRECTION RESULT - %lu %s %u %u:", __func__,
            sr->sid, sr->sname, sr->hoco_l, sr->n);
    n_scm = sr->n;
    k_mer = sr->k_mer;
    m_pos = sr->m_pos;
    for (j = 0; j < n_scm; ++j) {
        if (j > 0) { // print arc coverage
            fprintf(stderr, " [%u]", asmg_arc(asmg,
                        (k_mer[j-1]&MASK_ONE) | (m_pos[j-1]&1),
                        (k_mer[j]&MASK_ONE) | (m_pos[j]&1))->cov);
        }
        fprintf(stderr, " (%d u%lu%c %u)", j, k_mer[j]>>1, "+-"[m_pos[j]&1], scms[k_mer[j]>>1].cov);
    }
    fputc('\n', stderr);
    // position of syncmers on read
    fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::%s] ERROR CORRECTION RESULT - %lu %s %u %u:", __func__,
            sr->sid, sr->sname, sr->hoco_l, sr->n);
    for (j = 0; j < n_scm; ++j) fprintf(stderr, " %u", m_pos[j]>>1);
    fputc('\n', stderr);

    if (fo) {
        int score = 0, t_end = 0, q_end = 0, n_cigar = 0;
        l = sr->hoco_l;
        ks_resize(seq, l);
        get_kmer_dna_seq(sr->hoco_s, 0, l, 0, seq->s);
        seq->l = l;
        uint32_t *cigar = wf_ed(seq->l, seq->s, c_seq->l, c_seq->s, 1, -1, &score, &t_end, &q_end, &n_cigar);
        fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::%s] ERROR CORRECTION RESULT - ", __func__);
        wf_print_cigar(cigar, n_cigar, stderr);
        fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::%s] ED_ALIGNMENT: ED=%d BW=%d tL=%d t_EN=%d qL=%d q_EN=%d\n",
                __func__, score, -1, (int) seq->l, t_end, (int) c_seq->l, q_end);
        wf_print_alignment(seq->s, seq->l, c_seq->s, c_seq->l, cigar, n_cigar, 0, stderr);
        free(cigar);
        if (score != edist)
            fprintf(stderr, "[DEBUG_SYNCMER_CORRECTION::WARN::%s] RID %lu INCONSISTENT ERROR CORRECTION RESULT - EC=%d, EDIST=%d\n", 
                    __func__, sr->sid, score, edist);
    }
#endif

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl 0x18(%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
imulq $0x58, -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x74(%rbp)
movq -0x20(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
addq $0x30, %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x28(%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0xc0(%rbp), %rax
movq $0x0, (%rax)
movq -0xc8(%rbp), %rax
movq $0x0, (%rax)
movq -0xd0(%rbp), %rax
movq $0x0, (%rax)
movl $0x1, -0x84(%rbp)
movl $0xffffffff, -0x7c(%rbp) # imm = 0xFFFFFFFF
cmpl $0x1, -0x7c(%rbp)
jge 0x1b9f8
xorl %eax, %eax
movl %eax, -0xec(%rbp)
jmp 0x1ba13
movq -0x40(%rbp), %rax
movl -0x7c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
shrl %eax
addl -0x78(%rbp), %eax
movl %eax, -0xec(%rbp)
movl -0xec(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x44(%rbp)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0x1ba92
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
movslq -0x80(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x1ba85
movq -0x50(%rbp), %rax
movslq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x1ba85
movq -0x40(%rbp), %rax
movslq -0x80(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl %eax
cmpl -0x44(%rbp), %eax
jb 0x1ba85
jmp 0x1ba92
jmp 0x1ba87
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1ba2e
cmpl $0x0, -0x7c(%rbp)
jge 0x1baa4
movl -0x80(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0x1cbec
cmpl $0x0, -0x7c(%rbp)
jge 0x1bb12
movl -0x80(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x50(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $-0x2, %rax
movq -0x40(%rbp), %rcx
movslq -0x7c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
andl $0x1, %ecx
cmpl $0x0, %ecx
setne %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rcx
orq %rcx, %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x44(%rbp)
movq $-0x1, -0x60(%rbp)
movq -0x40(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x68(%rbp)
movl $0x1, -0x6c(%rbp)
jmp 0x1bbb5
movl -0x7c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x7c(%rbp)
movq -0x50(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $-0x2, %rax
movq -0x40(%rbp), %rcx
movslq -0x7c(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
orq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movslq -0x7c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl %eax
addl -0x78(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x74(%rbp), %eax
jl 0x1bb74
movq $-0x1, -0x60(%rbp)
movq -0x28(%rbp), %rax
movl 0x10(%rax), %eax
subl -0x44(%rbp), %eax
movl %eax, -0x68(%rbp)
jmp 0x1bbae
movq -0x50(%rbp), %rax
movslq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $-0x2, %rax
movq -0x40(%rbp), %rcx
movslq -0x80(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
andl $0x1, %ecx
movl %ecx, %ecx
orq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x40(%rbp), %rax
movslq -0x80(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl %eax
subl -0x44(%rbp), %eax
movl %eax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
cmpl $0x0, -0x68(%rbp)
jl 0x1bbbd
jmp 0x1bbdc
leaq 0x12c56(%rip), %rdi     # 0x2e81a
leaq 0x12c56(%rip), %rsi     # 0x2e821
movl $0x1ca, %edx            # imm = 0x1CA
leaq 0x12c54(%rip), %rcx     # 0x2e82b
callq 0x21e0
movq -0xb8(%rbp), %rdi
movslq -0x68(%rbp), %rsi
callq 0x1dbb0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x44(%rbp), %esi
movl -0x68(%rbp), %edx
movl -0x6c(%rbp), %ecx
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %r8
callq 0x14730
movslq -0x68(%rbp), %rcx
movq -0xb8(%rbp), %rax
movq %rcx, (%rax)
cmpl $0xa, -0x68(%rbp)
jl 0x1be94
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0xa8(%rbp), %rax
movq %rcx, (%rax)
movq -0xb8(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0xa8(%rbp), %rax
movl $0x0, 0x30(%rax)
movq -0xa8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0xa8(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0xa8(%rbp), %rax
movl $0x1, 0x28(%rax)
cvtsi2sdl -0x68(%rbp), %xmm0
mulsd -0x90(%rbp), %xmm0
callq 0x24e0
cvttsd2si %xmm0, %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0xa8(%rbp), %rax
cmpl $0x6, 0x2c(%rax)
jge 0x1bcc4
movq -0xa8(%rbp), %rax
movl $0x6, 0x2c(%rax)
movq -0xa8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1bcef
movl $0x1, %edi
movl $0x18, %esi
callq 0x2250
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movl -0x68(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0x1bd56
movl -0x68(%rbp), %eax
shll $0x2, %eax
movslq %eax, %rcx
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rdi
movl -0x68(%rbp), %eax
shll $0x2, %eax
cltq
imulq $0xc, %rax, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq $0x1, (%rax)
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movl $0x0, (%rax)
movq -0xa8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0xa8(%rbp), %r8
movq -0xb0(%rbp), %r9
callq 0x1a380
movl %eax, -0xd4(%rbp)
cmpl $0x0, -0xd4(%rbp)
je 0x1be27
movq -0x58(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq 0x68(%rcx), %rcx
cmpq (%rcx), %rax
jne 0x1be06
cmpq $-0x1, -0x60(%rbp)
je 0x1be04
movq -0x60(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq 0x68(%rcx), %rcx
movq -0xb0(%rbp), %rdx
movq 0x58(%rdx), %rdx
subq $0x1, %rdx
cmpq (%rcx,%rdx,8), %rax
jne 0x1be06
jmp 0x1be25
leaq 0x12a5c(%rip), %rdi     # 0x2e869
leaq 0x12a0d(%rip), %rsi     # 0x2e821
movl $0x1ed, %edx            # imm = 0x1ED
leaq 0x12a0b(%rip), %rcx     # 0x2e82b
callq 0x21e0
jmp 0x1be27
cmpq $-0x1, -0x60(%rbp)
jne 0x1be60
movq -0x98(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x98(%rbp), %rax
movl -0xd4(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x1be92
movq -0x98(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
movq -0x98(%rbp), %rax
movl -0xd4(%rbp), %ecx
addl $0x6, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x1beb1
movl $0x0, -0xd4(%rbp)
movq -0x98(%rbp), %rax
movq 0x50(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x50(%rax)
cmpl $0x1, -0xd4(%rbp)
jne 0x1c406
movq -0xb0(%rbp), %rax
movq 0x58(%rax), %rax
movl %eax, -0x70(%rbp)
cmpl $0x0, -0x6c(%rbp)
je 0x1c09a
movl -0x70(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jle 0x1c095
jmp 0x1beeb
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movq -0xc8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1bf74
movq -0xc8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1bf27
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xf8(%rbp)
jmp 0x1bf35
movl $0x2, %eax
movq %rax, -0xf8(%rbp)
jmp 0x1bf35
movq -0xf8(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xb0(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
andq $-0x2, %rdx
orq $0x1, %rdx
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc8(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x1bfb4
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq -0xd0(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1c03d
movq -0xd0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1bff0
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x100(%rbp)
jmp 0x1bffe
movl $0x2, %eax
movq %rax, -0x100(%rbp)
jmp 0x1bffe
movq -0x100(%rbp), %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xb0(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
movabsq $0xffffffff, %rcx       # imm = 0xFFFFFFFF
xorq %rcx, %rax
movl %eax, %edx
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xd0(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x1c087
movl -0x64(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x1bedf
jmp 0x1c401
movl $0x1, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl -0x70(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1c255
jmp 0x1c0b4
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movq -0xc8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1c13d
movq -0xc8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c0f0
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x108(%rbp)
jmp 0x1c0fe
movl $0x2, %eax
movq %rax, -0x108(%rbp)
jmp 0x1c0fe
movq -0x108(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xb0(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
andq $-0x2, %rdx
orq $0x1, %rdx
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc8(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x1c17d
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq -0xd0(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1c206
movq -0xd0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c1b9
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x110(%rbp)
jmp 0x1c1c7
movl $0x2, %eax
movq %rax, -0x110(%rbp)
jmp 0x1c1c7
movq -0x110(%rbp), %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xb0(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
orq $-0x2, %rax
movl %eax, %edx
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xd0(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x1c247
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x1c0a1
cmpq $-0x1, -0x60(%rbp)
jne 0x1c3ff
cmpl $0x1, -0x70(%rbp)
jle 0x1c3ff
jmp 0x1c26c
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movq -0xc8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1c2f5
movq -0xc8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c2a8
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x118(%rbp)
jmp 0x1c2b6
movl $0x2, %eax
movq %rax, -0x118(%rbp)
jmp 0x1c2b6
movq -0x118(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xb0(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
andq $-0x2, %rdx
orq $0x1, %rdx
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc8(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x1c335
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movq -0xd0(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1c3be
movq -0xd0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c371
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x120(%rbp)
jmp 0x1c37f
movl $0x2, %eax
movq %rax, -0x120(%rbp)
jmp 0x1c37f
movq -0x120(%rbp), %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xb0(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
orq $-0x2, %rax
movl %eax, %edx
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xd0(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movl %edx, (%rax,%rcx,4)
jmp 0x1c3ff
jmp 0x1c401
jmp 0x1cb26
cmpl $0x0, -0x6c(%rbp)
je 0x1c765
jmp 0x1c412
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movslq -0x7c(%rbp), %rcx
addq %rcx, %rax
movq -0xc8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x1c57a
movq -0xc8(%rbp), %rax
movq (%rax), %rcx
movslq -0x7c(%rbp), %rax
addq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c472
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x128(%rbp)
jmp 0x1c480
movl $0x1, %eax
movq %rax, -0x128(%rbp)
jmp 0x1c480
movq -0x128(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x50(%rbp), %rsi
movslq -0x7c(%rbp), %rdx
shlq $0x3, %rdx
callq 0x22c0
movslq -0x7c(%rbp), %rcx
movq -0xc8(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x1c5ba
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movslq -0x7c(%rbp), %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x1c722
movq -0xd0(%rbp), %rax
movq (%rax), %rcx
movslq -0x7c(%rbp), %rax
addq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c61a
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x130(%rbp)
jmp 0x1c628
movl $0x1, %eax
movq %rax, -0x130(%rbp)
jmp 0x1c628
movq -0x130(%rbp), %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq (%rax), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x40(%rbp), %rsi
movslq -0x7c(%rbp), %rdx
shlq $0x2, %rdx
callq 0x22c0
movslq -0x7c(%rbp), %rcx
movq -0xd0(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x1cb24
movl -0x7c(%rbp), %eax
addl $0x1, %eax
cmpl -0x74(%rbp), %eax
jge 0x1cb22
jmp 0x1c776
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movl -0x80(%rbp), %ecx
subl -0x7c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq -0xc8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x1c8ed
movq -0xc8(%rbp), %rax
movq (%rax), %rcx
movl -0x80(%rbp), %eax
subl -0x7c(%rbp), %eax
subl $0x1, %eax
cltq
addq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c7e5
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x138(%rbp)
jmp 0x1c7f3
movl $0x1, %eax
movq %rax, -0x138(%rbp)
jmp 0x1c7f3
movq -0x138(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x50(%rbp), %rsi
movl -0x7c(%rbp), %eax
addl $0x1, %eax
cltq
shlq $0x3, %rax
addq %rax, %rsi
movl -0x80(%rbp), %eax
subl -0x7c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x22c0
movl -0x80(%rbp), %eax
subl -0x7c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
movq -0xc8(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x1c94c
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movl -0x80(%rbp), %ecx
subl -0x7c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x1cac3
movq -0xd0(%rbp), %rax
movq (%rax), %rcx
movl -0x80(%rbp), %eax
subl -0x7c(%rbp), %eax
subl $0x1, %eax
cltq
addq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c9bb
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x140(%rbp)
jmp 0x1c9c9
movl $0x1, %eax
movq %rax, -0x140(%rbp)
jmp 0x1c9c9
movq -0x140(%rbp), %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq (%rax), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x40(%rbp), %rsi
movl -0x7c(%rbp), %eax
addl $0x1, %eax
cltq
shlq $0x2, %rax
addq %rax, %rsi
movl -0x80(%rbp), %eax
subl -0x7c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x22c0
movl -0x80(%rbp), %eax
subl -0x7c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
movq -0xd0(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x1cb22
jmp 0x1cb24
jmp 0x1cb26
cmpq $0x0, -0xa0(%rbp)
je 0x1cbea
cmpl $0x1, -0xd4(%rbp)
je 0x1cb46
cmpl $0x2, -0xd4(%rbp)
jne 0x1cb98
cmpl $0x0, -0x6c(%rbp)
je 0x1cb72
movq -0xb0(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0xb0(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %esi
movq -0xc0(%rbp), %rdx
callq 0x1d6d0
jmp 0x1cb96
movq -0xb0(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0xb0(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %esi
movq -0xc0(%rbp), %rdx
callq 0x1d860
jmp 0x1cbe8
cmpl $0x0, -0x6c(%rbp)
je 0x1cbc3
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xb8(%rbp), %rax
movq (%rax), %rax
movl %eax, %esi
movq -0xc0(%rbp), %rdx
callq 0x1d6d0
jmp 0x1cbe6
movq -0xb8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xb8(%rbp), %rax
movq (%rax), %rax
movl %eax, %esi
movq -0xc0(%rbp), %rdx
callq 0x1d860
jmp 0x1cbe8
jmp 0x1cbea
jmp 0x1cbf6
movl $0x0, -0x84(%rbp)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0x1cc51
movq -0x38(%rbp), %rax
movq -0x50(%rbp), %rcx
movslq -0x7c(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x1cc42
movq -0x50(%rbp), %rax
movslq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x1cc44
jmp 0x1cc51
jmp 0x1cc46
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1cbff
movl -0x7c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jle 0x1cc5e
jmp 0x1d086
jmp 0x1cc60
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movl -0x7c(%rbp), %ecx
subl -0x80(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq -0xc8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x1cdd1
movq -0xc8(%rbp), %rax
movq (%rax), %rcx
movl -0x7c(%rbp), %eax
subl -0x80(%rbp), %eax
cltq
addq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1ccc9
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x148(%rbp)
jmp 0x1ccd7
movl $0x1, %eax
movq %rax, -0x148(%rbp)
jmp 0x1ccd7
movq -0x148(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0xc8(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xc8(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x50(%rbp), %rsi
movslq -0x80(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movl -0x7c(%rbp), %eax
subl -0x80(%rbp), %eax
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x22c0
movl -0x7c(%rbp), %eax
subl -0x80(%rbp), %eax
movslq %eax, %rcx
movq -0xc8(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x1ce26
movq -0xd0(%rbp), %rax
movq (%rax), %rax
movl -0x7c(%rbp), %ecx
subl -0x80(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq -0xd0(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x1cf97
movq -0xd0(%rbp), %rax
movq (%rax), %rcx
movl -0x7c(%rbp), %eax
subl -0x80(%rbp), %eax
cltq
addq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1ce8f
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x150(%rbp)
jmp 0x1ce9d
movl $0x1, %eax
movq %rax, -0x150(%rbp)
jmp 0x1ce9d
movq -0x150(%rbp), %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0xd0(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0xd0(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xd0(%rbp), %rax
movq (%rax), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq -0x40(%rbp), %rsi
movslq -0x80(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
movl -0x7c(%rbp), %eax
subl -0x80(%rbp), %eax
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x22c0
movl -0x7c(%rbp), %eax
subl -0x80(%rbp), %eax
movslq %eax, %rcx
movq -0xd0(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
cmpq $0x0, -0xa0(%rbp)
je 0x1d081
movq -0x40(%rbp), %rax
movslq -0x80(%rbp), %rcx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movl -0x7c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
addl -0x78(%rbp), %eax
subl -0x44(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0xc0(%rbp), %rdi
movq -0xc0(%rbp), %rax
movq (%rax), %rsi
movslq -0x68(%rbp), %rax
addq %rax, %rsi
callq 0x1dbb0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x44(%rbp), %esi
movl -0x68(%rbp), %edx
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %r8
movq -0xc0(%rbp), %rax
addq (%rax), %r8
xorl %ecx, %ecx
callq 0x14730
movslq -0x68(%rbp), %rcx
movq -0xc0(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x1b9e8
cmpl $0x0, -0x84(%rbp)
je 0x1d1ca
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0xe8(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0xc8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0xe8(%rbp), %rdx
shlq $0x3, %rdx
callq 0x22c0
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0xe8(%rbp), %rsi
shlq $0x2, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0xd0(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0xe8(%rbp), %rdx
shlq $0x2, %rdx
callq 0x22c0
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0xe8(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x48(%rax)
movq $0x0, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jae 0x1d1ba
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x50(%rcx), %rcx
movq -0xe0(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xe0(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0xe0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe0(%rbp)
jmp 0x1d15e
movq -0xe8(%rbp), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x38(%rax)
cmpq $0x0, -0xa0(%rbp)
je 0x1d274
cmpl $0x0, -0x84(%rbp)
jne 0x1d228
movq -0x28(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0xc0(%rbp), %rdi
movslq -0x68(%rbp), %rsi
callq 0x1dbb0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x68(%rbp), %edx
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %r8
xorl %ecx, %ecx
movl %ecx, %esi
callq 0x14730
movslq -0x68(%rbp), %rcx
movq -0xc0(%rbp), %rax
movq %rcx, (%rax)
leaq 0x17279(%rip), %rdi     # 0x344a8
callq 0x2510
movq -0xa0(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0xc0(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0xc0(%rbp), %rax
movq 0x10(%rax), %r8
leaq 0x11672(%rip), %rsi     # 0x2e8d3
movb $0x0, %al
callq 0x2290
leaq 0x17239(%rip), %rdi     # 0x344a8
callq 0x2300
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax)