// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: gen_double_scaffold_gfa(ma_ug_t*, ma_ug_t*, ma_ug_t*, scaf_res_t*, scaf_res_t*, asg_t*, kv_u_trans_t*, long, kvect_sec_t**, kvect_sec_t**)
void gen_double_scaffold_gfa(ma_ug_t *ref, ma_ug_t *hu1, ma_ug_t *hu2, scaf_res_t *cp1, scaf_res_t *cp2, asg_t *sg, kv_u_trans_t *os, int64_t minNs, kvect_sec_t **sc1, kvect_sec_t **sc2)
{
    order_contig_trans(os);
    asg_t *g = asg_init(); uint64_t k, s, e, z, rn, pn, dn, rthres = asm_opt.self_scaf_reliable_min, el, glen; ma_utg_t *u, *ut; u_trans_t *p, *d, *r; 
    asg_arc_t t, *c; int64_t zs, ze, gl, gmin = -asm_opt.self_scaf_gap_max, gmax = asm_opt.self_scaf_gap_max; uint64_t mf, blen, bf, is_dip; uint32_t sce[2]; sce[0] = 0; sce[1] = 1;
    asg32_v b0, b1, b2, b3; kv_init(b0); kv_init(b1); kv_init(b2); kv_init(b3); uint8_t *f, *fs, *fsk; CALLOC(f, (ref->u.n<<1)); CALLOC(fs, (ref->u.n<<1)); CALLOC(fsk, ref->u.n);

    // fprintf(stderr, "[M::%s::] SSS\n", __func__); 
    for (k = 0; k < os->idx.n; ++k) {
        u = ((k<hu1->u.n)?&(hu1->u.a[k]):&(hu2->u.a[k-hu1->u.n]));
        asg_seq_set(g, k, u->len, 0); g->seq[k].c = (k<hu1->u.n?1:2);
    }

    // fprintf(stderr, "[M::%s::] MMM\n", __func__); 
    for (k = 0; k < os->idx.n; ++k) {
        
        r = u_trans_a(*os, k); rn = u_trans_n(*os, k); p = d = NULL; pn = dn = 0;
        // fprintf(stderr, "[M::%s::] # k:%lu, rn::%lu\n", __func__, k, rn); 
        if(rn <= 1) continue;
        for (z = 0, p = r; (z < rn) && (!(r[z].del)); z++); pn = z;
        for (d = r + z; (z < rn) && (r[z].qs != ((uint32_t)-1)); z++); dn = z - pn;
        // fprintf(stderr, "[M::%s::] # k:%lu, pn::%lu, dn::%lu\n", __func__, k, pn, dn); 
        if(pn <= 1) continue;///no scaf
        s = e = (uint64_t)-1;
        for (z = 0; z < pn; z++) {
            if((p[z].f) || (((p[z].qe-p[z].qs) >= rthres) && ((p[z].te-p[z].ts) >= rthres))) {
                s = e = z; break;
            }
        }
        for (; z < pn; z++) {
            if((p[z].f) || (((p[z].qe-p[z].qs) >= rthres) && ((p[z].te-p[z].ts) >= rthres))) e = z;
        }
        // fprintf(stderr, "[M::%s::] # k:%lu, s::%lu, e::%lu\n", __func__, k, s, e); 
        ///[s, e]
        u = ((k<hu1->u.n)?&(hu1->u.a[k]):&(hu2->u.a[k-hu1->u.n]));
        set_fsk(fsk, 1, ((k<hu1->u.n)?&(cp1->a[k]):&(cp2->a[k-hu1->u.n])));
        for (z = 1; z < pn; z++) {
            ///cannot scaffold circles
            ut = ((p[z-1].tn<hu1->u.n)?&(hu1->u.a[p[z-1].tn]):&(hu2->u.a[p[z-1].tn-hu1->u.n])); if(ut->circ) continue;
            ut = ((p[z].tn<hu1->u.n)?&(hu1->u.a[p[z].tn]):&(hu2->u.a[p[z].tn-hu1->u.n])); if(ut->circ) continue;
            // fprintf(stderr, "[M::%s::] # k:%lu, z::%lu, p[z-1].tn::%u, p[z].tn::%u, hu1->u.n::%u, hu2->u.n::%u\n", __func__, k, z, p[z-1].tn, p[z].tn, (uint32_t)hu1->u.n, (uint32_t)hu2->u.n); 
            
            el = 0; gl = 0;
            if((sce[(p[z-1].tn<hu1->u.n)?0:1] != sce[(p[z-1].qn<hu1->u.n)?0:1]) && (sce[(p[z].tn<hu1->u.n)?0:1] != sce[(p[z].qn<hu1->u.n)?0:1])) {///tn and qn come from different haplotypes
                if((((z-1)>=s)&&((z-1)<=e))&&(((z)>=s)&&((z)<=e))) el = 1;
                // fprintf(stderr, "-0-[M::%s::] # k::%lu, z::%lu, el::%lu\n", __func__, k, z, el); 
                if(el) {
                    zs = MAX(p[z-1].qs, p[z].qs); 
                    ze = MIN(p[z-1].qe, p[z].qe);
                    if(is_noisy_ov(MIN(zs, ze), MAX(zs, ze), u->len, 2500000, 0.5, d, dn)) el = 0;
                    // fprintf(stderr, "-1-[M::%s::] # k::%lu, z::%lu, el::%lu, zs::%ld, ze::%ld\n", __func__, k, z, el, zs, ze); 
                    if(el) {
                        gl = zs - ze;
                        if((!(p[z-1].f)) || (!(p[z].f))) {
                            if(gl >= gmin && gl <= gmax) el = 1;
                            else el = 0;///gap is too long
                        } else if(p[z-1].f && p[z].f) {
                            if(gl <= gmax) el = 1; ///p[z-1] and p[z] are too far away is bad; p[z-1] and p[z] are overlapped is fine
                            else el = 0;
                        }
                    }
                    // fprintf(stderr, "-2-[M::%s::] # k::%lu, z::%lu, el::%lu, zs::%ld, ze::%ld, p[z-1].f::%u, p[z].f::%u, gmin::%ld, gmax::%ld\n", __func__, k, z, el, zs, ze, p[z-1].f, p[z].f, gmin, gmax); 
                }
                ///final try in graph
                // fprintf(stderr, "[M::%s::] # k::%lu, z::%lu, el::%lu, gl::%ld\n", __func__, k, z, el, gl); 
                is_dip = 0;

                glen = is_small_tangle(&(p[z-1]), &(p[z]), ref, hu1, hu2, cp1, cp2, &b0, &b1, &b2, &b3, f, fs, fsk, 5000000, &is_dip);
                // fprintf(stderr, "[M::%s::] # k::%lu, z::%lu, el::%lu, glen::%lu, gl::%ld\n", __func__, k, z, el, glen, gl); 
                if((glen != (uint64_t)-1) && (((int64_t)glen) <= asm_opt.self_scaf_gap_max)) {
                    el = 1; if(!is_dip) gl = glen;
                }
            }
            if(gl < minNs) gl = minNs;
            if(el) {
                ///in anyway the gap cannot be too large
                if(gl <= gmax) el = 1; ///p[z-1] and p[z] are too far away is bad; p[z-1] and p[z] are overlapped is fine
                else el = 0;
            }
            
            scaf_hit2arc(&(p[z-1]), &(p[z]), 0, el, gl, &t);
            c = asg_arc_pushp(g); *c = t;
            scaf_hit2arc(&(p[z]), &(p[z-1]), 1, el, gl, &t);
            c = asg_arc_pushp(g); *c = t;
        }
        set_fsk(fsk, 0, ((k<hu1->u.n)?&(cp1->a[k]):&(cp2->a[k-hu1->u.n])));  
    }
    asg_cleanup(g); asg_symm(g);
    // fprintf(stderr, "[M::%s::] EEE\n", __func__); 

    uint64_t v, n_vtx = g->n_seq<<1, nv; asg_arc_t *av;
    for (v = 0; v < n_vtx; ++v) {
        if (g->seq[v>>1].del) continue;
        nv = asg_arc_n(g, v);
        if(nv <= 1) continue;
        av = asg_arc_a(g, v);
        for(k = 0; k < nv; k++) {
            if(av[k].del) continue;
            av[k].del = 1;
            asg_arc_del(g, av[k].v^1, (av[k].ul>>32)^1, 1);
        }
    }
    for (k = 0; k < g->n_arc; k++) {
        if(!(g->arc[k].el)) g->arc[k].del = 1;
    }
    asg_cleanup(g);

    if((ref->u.n<<1) < g->n_seq) REALLOC(f, g->n_seq);
    memset(f, 0, sizeof((*f))*g->n_seq);
    asg64_v b64; kv_init(b64); kvect_sec_t *i1 = NULL, *i2 = NULL, *im = NULL; uint64_t len[2];///, mmip;
    sec_t *mmi; CALLOC(i1, 1); CALLOC(i2, 1); ///i1->ctg = hu1; i2->ctg = hu2; 

    b0.n = 0; ///mmip = hu1->u.n; mmip <<= 1;
    for (v = 0; v < n_vtx; ++v) {
        nv = asg_arc_n(g, v); assert(nv <= 1);
        if(f[v>>1]) continue;
        if(asg_arc_n(g, (v^1)) != 0) continue;
        b64.n = 0; mf = gen_scaf_path_lst(g, v, &b64, &blen, &bf);
        assert(mf == END_TIPS);
        // rn = prt_gen_scaf_path_lst(b64.a, b64.n, (mf==LOOP)?1:0, hu1, hu2); kv_push(uint32_t, b0, rn);
        for (k = len[0] = len[1] = 0; k < b64.n; k++) {
            f[((uint32_t)b64.a[k])>>1] = 1;
            len[g->seq[((uint32_t)b64.a[k])>>1].c-1] += g->seq[((uint32_t)b64.a[k])>>1].len;
        }
        im = ((len[0] >= len[1])?i1:i2); kv_pushp(sec_t, (*im), &mmi); memset(mmi, 0, sizeof((*mmi)));
        mmi->is_c = 0; mmi->n = mmi->m = b64.n; MALLOC(mmi->a, mmi->n); memcpy(mmi->a, b64.a, sizeof((*(mmi->a)))*mmi->n);
        // for (k = 0; k < mmi->n; k++) { ///scaffold bug
        //     if((((uint32_t)mmi->a[k])>>1) >= hu1->u.n) mmi->a[k] -= mmip;
        // }
    }

    for (v = 0; v < n_vtx; ++v) {
        nv = asg_arc_n(g, v); assert(nv <= 1);
        if(f[v>>1]) continue;
        assert((nv == 1) && (asg_arc_n(g, (v^1)) == 1));
        b64.n = 0; mf = gen_scaf_path_lst(g, v, &b64, &blen, &bf);
        assert(mf == LOOP);
        // rn = prt_gen_scaf_path_lst(b64.a, b64.n, (mf==LOOP)?1:0, hu1, hu2); kv_push(uint32_t, b0, rn);
        for (k = len[0] = len[1] = 0; k < b64.n; k++) {
            f[((uint32_t)b64.a[k])>>1] = 1;
            len[g->seq[((uint32_t)b64.a[k])>>1].c-1] += g->seq[((uint32_t)b64.a[k])>>1].len;
        }
        im = ((len[0] >= len[1])?i1:i2);
        im = ((len[0] >= len[1])?i1:i2); kv_pushp(sec_t, (*im), &mmi); memset(mmi, 0, sizeof((*mmi)));
        mmi->is_c = 1; mmi->n = mmi->m = b64.n; MALLOC(mmi->a, mmi->n); memcpy(mmi->a, b64.a, sizeof((*(mmi->a)))*mmi->n);
        // for (k = 0; k < mmi->n; k++) { ///scaffold bug
        //     if((((uint32_t)mmi->a[k])>>1) >= hu1->u.n) mmi->a[k] -= mmip;
        // }
    }
    kv_destroy(b64);
    // cal_arr_N50(b0.a, b0.n, "Scf");

    // b1.n = 0;
    // for(k = 0; k < hu1->u.n; k++) kv_push(uint32_t, b1, hu1->u.a[k].len);
    // for(k = 0; k < hu2->u.n; k++) kv_push(uint32_t, b1, hu2->u.a[k].len);
    // cal_arr_N50(b1.a, b1.n, "Ctg");

    kv_destroy(b0); kv_destroy(b1); kv_destroy(b2); kv_destroy(b3); free(f); free(fs); free(fsk); asg_destroy(g); 
    (*sc1) = i1; (*sc2) = i2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f8, %rsp            # imm = 0x2F8
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movq 0x10(%rbp), %rdi
callq 0x2fff50
callq 0xcd150
movq %rax, -0x60(%rbp)
leaq 0x297063(%rip), %rax    # 0x3c47f8
movq 0x270(%rax), %rax
movq %rax, -0xa0(%rbp)
xorl %eax, %eax
leaq 0x29704c(%rip), %rcx    # 0x3c47f8
subq 0x278(%rcx), %rax
movq %rax, -0x118(%rbp)
leaq 0x297037(%rip), %rax    # 0x3c47f8
movq 0x278(%rax), %rax
movq %rax, -0x120(%rbp)
movl $0x0, -0x148(%rbp)
movl $0x1, -0x144(%rbp)
movq $0x0, -0x158(%rbp)
movq $0x0, -0x160(%rbp)
movq $0x0, -0x150(%rbp)
movq $0x0, -0x170(%rbp)
movq $0x0, -0x178(%rbp)
movq $0x0, -0x168(%rbp)
movq $0x0, -0x188(%rbp)
movq $0x0, -0x190(%rbp)
movq $0x0, -0x180(%rbp)
movq $0x0, -0x1a0(%rbp)
movq $0x0, -0x1a8(%rbp)
movq $0x0, -0x198(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
shlq %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, -0x1b0(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
shlq %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, -0x1b8(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, -0x1c0(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq 0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x12d982
movq -0x68(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x12d8f5
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x68(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x230(%rbp)
jmp 0x12d916
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x68(%rbp), %rcx
movq -0x38(%rbp), %rdx
subq (%rdx), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x230(%rbp)
movq -0x230(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rax
movl %eax, %esi
movq -0xb8(%rbp), %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
callq 0xcd8f0
movq -0x68(%rbp), %rdx
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movl $0x2, %eax
movl $0x1, %ecx
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movb %al, %dl
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x68(%rbp), %rcx
movb %dl, 0x4(%rax,%rcx,8)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x12d8bd
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq 0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x12e558
movq 0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x68(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd8(%rbp)
movq 0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x88(%rbp)
movq $0x0, -0xd0(%rbp)
movq $0x0, -0xc8(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0x90(%rbp)
cmpq $0x1, -0x88(%rbp)
ja 0x12da1a
jmp 0x12e547
movq $0x0, -0x80(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x80(%rbp), %rcx
xorl %eax, %eax
cmpq -0x88(%rbp), %rcx
movb %al, -0x231(%rbp)
jae 0x12da67
movq -0xd8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
shrb $0x7, %al
cmpb $0x0, %al
setne %al
xorb $-0x1, %al
movb %al, -0x231(%rbp)
movb -0x231(%rbp), %al
testb $0x1, %al
jne 0x12da73
jmp 0x12da83
jmp 0x12da75
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x12da30
movq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0xd8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movq -0x80(%rbp), %rcx
xorl %eax, %eax
cmpq -0x88(%rbp), %rcx
movb %al, -0x232(%rbp)
jae 0x12dad4
movq -0xd8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
cmpl $-0x1, (%rax)
setne %al
movb %al, -0x232(%rbp)
movb -0x232(%rbp), %al
testb $0x1, %al
jne 0x12dae0
jmp 0x12daf0
jmp 0x12dae2
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x12daa4
movq -0x80(%rbp), %rax
subq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x1, -0x90(%rbp)
ja 0x12db11
jmp 0x12e547
movq $-0x1, -0x78(%rbp)
movq $-0x1, -0x70(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x90(%rbp), %rax
jae 0x12dbd0
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
cmpb $0x0, %al
jne 0x12dbaf
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0xc8(%rbp), %rcx
imulq $0x30, -0x80(%rbp), %rdx
addq %rdx, %rcx
subl (%rcx), %eax
movl %eax, %eax
cmpq -0xa0(%rbp), %rax
jb 0x12dbbd
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq -0xc8(%rbp), %rcx
imulq $0x30, -0x80(%rbp), %rdx
addq %rdx, %rcx
subl 0xc(%rcx), %eax
movl %eax, %eax
cmpq -0xa0(%rbp), %rax
jb 0x12dbbd
movq -0x80(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %rax, -0x70(%rbp)
jmp 0x12dbd0
jmp 0x12dbbf
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x12db29
jmp 0x12dbd2
movq -0x80(%rbp), %rax
cmpq -0x90(%rbp), %rax
jae 0x12dc73
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
cmpb $0x0, %al
jne 0x12dc58
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0xc8(%rbp), %rcx
imulq $0x30, -0x80(%rbp), %rdx
addq %rdx, %rcx
subl (%rcx), %eax
movl %eax, %eax
cmpq -0xa0(%rbp), %rax
jb 0x12dc60
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq -0xc8(%rbp), %rcx
imulq $0x30, -0x80(%rbp), %rdx
addq %rdx, %rcx
subl 0xc(%rcx), %eax
movl %eax, %eax
cmpq -0xa0(%rbp), %rax
jb 0x12dc60
movq -0x80(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x12dc62
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x12dbd2
movq -0x68(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x12dc99
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x68(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x240(%rbp)
jmp 0x12dcba
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x68(%rbp), %rcx
movq -0x38(%rbp), %rdx
subq (%rdx), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x1c0(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x68(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x12dcfb
movq -0x48(%rbp), %rax
movq (%rax), %rax
imulq $0x58, -0x68(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x250(%rbp)
jmp 0x12dd1b
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq -0x68(%rbp), %rcx
movq -0x38(%rbp), %rdx
subq (%rdx), %rcx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x250(%rbp)
movq -0x248(%rbp), %rdi
movq -0x250(%rbp), %rdx
movl $0x1, %esi
callq 0x12d670
movq $0x1, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x90(%rbp), %rax
jae 0x12e4df
movq -0xc8(%rbp), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x12dd9f
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc8(%rbp), %rcx
movq -0x80(%rbp), %rdx
subq $0x1, %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x14(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x258(%rbp)
jmp 0x12ddd5
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc8(%rbp), %rcx
movq -0x80(%rbp), %rdx
subq $0x1, %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x14(%rcx), %ecx
movq -0x38(%rbp), %rdx
subq (%rdx), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x12ddf9
jmp 0x12e4ce
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x12de3e
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc8(%rbp), %rcx
imulq $0x30, -0x80(%rbp), %rdx
addq %rdx, %rcx
movl 0x14(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x260(%rbp)
jmp 0x12de6d
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc8(%rbp), %rcx
imulq $0x30, -0x80(%rbp), %rdx
addq %rdx, %rcx
movl 0x14(%rcx), %ecx
movq -0x38(%rbp), %rdx
subq (%rdx), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x260(%rbp)
movq -0x260(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x12de91
jmp 0x12e4ce
movq $0x0, -0xa8(%rbp)
movq $0x0, -0x110(%rbp)
movq -0xc8(%rbp), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movl %eax, %edx
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovbl %ecx, %eax
cltq
movl -0x148(%rbp,%rax,4), %eax
movq -0xc8(%rbp), %rcx
movq -0x80(%rbp), %rdx
subq $0x1, %rdx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movl %ecx, %esi
movq -0x38(%rbp), %rcx
movq (%rcx), %rdi
movl $0x1, %ecx
xorl %edx, %edx
cmpq %rdi, %rsi
cmovbl %edx, %ecx
movslq %ecx, %rcx
cmpl -0x148(%rbp,%rcx,4), %eax
je 0x12e38d
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
movl %eax, %edx
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovbl %ecx, %eax
cltq
movl -0x148(%rbp,%rax,4), %eax
movq -0xc8(%rbp), %rcx
imulq $0x30, -0x80(%rbp), %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movl %ecx, %esi
movq -0x38(%rbp), %rcx
movq (%rcx), %rdi
movl $0x1, %ecx
xorl %edx, %edx
cmpq %rdi, %rsi
cmovbl %edx, %ecx
movslq %ecx, %rcx
cmpl -0x148(%rbp,%rcx,4), %eax
je 0x12e38d
movq -0x80(%rbp), %rax
subq $0x1, %rax
cmpq -0x70(%rbp), %rax
jb 0x12dfc2
movq -0x80(%rbp), %rax
subq $0x1, %rax
cmpq -0x78(%rbp), %rax
ja 0x12dfc2
movq -0x80(%rbp), %rax
cmpq -0x70(%rbp), %rax
jb 0x12dfc2
movq -0x80(%rbp), %rax
cmpq -0x78(%rbp), %rax
ja 0x12dfc2
movq $0x1, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0x12e26c
movq -0xc8(%rbp), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0xc8(%rbp), %rcx
imulq $0x30, -0x80(%rbp), %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jb 0x12e01b
movq -0xc8(%rbp), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x264(%rbp)
jmp 0x12e032
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x264(%rbp)
movl -0x264(%rbp), %eax
movl %eax, %eax
movq %rax, -0x100(%rbp)
movq -0xc8(%rbp), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0xc8(%rbp), %rcx
imulq $0x30, -0x80(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
ja 0x12e08f
movq -0xc8(%rbp), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x268(%rbp)
jmp 0x12e0a7
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x268(%rbp)
movl -0x268(%rbp), %eax
movl %eax, %eax
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rax
cmpq -0x108(%rbp), %rax
jg 0x12e0d6
movq -0x100(%rbp), %rax
movq %rax, -0x270(%rbp)
jmp 0x12e0e4
movq -0x108(%rbp), %rax
movq %rax, -0x270(%rbp)
movq -0x270(%rbp), %rax
movq %rax, -0x278(%rbp)
movq -0x100(%rbp), %rax
cmpq -0x108(%rbp), %rax
jl 0x12e112
movq -0x100(%rbp), %rax
movq %rax, -0x280(%rbp)
jmp 0x12e120
movq -0x108(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x278(%rbp), %rdi
movq -0x280(%rbp), %rsi
movq -0xb8(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
movq -0xd0(%rbp), %r8
movq -0x98(%rbp), %r9
movl $0x2625a0, %ecx         # imm = 0x2625A0
movsd 0x254115(%rip), %xmm0   # 0x382270
callq 0x128ad0
cmpq $0x0, %rax
je 0x12e171
movq $0x0, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0x12e26a
movq -0x100(%rbp), %rax
subq -0x108(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0xc8(%rbp), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
cmpb $0x0, %al
je 0x12e1cb
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
cmpb $0x0, %al
jne 0x12e205
movq -0x110(%rbp), %rax
cmpq -0x118(%rbp), %rax
jl 0x12e1f8
movq -0x110(%rbp), %rax
cmpq -0x120(%rbp), %rax
jg 0x12e1f8
movq $0x1, -0xa8(%rbp)
jmp 0x12e203
movq $0x0, -0xa8(%rbp)
jmp 0x12e268
movq -0xc8(%rbp), %rax
movq -0x80(%rbp), %rcx
subq $0x1, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
cmpb $0x0, %al
je 0x12e266
movq -0xc8(%rbp), %rax
imulq $0x30, -0x80(%rbp), %rcx
addq %rcx, %rax
movb 0x28(%rax), %al
andb $0x3f, %al
cmpb $0x0, %al
je 0x12e266
movq -0x110(%rbp), %rax
cmpq -0x120(%rbp), %rax
jg 0x12e259
movq $0x1, -0xa8(%rbp)
jmp 0x12e264
movq $0x0, -0xa8(%rbp)
jmp 0x12e266
jmp 0x12e268
jmp 0x12e26a
jmp 0x12e26c
movq $0x0, -0x140(%rbp)
movq -0xc8(%rbp), %rdi
movq -0x80(%rbp), %rax
subq $0x1, %rax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq -0xc8(%rbp), %rsi
imulq $0x30, -0x80(%rbp), %rax
addq %rax, %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
movq -0x50(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x1b0(%rbp), %rbx
movq -0x1b8(%rbp), %r11
movq -0x1c0(%rbp), %r10
leaq -0x160(%rbp), %r13
leaq -0x178(%rbp), %r12
leaq -0x190(%rbp), %r15
leaq -0x1a8(%rbp), %r14
leaq -0x140(%rbp), %rax
movq %rax, -0x288(%rbp)
movq -0x290(%rbp), %rax
movq %rax, (%rsp)
movq -0x288(%rbp), %rax
movq %r13, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movq %rbx, 0x28(%rsp)
movq %r11, 0x30(%rsp)
movq %r10, 0x38(%rsp)
movq $0x4c4b40, 0x40(%rsp)   # imm = 0x4C4B40
movq %rax, 0x48(%rsp)
callq 0x12cc10
movq %rax, -0xb0(%rbp)
cmpq $-0x1, -0xb0(%rbp)
je 0x12e38b
movq -0xb0(%rbp), %rax
leaq 0x29649b(%rip), %rcx    # 0x3c47f8
cmpq 0x278(%rcx), %rax
jg 0x12e38b
movq $0x1, -0xa8(%rbp)
cmpq $0x0, -0x140(%rbp)
jne 0x12e389
movq -0xb0(%rbp), %rax
movq %rax, -0x110(%rbp)
jmp 0x12e38b
jmp 0x12e38d
movq -0x110(%rbp), %rax
cmpq 0x18(%rbp), %rax
jge 0x12e3a5
movq 0x18(%rbp), %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0x12e3d9
movq -0x110(%rbp), %rax
cmpq -0x120(%rbp), %rax
jg 0x12e3cc
movq $0x1, -0xa8(%rbp)
jmp 0x12e3d7
movq $0x0, -0xa8(%rbp)
jmp 0x12e3d9
movq -0xc8(%rbp), %rdi
movq -0x80(%rbp), %rax
subq $0x1, %rax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq -0xc8(%rbp), %rsi
imulq $0x30, -0x80(%rbp), %rax
addq %rax, %rsi
movq -0xa8(%rbp), %rcx
movq -0x110(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
leaq -0xf0(%rbp), %r9
callq 0x12eff0
movq -0x60(%rbp), %rdi
callq 0xd4050
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq -0xf0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xe8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0xc8(%rbp), %rdi
imulq $0x30, -0x80(%rbp), %rax
addq %rax, %rdi
movq -0xc8(%rbp), %rsi
movq -0x80(%rbp), %rax
subq $0x1, %rax
imulq $0x30, %rax, %rax
addq %rax, %rsi
movq -0xa8(%rbp), %rcx
movq -0x110(%rbp), %r8
movl $0x1, %edx
leaq -0xf0(%rbp), %r9
callq 0x12eff0
movq -0x60(%rbp), %rdi
callq 0xd4050
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq -0xf0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xe8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xe0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x12dd3b
movq -0x1c0(%rbp), %rax
movq %rax, -0x298(%rbp)
movq -0x68(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x12e512
movq -0x48(%rbp), %rax
movq (%rax), %rax
imulq $0x58, -0x68(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2a0(%rbp)
jmp 0x12e532
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq -0x68(%rbp), %rcx
movq -0x38(%rbp), %rdx
subq (%rdx), %rcx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x2a0(%rbp)
movq -0x298(%rbp), %rdi
movq -0x2a0(%rbp), %rdx
xorl %esi, %esi
callq 0x12d670
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x12d98a
movq -0x60(%rbp), %rdi
callq 0xcdd10
movq -0x60(%rbp), %rdi
callq 0xce020
movq -0x60(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
cltq
movq %rax, -0x1d0(%rbp)
movq $0x0, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
cmpq -0x1d0(%rbp), %rax
jae 0x12e6d9
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x1c8(%rbp), %rcx
shrq %rcx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x12e5c2
jmp 0x12e6c2
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x1c8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x1d8(%rbp)
cmpq $0x1, -0x1d8(%rbp)
ja 0x12e5ed
jmp 0x12e6c2
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x60(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x1c8(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x1e0(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x1d8(%rbp), %rax
jae 0x12e6c0
movq -0x1e0(%rbp), %rax
imulq $0x18, -0x68(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x12e64f
jmp 0x12e6af
movq -0x1e0(%rbp), %rax
imulq $0x18, -0x68(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
movq -0x60(%rbp), %rdi
movq -0x1e0(%rbp), %rax
imulq $0x18, -0x68(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
xorl $0x1, %esi
movq -0x1e0(%rbp), %rax
imulq $0x18, -0x68(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %edx
movl $0x1, %ecx
callq 0xd6530
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x12e622
jmp 0x12e6c2
movq -0x1c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c8(%rbp)
jmp 0x12e58c
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
movl 0x4(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x12e741
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
imulq $0x18, -0x68(%rbp), %rcx
addq %rcx, %rax
cmpb $0x0, 0x12(%rax)
jne 0x12e731
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
imulq $0x18, -0x68(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0xc(%rax)
jmp 0x12e733
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x12e6e1
movq -0x60(%rbp), %rdi
callq 0xcdd10
movq -0x30(%rbp), %rax
movq (%rax), %rax
shlq %rax
movq -0x60(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x12e78f
movq -0x1b0(%rbp), %rdi
movq -0x60(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %esi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rdi
movq -0x60(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x2100
movq $0x0, -0x1f0(%rbp)
movq $0x0, -0x1f8(%rbp)
movq $0x0, -0x1e8(%rbp)
movq $0x0, -0x200(%rbp)
movq $0x0, -0x208(%rbp)
movq $0x0, -0x210(%rbp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x2140
movq %rax, -0x200(%rbp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x2140
movq %rax, -0x208(%rbp)
movq $0x0, -0x160(%rbp)
movq $0x0, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
cmpq -0x1d0(%rbp), %rax
jae 0x12eb7c
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x1c8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x1d8(%rbp)
cmpq $0x1, -0x1d8(%rbp)
ja 0x12e871
jmp 0x12e890
leaq 0x259f0d(%rip), %rdi    # 0x388785
leaq 0x25803e(%rip), %rsi    # 0x3868bd
movl $0x5913, %edx           # imm = 0x5913
leaq 0x259f02(%rip), %rcx    # 0x38878d
callq 0x2130
movq -0x1b0(%rbp), %rax
movq -0x1c8(%rbp), %rcx
shrq %rcx
cmpb $0x0, (%rax,%rcx)
je 0x12e8ac
jmp 0x12eb65
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x1c8(%rbp), %rcx
xorq $0x1, %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, %eax
je 0x12e8cd
jmp 0x12eb65
movq $0x0, -0x1f8(%rbp)
movq -0x60(%rbp), %rdi
movq -0x1c8(%rbp), %rax
movl %eax, %esi
leaq -0x1f8(%rbp), %rdx
leaq -0x130(%rbp), %rcx
leaq -0x138(%rbp), %r8
callq 0x12cef0
movl %eax, %eax
movq %rax, -0x128(%rbp)
cmpq $0x5, -0x128(%rbp)
jne 0x12e914
jmp 0x12e933
leaq 0x259f0e(%rip), %rdi    # 0x388829
leaq 0x257f9b(%rip), %rsi    # 0x3868bd
movl $0x5917, %edx           # imm = 0x5917
leaq 0x259e5f(%rip), %rcx    # 0x38878d
callq 0x2130
movq $0x0, -0x218(%rbp)
movq $0x0, -0x220(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x1f8(%rbp), %rax
jae 0x12e9ed
movq -0x1b0(%rbp), %rax
movq -0x1e8(%rbp), %rcx
movq -0x68(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x1e8(%rbp), %rcx
movq -0x68(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x1e8(%rbp), %rdx
movq -0x68(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
shrl %edx
movl %edx, %edx
movzbl 0x4(%rax,%rdx,8), %eax
subl $0x1, %eax
cltq
addq -0x220(%rbp,%rax,8), %rcx
movq %rcx, -0x220(%rbp,%rax,8)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x12e951
movq -0x220(%rbp), %rax
cmpq -0x218(%rbp), %rax
jb 0x12ea0d
movq -0x200(%rbp), %rax
movq %rax, -0x2a8(%rbp)
jmp 0x12ea1b
movq -0x208(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq -0x2a8(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x210(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x210(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x12eab1
movq -0x210(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x12ea66
movq -0x210(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x2b0(%rbp)
jmp 0x12ea74
movl $0x2, %eax
movq %rax, -0x2b0(%rbp)
jmp 0x12ea74
movq -0x2b0(%rbp), %rcx
movq -0x210(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x210(%rbp), %rax
movq (%rax), %rdi
movq -0x210(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x5, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x210(%rbp), %rax
movq %rcx, (%rax)
movq -0x210(%rbp), %rax
movq (%rax), %rax
movq -0x210(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
movq -0x228(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x1f8(%rbp), %rcx
movq -0x228(%rbp), %rax
movq %rcx, (%rax)
movq -0x228(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x228(%rbp), %rax
movq 0x8(%rax), %rdi
shlq $0x3, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x228(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x228(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x1e8(%rbp), %rsi
movq -0x228(%rbp), %rax
movq 0x8(%rax), %rdx
shlq $0x3, %rdx
callq 0x2180
movq -0x1c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c8(%rbp)
jmp 0x12e835
movq $0x0, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
cmpq -0x1d0(%rbp), %rax
jae 0x12ef4b
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x1c8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x1d8(%rbp)
cmpq $0x1, -0x1d8(%rbp)
ja 0x12ebc3
jmp 0x12ebe2
leaq 0x259bbb(%rip), %rdi    # 0x388785
leaq 0x257cec(%rip), %rsi    # 0x3868bd
movl $0x5925, %edx           # imm = 0x5925
leaq 0x259bb0(%rip), %rcx    # 0x38878d
callq 0x2130
movq -0x1b0(%rbp), %rax
movq -0x1c8(%rbp), %rcx
shrq %rcx
cmpb $0x0, (%rax,%rcx)
je 0x12ebfe
jmp 0x12ef34
xorl %eax, %eax
cmpq $0x1, -0x1d8(%rbp)
movb %al, -0x2b1(%rbp)
jne 0x12ec33
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x1c8(%rbp), %rcx
xorq $0x1, %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x1, %eax
sete %al
movb %al, -0x2b1(%rbp)
movb -0x2b1(%rbp), %al
testb $0x1, %al
jne 0x12ec3f
jmp 0x12ec41
jmp 0x12ec60
leaq 0x259bf0(%rip), %rdi    # 0x388838
leaq 0x257c6e(%rip), %rsi    # 0x3868bd
movl $0x5927, %edx           # imm = 0x5927
leaq 0x259b32(%rip), %rcx    # 0x38878d
callq 0x2130
movq $0x0, -0x1f8(%rbp)
movq -0x60(%rbp), %rdi
movq -0x1c8(%rbp), %rax
movl %eax, %esi
leaq -0x1f8(%rbp), %rdx
leaq -0x130(%rbp), %rcx
leaq -0x138(%rbp), %r8
callq 0x12cef0
movl %eax, %eax
movq %rax, -0x128(%rbp)
cmpq $0x7, -0x128(%rbp)
jne 0x12eca7
jmp 0x12ecc6
leaq 0x259bb2(%rip), %rdi    # 0x388860
leaq 0x257c08(%rip), %rsi    # 0x3868bd
movl $0x5929, %edx           # imm = 0x5929
leaq 0x259acc(%rip), %rcx    # 0x38878d
callq 0x2130
movq $0x0, -0x218(%rbp)
movq $0x0, -0x220(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x1f8(%rbp), %rax
jae 0x12ed80
movq -0x1b0(%rbp), %rax
movq -0x1e8(%rbp), %rcx
movq -0x68(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
movb $0x1, (%rax,%rcx)
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x1e8(%rbp), %rcx
movq -0x68(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %ecx
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x1e8(%rbp), %rdx
movq -0x68(%rbp), %rsi
movq (%rdx,%rsi,8), %rdx
shrl %edx
movl %edx, %edx
movzbl 0x4(%rax,%rdx,8), %eax
subl $0x1, %eax
cltq
addq -0x220(%rbp,%rax,8), %rcx
movq %rcx, -0x220(%rbp,%rax,8)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x12ece4
movq -0x220(%rbp), %rax
cmpq -0x218(%rbp), %rax
jb 0x12eda0
movq -0x200(%rbp), %rax
movq %rax, -0x2c0(%rbp)
jmp 0x12edae
movq -0x208(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq -0x2c0(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x220(%rbp), %rax
cmpq -0x218(%rbp), %rax
jb 0x12eddc
movq -0x200(%rbp), %rax
movq %rax, -0x2c8(%rbp)
jmp 0x12edea
movq -0x208(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x2c8(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x210(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x210(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x12ee80
movq -0x210(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x12ee35
movq -0x210(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x2d0(%rbp)
jmp 0x12ee43
movl $0x2, %eax
movq %rax, -0x2d0(%rbp)
jmp 0x12ee43
movq -0x2d0(%rbp), %rcx
movq -0x210(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x210(%rbp), %rax
movq (%rax), %rdi
movq -0x210(%rbp), %rax
movq 0x10(%rax), %rsi
shlq $0x5, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x210(%rbp), %rax
movq %rcx, (%rax)
movq -0x210(%rbp), %rax
movq (%rax), %rax
movq -0x210(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
movq -0x228(%rbp), %rax
movq $0x1, 0x10(%rax)
movq -0x1f8(%rbp), %rcx
movq -0x228(%rbp), %rax
movq %rcx, (%rax)
movq -0x228(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x228(%rbp), %rax
movq 0x8(%rax), %rdi
shlq $0x3, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x228(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x228(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x1e8(%rbp), %rsi
movq -0x228(%rbp), %rax
movq 0x8(%rax), %rdx
shlq $0x3, %rdx
callq 0x2180
movq -0x1c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c8(%rbp)
jmp 0x12eb87
movq -0x1e8(%rbp), %rdi
callq 0x2210
movq -0x150(%rbp), %rdi
callq 0x2210
movq -0x168(%rbp), %rdi
callq 0x2210
movq -0x180(%rbp), %rdi
callq 0x2210
movq -0x198(%rbp), %rdi
callq 0x2210
movq -0x1b0(%rbp), %rdi
callq 0x2210
movq -0x1b8(%rbp), %rdi
callq 0x2210
movq -0x1c0(%rbp), %rdi
callq 0x2210
movq -0x60(%rbp), %rdi
callq 0xcd170
movq -0x200(%rbp), %rcx
movq 0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x208(%rbp), %rcx
movq 0x28(%rbp), %rax
movq %rcx, (%rax)
addq $0x2f8, %rsp            # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)