// File: /workspace/github_c_makefile_star2_O2/c-zhou[P]oatk/graph.c
// Function: asmg_unitigging
asmg_t *asmg_unitigging(asmg_t *g)
{
    uint64_t i, j, k, n_vtx, n_arc, n_arc1, v, w, n, m, *vtx_p;
    asmg_arc_t *arc, *arc1;
    asmg_vtx_t *vtx, *vtx1;
    uint8_t *vtx_visited;
    asmg_t *utg_asmg;
    kvec_t(asmg_vtx_t) utgs = {0, 0, 0};
    kvec_t(asmg_arc_t) arcs = {0, 0, 0};
    vtx = g->vtx;
    n_vtx = g->n_vtx;
    MYCALLOC(vtx_visited, n_vtx);

    /* first visit for all untigs connected to a junction */
    for (i = 0; i < n_vtx; ++i) {
        if (vtx[i].del || !is_junction(g, i))
            continue;
        for (k = 0; k < 2; ++k) {
            v = i << 1 | k;
            n_arc = asmg_arc_n(g, v);
            n_arc1 = asmg_arc_n1(g, v);
            arc = asmg_arc_a(g, v);
            for (j = 0; j < n_arc; ++j) {
                if (arc[j].del)
                    continue;
                kvec_t(uint64_t) vec = {0, 0, 0};
                if (!vtx_visited[v>>1] && n_arc1 == 1)
                    kv_push(uint64_t, vec, v); /* add to utg vec */
                v = asmg_arc_tail(arc[j]);
                /* v can be the start point of a unitig */
                while (!vtx_visited[v>>1] && asmg_arc_n1(g, v^1) == 1) {
                    kv_push(uint64_t, vec, v);
                    vtx_visited[v>>1] = 1;
                    if (asmg_arc_n1(g, v) == 1) /* at most one outgoing edge */
                        v = asmg_arc_a1(g, v)->w;
                    else
                        break;
                }
                if (vec.n > 1) {
                    kv_pushp(asmg_vtx_t, utgs, &vtx1);
                    vtx1->n = vec.n;
                    vtx1->a = vec.a;
                    vtx1->seq = 0;
                    vtx1->len = 0;
                    vtx1->cov = vtx1->del = vtx1->circ = 0;
                    MYREALLOC(vtx1->a, vtx1->n);
                } else {
                    kv_destroy(vec);
                }
            }
        }
        vtx_visited[i] = 1;
    }

    /* second visit to get linear path */
    /* TODO */
    /* consider this special case as linear */
    /* v(-)->v(+) v(+)->w(+) w(+)->w(-) */
    for (i = 0; i < n_vtx; ++i) {
        if (vtx[i].del || vtx_visited[i] ||
                (asmg_arc_n1(g, i << 1) > 0 &&
                 asmg_arc_n1(g, i << 1 | 1) > 0))
            continue;
        v = asmg_arc_n1(g, i << 1) > 0? i << 1 : i << 1 | 1;
        kvec_t(uint64_t) vec = {0, 0, 0};
        kv_push(uint64_t, vec, v);
        vtx_visited[v>>1] = 1;
        while (asmg_arc_n1(g, v) == 1) { /* should always be 1 */
            v = asmg_arc_a1(g, v)->w;
            if (!vtx_visited[v>>1])
                kv_push(uint64_t, vec, v);
            else
                break;
            vtx_visited[v>>1] = 1;
        }
        if (vec.n > 1) {
            kv_pushp(asmg_vtx_t, utgs, &vtx1);
            vtx1->n = vec.n;
            vtx1->a = vec.a;
            vtx1->seq = 0;
            vtx1->len = 0;
            vtx1->cov = vtx1->del = vtx1->circ = 0;
            MYREALLOC(vtx1->a, vtx1->n);
        } else {
            kv_destroy(vec);
        }
    }

    /* last visit for the remaining unvisited non-juntions on circles */
    for (i = 0; i < n_vtx; ++i) {
        if (vtx[i].del || vtx_visited[i]) continue;
        v = i << 1; /* either direction would work */
        kvec_t(uint64_t) vec = {0, 0, 0};
        kv_push(uint64_t, vec, v);
        vtx_visited[v>>1] = 1;
        while (asmg_arc_n1(g, v) > 0) {
            v = asmg_arc_a1(g, v)->w;
            if (!vtx_visited[v>>1])
                kv_push(uint64_t, vec, v);
            else
                break;
            vtx_visited[v>>1] = 1;
        }
        if (vec.n > 1) {
            kv_pushp(asmg_vtx_t, utgs, &vtx1);
            vtx1->n = vec.n;
            vtx1->a = vec.a;
            vtx1->seq = 0;
            vtx1->len = 0;
            vtx1->cov = vtx1->del = 0;
            vtx1->circ = 1;
            MYREALLOC(vtx1->a, vtx1->n);
        } else {
            kv_destroy(vec);
        }
    }
    free(vtx_visited);

    /* singleton: UINT64_MAX; start: u << 1 | 0; end: u << 1 | 1; mid: UINT64_MAX - 1 */
    MYMALLOC(vtx_p, n_vtx);
    MYBONE(vtx_p, n_vtx);
    for (i = 0; i < utgs.n; ++i) {
        vtx1 = &utgs.a[i];
        vtx_p[vtx1->a[0]>>1] = i << 1;
        vtx_p[vtx1->a[vtx1->n-1]>>1] = i << 1 | 1;
        for (j = 1; j < vtx1->n-1; ++j) { /* vtx1->n > 1 */
            vtx_p[vtx1->a[j]>>1] = UINT64_MAX - 1;
            asmg_arc_del(g, vtx1->a[j-1], vtx1->a[j], 1);
            asmg_arc_del(g, vtx1->a[j]^1, vtx1->a[j-1]^1, 1);
        }
        asmg_arc_del(g, vtx1->a[vtx1->n-2], vtx1->a[vtx1->n-1], 1);
        asmg_arc_del(g, vtx1->a[vtx1->n-1]^1, vtx1->a[vtx1->n-2]^1, 1);
    }
    
    /* add singletons to utg set */
    for (i = 0; i < n_vtx; ++i) {
        if (vtx_p[i] == UINT64_MAX && !vtx[i].del) {
            vtx_p[i] = utgs.n << 1; /*update index*/
            kv_pushp(asmg_vtx_t, utgs, &vtx1);
            v = i << 1;
            vtx1->n = 1;
            MYMALLOC(vtx1->a, 1);
            vtx1->a[0] = v;
            vtx1->seq = 0;
            vtx1->len = 0;
            vtx1->cov = vtx1->del = 0;
            vtx1->circ = asmg_arc_exist1(g, v, v);
        }
    }

    /* add arcs */
    for (i = 0, n_arc = g->n_arc; i < n_arc; ++i) {
        arc = &g->arc[i];
        if (arc->del) continue;
        v = vtx_p[arc->v>>1];
        w = vtx_p[arc->w>>1];
        if (v == UINT64_MAX - 1 || w == UINT64_MAX - 1) continue;
        kv_pushp(asmg_arc_t, arcs, &arc1);
        arc1->v = utgs.a[v>>1].n>1? v^1 : v|(arc->v&1);
        arc1->w = utgs.a[w>>1].n>1?  w  : w|(arc->w&1);
        arc1->ln = arc->ln;
        arc1->ls = arc->ls;
        arc1->link_id = arc->link_id;
        arc1->cov = arc->cov;
        arc1->del = 0;
        arc1->comp = arc->comp;
    }
    free(vtx_p);

    /* expand utgs */
    for (i = 0, n = utgs.n; i < n; ++i) {
        vtx_p = utgs.a[i].a;
        m = utgs.a[i].n;
        u64_v_t v_vec = {0, 0, 0};
        for (j = 0; j < m; ++j) {
            if (j > 0)
                v_vec.n -= asmg_arc(g, vtx_p[j-1], vtx_p[j])->ln;
            vtx1 = &vtx[vtx_p[j]>>1];
            vec_add(&v_vec, vtx1->a, vtx1->n, !!(vtx_p[j]&1));
        }
        vtx1 = &utgs.a[i];
        free(vtx1->a);
        vtx1->n = v_vec.n;
        vtx1->a = v_vec.a;
        vtx1->cov = 0; // need to redo alignment and coverage estimation
        MYREALLOC(vtx1->a, vtx1->n);
    }

    /* finalize */
    MYCALLOC(utg_asmg, 1);
    utg_asmg->n_vtx = utgs.n;
    utg_asmg->m_vtx = utgs.m;
    utg_asmg->vtx = utgs.a;
    utg_asmg->n_arc = arcs.n;
    utg_asmg->m_arc = arcs.m;
    utg_asmg->arc = arcs.a;

    asmg_finalize(utg_asmg, 1);

    return utg_asmg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %r15
movq (%rdi), %rdi
movq 0x10(%r15), %rax
movq %rax, 0x40(%rsp)
pushq $0x1
popq %rsi
movq %rdi, 0x30(%rsp)
callq 0x2250
movq %rax, %rbp
xorl %ebx, %ebx
movq $0x0, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x18(%rsp)
movq %r15, 0x8(%rsp)
movq %rax, 0x10(%rsp)
cmpq 0x30(%rsp), %rbx
je 0x13e86
imulq $0x28, %rbx, %rax
movq 0x40(%rsp), %rcx
testb $0x40, 0x23(%rcx,%rax)
jne 0x13e7e
leaq (%rbx,%rbx), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x12e42
cmpq $0x1, %rax
ja 0x13c70
movq %r14, %rsi
orq $0x1, %rsi
movq %r15, %rdi
callq 0x12e42
cmpq $0x2, %rax
jb 0x13e7e
xorl %r13d, %r13d
movq %rbx, 0x58(%rsp)
movq %r14, 0x38(%rsp)
cmpq $0x2, %r13
je 0x13e79
movq %r13, 0x60(%rsp)
orq %r14, %r13
movq 0x38(%r15), %rax
movq (%rax,%r13,8), %r14
movq %r15, %rdi
movq %r13, %rsi
callq 0x12e42
movq 0x30(%r15), %rcx
imulq $0x30, (%rcx,%r13,8), %rcx
movq %rax, 0x68(%rsp)
addq 0x28(%r15), %rcx
movq %rcx, 0x50(%rsp)
xorl %ebx, %ebx
movq %r14, 0x48(%rsp)
cmpq %r14, %rbx
je 0x13e62
imulq $0x30, %rbx, %r15
movq 0x50(%rsp), %rax
testb $0x40, 0x23(%rax,%r15)
jne 0x13d17
movq %r13, %rax
shrq %rax
cmpb $0x0, (%rbp,%rax)
jne 0x13d21
movl $0x0, %ebp
movl $0x0, %r12d
movl $0x0, %r14d
cmpq $0x1, 0x68(%rsp)
jne 0x13d29
pushq $0x10
popq %rdi
callq 0x2310
movq %rax, %r14
movq %r13, (%rax)
pushq $0x1
popq %rbp
pushq $0x2
popq %r12
jmp 0x13d29
movq 0x8(%rsp), %r15
jmp 0x13e5a
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r14d, %r14d
addq 0x50(%rsp), %r15
movq 0x8(%r15), %r13
movq %r13, %r15
shrq %r15
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax,%r15)
jne 0x13dbf
movq %r13, %rsi
xorq $0x1, %rsi
movq 0x8(%rsp), %rdi
callq 0x12e42
cmpq $0x1, %rax
jne 0x13dbf
cmpq %r12, %rbp
jne 0x13d85
leaq (,%rbp,2), %r12
testq %rbp, %rbp
pushq $0x2
popq %rax
cmoveq %rax, %r12
leaq (,%r12,8), %rsi
movq %r14, %rdi
callq 0x2350
movq %rax, %r14
movq %r13, (%r14,%rbp,8)
incq %rbp
movq 0x10(%rsp), %rax
movb $0x1, (%rax,%r15)
movq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x12e42
cmpq $0x1, %rax
jne 0x13dc4
movq %r15, %rdi
movq %r13, %rsi
callq 0x12abe
movq %rax, %r15
jmp 0x13d2e
movq 0x8(%rsp), %r15
cmpq $0x2, %rbp
jb 0x13dfc
movq 0x20(%rsp), %r15
cmpq 0x28(%rsp), %r15
jne 0x13e06
leaq (%r15,%r15), %rcx
testq %r15, %r15
pushq $0x2
popq %rax
cmoveq %rax, %rcx
movq %rcx, 0x28(%rsp)
imulq $0x28, %rcx, %rsi
movq 0x18(%rsp), %rdi
callq 0x2350
movq %rax, %r12
jmp 0x13e0b
movq %r14, %rdi
callq 0x2060
jmp 0x13e50
movq 0x18(%rsp), %r12
movq %r15, %rax
imulq $0x28, %r15, %r15
incq %rax
movq %rax, 0x20(%rsp)
movq %rbp, (%r12,%r15)
movq %r14, 0x8(%r12,%r15)
shlq $0x3, %rbp
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12,%r15)
andl $0x0, 0x20(%r12,%r15)
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2350
movq %r12, 0x18(%rsp)
movq %rax, 0x8(%r12,%r15)
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbp
movq 0x48(%rsp), %r14
incq %rbx
jmp 0x13cc0
movq 0x60(%rsp), %r13
incq %r13
movq 0x58(%rsp), %rbx
movq 0x38(%rsp), %r14
jmp 0x13c7d
movb $0x1, (%rbp,%rbx)
incq %rbx
jmp 0x13c23
xorl %ebx, %ebx
cmpq 0x30(%rsp), %rbx
je 0x1402e
imulq $0x28, %rbx, %rax
movq 0x40(%rsp), %rcx
testb $0x40, 0x23(%rcx,%rax)
jne 0x13eaa
cmpb $0x0, (%rbp,%rbx)
je 0x13eaf
incq %rbx
jmp 0x13e88
movq %r15, %r12
leaq (%rbx,%rbx), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x12e42
movq %rax, %r14
testq %rax, %rax
je 0x13ee2
movq %r15, %rsi
orq $0x1, %rsi
movq %r12, %rdi
callq 0x12e42
testq %rax, %rax
je 0x13ee2
movq %r12, %r15
jmp 0x13eaa
xorl %eax, %eax
testq %r14, %r14
sete %al
orq %rax, %r15
pushq $0x10
popq %rdi
callq 0x2310
movq %rax, %r14
movq %r15, (%rax)
movq %rbp, %rax
movq %rbx, %rbp
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq %rcx, %rbp
addq %rax, %rbp
pushq $0x1
popq %r13
pushq $0x2
popq %r12
movb $0x1, (%rbp)
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x12e42
cmpq $0x1, %rax
jne 0x13f8b
movq %rbp, %rdi
movq %r15, %rsi
callq 0x12abe
movq 0x8(%rax), %r15
movq %r15, %rbp
shrq %rbp
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax,%rbp)
jne 0x13f8b
cmpq %r12, %r13
jne 0x13f7d
leaq (,%r13,2), %r12
testq %r13, %r13
pushq $0x2
popq %rax
cmoveq %rax, %r12
leaq (,%r12,8), %rsi
movq %r14, %rdi
callq 0x2350
movq %rax, %r14
addq 0x10(%rsp), %rbp
movq %r15, (%r14,%r13,8)
incq %r13
jmp 0x13f19
cmpq $0x2, %r13
jb 0x13fc8
movq 0x20(%rsp), %r15
cmpq 0x28(%rsp), %r15
movq 0x10(%rsp), %rbp
jne 0x13fdf
leaq (%r15,%r15), %rcx
testq %r15, %r15
pushq $0x2
popq %rax
cmoveq %rax, %rcx
movq %rcx, 0x28(%rsp)
imulq $0x28, %rcx, %rsi
movq 0x18(%rsp), %rdi
callq 0x2350
movq %rax, %r12
jmp 0x13fe4
movq %r14, %rdi
callq 0x2060
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbp
jmp 0x13eaa
movq 0x18(%rsp), %r12
movq %r15, %rax
imulq $0x28, %r15, %r15
incq %rax
movq %rax, 0x20(%rsp)
movq %r13, (%r12,%r15)
movq %r14, 0x8(%r12,%r15)
shlq $0x3, %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12,%r15)
andl $0x0, 0x20(%r12,%r15)
movq %r14, %rdi
movq %r13, %rsi
callq 0x2350
movq %r12, 0x18(%rsp)
movq %rax, 0x8(%r12,%r15)
movq 0x8(%rsp), %r15
jmp 0x13eaa
xorl %ebx, %ebx
cmpq 0x30(%rsp), %rbx
je 0x141a1
imulq $0x28, %rbx, %rax
movq 0x40(%rsp), %rcx
testb $0x40, 0x23(%rcx,%rax)
jne 0x14199
cmpb $0x0, (%rbp,%rbx)
jne 0x14199
leaq (%rbx,%rbx), %r15
pushq $0x10
popq %rdi
callq 0x2310
movq %rax, %r14
movq %r15, (%rax)
movq %rbp, %rax
movq %rbx, %rbp
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq %rcx, %rbp
addq %rax, %rbp
pushq $0x1
popq %r13
pushq $0x2
popq %r12
movb $0x1, (%rbp)
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x12e42
testq %rax, %rax
je 0x140fb
movq %rbp, %rdi
movq %r15, %rsi
callq 0x12abe
movq 0x8(%rax), %r15
movq %r15, %rbp
shrq %rbp
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax,%rbp)
jne 0x140fb
cmpq %r12, %r13
jne 0x140ed
leaq (,%r13,2), %r12
testq %r13, %r13
pushq $0x2
popq %rax
cmoveq %rax, %r12
leaq (,%r12,8), %rsi
movq %r14, %rdi
callq 0x2350
movq %rax, %r14
addq 0x10(%rsp), %rbp
movq %r15, (%r14,%r13,8)
incq %r13
jmp 0x1408a
cmpq $0x2, %r13
jb 0x14138
movq 0x20(%rsp), %r15
cmpq 0x28(%rsp), %r15
movq 0x10(%rsp), %rbp
jne 0x1414c
leaq (%r15,%r15), %rcx
testq %r15, %r15
pushq $0x2
popq %rax
cmoveq %rax, %rcx
movq %rcx, 0x28(%rsp)
imulq $0x28, %rcx, %rsi
movq 0x18(%rsp), %rdi
callq 0x2350
movq %rax, %r12
jmp 0x14151
movq %r14, %rdi
callq 0x2060
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbp
jmp 0x14199
movq 0x18(%rsp), %r12
movq %r15, %rax
imulq $0x28, %r15, %r15
incq %rax
movq %rax, 0x20(%rsp)
movq %r13, (%r12,%r15)
movq %r14, 0x8(%r12,%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12,%r15)
movl $0x80000000, 0x20(%r12,%r15) # imm = 0x80000000
shlq $0x3, %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x2350
movq %r12, 0x18(%rsp)
movq %rax, 0x8(%r12,%r15)
movq 0x8(%rsp), %r15
incq %rbx
jmp 0x14030
movq %rbp, %rdi
callq 0x2060
movq 0x30(%rsp), %rax
leaq (,%rax,8), %r14
movq %r14, %rdi
callq 0x2310
movq %rax, %r12
movq %rax, %rdi
movl $0xff, %esi
movq %r14, %rdx
callq 0x21e0
xorl %ebx, %ebx
pushq $0x1
popq %rbp
cmpq 0x20(%rsp), %rbx
je 0x142c1
imulq $0x28, %rbx, %rax
movq 0x18(%rsp), %rdi
leaq (%rdi,%rax), %r15
leaq (%rbx,%rbx), %rcx
movq 0x8(%rdi,%rax), %rdx
movq (%rdx), %rsi
andq $-0x2, %rsi
movq %rcx, (%r12,%rsi,4)
leaq 0x1(,%rbx,2), %rcx
movq (%rdi,%rax), %rax
movq -0x8(%rdx,%rax,8), %rax
andq $-0x2, %rax
movq %rcx, (%r12,%rax,4)
pushq $0x1
popq %r13
movq (%r15), %rcx
movq 0x8(%r15), %rax
leaq -0x1(%rcx), %rdx
cmpq %rdx, %r13
jae 0x1427a
movq (%rax,%r13,8), %rdx
movq %rdx, %rcx
andq $-0x2, %rcx
movq $-0x2, (%r12,%rcx,4)
movq -0x8(%rax,%r13,8), %rsi
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl %ebp, %ecx
callq 0x13116
movq 0x8(%r15), %rax
movq -0x8(%rax,%r13,8), %rdx
movq (%rax,%r13,8), %rsi
xorq $0x1, %rsi
xorq $0x1, %rdx
movq %r14, %rdi
movl %ebp, %ecx
callq 0x13116
incq %r13
jmp 0x1421f
movq -0x10(%rax,%rcx,8), %rsi
movq -0x8(%rax,%rcx,8), %rdx
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl %ebp, %ecx
callq 0x13116
movq (%r15), %rax
movq 0x8(%r15), %rcx
movq %r14, %r15
movq -0x10(%rcx,%rax,8), %rdx
movq -0x8(%rcx,%rax,8), %rsi
xorq $0x1, %rsi
xorq $0x1, %rdx
movq %r14, %rdi
movl %ebp, %ecx
callq 0x13116
incq %rbx
jmp 0x141d6
xorl %ebx, %ebx
cmpq 0x30(%rsp), %rbx
je 0x143c9
cmpq $-0x1, (%r12,%rbx,8)
jne 0x143c1
imulq $0x28, %rbx, %rax
movq 0x40(%rsp), %rcx
testb $0x40, 0x23(%rcx,%rax)
jne 0x143c1
movq 0x20(%rsp), %r13
leaq (,%r13,2), %r15
movq %r15, (%r12,%rbx,8)
cmpq 0x28(%rsp), %r13
jne 0x14327
testq %r13, %r13
pushq $0x2
popq %rax
cmoveq %rax, %r15
imulq $0x28, %r15, %rsi
movq 0x18(%rsp), %rdi
callq 0x2350
movq %rax, %r14
movq %r15, 0x28(%rsp)
jmp 0x1432c
movq 0x18(%rsp), %r14
imulq $0x28, %r13, %rbp
incq %r13
movq %r13, 0x20(%rsp)
leaq (%r14,%rbp), %r15
leaq (%rbx,%rbx), %r13
movq $0x1, (%r14,%rbp)
pushq $0x8
popq %rdi
callq 0x2310
movq %rax, 0x8(%r14,%rbp)
movq %r13, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14,%rbp)
movq %r14, 0x18(%rsp)
andl $0x80000000, 0x20(%r14,%rbp) # imm = 0x80000000
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rcx
movq 0x30(%rax), %rdx
movq %rbx, %rsi
shlq $0x4, %rsi
movq 0x38(%rax), %rax
movq (%rax,%rsi), %rax
imulq $0x30, (%rdx,%rsi), %rdx
addq %rdx, %rcx
addq $0x20, %rcx
subq $0x1, %rax
jb 0x143af
cmpq %r13, -0x18(%rcx)
jne 0x143a9
testb $0x40, 0x3(%rcx)
je 0x143b3
addq $0x30, %rcx
jmp 0x14397
xorl %eax, %eax
jmp 0x143b8
movl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0x20(%r15)
movq 0x8(%rsp), %r15
incq %rbx
jmp 0x142c3
movq 0x18(%r15), %rbx
xorl %r14d, %r14d
movl $0x3fffffff, %r9d       # imm = 0x3FFFFFFF
movl $0x80000000, %r10d      # imm = 0x80000000
xorl %esi, %esi
xorl %edi, %edi
xorl %r8d, %r8d
subq $0x1, %rbx
jb 0x1450a
movq 0x28(%r15), %rbp
testb $0x40, 0x23(%rbp,%r14)
jne 0x14501
movq (%rbp,%r14), %rax
andq $-0x2, %rax
movq (%r12,%rax,4), %r13
cmpq $-0x2, %r13
je 0x14501
movq 0x8(%rbp,%r14), %rax
andq $-0x2, %rax
movq (%r12,%rax,4), %r11
cmpq $-0x2, %r11
je 0x144fc
cmpq %rdi, %rsi
jne 0x14470
leaq (%rsi,%rsi), %r15
testq %rsi, %rsi
pushq $0x2
popq %rax
cmoveq %rax, %r15
movq %rsi, 0x38(%rsp)
imulq $0x30, %r15, %rsi
movq %r8, %rdi
movq %r11, 0x10(%rsp)
callq 0x2350
movq 0x10(%rsp), %r11
movl $0x80000000, %r10d      # imm = 0x80000000
movl $0x3fffffff, %r9d       # imm = 0x3FFFFFFF
movq %r15, %rdi
movq 0x38(%rsp), %rsi
movq %rax, %r8
movq %r13, %rax
shrq %rax
imulq $0x28, %rax, %rax
movq 0x18(%rsp), %rcx
cmpq $0x2, (%rcx,%rax)
jb 0x1448c
xorq $0x1, %r13
jmp 0x14497
movq (%rbp,%r14), %rax
andl $0x1, %eax
orq %rax, %r13
imulq $0x30, %rsi, %rax
addq %r8, %rax
movq %r13, (%rax)
movq %r11, %rcx
shrq %rcx
imulq $0x28, %rcx, %rcx
movq 0x18(%rsp), %rdx
cmpq $0x1, (%rdx,%rcx)
ja 0x144c2
movq 0x8(%rbp,%r14), %rcx
andl $0x1, %ecx
orq %rcx, %r11
incq %rsi
movq %r11, 0x8(%rax)
movups 0x10(%rbp,%r14), %xmm0
movups %xmm0, 0x10(%rax)
movq 0x28(%rbp,%r14), %rcx
movq %rcx, 0x28(%rax)
movl 0x20(%rbp,%r14), %ecx
andl %r9d, %ecx
movl 0x20(%rax), %edx
andl %r10d, %edx
orl %ecx, %edx
movl %edx, 0x20(%rax)
movl 0x20(%rbp,%r14), %edx
andl %r10d, %edx
orl %ecx, %edx
movl %edx, 0x20(%rax)
movq 0x8(%rsp), %r15
addq $0x30, %r14
jmp 0x143e3
movq %r8, 0x70(%rsp)
movq %rdi, 0x30(%rsp)
movq %rsi, 0x38(%rsp)
movq %r12, %rdi
callq 0x2060
xorl %eax, %eax
movq 0x20(%rsp), %r14
cmpq %r14, %rax
movq 0x18(%rsp), %r15
je 0x146a7
movq %rax, 0x60(%rsp)
imulq $0x28, %rax, %rax
leaq (%r15,%rax), %rcx
movq %rcx, 0x58(%rsp)
movq (%r15,%rax), %rbx
movq 0x8(%r15,%rax), %rax
movq %rax, 0x48(%rsp)
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %r13d, %r13d
xorl %ecx, %ecx
movq %rbx, 0x68(%rsp)
cmpq %rbx, %rcx
je 0x1466b
testq %rcx, %rcx
movq %rcx, 0x50(%rsp)
je 0x1459a
movq 0x48(%rsp), %rax
movq -0x8(%rax,%rcx,8), %rsi
movq (%rax,%rcx,8), %r14
movq 0x8(%rsp), %rdi
movq %r14, %rdx
callq 0x12096
subq 0x10(%rax), %r12
jmp 0x145a2
movq 0x48(%rsp), %rax
movq (%rax), %r14
movq %r14, %rax
shrq %rax
imulq $0x28, %rax, %rax
movq 0x40(%rsp), %rcx
movq (%rcx,%rax), %rbp
movq 0x8(%rcx,%rax), %rcx
testb $0x1, %r14b
movq %rcx, 0x10(%rsp)
leaq (%r12,%r12), %r14
jne 0x14613
xorl %ebx, %ebx
cmpq %rbx, %rbp
je 0x14659
cmpq %r15, %r12
jne 0x145fe
testq %r12, %r12
movq %r14, %r15
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,8), %rsi
movq %r13, %rdi
callq 0x2350
movq 0x10(%rsp), %rcx
movq %rax, %r13
movq (%rcx,%rbx,8), %rax
movq %rax, (%r13,%r12,8)
incq %r12
incq %rbx
addq $0x2, %r14
jmp 0x145cb
subq $0x1, %rbp
jb 0x1465e
cmpq %r15, %r12
jne 0x14643
testq %r12, %r12
movq %r14, %r15
pushq $0x2
popq %rax
cmoveq %rax, %r15
leaq (,%r15,8), %rsi
movq %r13, %rdi
callq 0x2350
movq 0x10(%rsp), %rcx
movq %rax, %r13
movq (%rcx,%rbp,8), %rax
xorq $0x1, %rax
movq %rax, (%r13,%r12,8)
incq %r12
addq $0x2, %r14
jmp 0x14613
movq 0x68(%rsp), %rbx
movq 0x50(%rsp), %rcx
incq %rcx
jmp 0x14566
movq 0x58(%rsp), %rbx
movq 0x8(%rbx), %rdi
callq 0x2060
movq %r12, (%rbx)
movq %r13, 0x8(%rbx)
andl $0xc0000000, 0x20(%rbx) # imm = 0xC0000000
shlq $0x3, %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x2350
movq %rax, 0x8(%rbx)
movq 0x60(%rsp), %rax
incq %rax
jmp 0x14523
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x2250
movq %rax, %rbx
movq %r14, (%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rbx)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rbx)
movq 0x70(%rsp), %rax
movq %rax, 0x28(%rbx)
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1213f
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq