// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r9d, 0x2c(%rsp)
movq %rcx, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movl 0x10(%rdi), %ecx
testq %rcx, %rcx
je 0xb44c4
movq %rsi, %r14
movq %r8, 0x8(%rsp)
movq 0xa8(%rsp), %r11
movq 0x18(%rdi), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %r9
cmpq $-0x1, %r9
je 0xb3f25
movl %eax, %r8d
movq %r9, (%rdx,%r8,8)
incl %eax
incq %rsi
cmpq %rsi, %rcx
jne 0xb3f12
movl %eax, 0x10(%rdi)
xorl %ebp, %ebp
movl $0x0, %r10d
cmpl $0x2, %eax
movq %rdi, (%rsp)
movq 0x8(%rsp), %r9
movq %r14, 0x18(%rsp)
jb 0xb447f
movq 0x18(%rdi), %rcx
movl $0x1, %edx
leaq 0x1e22d1(%rip), %rsi    # 0x296230
xorl %ebx, %ebx
xorl %r10d, %r10d
movq %rdx, %rbp
movq (%rcx,%rbx,8), %r15
movq 0x10(%rsi), %rax
movq 0x18(%rsi), %rdx
movq %r15, %r12
shrq $0x21, %r12
movl (%rdx,%r12,8), %edx
cmpq $0x0, (%rax,%r12,8)
je 0xb43da
movq (%rcx,%rbp,8), %r13
movq %r13, 0x10(%rsp)
shrq $0x20, %r13
movl %r13d, %ecx
shrl %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0xb43da
movq %rcx, 0x38(%rsp)
movq %rbp, 0x20(%rsp)
movq %r15, %rbp
shrq $0x20, %rbp
movq 0x28(%r14), %rax
movq (%rax,%rbp,8), %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0xb400a
movq 0x8(%r14), %rcx
movq %rax, %rsi
shrq $0x20, %rsi
movl %eax, %edx
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rsi
addq $0xc, %rsi
xorl %ecx, %ecx
cmpl $0x0, (%rsi)
js 0xb3fee
cmpl %r13d, -0x4(%rsi)
je 0xb400e
incq %rcx
addq $0x18, %rsi
cmpq %rcx, %rdx
jne 0xb3fe3
movl %eax, %ecx
leaq 0x1e222d(%rip), %rsi    # 0x296230
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
jmp 0xb4018
xorl %ecx, %ecx
jmp 0xb4018
movl -0xc(%rsi), %edx
leaq 0x1e2218(%rip), %rsi    # 0x296230
cmpl %eax, %ecx
jne 0xb4275
movq (%r9), %rax
testq %rax, %rax
je 0xb4082
movl %edx, %r11d
movq 0x10(%r9), %rcx
movl $0x1, %edx
xorl %r14d, %r14d
leaq (%r14,%r14,2), %rsi
cmpl $0x0, 0xc(%rcx,%rsi,8)
js 0xb405b
leaq (%rcx,%rsi,8), %r9
movq (%r9), %rsi
movq %rsi, %r8
shrq $0x20, %r8
cmpl %ebp, %r8d
jne 0xb405b
cmpl %r13d, 0x8(%r9)
je 0xb406a
movl %edx, %r14d
incl %edx
cmpq %r14, %rax
ja 0xb4037
movl %r11d, %edx
jmp 0xb406c
movl %esi, %edx
cmpq %r14, %rax
movq 0x8(%rsp), %r9
movq 0xa8(%rsp), %r11
jne 0xb41f7
movl %r10d, 0x10(%rsp)
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl 0x2c(%rsp), %ecx
movl 0xa0(%rsp), %r8d
movl %ebp, %r9d
leaq 0x50(%rsp), %rax
pushq %rax
pushq %r13
callq 0xb3df3
addq $0x10, %rsp
testl %eax, %eax
movq 0x18(%rsp), %r14
je 0xb430c
movl 0x50(%rsp), %edx
movq 0xa8(%rsp), %r11
testq %r11, %r11
je 0xb4251
movq (%r11), %rcx
movq 0x10(%r11), %rax
cmpq 0x8(%r11), %rcx
movl %edx, 0x30(%rsp)
jne 0xb4117
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x8(%r11)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0xa8(%rsp), %r11
movq %rax, 0x10(%r11)
movq (%r11), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%r11)
leaq (%rcx,%rcx,2), %rcx
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rax,%rcx,8)
movl %r13d, %r9d
xorl $0x1, %r9d
movl %ebp, %eax
xorl $0x1, %eax
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl 0x2c(%rsp), %ecx
movl 0xa0(%rsp), %r8d
leaq 0x50(%rsp), %rdx
pushq %rdx
pushq %rax
movq %r11, %r14
callq 0xb3df3
addq $0x10, %rsp
testl %eax, %eax
je 0xb443b
movq (%r14), %rcx
movq 0x10(%r14), %rax
cmpq 0x8(%r14), %rcx
movq %r14, %r11
jne 0xb41b5
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x8(%r11)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0xa8(%rsp), %r11
movq %rax, 0x10(%r11)
movq (%r11), %rcx
movq (%rsp), %rdi
movl 0x10(%rsp), %r10d
movq 0x8(%rsp), %r9
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %rbp
leaq 0x1e205c(%rip), %rsi    # 0x296230
leaq 0x1(%rcx), %rdx
movq %rdx, (%r11)
leaq (%rcx,%rcx,2), %rcx
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rax,%rcx,8)
jmp 0xb43d1
testq %r11, %r11
leaq 0x1e202f(%rip), %rsi    # 0x296230
je 0xb4270
movl %edx, 0x30(%rsp)
movq (%r11), %rcx
movq 0x10(%r11), %rax
cmpq 0x8(%r11), %rcx
jne 0xb427f
movl %r10d, %r12d
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x8(%r11)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r9
movq 0xa8(%rsp), %r11
movq %rax, 0x10(%r11)
movq (%r11), %rcx
jmp 0xb4282
movq (%rsp), %rdi
movl 0x10(%rsp), %r10d
movq 0x8(%rsp), %r9
movq 0x20(%rsp), %rbp
leaq 0x1e1fc5(%rip), %rsi    # 0x296230
jmp 0xb43d5
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %rbp
jmp 0xb43d5
movl %r10d, %r12d
movabsq $0x100000000, %r13      # imm = 0x100000000
movq 0x10(%r9), %rdx
leaq (%r14,%r14,2), %rsi
leaq 0x1(%rcx), %rdi
movq %rdi, (%r11)
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rdx,%rsi,8), %rdi
movq %rdi, 0x10(%rax,%rcx,8)
movups (%rdx,%rsi,8), %xmm0
movups %xmm0, (%rax,%rcx,8)
movq (%r9), %rax
testq %rax, %rax
je 0xb4307
movq 0x10(%r9), %rcx
movl $0x1, %edx
xorl %r14d, %r14d
leaq (%r14,%r14,2), %rsi
cmpl $0x0, 0xc(%rcx,%rsi,8)
js 0xb42fb
leaq (%rcx,%rsi,8), %rdi
movq (%rdi), %rsi
movq %rsi, %r8
xorq 0x10(%rsp), %r8
movabsq $-0x100000000, %r10     # imm = 0xFFFFFFFF00000000
andq %r10, %r8
cmpq %r13, %r8
jne 0xb42fb
movl 0x8(%rdi), %edi
xorl %ebp, %edi
cmpl $0x1, %edi
je 0xb434b
movl %edx, %r14d
incl %edx
cmpq %r14, %rax
ja 0xb42c5
jmp 0xb434f
xorl %r14d, %r14d
jmp 0xb434f
movq 0x1e0ccd(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
movl %ebp, %ecx
andl $0x1, %ecx
movl %r13d, %r9d
andl $0x1, %r9d
movl 0x18(%r14), %r10d
subq $0x8, %rsp
leaq 0x182016(%rip), %rsi    # 0x236347
movl %r12d, %edx
movq 0x40(%rsp), %r8
xorl %eax, %eax
pushq %r10
callq 0x22b0
addq $0x10, %rsp
jmp 0xb40be
movl %esi, 0x30(%rsp)
movq (%r11), %rcx
movq 0x10(%r11), %rax
cmpq 0x8(%r11), %rcx
movq 0x20(%rsp), %rbp
jne 0xb4399
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmoveq %rcx, %rdx
movq %rdx, 0x8(%r11)
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r9
movq 0xa8(%rsp), %r11
movq %rax, 0x10(%r11)
movq (%r11), %rcx
movq (%rsp), %rdi
movl %r12d, %r10d
movq 0x10(%r9), %rdx
leaq (%r14,%r14,2), %rsi
leaq 0x1(%rcx), %r8
movq %r8, (%r11)
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rdx,%rsi,8), %r8
movq %r8, 0x10(%rax,%rcx,8)
movups (%rdx,%rsi,8), %xmm0
movups %xmm0, (%rax,%rcx,8)
movq 0x18(%rsp), %r14
leaq 0x1e1e5f(%rip), %rsi    # 0x296230
movl 0x30(%rsp), %edx
cmpl $-0x1, %edx
je 0xb440c
movq 0x18(%rdi), %rcx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
andq %rax, %r15
movl %edx, %eax
orq %r15, %rax
movq %rax, (%rcx,%rbx,8)
addl %edx, %r10d
leaq 0x1(%rbp), %rdx
movl 0x10(%rdi), %eax
incq %rbx
cmpq %rax, %rdx
jb 0xb3f64
jmp 0xb447f
movl %r10d, %ebp
callq 0x101a9
leaq 0x1e1e15(%rip), %rsi    # 0x296230
movq 0x8(%rsp), %r9
movq 0xa8(%rsp), %r11
movl %ebp, %r10d
movq 0x20(%rsp), %rbp
movq (%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
jmp 0xb43da
movq 0x1e0b9e(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
andl $0x1, %ebp
andl $0x1, %r13d
movq 0x18(%rsp), %rax
movl 0x18(%rax), %r10d
subq $0x8, %rsp
leaq 0x181f24(%rip), %rsi    # 0x236384
movl %r12d, %edx
movl %ebp, %ecx
movq 0x40(%rsp), %r8
movl %r13d, %r9d
xorl %eax, %eax
pushq %r10
callq 0x22b0
addq $0x10, %rsp
jmp 0xb4172
cmpl %eax, %ebp
jae 0xb4912
cmpl $0x0, (%rdi)
movabsq $-0x100000000, %r12     # imm = 0xFFFFFFFF00000000
movq 0x18(%rdi), %rax
movl %ebp, %r14d
movq (%rax,%r14,8), %rbx
js 0xb44cc
leaq (%rax,%r14,8), %r14
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rbx, %rcx
shrq $0x21, %rcx
movl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
andl (%rax,%rcx,8), %r15d
jmp 0xb4903
xorl %r10d, %r10d
jmp 0xb4912
leaq 0x1e1d5d(%rip), %rdx    # 0x296230
movq 0x10(%rdx), %rcx
movq 0x18(%rdx), %rdx
movq %rbx, %rsi
shrq $0x21, %rsi
movl (%rdx,%rsi,8), %r15d
cmpq $0x0, (%rcx,%rsi,8)
je 0xb48fb
movq (%rax), %rbp
movq %rbp, 0x20(%rsp)
shrq $0x20, %rbp
movl %ebp, %eax
shrl %eax
cmpq $0x0, (%rcx,%rax,8)
je 0xb48fb
movq %rax, 0x30(%rsp)
movq %rsi, 0x38(%rsp)
movq %rbx, %r8
shrq $0x20, %r8
movq 0x18(%rsp), %rcx
movq 0x28(%rcx), %rax
movq (%rax,%r8,8), %rax
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testl %eax, %eax
je 0xb4569
movq 0x8(%rcx), %rcx
movq %rax, %rsi
shrq $0x20, %rsi
movl %eax, %edx
leaq (%rsi,%rsi,2), %rsi
leaq (%rcx,%rsi,8), %rsi
addq $0xc, %rsi
xorl %ecx, %ecx
cmpl $0x0, (%rsi)
js 0xb4559
cmpl %ebp, -0x4(%rsi)
je 0xb456d
incq %rcx
addq $0x18, %rsi
cmpq %rcx, %rdx
jne 0xb454f
movl %eax, %ecx
jmp 0xb4571
xorl %ecx, %ecx
jmp 0xb4571
movl -0xc(%rsi), %r15d
cmpl %eax, %ecx
jne 0xb48f5
movq (%r9), %rax
testq %rax, %rax
je 0xb45d4
movq 0x10(%r9), %rcx
movl $0x1, %edx
xorl %r12d, %r12d
leaq (%r12,%r12,2), %rsi
cmpl $0x0, 0xc(%rcx,%rsi,8)
js 0xb45b7
leaq (%rcx,%rsi,8), %r9
movq (%r9), %rsi
movq %r8, %r13
movq %rsi, %r8
shrq $0x20, %r8
cmpl %r13d, %r8d
movq %r13, %r8
jne 0xb45b7
cmpl %ebp, 0x8(%r9)
je 0xb45c3
movl %edx, %r12d
incl %edx
cmpq %r12, %rax
ja 0xb458d
jmp 0xb45c6
movl %esi, %r15d
cmpq %r12, %rax
movq 0x8(%rsp), %r9
jne 0xb4667
movl %r10d, 0x10(%rsp)
leaq 0x50(%rsp), %r13
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl 0x2c(%rsp), %ecx
movq %r8, %r9
movl 0xa0(%rsp), %r8d
movq %r9, %r12
pushq %r13
pushq %rbp
callq 0xb3df3
addq $0x10, %rsp
testl %eax, %eax
je 0xb482e
movl 0x50(%rsp), %r15d
movq 0xa8(%rsp), %r10
testq %r10, %r10
je 0xb46c3
movq (%r10), %rcx
cmpq 0x8(%r10), %rcx
jne 0xb46d1
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
movl $0x2, %ecx
cmovneq %rax, %rcx
movq %rcx, 0x8(%r10)
movq 0x10(%r10), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0xa8(%rsp), %r10
movq %rax, 0x10(%r10)
movq (%r10), %rcx
jmp 0xb46d5
testq %r11, %r11
je 0xb48eb
movq (%r11), %rcx
cmpq 0x8(%r11), %rcx
movl %r10d, 0x10(%rsp)
movq %r8, %rbp
jne 0xb4798
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
movl $0x2, %ecx
cmovneq %rax, %rcx
movq %rcx, 0x8(%r11)
movq 0x10(%r11), %rdi
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
callq 0x2370
movq 0x8(%rsp), %r9
movq 0xa8(%rsp), %r11
movq %rax, 0x10(%r11)
movq (%r11), %rcx
jmp 0xb479c
movq (%rsp), %rdi
movl 0x10(%rsp), %r10d
jmp 0xb48eb
movq 0x10(%r10), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%r10)
leaq (%rcx,%rcx,2), %rcx
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rax,%rcx,8)
movl %ebp, %r9d
xorl $0x1, %r9d
movl %r12d, %eax
xorl $0x1, %eax
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
movl 0x2c(%rsp), %ecx
movl 0xa0(%rsp), %r8d
pushq %r13
pushq %rax
movq %r10, %r13
callq 0xb3df3
addq $0x10, %rsp
testl %eax, %eax
je 0xb496b
movq (%r13), %rcx
movq 0x10(%r13), %rax
cmpq 0x8(%r13), %rcx
jne 0xb476f
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmovneq %rdx, %rcx
movq %rcx, 0x8(%r13)
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0xa8(%rsp), %r13
movq %rax, 0x10(%r13)
movq (%r13), %rcx
movq (%rsp), %rdi
movl 0x10(%rsp), %r10d
leaq 0x1(%rcx), %rdx
movq %rdx, (%r13)
leaq (%rcx,%rcx,2), %rcx
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movups 0x50(%rsp), %xmm0
jmp 0xb48e7
movq 0x10(%r11), %rax
movq 0x10(%r9), %rdx
leaq (%r12,%r12,2), %rsi
leaq 0x1(%rcx), %rdi
movq %rdi, (%r11)
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rdx,%rsi,8), %rdi
movq %rdi, 0x10(%rax,%rcx,8)
movups (%rdx,%rsi,8), %xmm0
movups %xmm0, (%rax,%rcx,8)
movq (%r9), %rax
testq %rax, %rax
je 0xb4829
movq 0x10(%r9), %rcx
movl $0x1, %edx
xorl %r12d, %r12d
movabsq $0x100000000, %rsi      # imm = 0x100000000
movabsq $-0x100000000, %r10     # imm = 0xFFFFFFFF00000000
leaq (%r12,%r12,2), %rdi
cmpl $0x0, 0xc(%rcx,%rdi,8)
js 0xb481d
leaq (%rcx,%rdi,8), %r8
movq (%r8), %rdi
movq %rdi, %r9
xorq 0x20(%rsp), %r9
andq %r10, %r9
cmpq %rsi, %r9
movq 0x8(%rsp), %r9
jne 0xb481d
movl 0x8(%r8), %r8d
xorl %ebp, %r8d
cmpl $0x1, %r8d
je 0xb4875
movl %edx, %r12d
incl %edx
cmpq %r12, %rax
ja 0xb47e9
jmp 0xb4878
xorl %r12d, %r12d
jmp 0xb4878
movq 0x1e07ab(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
movl %r12d, %ecx
andl $0x1, %ecx
movl %ebp, %r9d
andl $0x1, %r9d
movq 0x18(%rsp), %rax
movl 0x18(%rax), %r10d
subq $0x8, %rsp
leaq 0x181aee(%rip), %rsi    # 0x236347
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %r8
xorl %eax, %eax
pushq %r10
callq 0x22b0
addq $0x10, %rsp
jmp 0xb460e
movl %edi, %r15d
movq (%r11), %rcx
movq 0x10(%r11), %rax
cmpq 0x8(%r11), %rcx
jne 0xb48bd
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
movl $0x2, %ecx
cmovneq %rdx, %rcx
movq %rcx, 0x8(%r11)
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r9
movq 0xa8(%rsp), %r11
movq %rax, 0x10(%r11)
movq (%r11), %rcx
movq (%rsp), %rdi
movl 0x10(%rsp), %r10d
movq 0x10(%r9), %rdx
leaq (%r12,%r12,2), %rsi
leaq 0x1(%rcx), %r8
movq %r8, (%r11)
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rdx,%rsi,8), %r8
movq %r8, 0x10(%rax,%rcx,8)
movups (%rdx,%rsi,8), %xmm0
movups %xmm0, (%rax,%rcx,8)
movabsq $-0x100000000, %r12     # imm = 0xFFFFFFFF00000000
cmpl $-0x1, %r15d
je 0xb4954
shlq $0x3, %r14
addq 0x18(%rdi), %r14
andq %r12, %rbx
movl %r15d, %eax
orq %rbx, %rax
movq %rax, (%r14)
addl %r15d, %r10d
movl (%rdi), %eax
andl $0x7fffffff, %r10d      # imm = 0x7FFFFFFF
movl %eax, %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl %r10d, %ecx
movl %ecx, (%rdi)
testl %eax, %eax
js 0xb4945
movq 0x18(%rdi), %rax
movl 0x4(%rax), %ecx
movl %ecx, 0x4(%rdi)
movl 0x10(%rdi), %ecx
decl %ecx
movl 0x4(%rax,%rcx,8), %eax
xorl $0x1, %eax
movl %eax, 0x8(%rdi)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r10d, %ebp
callq 0x101c5
movl %ebp, %r10d
movq (%rsp), %rdi
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0xb48fb
movq 0x1e066e(%rip), %rax    # 0x294fe0
movq (%rax), %rdi
andl $0x1, %r12d
andl $0x1, %ebp
movq 0x18(%rsp), %rax
movl 0x18(%rax), %r10d
subq $0x8, %rsp
leaq 0x1819f4(%rip), %rsi    # 0x236384
movq 0x40(%rsp), %rdx
movl %r12d, %ecx
movq 0x38(%rsp), %r8
movl %ebp, %r9d
xorl %eax, %eax
pushq %r10
callq 0x22b0
addq $0x10, %rsp
jmp 0xb472d