// File: chhylp123[P]hifiasm/horder.cpp
// Function: get_r_hits_for_trio(kvec_pe_hit*, asg_t*, ma_ug_t*, bubble_type*, unsigned long, unsigned long)
kvec_pe_hit *get_r_hits_for_trio(kvec_pe_hit *u_hits, asg_t* r_g, ma_ug_t* ug, bubble_type* bub, uint64_t uID_bits, uint64_t pos_mode)
{
    kvec_pe_hit *r_hits = NULL;
    CALLOC(r_hits, 1);
    uint64_t k, l, i, r_i, offset, rid, rev, rBeg, rEnd, ubits, p_mode, upos, rpos, update, ubeg, uend, suid, euid;
    ma_utg_t *u = NULL;
    memset(r_hits, 0, sizeof(*r_hits));
    r_hits->uID_bits = uID_bits;
    r_hits->pos_mode = pos_mode;
    //reset for reads
    for (ubits=1; (uint64_t)(1<<ubits)<(uint64_t)r_g->n_seq; ubits++);
    p_mode = ((uint64_t)-1) >> (ubits + 1);

    u_hits->uID_bits = uID_bits; u_hits->pos_mode = pos_mode;
    for (i = r_i = 0; i < u_hits->a.n; i++)
    {
        suid = get_hit_suid(*u_hits, i);
        euid = get_hit_euid(*u_hits, i);
        if(IF_HOM(suid, *bub)) continue;
        if(IF_HOM(euid, *bub)) continue;
        if(suid == euid) continue;
        kv_push(pe_hit, r_hits->a, u_hits->a.a[i]);

        resolve_hit(r_hits->a.a[r_i].s, r_hits->a.a[r_i].len>>32, r_hits->uID_bits, 
                                                                r_hits->pos_mode, NULL, &ubeg, &uend);
        upos = (ubeg+uend-1)>>1;
        r_hits->a.a[r_i].s -= get_hit_spos(*r_hits, r_i);
        r_hits->a.a[r_i].s += upos;


        resolve_hit(r_hits->a.a[r_i].e, (uint32_t)r_hits->a.a[r_i].len, r_hits->uID_bits, 
                                                                r_hits->pos_mode, NULL, &ubeg, &uend);
        upos = (ubeg+uend-1)>>1;
        r_hits->a.a[r_i].e -= get_hit_epos(*r_hits, r_i);///pos at unitig
        r_hits->a.a[r_i].e += upos;
        
        r_hits->a.a[r_i].id = (suid<<32)|euid;
        r_i++;
    }

    radix_sort_pe_hit_idx_hn1(r_hits->a.a, r_hits->a.a + r_hits->a.n);
    for (k = 1, l = 0; k <= r_hits->a.n; ++k) 
    {   
        if (k == r_hits->a.n || get_hit_suid(*r_hits, k) != get_hit_suid(*r_hits, l))//same suid
        {
            ///already sort by spos
            u = &(ug->u.a[get_hit_suid(*r_hits, l)]);
            update = 0;
            for (i = offset = 0, r_i = l; i < u->n; i++)
            {
                rid = u->a[i]>>33; 
                rBeg = offset;
                rEnd = rBeg + r_g->seq[rid].len - 1;
                for (; r_i < k; r_i++)
                {
                    upos = get_hit_spos(*r_hits, r_i);///pos at unitig
                    
                    if(upos > rEnd) break;
                    if(upos >= rBeg && upos <= rEnd)
                    {
                        rpos = (((u->a[i]>>32)&1)? rEnd - upos : upos - rBeg);///pos at read
                        rev = ((u->a[i]>>32)&1) ^ (r_hits->a.a[r_i].s>>63);
                        r_hits->a.a[r_i].s = (rev<<63) | ((rid << (64-ubits))>>1) | (rpos & p_mode);
                        
                        update++;
                    }
                }
                offset += (uint32_t)u->a[i];
            }

            if(r_i != k || update != k - l) fprintf(stderr, "ERROR-r_i\n");
            l = k;
        }
    }

    radix_sort_pe_hit_idx_hn2(r_hits->a.a, r_hits->a.a + r_hits->a.n);
    for (k = 1, l = 0; k <= r_hits->a.n; ++k) 
    {
        if (k == r_hits->a.n || get_hit_euid(*r_hits, k) != get_hit_euid(*r_hits, l))//same euid
        {
            ///already sort by epos
            u = &(ug->u.a[get_hit_euid(*r_hits, l)]);
            update = 0;
            for (i = offset = 0, r_i = l; i < u->n; i++)
            {
                rid = u->a[i]>>33; 
                rBeg = offset;
                rEnd = rBeg + r_g->seq[rid].len - 1;
                for (; r_i < k; r_i++)
                {
                    upos = get_hit_epos(*r_hits, r_i);///pos at unitig

                    if(upos > rEnd) break;
                    if(upos >= rBeg && upos <= rEnd)
                    {
                        rpos = (((u->a[i]>>32)&1)? rEnd - upos : upos - rBeg);///pos at read
                        rev = ((u->a[i]>>32)&1) ^ (r_hits->a.a[r_i].e>>63);
                        r_hits->a.a[r_i].e = (rev<<63) | ((rid << (64-ubits))>>1) | (rpos & p_mode);
                        
                        update++;
                    }
                }
                offset += (uint32_t)u->a[i];
            }

            if(r_i != k || update != k - l) fprintf(stderr, "ERROR-r_i\n");
            l = k;
        }
    }


    r_hits->uID_bits = ubits;
    r_hits->pos_mode = p_mode;
    return r_hits;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x1, %edi
movl $0x58, %esi
callq 0x2140
movq %rax, -0x38(%rbp)
movq $0x0, -0xd0(%rbp)
movq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0x2100
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x50(%rax)
movq $0x1, -0x88(%rbp)
movq -0x88(%rbp), %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
cltq
movq -0x10(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x233568
jmp 0x233554
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x23352c
movq -0x88(%rbp), %rcx
addq $0x1, %rcx
movq $-0x1, %rax
shrq %cl, %rax
movq %rax, -0x90(%rbp)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x50(%rax)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x23393d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
shlq %rax
movq -0x8(%rbp), %rdx
movl $0x40, %ecx
subq 0x48(%rdx), %rcx
shrq %cl, %rax
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shlq %rax
movq -0x8(%rbp), %rdx
movl $0x40, %ecx
subq 0x48(%rdx), %rcx
shrq %cl, %rax
movq %rax, -0xc8(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0xc0(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x233648
jmp 0x23392c
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0xc8(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
movq 0x80(%rcx), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x233672
jmp 0x23392c
movq -0xc0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x233687
jmp 0x23392c
jmp 0x233689
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x2336fa
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2336b9
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xd8(%rbp)
jmp 0x2336c7
movl $0x2, %eax
movq %rax, -0xd8(%rbp)
jmp 0x2336c7
movq -0xd8(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x5, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x50(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rcx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
shlq $0x5, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
movl %eax, %esi
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rdx
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rcx
xorl %eax, %eax
movl %eax, %r8d
leaq -0xb0(%rbp), %r9
leaq -0xb8(%rbp), %rax
movq %rax, (%rsp)
callq 0x233160
movq -0xb0(%rbp), %rax
addq -0xb8(%rbp), %rax
subq $0x1, %rax
shrq %rax
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movq -0x38(%rbp), %rax
andq 0x50(%rax), %rdx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
subq %rdx, %rcx
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movl %eax, %esi
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rdx
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rcx
xorl %eax, %eax
movl %eax, %r8d
leaq -0xb0(%rbp), %r9
leaq -0xb8(%rbp), %rax
movq %rax, (%rsp)
callq 0x233160
movq -0xb0(%rbp), %rax
addq -0xb8(%rbp), %rax
subq $0x1, %rax
shrq %rax
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movq -0x38(%rbp), %rax
andq 0x50(%rax), %rdx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x8(%rax)
movq -0x98(%rbp), %rcx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0xc0(%rbp), %rcx
shlq $0x20, %rcx
orq -0xc8(%rbp), %rcx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x2335ac
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rax
shlq $0x5, %rax
addq %rax, %rsi
callq 0x22d9e0
movq $0x1, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
ja 0x233ca3
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
je 0x2339ec
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
shlq %rax
movq -0x38(%rbp), %rdx
movl $0x40, %ecx
subq 0x48(%rdx), %rcx
shrq %cl, %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x48(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
shlq %rdx
movq -0x38(%rbp), %rsi
movl $0x40, %ecx
subq 0x48(%rsi), %rcx
shrq %cl, %rdx
movq %rdx, %rcx
cmpq %rcx, %rax
je 0x233c90
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x48(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq (%rcx), %rdx
shlq %rdx
movq -0x38(%rbp), %rsi
movl $0x40, %ecx
subq 0x48(%rsi), %rcx
shrq %cl, %rdx
movq %rdx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movq $0x0, -0xa8(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq -0xd0(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0x233c52
movq -0xd0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x68(%rbp), %rdx
movl (%rcx,%rdx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
addq %rcx, %rax
subq $0x1, %rax
movq %rax, -0x80(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x233c24
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
andq 0x50(%rcx), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpq -0x80(%rbp), %rax
jbe 0x233af6
jmp 0x233c24
movq -0x98(%rbp), %rax
cmpq -0x78(%rbp), %rax
jb 0x233c11
movq -0x98(%rbp), %rax
cmpq -0x80(%rbp), %rax
ja 0x233c11
movq -0xd0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x233b4d
movq -0x80(%rbp), %rax
subq -0x98(%rbp), %rax
movq %rax, -0xe0(%rbp)
jmp 0x233b5f
movq -0x98(%rbp), %rax
subq -0x78(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xd0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x58(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
shrq $0x3f, %rcx
xorq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
shlq $0x3f, %rax
movq %rax, -0xe8(%rbp)
movq -0x68(%rbp), %rax
movl $0x40, %ecx
subq -0x88(%rbp), %rcx
shlq %cl, %rax
movq -0xe8(%rbp), %rcx
shrq %rax
orq %rax, %rcx
movq -0xa0(%rbp), %rax
andq -0x90(%rbp), %rax
orq %rax, %rcx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x233c13
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x233ab1
movq -0xd0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x233a51
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x233c70
movq -0xa8(%rbp), %rax
movq -0x40(%rbp), %rcx
subq -0x48(%rbp), %rcx
cmpq %rcx, %rax
je 0x233c88
movq 0x190369(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x15a7cf(%rip), %rsi    # 0x38e450
movb $0x0, %al
callq 0x22a0
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x233c92
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x233970
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rax
shlq $0x5, %rax
addq %rax, %rsi
callq 0x22df40
movq $0x1, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
ja 0x23400f
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq (%rcx), %rax
je 0x233d54
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
shlq %rax
movq -0x38(%rbp), %rdx
movl $0x40, %ecx
subq 0x48(%rdx), %rcx
shrq %cl, %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x48(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rdx
shlq %rdx
movq -0x38(%rbp), %rsi
movl $0x40, %ecx
subq 0x48(%rsi), %rcx
shrq %cl, %rdx
movq %rdx, %rcx
cmpq %rcx, %rax
je 0x233ffc
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x48(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rdx
shlq %rdx
movq -0x38(%rbp), %rsi
movl $0x40, %ecx
subq 0x48(%rsi), %rcx
shrq %cl, %rdx
movq %rdx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movq $0x0, -0xa8(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq -0xd0(%rbp), %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0x233fbe
movq -0xd0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x21, %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x68(%rbp), %rdx
movl (%rcx,%rdx,8), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
addq %rcx, %rax
subq $0x1, %rax
movq %rax, -0x80(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x233f90
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x38(%rbp), %rcx
andq 0x50(%rcx), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
cmpq -0x80(%rbp), %rax
jbe 0x233e60
jmp 0x233f90
movq -0x98(%rbp), %rax
cmpq -0x78(%rbp), %rax
jb 0x233f7d
movq -0x98(%rbp), %rax
cmpq -0x80(%rbp), %rax
ja 0x233f7d
movq -0xd0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x233eb7
movq -0x80(%rbp), %rax
subq -0x98(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x233ec9
movq -0x98(%rbp), %rax
subq -0x78(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xd0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
andq $0x1, %rax
movq -0x38(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x58(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rcx
shrq $0x3f, %rcx
xorq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
shlq $0x3f, %rax
movq %rax, -0xf8(%rbp)
movq -0x68(%rbp), %rax
movl $0x40, %ecx
subq -0x88(%rbp), %rcx
shlq %cl, %rax
movq -0xf8(%rbp), %rcx
shrq %rax
orq %rax, %rcx
movq -0xa0(%rbp), %rax
andq -0x90(%rbp), %rax
orq %rax, %rcx
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x233f7f
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x233e1a
movq -0xd0(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x233dba
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jne 0x233fdc
movq -0xa8(%rbp), %rax
movq -0x40(%rbp), %rcx
subq -0x48(%rbp), %rcx
cmpq %rcx, %rax
je 0x233ff4
movq 0x18fffd(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x15a463(%rip), %rsi    # 0x38e450
movb $0x0, %al
callq 0x22a0
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x233ffe
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x233cd6
movq -0x88(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x90(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x38(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw (%rax,%rax)