// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: asg_bub_backtrack_primary_cov(ma_ug_t*, unsigned int, buf_t*, hap_cov_t*, unsigned int)
static void asg_bub_backtrack_primary_cov(ma_ug_t *ug, uint32_t v0, buf_t *b, hap_cov_t *cov, uint32_t is_update_chain)
{
    uint32_t i, k, k_i, v, u, uLen = 0, uCov = 0, uId, rId, ori;
    ma_utg_t* p = NULL;
    trans_chain* t_ch = (is_update_chain?cov->t_ch:NULL);
    ///b->S.a[0] is the sink of this bubble

    ///assert(b->S.n == 1);
    ///first remove all nodes in this bubble
    for (i = 0; i < b->b.n; ++i)
    {
        uId = b->b.a[i]>>1;
        if(uId == (b->S.a[0]>>1)) continue;
        p = &(ug->u.a[uId]);
        if(p->n == 0) continue;

        for (k = 0; k < p->n; k++)
        {
            rId = p->a[k]>>33;
            uCov += cov->cov[rId];
        }
    }

    
    ///v is the sink of this bubble
    v = b->S.a[0];
    ///recover node
    do {
        u = b->a[v].p; // u->v
        if(v != b->S.a[0])
        {
            uId = v>>1;
            p = &(ug->u.a[uId]);
            if(p->n == 0) continue;
            for (k = 0; k < p->n; k++)
            {
                rId = p->a[k]>>33;
                uCov -= cov->cov[rId];
                uLen += cov->read_g->seq[rId].len;
            }
        }
        v = u;
    } while (v != v0);

    uCov = (uLen == 0? 0 : uCov / uLen);

    ///v is the sink of this bubble
    v = b->S.a[0];
    ///recover node
    do {
        u = b->a[v].p; // u->v
        if(v != b->S.a[0])
        {
            uId = v>>1;
            p = &(ug->u.a[uId]);
            if(p->n == 0) continue;
            for (k = 0; k < p->n; k++)
            {
                rId = p->a[k]>>33;
                cov->cov[rId] += (uCov * cov->read_g->seq[rId].len);///this the average coverage of the whole bubble
            }
        }
        v = u;
    } while (v != v0);


    if(t_ch)
    {
        ///is this requirement appropriate?
        if(get_real_length(ug->g, v0, NULL) == 2 && get_real_length(ug->g, b->S.a[0]^1, NULL) == 2)
        {
            long long tmp, max_stop_nodeLen, max_stop_baseLen, bch_occ[2];
            uint32_t bch[2], convex[2];
            get_real_length(ug->g, v0, bch);

            ///in rare cases, one side of a bubble might be empty
            if((bch[0]>>1)!=(b->S.a[0]>>1) && (bch[1]>>1)!=(b->S.a[0]>>1))
            {
                get_unitig(ug->g, NULL, bch[0], &convex[0], &bch_occ[0], &tmp, 
                                                    &max_stop_nodeLen, &max_stop_baseLen, 1, NULL);
                get_unitig(ug->g, NULL, bch[1], &convex[1], &bch_occ[1], &tmp, 
                                                    &max_stop_nodeLen, &max_stop_baseLen, 1, NULL);
                ///if this is a simple bubble
                if(((bch_occ[0] + bch_occ[1] + 1) == (uint32_t)b->b.n) && 
                        get_real_length(ug->g, convex[0], NULL) == 1 && get_real_length(ug->g, convex[1], NULL) == 1)
                {
                    get_real_length(ug->g, convex[0], &convex[0]);
                    get_real_length(ug->g, convex[1], &convex[1]);
                    if(convex[0] == b->S.a[0] && convex[1] == b->S.a[0])///double check if it is a simple bubble
                    {
                        t_ch->b_buf_0.b.n = 0;
                        get_unitig(ug->g, NULL, bch[0], &convex[0], &bch_occ[0], &tmp, &max_stop_nodeLen, &max_stop_baseLen, 1, &(t_ch->b_buf_0));
                        for (i = 0; i < t_ch->b_buf_0.b.n; ++i)///retrive one side of the bubble
                        {
                            uId = t_ch->b_buf_0.b.a[i]>>1;
                            p = &(ug->u.a[uId]);
                            if(p->n == 0) continue;
                            ori = t_ch->b_buf_0.b.a[i]&1;
                            for (k = 0; k < p->n; k++)
                            {
                                t_ch->ir_het[(ori == 1?((p->a[p->n-k-1])>>33):(p->a[k]>>33))] |= P_HET;
                            }
                        }
                        
                        t_ch->b_buf_1.b.n = 0;
                        get_unitig(ug->g, NULL, bch[1], &convex[1], &bch_occ[1], &tmp, &max_stop_nodeLen, &max_stop_baseLen, 1, &(t_ch->b_buf_1));
                        for (i = 0; i < t_ch->b_buf_1.b.n; ++i)///retrive another side of the bubble
                        {
                            uId = t_ch->b_buf_1.b.a[i]>>1;
                            p = &(ug->u.a[uId]);
                            if(p->n == 0) continue;
                            ori = t_ch->b_buf_1.b.a[i]&1;
                            for (k = 0; k < p->n; k++)
                            {
                                t_ch->ir_het[(ori == 1?((p->a[p->n-k-1])>>33):(p->a[k]>>33))] |= P_HET;
                            }
                        }
                        ///generate read-to-read overlaps
                        chain_origin_trans_uid_s_bubble(&(t_ch->b_buf_0), &(t_ch->b_buf_1), 
                                                                        v0, b->S.a[0]^1, ug, cov);
                        return;
                    }
                }
            }
        }

        topologicalSortUtil(ug->g, cov, v0, b->S.a[0]);
        ///if(cov->t_ch->topo_res.n != b->b.n - 1) fprintf(stderr, "ERROR-4\n");
        if(cov->t_ch->topo_res.n == 0) return;
        for (i = 0; i < cov->t_ch->topo_res.n; ++i)
        {
            uId = cov->t_ch->topo_res.a[i]>>1;
            if(uId == (b->S.a[0]>>1)) continue;

            dfs_trans_chain_bub(ug->g, cov, uId, v0>>1, b->S.a[0]>>1);

            if(cov->t_ch->b_buf_0.b.n == 0) continue;
            chain_origin_trans_uid_c_bubble(cov->t_ch->topo_res.a[i], &(t_ch->b_buf_0), b, ug, cov);

            /***********************x***********************/
            uId = cov->t_ch->topo_res.a[i]>>1;
            p = &(ug->u.a[uId]);
            if(p->n == 0) continue;
            ori = cov->t_ch->topo_res.a[i]&1;
            for (k = 0; k < p->n; k++)
            {
                t_ch->ir_het[(ori == 1?((p->a[p->n-k-1])>>33):(p->a[k]>>33))] |= P_HET;
            }
            /***********************x***********************/

            /***********************y***********************/
            for (k_i = 0; k_i < t_ch->b_buf_0.b.n; ++k_i)
            {
                uId = t_ch->b_buf_0.b.a[k_i]>>1;
                p = &(ug->u.a[uId]);
                if(p->n == 0) continue;
                ori = t_ch->b_buf_0.b.a[k_i]&1;
                for (k = 0; k < p->n; k++)
                {
                    t_ch->ir_het[(ori == 1?((p->a[p->n-k-1])>>33):(p->a[k]>>33))] |= P_HET;
                }
            }
            /***********************y***********************/
        }
    } 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq $0x0, -0x58(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x13adde
movq -0x20(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0xa8(%rbp)
jmp 0x13ade9
xorl %eax, %eax
movq %rax, -0xa8(%rbp)
jmp 0x13ade9
movq -0xa8(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x13aeae
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl (%rcx), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x13ae34
jmp 0x13aea0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x13ae56
jmp 0x13aea0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x13ae9e
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x48(%rbp), %ecx
movl (%rax,%rcx,4), %eax
addl -0x40(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x13ae5d
jmp 0x13aea0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x13adfb
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl -0x34(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
je 0x13af77
movl -0x34(%rbp), %eax
shrl %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x13af0e
jmp 0x13af7d
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x13af75
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x48(%rbp), %ecx
movl (%rax,%rcx,4), %ecx
movl -0x40(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rax), %rax
movl -0x48(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x13af15
jmp 0x13af77
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0x13aebb
cmpl $0x0, -0x3c(%rbp)
jne 0x13af99
xorl %eax, %eax
movl %eax, -0xac(%rbp)
jmp 0x13afa7
movl -0x40(%rbp), %eax
xorl %edx, %edx
divl -0x3c(%rbp)
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl -0x34(%rbp), %ecx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
je 0x13b074
movl -0x34(%rbp), %eax
shrl %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x13b010
jmp 0x13b07a
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x13b072
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movl %eax, -0x48(%rbp)
movl -0x40(%rbp), %edx
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x20(%rax), %rax
movl -0x48(%rbp), %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
imull %eax, %edx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x48(%rbp), %ecx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x13b017
jmp 0x13b074
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0x13afbd
cmpq $0x0, -0x60(%rbp)
je 0x13b8a0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0xc(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x2, %eax
jne 0x13b5a2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %esi
xorl $0x1, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x2, %eax
jne 0x13b5a2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0xc(%rbp), %esi
leaq -0x98(%rbp), %rdx
callq 0x166b50
movl -0x98(%rbp), %eax
shrl %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl (%rcx), %ecx
shrl %ecx
cmpl %ecx, %eax
je 0x13b5a0
movl -0x94(%rbp), %eax
shrl %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl (%rcx), %ecx
shrl %ecx
cmpl %ecx, %eax
je 0x13b5a0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x98(%rbp), %edx
leaq -0xa0(%rbp), %rcx
leaq -0x90(%rbp), %r8
xorl %eax, %eax
movl %eax, %esi
leaq -0x68(%rbp), %r9
leaq -0x70(%rbp), %r10
leaq -0x78(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
callq 0x166c30
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x94(%rbp), %edx
leaq -0xa0(%rbp), %rcx
addq $0x4, %rcx
leaq -0x90(%rbp), %r8
addq $0x8, %r8
xorl %eax, %eax
movl %eax, %esi
leaq -0x68(%rbp), %r9
leaq -0x70(%rbp), %r10
leaq -0x78(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
callq 0x166c30
movq -0x90(%rbp), %rax
addq -0x88(%rbp), %rax
addq $0x1, %rax
movq -0x18(%rbp), %rcx
movq 0x38(%rcx), %rcx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0x13b59e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0xa0(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x1, %eax
jne 0x13b59e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x9c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x166b50
cmpl $0x1, %eax
jne 0x13b59e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0xa0(%rbp), %esi
leaq -0xa0(%rbp), %rdx
callq 0x166b50
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x9c(%rbp), %esi
leaq -0xa0(%rbp), %rdx
addq $0x4, %rdx
callq 0x166b50
movl -0xa0(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x13b59c
movl -0x9c(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x13b59c
movq -0x60(%rbp), %rax
movq $0x0, 0xa0(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x98(%rbp), %edx
leaq -0xa0(%rbp), %rcx
leaq -0x90(%rbp), %r8
movq -0x60(%rbp), %rax
addq $0x68, %rax
xorl %esi, %esi
leaq -0x68(%rbp), %r9
leaq -0x70(%rbp), %r11
leaq -0x78(%rbp), %r10
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x166c30
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpq 0xa0(%rcx), %rax
jae 0x13b3f4
movq -0x60(%rbp), %rax
movq 0xb0(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x13b33d
jmp 0x13b3e6
movq -0x60(%rbp), %rax
movq 0xb0(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0x1, %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x13b3e4
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xb8(%rbp)
cmpl $0x1, -0x4c(%rbp)
jne 0x13b3a4
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0xc0(%rbp)
jmp 0x13b3be
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rax
movq -0xc0(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl $0x2, %edx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x13b35b
jmp 0x13b3e6
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x13b2ee
movq -0x60(%rbp), %rax
movq $0x0, 0x108(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x94(%rbp), %edx
leaq -0xa0(%rbp), %rcx
addq $0x4, %rcx
leaq -0x90(%rbp), %r8
addq $0x8, %r8
movq -0x60(%rbp), %rax
addq $0xd0, %rax
xorl %esi, %esi
leaq -0x68(%rbp), %r9
leaq -0x70(%rbp), %r11
leaq -0x78(%rbp), %r10
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0x166c30
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpq 0x108(%rcx), %rax
jae 0x13b567
movq -0x60(%rbp), %rax
movq 0x118(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x13b4b0
jmp 0x13b559
movq -0x60(%rbp), %rax
movq 0x118(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0x1, %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x13b557
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xc8(%rbp)
cmpl $0x1, -0x4c(%rbp)
jne 0x13b517
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0xd0(%rbp)
jmp 0x13b531
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rax
movq -0xd0(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl $0x2, %edx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x13b4ce
jmp 0x13b559
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x13b461
movq -0x60(%rbp), %rdi
addq $0x68, %rdi
movq -0x60(%rbp), %rsi
addq $0xd0, %rsi
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %ecx
xorl $0x1, %ecx
movq -0x8(%rbp), %r8
movq -0x20(%rbp), %r9
callq 0x134c00
jmp 0x13b8a0
jmp 0x13b59e
jmp 0x13b5a0
jmp 0x13b5a2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl -0xc(%rbp), %edx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %ecx
callq 0x134700
movq -0x20(%rbp), %rax
movq 0xa8(%rax), %rax
cmpq $0x0, 0x50(%rax)
jne 0x13b5d7
jmp 0x13b8a0
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x20(%rbp), %rcx
movq 0xa8(%rcx), %rcx
cmpq 0x50(%rcx), %rax
jae 0x13b89e
movq -0x20(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x60(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl (%rcx), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x13b628
jmp 0x13b890
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl -0x44(%rbp), %edx
movl -0xc(%rbp), %ecx
shrl %ecx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %r8d
shrl %r8d
callq 0x133c70
movq -0x20(%rbp), %rax
movq 0xa8(%rax), %rax
cmpq $0x0, 0xa0(%rax)
jne 0x13b669
jmp 0x13b890
movq -0x20(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x60(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %edi
movq -0x60(%rbp), %rsi
addq $0x68, %rsi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x135260
movq -0x20(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x60(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x13b6d6
jmp 0x13b890
movq -0x20(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x60(%rax), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0x1, %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x13b781
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xd8(%rbp)
cmpl $0x1, -0x4c(%rbp)
jne 0x13b741
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0xe0(%rbp)
jmp 0x13b75b
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rax
movq -0xe0(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl $0x2, %edx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x13b6f8
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x60(%rbp), %rcx
cmpq 0xa0(%rcx), %rax
jae 0x13b88e
movq -0x60(%rbp), %rax
movq 0xb0(%rax), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x13b7d7
jmp 0x13b880
movq -0x60(%rbp), %rax
movq 0xb0(%rax), %rax
movl -0x30(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0x1, %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x13b87e
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xe8(%rbp)
cmpl $0x1, -0x4c(%rbp)
jne 0x13b83e
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x58(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0xf0(%rbp)
jmp 0x13b858
movq -0x58(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rax
movq -0xf0(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl $0x2, %edx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x13b7f5
jmp 0x13b880
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x13b788
jmp 0x13b890
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x13b5de
jmp 0x13b8a0
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax)