// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: set_trio_flag_by_cov(ma_ug_t*, asg_t*, hap_cov_t*)
void set_trio_flag_by_cov(ma_ug_t *ug, asg_t *read_g, hap_cov_t *cov)
{
    kvec_t(uint64_t) idx; kv_init(idx);
    uint32_t i, k, j, qn, tn, s[2], flag, n, found = 0;
    uint64_t offset, r_beg, r_end, ovlp;
    ma_utg_t *u = NULL, *w = NULL;
    u_trans_t *a = NULL;
    kv_u_trans_t *ta = &(cov->t_ch->k_trans);

    for (i = 0, idx.n = 0; i < ta->idx.n; i++)
    {
        qn = i;
        u = &(ug->u.a[qn]);
        for (k = 0; k < u->n; k++)
        {
            if((R_INF.trio_flag[u->a[k]>>33]&SET_TRIO)==0) break;
        }

        if(k >= u->n) continue; ///whole unitig is primary

        a = u_trans_a(*ta, qn);
        n = u_trans_n(*ta, qn);
        for (k = 0, s[0] = s[1] = 0; k < n; k++)
        {
            tn = a[k].tn;
            w = &(ug->u.a[tn]);
            for (j = found = 0, offset = 0; j < w->n; j++)
            {

                r_beg = offset; r_end = offset + read_g->seq[w->a[j]>>33].len;
                offset += (uint32_t)w->a[j];
                ovlp = ((MIN(r_end, a[k].te) > MAX(r_beg, a[k].ts))?
                                        MIN(r_end, a[k].te) - MAX(r_beg, a[k].ts):0);
                if(found == 1 && ovlp == 0) break;
                if(ovlp == 0) continue;
                found = 1;
                if(ovlp <= (read_g->seq[w->a[j]>>33].len)*0.8) continue;

                if((R_INF.trio_flag[w->a[j]>>33]&FATHER)||(R_INF.trio_flag[w->a[j]>>33]&MOTHER))
                {
                    s[0]++;
                }
                
                if(R_INF.trio_flag[w->a[j]>>33]&SET_TRIO)
                {
                    s[1]++;
                }
            }
        }

        if(s[1] > 0)
        {
            kv_push(uint64_t, idx, (uint64_t)((uint32_t)-1 - s[0]) << 32 | (qn));
        }
    }

    for (i = 0; i < idx.n; i++)
    {
        qn = (uint32_t)idx.a[i];
        u = &(ug->u.a[qn]);
        a = u_trans_a(*ta, qn);
        n = u_trans_n(*ta, qn);
        for (k = 0, s[0] = s[1] = 0; k < n; k++)
        {
            tn = a[k].tn;
            w = &(ug->u.a[tn]);
            for (j = found = 0, offset = 0; j < w->n; j++)
            {

                r_beg = offset; r_end = offset + read_g->seq[w->a[j]>>33].len;
                offset += (uint32_t)w->a[j];
                ovlp = ((MIN(r_end, a[k].te) > MAX(r_beg, a[k].ts))?
                                        MIN(r_end, a[k].te) - MAX(r_beg, a[k].ts):0);
                if(found == 1 && ovlp == 0) break;
                if(ovlp == 0) continue;
                found = 1;
                if(ovlp <= (read_g->seq[w->a[j]>>33].len)*0.8) continue;

                if(R_INF.trio_flag[w->a[j]>>33]&FATHER)
                {
                    s[0]++;
                }

                if(R_INF.trio_flag[w->a[j]>>33]&MOTHER)
                {
                    s[1]++;
                }
            }
        }

        if(s[0] >= s[1])
        {
            flag = MOTHER;
        }
        else
        {
            flag = FATHER;
        }
        for (k = 0; k < u->n; k++)
        {
            if(R_INF.trio_flag[u->a[k]>>33]&SET_TRIO) continue;
            if(cov->t_ch->ir_het[u->a[k]>>33] == N_HET) continue;
            R_INF.trio_flag[u->a[k]>>33] |= flag;
        }
    }


    for (i = 0, idx.n = 0; i < ta->idx.n; i++)
    {
        qn = i;
        u = &(ug->u.a[qn]);
        for (k = 0; k < u->n; k++)
        {
            if(R_INF.trio_flag[u->a[k]>>33]&FATHER)
            {
                R_INF.trio_flag[u->a[k]>>33] = FATHER;
            }
            else if(R_INF.trio_flag[u->a[k]>>33]&MOTHER)
            {
                R_INF.trio_flag[u->a[k]>>33] = MOTHER;
            }
            else
            {
                R_INF.trio_flag[u->a[k]>>33] = AMBIGU;
            }
        }
    }
    kv_destroy(idx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x58(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq -0x18(%rbp), %rax
movq 0xa8(%rax), %rax
addq $0x138, %rax            # imm = 0x138
movq %rax, -0x98(%rbp)
movl $0x0, -0x34(%rbp)
movq $0x0, -0x30(%rbp)
movl -0x34(%rbp), %eax
movq -0x98(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x110375
movl -0x34(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x40(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x80(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x10fef7
leaq 0x2b540b(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x10feea
jmp 0x10fef7
jmp 0x10feec
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x10feb2
movl -0x38(%rbp), %eax
movq -0x80(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jb 0x10ff08
jmp 0x110367
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x40(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x98(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x40(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x54(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x1102db
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %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, -0x88(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x0, -0x3c(%rbp)
movq $0x0, -0x60(%rbp)
movl -0x3c(%rbp), %eax
movq -0x88(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1102cb
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x88(%rbp), %rdx
movq 0x18(%rdx), %rdx
movl -0x3c(%rbp), %esi
movq (%rdx,%rsi,8), %rdx
shrq $0x21, %rdx
movl (%rcx,%rdx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x3c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rax
movq -0x90(%rbp), %rcx
movl -0x38(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
ja 0x110048
movq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
jmp 0x110063
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x68(%rbp), %rax
movq -0x90(%rbp), %rcx
movl -0x38(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jb 0x11009b
movq -0x68(%rbp), %rax
movq %rax, -0xb0(%rbp)
jmp 0x1100b6
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rax
movq -0xb0(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x11017f
movq -0x70(%rbp), %rax
movq -0x90(%rbp), %rcx
movl -0x38(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
ja 0x1100f7
movq -0x70(%rbp), %rax
movq %rax, -0xb8(%rbp)
jmp 0x110112
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x68(%rbp), %rax
movq -0x90(%rbp), %rcx
movl -0x38(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jb 0x11014a
movq -0x68(%rbp), %rax
movq %rax, -0xc8(%rbp)
jmp 0x110165
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rax
movq -0xc8(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0xd0(%rbp)
jmp 0x11018a
xorl %eax, %eax
movq %rax, -0xd0(%rbp)
jmp 0x11018a
movq -0xd0(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpl $0x1, -0x58(%rbp)
jne 0x1101a7
cmpq $0x0, -0x78(%rbp)
jne 0x1101a7
jmp 0x1102cb
cmpq $0x0, -0x78(%rbp)
jne 0x1101b3
jmp 0x1102bd
movl $0x1, -0x58(%rbp)
movaps 0x271e4f(%rip), %xmm0   # 0x382010
movq -0x78(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x271e4e(%rip), %xmm0   # 0x382020
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cvtsi2sd %eax, %xmm0
movsd 0x27201d(%rip), %xmm2   # 0x382230
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x110222
jmp 0x1102bd
leaq 0x2b50a7(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x11027c
leaq 0x2b507a(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x110285
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
leaq 0x2b5044(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x1102bb
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x1102bd
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x10ffb3
jmp 0x1102cd
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x10ff61
cmpl $0x0, -0x48(%rbp)
jbe 0x110365
jmp 0x1102e7
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0x110336
cmpq $0x0, -0x28(%rbp)
je 0x110308
movq -0x28(%rbp), %rax
shlq %rax
movq %rax, -0xd8(%rbp)
jmp 0x110316
movl $0x2, %eax
movq %rax, -0xd8(%rbp)
jmp 0x110316
movq -0xd8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x20(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
subl -0x4c(%rbp), %eax
movl %eax, %eax
movl %eax, %edx
shlq $0x20, %rdx
movl -0x40(%rbp), %eax
orq %rax, %rdx
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x30(%rbp)
movq %rdx, (%rax,%rcx,8)
jmp 0x110365
jmp 0x110367
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x10fe7b
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpq -0x30(%rbp), %rax
jae 0x110820
movq -0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x40(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x40(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x98(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x40(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x54(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x54(%rbp), %eax
jae 0x110750
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %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, -0x88(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x0, -0x3c(%rbp)
movq $0x0, -0x60(%rbp)
movl -0x3c(%rbp), %eax
movq -0x88(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x110740
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x88(%rbp), %rdx
movq 0x18(%rdx), %rdx
movl -0x3c(%rbp), %esi
movq (%rdx,%rsi,8), %rdx
shrq $0x21, %rdx
movl (%rcx,%rdx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x88(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x3c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rax
movq -0x90(%rbp), %rcx
movl -0x38(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
ja 0x1104ed
movq -0x70(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x110508
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x68(%rbp), %rax
movq -0x90(%rbp), %rcx
movl -0x38(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jb 0x110540
movq -0x68(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x11055b
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rax
movq -0xf0(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x110624
movq -0x70(%rbp), %rax
movq -0x90(%rbp), %rcx
movl -0x38(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
ja 0x11059c
movq -0x70(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x1105b7
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x68(%rbp), %rax
movq -0x90(%rbp), %rcx
movl -0x38(%rbp), %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jb 0x1105ef
movq -0x68(%rbp), %rax
movq %rax, -0x108(%rbp)
jmp 0x11060a
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rax
movq -0x108(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x110(%rbp)
jmp 0x11062f
xorl %eax, %eax
movq %rax, -0x110(%rbp)
jmp 0x11062f
movq -0x110(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpl $0x1, -0x58(%rbp)
jne 0x11064c
cmpq $0x0, -0x78(%rbp)
jne 0x11064c
jmp 0x110740
cmpq $0x0, -0x78(%rbp)
jne 0x110658
jmp 0x110732
movl $0x1, -0x58(%rbp)
movaps 0x2719aa(%rip), %xmm0   # 0x382010
movq -0x78(%rbp), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x2719a9(%rip), %xmm0   # 0x382020
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cvtsi2sd %eax, %xmm0
movsd 0x271b78(%rip), %xmm2   # 0x382230
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x1106c4
jmp 0x110732
leaq 0x2b4c05(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1106fa
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
leaq 0x2b4bcf(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x88(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x110730
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x110732
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x110458
jmp 0x110742
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x110406
movl -0x4c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jb 0x110761
movl $0x2, -0x50(%rbp)
jmp 0x110768
movl $0x1, -0x50(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x80(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x110810
leaq 0x2b4b4a(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x1107ab
jmp 0x110802
movq -0x18(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1107d8
jmp 0x110802
movl -0x50(%rbp), %esi
leaq 0x2b4aee(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x11076f
jmp 0x110812
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x11037c
movl $0x0, -0x34(%rbp)
movq $0x0, -0x30(%rbp)
movl -0x34(%rbp), %eax
movq -0x98(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0x110956
movl -0x34(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x40(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x80(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x110946
leaq 0x2b4a53(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1108c4
leaq 0x2b4a29(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movb $0x1, (%rax,%rcx)
jmp 0x110936
leaq 0x2b4a05(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x110912
leaq 0x2b49db(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movb $0x2, (%rax,%rcx)
jmp 0x110934
leaq 0x2b49b7(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x38(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movb $0x0, (%rax,%rcx)
jmp 0x110936
jmp 0x110938
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x110866
jmp 0x110948
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x11082f
movq -0x20(%rbp), %rdi
callq 0x2210
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax,%rax)