// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: reduce_ma_utg_t_scaf(ma_utg_t*, asg_t*, ma_hit_t_alloc*, ma_sub_t*, kvec_asg_arc_t_warp*, int, int, kvec_asg_arc_t_warp*)
void reduce_ma_utg_t_scaf(ma_utg_t *in, asg_t *rg, ma_hit_t_alloc* src, ma_sub_t *cov, kvec_asg_arc_t_warp* edge, int max_hang, int min_ovlp, kvec_asg_arc_t_warp* newE)
{
    asg_arc_t t_f;
    asg_arc_t* av = NULL;
    uint32_t m = 0, k, i, nv;
    for (i = 0; i < in->n; i++) {
        if(in->a[i] == (uint64_t)-1) {
            // if(newE) asg_seq_del(read_g, collection->a[i]>>33);
            continue;
        } 
        
        in->a[m] = in->a[i];
        m++;
    }
    in->n = m;


    uint32_t totalLen = 0, v, w, l;
    for (i = 0; i + 1 < in->n; i++) {
        v = (uint64_t)(in->a[i])>>32;
        w = (uint64_t)(in->a[i + 1])>>32; 
        l = Get_READ_LENGTH(R_INF, (v>>1)); ///for Ns

        if((!IS_SCAF_READ(R_INF, v>>1)) && (!IS_SCAF_READ(R_INF, w>>1))) {
            /*******************************for debug************************************/
            l = (uint32_t)-1;
            av = asg_arc_a(rg, v); nv = asg_arc_n(rg, v);
            for (k = 0; k < nv; k++) {
                if(av[k].del) continue;
                if(av[k].v == w) {
                    l = asg_arc_len(av[k]);
                    break;
                }
            }

            if(k == nv)  {
                for (k = 0; k < edge->a.n; k++) {
                    if(edge->a.a[k].del) continue;
                    if((edge->a.a[k].ul>>32) == v && edge->a.a[k].v == w) {
                        l = asg_arc_len(edge->a.a[k]);
                        break;
                    }
                }

                if(k == edge->a.n) {
                    if(get_edge_from_source(src, cov, NULL, max_hang, min_ovlp, v, w, &t_f)==0) {
                        fprintf(stderr, "####ERROR1: v>>1: %u, v&1: %u, w>>1: %u, w&1: %u, r_seq: %u\n",
                        v>>1, v&1, w>>1, w&1, rg->r_seq);
                    }
                    l = asg_arc_len(t_f);

                    
                    if(newE) {
                        kv_push(asg_arc_t, newE->a, t_f);
                        if(get_edge_from_source(src, cov, NULL, max_hang, min_ovlp, w^1, v^1, &t_f)==0) {
                            fprintf(stderr, "####ERROR2: v>>1: %u, v&1: %u, w>>1: %u, w&1: %u, r_seq: %u\n",
                            v>>1, v&1, w>>1, w&1, rg->r_seq);
                        }
                        kv_push(asg_arc_t, newE->a, t_f);
                    }
                    
                }
                else if(newE) {
                    kv_push(asg_arc_t, newE->a, edge->a.a[k]);
                    for (k = 0; k < edge->a.n; k++) {
                        if(edge->a.a[k].del) continue;
                        if((edge->a.a[k].ul>>32) == (w^1) && edge->a.a[k].v == (v^1)) {
                            l = asg_arc_len(edge->a.a[k]);
                            break;
                        }
                    }
                    kv_push(asg_arc_t, newE->a, edge->a.a[k]);
                }
            }
            if(l == (uint32_t)-1) fprintf(stderr, "ERROR\n");
            /*******************************for debug************************************/
        }


        in->a[i] = v; in->a[i] = in->a[i]<<32; 
        in->a[i] = in->a[i] | (uint64_t)(l);
        totalLen += l;
    }

    if(i < in->n) {
        if(in->circ) {
            v = (uint64_t)(in->a[i])>>32;
            w = (uint64_t)(in->a[0])>>32; 
            l = Get_READ_LENGTH(R_INF, (v>>1)); ///for Ns

            if((!IS_SCAF_READ(R_INF, v>>1)) && (!IS_SCAF_READ(R_INF, w>>1))) {
                /*******************************for debug************************************/
                l = (uint32_t)-1;
                av = asg_arc_a(rg, v);
                nv = asg_arc_n(rg, v);
                for (k = 0; k < nv; k++) {
                    if(av[k].del) continue;
                    if(av[k].v == w) {
                        l = asg_arc_len(av[k]);
                        break;
                    }
                }
                
                if(k == nv) {
                    for (k = 0; k < edge->a.n; k++) {
                        if(edge->a.a[k].del) continue;
                        if((edge->a.a[k].ul>>32) == v && edge->a.a[k].v == w) {
                            l = asg_arc_len(edge->a.a[k]);
                            break;
                        }
                    }

                    if(k == edge->a.n) {
                        if(get_edge_from_source(src, cov, NULL, max_hang, min_ovlp, v, w, &t_f)==0) {
                            fprintf(stderr, "####ERROR1: v>>1: %u, v&1: %u, w>>1: %u, w&1: %u, r_seq: %u\n",
                            v>>1, v&1, w>>1, w&1, rg->r_seq);
                        }
                        l = asg_arc_len(t_f);

                        if(newE) {
                            kv_push(asg_arc_t, newE->a, t_f);
                            if(get_edge_from_source(src, cov, NULL, max_hang, min_ovlp, w^1, v^1, &t_f)==0) {
                                fprintf(stderr, "####ERROR2: v>>1: %u, v&1: %u, w>>1: %u, w&1: %u, r_seq: %u\n",
                                v>>1, v&1, w>>1, w&1, rg->r_seq);
                            }
                            kv_push(asg_arc_t, newE->a, t_f);
                        }
                    } else if(newE) {
                        kv_push(asg_arc_t, newE->a, edge->a.a[k]);
                        for (k = 0; k < edge->a.n; k++) {
                            if(edge->a.a[k].del) continue;
                            if((edge->a.a[k].ul>>32) == (w^1) && edge->a.a[k].v == (v^1)) {
                                l = asg_arc_len(edge->a.a[k]);
                                break;
                            }
                        }
                        kv_push(asg_arc_t, newE->a, edge->a.a[k]);
                    }
                }
                if(l == (uint32_t)-1) fprintf(stderr, "ERROR\n");
                /*******************************for debug************************************/
            }

            in->a[i] = v; in->a[i] = in->a[i]<<32; 
            in->a[i] = in->a[i] | (uint64_t)(l);

            totalLen += l;
        } else {
            v = (uint64_t)(in->a[i])>>32;
            l = rg->seq[v>>1].len;
            in->a[i] = v;
            in->a[i] = in->a[i]<<32;
            in->a[i] = in->a[i] | (uint64_t)(l);
            totalLen += l;
        }
    }

    in->len = totalLen;
    if(!in->circ) {
        in->start = in->a[0]>>32;
        in->end = (in->a[in->n-1]>>32)^1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0xe9752
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
cmpq $-0x1, (%rax,%rcx,8)
jne 0xe9720
jmp 0xe9747
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x54(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xe9700
movl -0x54(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movl $0x0, -0x64(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0xe9e4a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x6c(%rbp)
leaq 0x2dbb1b(%rip), %rax    # 0x3c52d0
movq 0x18(%rax), %rax
movl -0x68(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x70(%rbp)
leaq 0x2dbb02(%rip), %rax    # 0x3c52d0
movq 0x10(%rax), %rax
movl -0x68(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xe9dd9
leaq 0x2dbae5(%rip), %rax    # 0x3c52d0
movq 0x10(%rax), %rax
movl -0x6c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xe9dd9
movl $0xffffffff, -0x70(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x68(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x68(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x60(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0xe98a3
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe986a
jmp 0xe9898
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xe9896
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe98a3
jmp 0xe9898
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe9847
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jne 0xe9db9
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xe994a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe98e5
jmp 0xe993c
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl -0x68(%rbp), %ecx
cmpq %rcx, %rax
jne 0xe993a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xe993a
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe994a
jmp 0xe993c
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe98b6
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jne 0xe9b93
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0x68(%rbp), %r9d
movl -0x6c(%rbp), %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
cmpl $0x0, %eax
jne 0xe99c8
movq 0x2da64d(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x68(%rbp), %edx
shrl %edx
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
movl -0x6c(%rbp), %r8d
shrl %r8d
movl -0x6c(%rbp), %r9d
andl $0x1, %r9d
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
leaq 0x29d3b5(%rip), %rsi    # 0x386d73
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x48(%rbp), %rax
movl %eax, -0x70(%rbp)
cmpq $0x0, 0x18(%rbp)
je 0xe9b8e
jmp 0xe99dc
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe9a41
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe9a09
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x78(%rbp)
jmp 0xe9a14
movl $0x2, %eax
movq %rax, -0x78(%rbp)
jmp 0xe9a14
movq -0x78(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0x6c(%rbp), %r9d
xorl $0x1, %r9d
movl -0x68(%rbp), %r10d
xorl $0x1, %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
cmpl $0x0, %eax
jne 0xe9aee
movq 0x2da527(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x68(%rbp), %edx
shrl %edx
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
movl -0x6c(%rbp), %r8d
shrl %r8d
movl -0x6c(%rbp), %r9d
andl $0x1, %r9d
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
leaq 0x29d2cc(%rip), %rsi    # 0x386db0
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
jmp 0xe9af0
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe9b55
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe9b1d
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x80(%rbp)
jmp 0xe9b28
movl $0x2, %eax
movq %rax, -0x80(%rbp)
jmp 0xe9b28
movq -0x80(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0xe9b8e
jmp 0xe9db7
cmpq $0x0, 0x18(%rbp)
je 0xe9db5
jmp 0xe9ba0
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe9c0e
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe9bd0
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x88(%rbp)
jmp 0xe9bde
movl $0x2, %eax
movq %rax, -0x88(%rbp)
jmp 0xe9bde
movq -0x88(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x58(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xe9cfb
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe9c8c
jmp 0xe9ced
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl -0x6c(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0xe9ceb
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x68(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0xe9ceb
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe9cfb
jmp 0xe9ced
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe9c5d
jmp 0xe9cfd
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe9d6b
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe9d2d
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x90(%rbp)
jmp 0xe9d3b
movl $0x2, %eax
movq %rax, -0x90(%rbp)
jmp 0xe9d3b
movq -0x90(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x58(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0xe9db5
jmp 0xe9db7
jmp 0xe9db9
cmpl $-0x1, -0x70(%rbp)
jne 0xe9dd7
movq 0x2da21a(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x29fcdf(%rip), %rsi    # 0x389aaf
movb $0x0, %al
callq 0x22a0
jmp 0xe9dd9
movl -0x68(%rbp), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl -0x70(%rbp), %eax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x70(%rbp), %eax
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xe976a
movl -0x5c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0xea5ce
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xea539
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x6c(%rbp)
leaq 0x2db435(%rip), %rax    # 0x3c52d0
movq 0x18(%rax), %rax
movl -0x68(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x70(%rbp)
leaq 0x2db41c(%rip), %rax    # 0x3c52d0
movq 0x10(%rax), %rax
movl -0x68(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xea4d1
leaq 0x2db3ff(%rip), %rax    # 0x3c52d0
movq 0x10(%rax), %rax
movl -0x6c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xea4d1
movl $0xffffffff, -0x70(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x68(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x68(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x60(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jae 0xe9f89
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe9f50
jmp 0xe9f7e
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xe9f7c
movq -0x50(%rbp), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xe9f89
jmp 0xe9f7e
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe9f2d
movl -0x58(%rbp), %eax
cmpl -0x60(%rbp), %eax
jne 0xea4b1
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xea030
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe9fcb
jmp 0xea022
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl -0x68(%rbp), %ecx
cmpq %rcx, %rax
jne 0xea020
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xea020
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xea030
jmp 0xea022
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe9f9c
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jne 0xea28b
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0x68(%rbp), %r9d
movl -0x6c(%rbp), %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
cmpl $0x0, %eax
jne 0xea0ae
movq 0x2d9f67(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x68(%rbp), %edx
shrl %edx
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
movl -0x6c(%rbp), %r8d
shrl %r8d
movl -0x6c(%rbp), %r9d
andl $0x1, %r9d
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
leaq 0x29cccf(%rip), %rsi    # 0x386d73
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
movq -0x48(%rbp), %rax
movl %eax, -0x70(%rbp)
cmpq $0x0, 0x18(%rbp)
je 0xea286
jmp 0xea0c2
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xea130
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xea0f2
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x98(%rbp)
jmp 0xea100
movl $0x2, %eax
movq %rax, -0x98(%rbp)
jmp 0xea100
movq -0x98(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %ecx
movl 0x10(%rbp), %r8d
movl -0x6c(%rbp), %r9d
xorl $0x1, %r9d
movl -0x68(%rbp), %r10d
xorl $0x1, %r10d
xorl %eax, %eax
movl %eax, %edx
leaq -0x48(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xe9560
cmpl $0x0, %eax
jne 0xea1dd
movq 0x2d9e38(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x68(%rbp), %edx
shrl %edx
movl -0x68(%rbp), %ecx
andl $0x1, %ecx
movl -0x6c(%rbp), %r8d
shrl %r8d
movl -0x6c(%rbp), %r9d
andl $0x1, %r9d
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
leaq 0x29cbdd(%rip), %rsi    # 0x386db0
movl %eax, (%rsp)
movb $0x0, %al
callq 0x22a0
jmp 0xea1df
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xea24d
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xea20f
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xa0(%rbp)
jmp 0xea21d
movl $0x2, %eax
movq %rax, -0xa0(%rbp)
jmp 0xea21d
movq -0xa0(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0xea286
jmp 0xea4af
cmpq $0x0, 0x18(%rbp)
je 0xea4ad
jmp 0xea298
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xea306
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xea2c8
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xa8(%rbp)
jmp 0xea2d6
movl $0x2, %eax
movq %rax, -0xa8(%rbp)
jmp 0xea2d6
movq -0xa8(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x58(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xea3f3
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xea384
jmp 0xea3e5
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl -0x6c(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0xea3e3
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x68(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0xea3e3
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x58(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x70(%rbp)
jmp 0xea3f3
jmp 0xea3e5
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xea355
jmp 0xea3f5
movq 0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xea463
movq 0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xea425
movq 0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xb0(%rbp)
jmp 0xea433
movl $0x2, %eax
movq %rax, -0xb0(%rbp)
jmp 0xea433
movq -0xb0(%rbp), %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rbp), %rax
imulq $0x18, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq 0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movl -0x58(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rcx
movq 0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rbp), %rsi
movq (%rsi), %rdx
movq %rdx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
jmp 0xea4ad
jmp 0xea4af
jmp 0xea4b1
cmpl $-0x1, -0x70(%rbp)
jne 0xea4cf
movq 0x2d9b22(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x29f5e7(%rip), %rsi    # 0x389aaf
movb $0x0, %al
callq 0x22a0
jmp 0xea4d1
movl -0x68(%rbp), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl -0x70(%rbp), %eax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x70(%rbp), %eax
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0xea5cc
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x68(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x70(%rbp)
movl -0x68(%rbp), %eax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl -0x70(%rbp), %eax
orq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x5c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x70(%rbp), %eax
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0xea5ce
movl -0x64(%rbp), %edx
movq -0x8(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0xea636
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
addq $0xc0, %rsp
popq %rbp
retq
nop