// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: get_remove_hifi_occ(ul_resolve_t*, unsigned long, unsigned long*, unsigned long, asg64_v*, unsigned int*)
inline uint64_t get_remove_hifi_occ(ul_resolve_t *uidx, uint64_t thres, uint64_t *v_a, uint64_t v_n, asg64_v *buf, uint32_t *del_occ)
{
    ul2ul_idx_t *idx = &(uidx->uovl);
    ma_ug_t *iug = idx->i_ug, *raw = uidx->l1_ug;
    uint64_t k, l, z, m, p, *raw_a, raw_n, raw_id, iug_id, iug_off, del_n, keep_ns[2], del_ns[2], dup_raw, n_mask, pn, fn, is, ie; 
    uinfo_srt_warp_t *iu; uint64_t ms, me; 
    for (k = del_n = fn = 0, buf->n = dup_raw = 0; k < v_n; k++) {
        iu = &(idx->cc.iug_a[v_a[k]>>1]); ///integer unitigs
        for (z = 0; z < iu->n; z++) {
            raw_id = (iu->a[z].v>>1);
            raw_a = idx->cc.iug_b + idx->cc.iug_idx[raw_id];
            raw_n = idx->cc.iug_idx[raw_id+1] - idx->cc.iug_idx[raw_id];
            assert(raw_n > 0);
            for (m = keep_ns[0] = keep_ns[1] = 0, pn = buf->n, n_mask = 0; m < raw_n; m++) {
                iug_id = (raw_a[m]<<1)>>33; iug_off = (uint32_t)raw_a[m];
                // if(iug_id >= iug->g->n_seq){
                //     fprintf(stderr, ">>>[M::%s::] v_a[%lu]>>1::%lu, raw_id::%lu, raw_n::%lu, m::%lu, raw_a[m]::%lu, uidx->uovl.cc.iug_b[455]::%lu, iug_id::%lu, iug_off::%lu, iug->g->n_seq::%u\n", __func__, 
                //         k, v_a[k]>>1, raw_id, raw_n, m, raw_a[m], uidx->uovl.cc.iug_b[455], iug_id, iug_off, (uint32_t)iug->g->n_seq);
                // }
                if(iug->g->seq[iug_id].del) continue;
                if(raw_a[m]&((uint64_t)(0x8000000000000000))) {
                    n_mask++;
                    continue;
                }
                if(iug_id == (v_a[k]>>1) && iug_off == z) {///query itself
                    raw_a[m] |= ((uint64_t)(0x8000000000000000));
                    p = (uint32_t)-1; p <<= 32; p += idx->cc.iug_idx[raw_id] + m; 
                    kv_push(uint64_t, *buf, p);
                } else {
                    if(!(idx->cc.iug_a[iug_id].a[iug_off].v&1)) {
                        keep_ns[0] = MAX(idx->cc.iug_a[iug_id].a[iug_off].n, keep_ns[0]);
                    } else {
                        keep_ns[1] = MAX(idx->cc.iug_a[iug_id].a[iug_off].n, keep_ns[1]);
                    }                    
                }
            }
            assert(buf->n == pn + 1);
            if(keep_ns[0] + keep_ns[1] >= raw->u.a[raw_id].n) {
                keep_ns[0] = keep_ns[1] = raw->u.a[raw_id].n;
            }

            is = keep_ns[0]; ie = raw->u.a[raw_id].n - keep_ns[1];///[is, ie) -> uncovered coordinates
            if(ie > is) {
                if(!(iu->a[z].v&1)) {
                    ms = 0; me = iu->a[z].n;
                } else {
                    ms = raw->u.a[raw_id].n - iu->a[z].n; me = raw->u.a[raw_id].n;
                }
                if(MAX(is, ms) < MIN(ie, me)) {
                    del_n += MIN(ie, me) - MAX(is, ms);
                    buf->a[pn] <<= 32; buf->a[pn] >>= 32; buf->a[pn] |= (raw_id<<32); fn++;
                    if(n_mask) dup_raw = 1;
                }
            }
        }
    }

    if(del_n > thres && dup_raw) {
        radix_sort_srt64(buf->a, buf->a + buf->n); del_n = 0;
        for (l = 0, k = 1; k <= fn; k++) {
            if(k == fn || (buf->a[k]>>32) != (buf->a[l]>>32)) {
                raw_id = (buf->a[l]>>32); 
                raw_a = idx->cc.iug_b + idx->cc.iug_idx[raw_id];
                raw_n = idx->cc.iug_idx[raw_id+1] - idx->cc.iug_idx[raw_id];
                assert(raw_n > 0);
                for (m = del_ns[0] = del_ns[1] = keep_ns[0] = keep_ns[1] = 0; m < raw_n; m++) {
                    iug_id = (raw_a[m]<<1)>>33; iug_off = (uint32_t)raw_a[m];
                    if(iug->g->seq[iug_id].del) continue;
                    if(raw_a[m]&((uint64_t)(0x8000000000000000))) {
                        if(!(idx->cc.iug_a[iug_id].a[iug_off].v&1)) {
                            del_ns[0] = MAX(idx->cc.iug_a[iug_id].a[iug_off].n, del_ns[0]);
                        } else {
                            del_ns[1] = MAX(idx->cc.iug_a[iug_id].a[iug_off].n, del_ns[1]);
                        } 
                    } else {
                        if(!(idx->cc.iug_a[iug_id].a[iug_off].v&1)) {
                            keep_ns[0] = MAX(idx->cc.iug_a[iug_id].a[iug_off].n, keep_ns[0]);
                        } else {
                            keep_ns[1] = MAX(idx->cc.iug_a[iug_id].a[iug_off].n, keep_ns[1]);
                        }   
                    }
                }
                assert(del_ns[0] + del_ns[1] > 0);
                if(keep_ns[0] + keep_ns[1] >= raw->u.a[raw_id].n) {
                    keep_ns[0] = keep_ns[1] = raw->u.a[raw_id].n;
                }
                

                is = keep_ns[0]; ie = raw->u.a[raw_id].n - keep_ns[1];///[is, ie) -> uncovered coordinates
                if(ie > is) {
                    if(del_ns[0] + del_ns[1] >= raw->u.a[raw_id].n) {
                        del_n += ie - is;
                    } else {
                        ms = 0; me = del_ns[0];
                        if(ms < me && MAX(is, ms) < MIN(ie, me)) {
                            del_n += MIN(ie, me) - MAX(is, ms);
                        }

                        ms = raw->u.a[raw_id].n - del_ns[1]; me = raw->u.a[raw_id].n;
                        if(ms < me && MAX(is, ms) < MIN(ie, me)) {
                            del_n += MIN(ie, me) - MAX(is, ms);
                        }
                    }
                }
                if(del_n > thres) break;
                l = k; 
            }
        }
    }

    for (k = 0; k < buf->n; k++) {
        assert(idx->cc.iug_b[(uint32_t)buf->a[k]]&((uint64_t)(0x8000000000000000)));
        idx->cc.iug_b[(uint32_t)buf->a[k]] <<= 1; idx->cc.iug_b[(uint32_t)buf->a[k]] >>= 1;
    }
    // fprintf(stderr, "*[M::%s::] del_n::%lu\n", __func__, del_n);
    if(del_occ) *del_occ = del_n;
    return ((del_n > thres)?0:1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
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 -0x8(%rbp), %rax
addq $0x1f0, %rax            # imm = 0x1F0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0xe0(%rbp)
movq $0x0, -0xa0(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0xc8(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x50(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x37c6ce
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x18(%rbp), %rcx
movq -0x50(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xf8(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq -0xf8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x37c6bb
movq -0xf8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl %eax
movl %eax, %eax
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x78(%rcx), %rcx
movq -0x88(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x88(%rbp), %rcx
movl 0x4(%rax,%rcx,4), %eax
movq -0x38(%rbp), %rcx
movq 0x78(%rcx), %rcx
movq -0x88(%rbp), %rdx
subl (%rcx,%rdx,4), %eax
movl %eax, %eax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jbe 0x37c06b
jmp 0x37c08a
leaq 0x1f172(%rip), %rdi     # 0x39b1e4
leaq 0x1a140(%rip), %rsi     # 0x3961b9
movl $0x213f, %edx           # imm = 0x213F
leaq 0x1f169(%rip), %rcx     # 0x39b1ee
callq 0x2130
movq $0x0, -0xa8(%rbp)
movq $0x0, -0xb0(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xd8(%rbp)
movq $0x0, -0xd0(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x80(%rbp), %rax
jae 0x37c3ae
movq -0x78(%rbp), %rax
movq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shlq %rax
shrq $0x21, %rax
movq %rax, -0x90(%rbp)
movq -0x78(%rbp), %rax
movq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x98(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x90(%rbp), %rcx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x37c121
jmp 0x37c39d
movq -0x78(%rbp), %rcx
movq -0x68(%rbp), %rdx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
je 0x37c154
movq -0xd0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xd0(%rbp)
jmp 0x37c39d
movq -0x90(%rbp), %rax
movq -0x18(%rbp), %rcx
movq -0x50(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq %rcx
cmpq %rcx, %rax
jne 0x37c268
movq -0x98(%rbp), %rax
cmpq -0x60(%rbp), %rax
jne 0x37c268
movq -0x78(%rbp), %rax
movq -0x68(%rbp), %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x70(%rbp)
movq -0x38(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x88(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addq -0x68(%rbp), %rax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x37c242
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x37c201
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x110(%rbp)
jmp 0x37c20f
movl $0x2, %eax
movq %rax, -0x110(%rbp)
jmp 0x37c20f
movq -0x110(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x70(%rbp), %rdx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x37c39b
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x37c31b
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpq -0xb0(%rbp), %rax
jb 0x37c2fd
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x118(%rbp)
jmp 0x37c30b
movq -0xb0(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0xb0(%rbp)
jmp 0x37c399
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpq -0xa8(%rbp), %rax
jb 0x37c37d
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x120(%rbp)
jmp 0x37c38b
movq -0xa8(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x37c39b
jmp 0x37c39d
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x37c0c1
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0xd8(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jne 0x37c3c7
jmp 0x37c3e6
leaq 0x1ee84(%rip), %rdi     # 0x39b252
leaq 0x19de4(%rip), %rsi     # 0x3961b9
movl $0x2157, %edx           # imm = 0x2157
leaq 0x1ee0d(%rip), %rcx     # 0x39b1ee
callq 0x2130
movq -0xb0(%rbp), %rax
addq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x88(%rbp), %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jb 0x37c433
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0xa8(%rbp)
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
subq -0xa8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jbe 0x37c6a8
movq -0xf8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x37c4c6
movq $0x0, -0x100(%rbp)
movq -0xf8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x60(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x108(%rbp)
jmp 0x37c51b
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq -0xf8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x60(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
subl 0xc(%rcx), %eax
movl %eax, %eax
movq %rax, -0x100(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x108(%rbp)
movq -0xe8(%rbp), %rax
cmpq -0x100(%rbp), %rax
jb 0x37c53b
movq -0xe8(%rbp), %rax
movq %rax, -0x128(%rbp)
jmp 0x37c549
movq -0x100(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0xf0(%rbp), %rax
cmpq -0x108(%rbp), %rax
ja 0x37c577
movq -0xf0(%rbp), %rax
movq %rax, -0x138(%rbp)
jmp 0x37c585
movq -0x108(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x130(%rbp), %rax
movq -0x138(%rbp), %rcx
cmpq %rcx, %rax
jae 0x37c6a6
movq -0xf0(%rbp), %rax
cmpq -0x108(%rbp), %rax
ja 0x37c5bc
movq -0xf0(%rbp), %rax
movq %rax, -0x140(%rbp)
jmp 0x37c5ca
movq -0x108(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0xe8(%rbp), %rax
cmpq -0x100(%rbp), %rax
jb 0x37c5f8
movq -0xe8(%rbp), %rax
movq %rax, -0x150(%rbp)
jmp 0x37c606
movq -0x100(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x148(%rbp), %rax
movq -0x150(%rbp), %rcx
subq %rcx, %rax
addq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xd8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xd8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
shrq $0x20, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x88(%rbp), %rdx
shlq $0x20, %rdx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xd8(%rbp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0xe0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0xd0(%rbp)
je 0x37c6a4
movq $0x1, -0xc8(%rbp)
jmp 0x37c6a6
jmp 0x37c6a8
jmp 0x37c6aa
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x37bfd8
jmp 0x37c6bd
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x37bf9d
movq -0xa0(%rbp), %rax
cmpq -0x10(%rbp), %rax
jbe 0x37cf18
cmpq $0x0, -0xc8(%rbp)
je 0x37cf18
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x28(%rbp), %rax
movq (%rax), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x30ed90
movq $0x0, -0xa0(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x1, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0xe0(%rbp), %rax
ja 0x37cf16
movq -0x50(%rbp), %rax
cmpq -0xe0(%rbp), %rax
je 0x37c77a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x58(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
je 0x37cf03
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq %rax, -0x88(%rbp)
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x38(%rbp), %rcx
movq 0x78(%rcx), %rcx
movq -0x88(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x38(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x88(%rbp), %rcx
movl 0x4(%rax,%rcx,4), %eax
movq -0x38(%rbp), %rcx
movq 0x78(%rcx), %rcx
movq -0x88(%rbp), %rdx
subl (%rcx,%rdx,4), %eax
movl %eax, %eax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jbe 0x37c7f1
jmp 0x37c810
leaq 0x1e9ec(%rip), %rdi     # 0x39b1e4
leaq 0x199ba(%rip), %rsi     # 0x3961b9
movl $0x2173, %edx           # imm = 0x2173
leaq 0x1e9e3(%rip), %rcx     # 0x39b1ee
callq 0x2130
movq $0x0, -0xa8(%rbp)
movq $0x0, -0xb0(%rbp)
movq $0x0, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq -0x80(%rbp), %rax
jae 0x37cb40
movq -0x78(%rbp), %rax
movq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shlq %rax
shrq $0x21, %rax
movq %rax, -0x90(%rbp)
movq -0x78(%rbp), %rax
movq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
movq %rax, -0x98(%rbp)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movq -0x90(%rbp), %rcx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x37c8a4
jmp 0x37cb2f
movq -0x78(%rbp), %rcx
movq -0x68(%rbp), %rdx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
je 0x37c9fa
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x37c977
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpq -0xc0(%rbp), %rax
jb 0x37c959
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x158(%rbp)
jmp 0x37c967
movq -0xc0(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0xc0(%rbp)
jmp 0x37c9f5
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpq -0xb8(%rbp), %rax
jb 0x37c9d9
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x160(%rbp)
jmp 0x37c9e7
movq -0xb8(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x160(%rbp), %rax
movq %rax, -0xb8(%rbp)
jmp 0x37cb2d
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x37caad
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpq -0xb0(%rbp), %rax
jb 0x37ca8f
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x168(%rbp)
jmp 0x37ca9d
movq -0xb0(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movq %rax, -0xb0(%rbp)
jmp 0x37cb2b
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpq -0xa8(%rbp), %rax
jb 0x37cb0f
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x18, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq %rax, -0x170(%rbp)
jmp 0x37cb1d
movq -0xa8(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x37cb2d
jmp 0x37cb2f
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x37c844
movq -0xc0(%rbp), %rax
addq -0xb8(%rbp), %rax
cmpq $0x0, %rax
jbe 0x37cb56
jmp 0x37cb75
leaq 0x1e706(%rip), %rdi     # 0x39b263
leaq 0x19655(%rip), %rsi     # 0x3961b9
movl $0x2185, %edx           # imm = 0x2185
leaq 0x1e67e(%rip), %rcx     # 0x39b1ee
callq 0x2130
movq -0xb0(%rbp), %rax
addq -0xa8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x88(%rbp), %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jb 0x37cbc2
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0xa8(%rbp)
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
subq -0xa8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jbe 0x37ceec
movq -0xc0(%rbp), %rax
addq -0xb8(%rbp), %rax
movq -0x48(%rbp), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, -0x88(%rbp), %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jb 0x37cc52
movq -0xf0(%rbp), %rax
subq -0xe8(%rbp), %rax
addq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
jmp 0x37ceea
movq $0x0, -0x100(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rax
cmpq -0x108(%rbp), %rax
jae 0x37cd89
movq -0xe8(%rbp), %rax
cmpq -0x100(%rbp), %rax
jb 0x37cc9f
movq -0xe8(%rbp), %rax
movq %rax, -0x178(%rbp)
jmp 0x37ccad
movq -0x100(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0xf0(%rbp), %rax
cmpq -0x108(%rbp), %rax
ja 0x37ccdb
movq -0xf0(%rbp), %rax
movq %rax, -0x188(%rbp)
jmp 0x37cce9
movq -0x108(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x180(%rbp), %rax
movq -0x188(%rbp), %rcx
cmpq %rcx, %rax
jae 0x37cd89
movq -0xf0(%rbp), %rax
cmpq -0x108(%rbp), %rax
ja 0x37cd20
movq -0xf0(%rbp), %rax
movq %rax, -0x190(%rbp)
jmp 0x37cd2e
movq -0x108(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0xe8(%rbp), %rax
cmpq -0x100(%rbp), %rax
jb 0x37cd5c
movq -0xe8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
jmp 0x37cd6a
movq -0x100(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x198(%rbp), %rax
movq -0x1a0(%rbp), %rcx
subq %rcx, %rax
addq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
subq -0xb8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
imulq $0x28, -0x88(%rbp), %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rax
cmpq -0x108(%rbp), %rax
jae 0x37cee8
movq -0xe8(%rbp), %rax
cmpq -0x100(%rbp), %rax
jb 0x37cdfe
movq -0xe8(%rbp), %rax
movq %rax, -0x1a8(%rbp)
jmp 0x37ce0c
movq -0x100(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0xf0(%rbp), %rax
cmpq -0x108(%rbp), %rax
ja 0x37ce3a
movq -0xf0(%rbp), %rax
movq %rax, -0x1b8(%rbp)
jmp 0x37ce48
movq -0x108(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x1b0(%rbp), %rax
movq -0x1b8(%rbp), %rcx
cmpq %rcx, %rax
jae 0x37cee8
movq -0xf0(%rbp), %rax
cmpq -0x108(%rbp), %rax
ja 0x37ce7f
movq -0xf0(%rbp), %rax
movq %rax, -0x1c0(%rbp)
jmp 0x37ce8d
movq -0x108(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0xe8(%rbp), %rax
cmpq -0x100(%rbp), %rax
jb 0x37cebb
movq -0xe8(%rbp), %rax
movq %rax, -0x1d0(%rbp)
jmp 0x37cec9
movq -0x100(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x1c8(%rbp), %rax
movq -0x1d0(%rbp), %rcx
subq %rcx, %rax
addq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
jmp 0x37ceea
jmp 0x37ceec
movq -0xa0(%rbp), %rax
cmpq -0x10(%rbp), %rax
jbe 0x37cefb
jmp 0x37cf16
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x37cf05
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x37c72b
jmp 0x37cf18
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x37cfe6
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rcx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x50(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %eax, %eax
movl %eax, %edx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
je 0x37cf66
jmp 0x37cf85
leaq 0x1e310(%rip), %rdi     # 0x39b27d
leaq 0x19245(%rip), %rsi     # 0x3961b9
movl $0x21a2, %edx           # imm = 0x21A2
leaq 0x1e26e(%rip), %rcx     # 0x39b1ee
callq 0x2130
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x50(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
shlq %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x50(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
shrq %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x37cf20
cmpq $0x0, -0x30(%rbp)
je 0x37cffc
movq -0xa0(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0xa0(%rbp), %rdx
movq -0x10(%rbp), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmoval %ecx, %eax
cltq
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nop