// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: gen_switch_phasing(asg_t*, ma_ug_t*, unsigned long, ma_hit_t_alloc*, ma_sub_t*, int, int, unsigned char*, unsigned char*, buf_t*, unsigned long, unsigned long, asg_t*, asg64_v*)
int gen_switch_phasing(asg_t *sg, ma_ug_t *ug, uint64_t bi, 
ma_hit_t_alloc* src, ma_sub_t *cov, int32_t max_hang, 
int32_t min_ovlp, uint8_t* trio_flag, uint8_t* vis_r_flag, 
buf_t *b, uint64_t tLen, uint64_t vis_f, asg_t *res, asg64_v *sv)
{
    uint32_t k_i, k_j, k_v, rev, z, zn; asg_arc_t *za; 
    ma_utg_t* nsu = NULL; int sw0, sw1;

    sw0 = sw1 = 1;
    asg_bub_pop1_primary_trio_switch_check(ug->g, ug, bi, tLen, b, FATHER, DROP, 0, NULL, NULL, &sw0);
    if(sw0 == 0) {
        asg_bub_pop1_primary_trio_switch_check(ug->g, ug, bi, tLen, b, MOTHER, DROP, 0, NULL, NULL, &sw1);
    } 

    for (k_i = 0; k_i < b->b.n; k_i++) {
        if((b->b.a[k_i]>>1)==(bi>>1) || (b->b.a[k_i]>>1)==(b->S.a[0]>>1)) continue;
        nsu = &(ug->u.a[b->b.a[k_i]>>1]);
        for (k_j = 0; k_j < nsu->n; k_j++) {
            if(R_INF.trio_flag[nsu->a[k_j]>>33] == DROP) R_INF.trio_flag[nsu->a[k_j]>>33] = AMBIGU;
        }
    }
    if(sw0 == 0 && sw1 == 0) return 0;

    uint64_t i, ei = b->S.a[0]^1, v, bv, ev;
    for (k_i = 0; k_i < b->b.n; k_i++) {
        if((b->b.a[k_i]>>1)==(bi>>1) || (b->b.a[k_i]>>1)==(b->S.a[0]>>1)) continue;
        nsu = &(ug->u.a[b->b.a[k_i]>>1]); rev = b->b.a[k_i]&1;
        for (k_j = 0; k_j < nsu->n; k_j++) {
            v = nsu->a[k_j]>>32; if(rev) v ^= 1;
            vis_r_flag[v] = vis_f;
        }
    }
    bv = (bi&1)?(ug->u.a[bi>>1].start^1):(ug->u.a[bi>>1].end^1); //vis_r_flag[bv] = vis_f;
    ev = (ei&1)?(ug->u.a[ei>>1].start^1):(ug->u.a[ei>>1].end^1); //vis_r_flag[ev] = vis_f;

    ma_hit_t_alloc* x = NULL;
    ma_hit_t *h; ma_sub_t *sq, *st;
    int32_t r; asg_arc_t t0, t1, *p;

    for (k_i = 0; k_i < b->b.n; k_i++) {
        if((b->b.a[k_i]>>1)==(bi>>1) || (b->b.a[k_i]>>1)==(b->S.a[0]>>1)) continue;
        nsu = &(ug->u.a[b->b.a[k_i]>>1]);
        for (k_j = 0; k_j < nsu->n; k_j++) {
            for (k_v = 0; k_v < 2; k_v++) {
                v = ((nsu->a[k_j]>>33)<<1) + k_v;
                if(vis_r_flag[v] != vis_f) continue;;
                x = &(src[v>>1]); 
                za = asg_arc_a(sg, v); 
                zn = asg_arc_n(sg, v); 
                for (i = 0; i < x->length; i++) {
                    h = &(x->buffer[i]);
                    // if(!(h->el)) continue;
                    sq = &(cov[Get_qn(*h)]); st = &(cov[Get_tn(*h)]);
                    if(st->del || sg->seq[Get_tn(*h)].del) continue;
                    r = ma_hit2arc(h, sq->e - sq->s, st->e - st->s, max_hang, 
                                        asm_opt.max_hang_rate, min_ovlp, &t0);
                
                    ///if it is a contained read, skip
                    if(r < 0) continue;
                    if((t0.ul>>32) != v) continue;
                    if((vis_r_flag[t0.ul>>32] != vis_f) || (vis_r_flag[t0.v] != vis_f)) continue;
                    for (z = 0; (z < zn) && (za[z].v != t0.v); z++);
                    if(z < zn) continue;
                    if(get_edge_from_source(src, cov, NULL, max_hang, min_ovlp, (t0.v^1), ((t0.ul>>32)^1), &t1)) {
                        p = asg_arc_pushp(res); *p = t0;
                        p = asg_arc_pushp(res); *p = t1;
                    }
                }

            }
        }
    }
    kv_push(uint64_t, *sv, (bv<<32)|(ev));
    return 1;
}

int asg_arc_del_trans_aux(asg_t *g, asg_t *aux, uint8_t *mark, int fuzz)
{
    uint32_t v, w, n_vtx = g->n_seq * 2, n_reduced = 0;
    uint32_t L, i, j, nv0, nv1, kv; asg_arc_t *av0, *av1;
    asg_arc_t *aw0, *aw1; uint32_t nw0, nw1; 
    memset(mark, 0, sizeof((*mark))*n_vtx);

    for (v = 0; v < n_vtx; ++v) {
        if (g->seq[v>>1].del) continue;
        nv0 = asg_arc_n(g, v); av0 = asg_arc_a(g, v); 
        nv1 = asg_arc_n(aux, v); av1 = asg_arc_a(aux, v);
        if (nv0 + nv1 == 0) continue; 
        //all outnode of v should be set to "not reduce"
        for (i = kv = 0; i < nv0; ++i) {
            if(av0[i].del) continue;
            mark[av0[i].v] = 1; kv++;
        }
        for (i = 0; i < nv1; ++i) {
            if(av1[i].del) continue;
            mark[av1[i].v] = 1; kv++;
        }
        if(kv == 0) continue; 

        ///av[nv-1] is longest out-dege
        L = 0;
        if(nv0) L = asg_arc_len(av0[nv0-1]);
        if(nv1 && L < asg_arc_len(av1[nv1-1])) L = asg_arc_len(av1[nv1-1]);
        L += fuzz;
        for (i = 0; i < nv0; ++i) {
            //w is an out-node of v
            w = av0[i].v; if (mark[w] != 1) continue; ///w has already been reduced
            nw0 = asg_arc_n(g, w); aw0 = asg_arc_a(g, w);
            nw1 = asg_arc_n(aux, w); aw1 = asg_arc_a(aux, w);

            for (j = 0; j < nw0 && asg_arc_len(aw0[j]) + asg_arc_len(av0[i]) <= L; ++j)
                if (mark[aw0[j].v]) mark[aw0[j].v] = 2;
            for (j = 0; j < nw1 && asg_arc_len(aw1[j]) + asg_arc_len(av0[i]) <= L; ++j)
                if (mark[aw1[j].v]) mark[aw1[j].v] = 2;
        }
        //remove edges
        for (i = 0; i < nv0; ++i) {
            if (mark[av0[i].v] == 2) {
                av0[i].del = 1; ++n_reduced;
            }
            mark[av0[i].v] = 0;
        }
    }

    if (n_reduced) {
        asg_cleanup(g);
        asg_symm(g);
    }

    return n_reduced;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq 0x48(%rbp), %rax
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x1, -0x68(%rbp)
movl $0x1, -0x64(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rax
movl %eax, %edx
movq 0x30(%rbp), %rcx
movq 0x28(%rbp), %r8
movl $0x1, %r9d
xorl %eax, %eax
xorl %eax, %eax
leaq -0x64(%rbp), %rax
movl $0x5, (%rsp)
movl $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x135a60
cmpl $0x0, -0x64(%rbp)
jne 0x137094
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rax
movl %eax, %edx
movq 0x30(%rbp), %rcx
movq 0x28(%rbp), %r8
movl $0x2, %r9d
xorl %eax, %eax
xorl %eax, %eax
leaq -0x68(%rbp), %rax
movl $0x5, (%rsp)
movl $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x135a60
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq 0x28(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x13718d
movq 0x28(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x38(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, %eax
movq -0x20(%rbp), %rcx
shrq %rcx
cmpq %rcx, %rax
je 0x1370ea
movq 0x28(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x38(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movq 0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl (%rcx), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x1370ef
jmp 0x13717f
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rbp), %rcx
movq 0x48(%rcx), %rcx
movl -0x38(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x13717d
leaq 0x28e1a2(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x60(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x5, %eax
jne 0x137170
leaq 0x28e17b(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x60(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movb $0x0, (%rax,%rcx)
jmp 0x137172
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x13711b
jmp 0x13717f
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x13709b
cmpl $0x0, -0x64(%rbp)
jne 0x1371a5
cmpl $0x0, -0x68(%rbp)
jne 0x1371a5
movl $0x0, -0x4(%rbp)
jmp 0x13781a
movq 0x28(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
xorl $0x1, %eax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq 0x28(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x1372b4
movq 0x28(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x38(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, %eax
movq -0x20(%rbp), %rcx
shrq %rcx
cmpq %rcx, %rax
je 0x13720e
movq 0x28(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x38(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movq 0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl (%rcx), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x137213
jmp 0x1372a6
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rbp), %rcx
movq 0x48(%rcx), %rcx
movl -0x38(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq 0x28(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x38(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0x1, %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1372a4
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x3c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x80(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x137288
movq -0x80(%rbp), %rax
xorq $0x1, %rax
movq %rax, -0x80(%rbp)
movq 0x38(%rbp), %rax
movb %al, %dl
movq 0x20(%rbp), %rax
movq -0x80(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x137253
jmp 0x1372a6
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1371bf
movq -0x20(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x1372e6
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
shrq %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
xorl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x137308
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
shrq %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movl %eax, %eax
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x137349
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rcx
shrq %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
xorl $0x1, %eax
movl %eax, -0xf8(%rbp)
jmp 0x13736b
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x78(%rbp), %rcx
shrq %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0xf8(%rbp)
movl -0xf8(%rbp), %eax
movl %eax, %eax
movq %rax, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq 0x28(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x137771
movq 0x28(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x38(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, %eax
movq -0x20(%rbp), %rcx
shrq %rcx
cmpq %rcx, %rax
je 0x1373db
movq 0x28(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x38(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movq 0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl (%rcx), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x1373e0
jmp 0x137763
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x28(%rbp), %rcx
movq 0x48(%rcx), %rcx
movl -0x38(%rbp), %edx
movl (%rcx,%rdx,4), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x137761
movl $0x0, -0x40(%rbp)
cmpl $0x2, -0x40(%rbp)
jae 0x137751
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x3c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
shlq %rax
movl -0x40(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq 0x20(%rbp), %rax
movq -0x80(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpq 0x38(%rbp), %rax
je 0x137464
jmp 0x137743
movq -0x28(%rbp), %rax
movq -0x80(%rbp), %rcx
shrq %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x80(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x4c(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq -0x98(%rbp), %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jae 0x137741
movq -0x98(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x70(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0x30(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0x30(%rbp), %rax
movq -0xa0(%rbp), %rcx
movl 0xc(%rcx), %ecx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0x13755b
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0xa0(%rbp), %rcx
movl 0xc(%rcx), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x137560
jmp 0x137730
movq -0xa0(%rbp), %rdi
movq -0xa8(%rbp), %rax
movl 0x4(%rax), %esi
movq -0xa8(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %esi
movq -0xb0(%rbp), %rax
movl 0x4(%rax), %edx
movq -0xb0(%rbp), %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subl %eax, %edx
movl -0x34(%rbp), %ecx
leaq 0x28d253(%rip), %rax    # 0x3c47f8
movss 0x158(%rax), %xmm0
movl 0x10(%rbp), %r8d
leaq -0xd0(%rbp), %r9
callq 0xd0300
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb4(%rbp)
jge 0x1375d1
jmp 0x137730
movq -0xd0(%rbp), %rax
shrq $0x20, %rax
cmpq -0x80(%rbp), %rax
je 0x1375e7
jmp 0x137730
movq 0x20(%rbp), %rax
movq -0xd0(%rbp), %rcx
shrq $0x20, %rcx
movzbl (%rax,%rcx), %eax
cmpq 0x38(%rbp), %rax
jne 0x137614
movq 0x20(%rbp), %rax
movl -0xc8(%rbp), %ecx
movzbl (%rax,%rcx), %eax
cmpq 0x38(%rbp), %rax
je 0x137619
jmp 0x137730
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %ecx
xorl %eax, %eax
cmpl -0x4c(%rbp), %ecx
movb %al, -0xf9(%rbp)
jae 0x137650
movq -0x58(%rbp), %rax
movl -0x48(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0xc8(%rbp), %eax
setne %al
movb %al, -0xf9(%rbp)
movb -0xf9(%rbp), %al
testb $0x1, %al
jne 0x13765c
jmp 0x137669
jmp 0x13765e
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x137620
movl -0x48(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jae 0x137676
jmp 0x137730
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x34(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0xc8(%rbp), %r9d
xorl $0x1, %r9d
movq -0xd0(%rbp), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0xe8(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
cmpl $0x0, %eax
je 0x13772e
movq 0x40(%rbp), %rdi
callq 0xd4050
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq -0xd0(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq 0x40(%rbp), %rdi
callq 0xd4050
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq -0xe8(%rbp), %rcx
movq %rcx, (%rax)
movq -0xe0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xd8(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x137730
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x1374bf
jmp 0x137743
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x137423
jmp 0x137753
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x13740c
jmp 0x137763
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x13738c
jmp 0x137773
movq 0x48(%rbp), %rax
movq (%rax), %rax
movq 0x48(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x1377e4
movq 0x48(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1377a3
movq 0x48(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x108(%rbp)
jmp 0x1377b1
movl $0x2, %eax
movq %rax, -0x108(%rbp)
jmp 0x1377b1
movq -0x108(%rbp), %rcx
movq 0x48(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x48(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq 0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x88(%rbp), %rdx
shlq $0x20, %rdx
orq -0x90(%rbp), %rdx
movq 0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x48(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)