// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: ma_ug_hybrid_gen(usg_t*)
ma_ug_t *ma_ug_hybrid_gen(usg_t *g)
{
    int32_t *mark; uint32_t i, v, n_vtx = g->n<<1;
    uint32_t w, x, l, start, end, len; ma_utg_t *p;
    kdq_t(uint64_t) *q; ///is a queue
    ma_ug_t *ug;

    ug = (ma_ug_t*)calloc(1, sizeof(ma_ug_t));
    ug->g = asg_init();
    ///each node has two directions
    mark = (int32_t*)calloc(n_vtx, 4);

    q = kdq_init(uint64_t);
    for (v = 0; v < n_vtx; ++v) {
        // fprintf(stderr, "+[M::%s::] v::%u, n_vtx::%u\n", __func__, v, n_vtx);
        if (g->a[v>>1].del || mark[v]) continue;
        if (usg_arc_n(g, v) == 0 && usg_arc_n(g, (v^1)) != 0) continue;
        // fprintf(stderr, "-[M::%s::] v::%u, n_vtx::%u\n", __func__, v, n_vtx);
        mark[v] = 1; q->count = 0, start = v, end = v^1, len = 0;
        // forward
        w = v;
        while (1) {
            /**
             * w----->x
             * w<-----x
             * that means the only suffix of w is x, and the only prefix of x is w
             **/
            if (usg_arc_n(g, w) != 1) break;
            x = usg_arc_a(g, w)[0].v; // w->x
            if (usg_arc_n(g, x^1) != 1) break;

            /**
             * another direction of w would be marked as used (since w has been used)
            **/
            mark[x] = mark[w^1] = 1;
            ///l is the edge length, instead of overlap length
            ///note: edge length is different with overlap length
            l = asg_arc_len(usg_arc_a(g, w)[0]);
            kdq_push(uint64_t, q, (uint64_t)w<<32 | l);
            end = x^1, len += l;
            w = x;
            if (x == v) break;
        }
        if (start != (end^1) || kdq_size(q) == 0) { // linear unitig
            ///length of seq, instead of edge
            l = g->a[end>>1].len;
            kdq_push(uint64_t, q, (uint64_t)(end^1)<<32 | l);
            len += l;
        } else { // circular unitig
            start = end = UINT32_MAX;
            goto add_usg_unitig; // then it is not necessary to do the backward
        }

        // backward
        x = v;
        while (1) { // similar to forward but not the same
            if (usg_arc_n(g, x^1) != 1) break;
            w = usg_arc_a(g, x^1)[0].v ^ 1; // w->x
            if (usg_arc_n(g, w) != 1) break;
            mark[x] = mark[w^1] = 1;
            l = asg_arc_len(usg_arc_a(g, w)[0]);
            ///w is the seq id + direction, l is the length of edge
            ///push element to the front of a queue
            kdq_unshift(uint64_t, q, (uint64_t)w<<32 | l);

            // fprintf(stderr, "uId: %u, >%.*s (%u)\n", 
            // ug->u.n, (int)Get_NAME_LENGTH((R_INF), w>>1), Get_NAME((R_INF), w>>1), w>>1);

            start = w, len += l;
            x = w;
        }

        add_usg_unitig:
        if (start != UINT32_MAX) mark[start] = mark[end] = 1;
        kv_pushp(ma_utg_t, ug->u, &p);
        p->s = 0, p->start = start, p->end = end, p->len = len, p->n = kdq_size(q), p->circ = (start == UINT32_MAX);
        p->m = p->n;
        kv_roundup32(p->m);
        p->a = (uint64_t*)malloc(8 * p->m);
        //all elements are saved here
        for (i = 0; i < kdq_size(q); ++i)
            p->a[i] = kdq_at(q, i);
        // fprintf(stderr, "*[M::%s::] v::%u, n_vtx::%u\n", __func__, v, n_vtx);
    }
    kdq_destroy(uint64_t, q);
    // fprintf(stderr, "-1-[M::%s::] **************\n", __func__);
    // add arcs between unitigs; reusing mark for a different purpose
    //ug saves all unitigs
    for (v = 0; v < n_vtx; ++v) mark[v] = -1;
    // fprintf(stderr, "-2-[M::%s::] **************\n", __func__);

    //mark all start nodes and end nodes of all unitigs
    for (i = 0; i < ug->u.n; ++i) {
        if (ug->u.a[i].circ) continue;
        mark[ug->u.a[i].start] = i<<1 | 0;
        mark[ug->u.a[i].end] = i<<1 | 1;
    }
    // fprintf(stderr, "-3-[M::%s::] **************\n", __func__);
    //scan all edges
    usg_arc_t *av; uint32_t nv;
    for (v = 0; v < n_vtx; v++) {
        av = usg_arc_a(g, v); nv = usg_arc_n(g, v);
        for (i = 0; i < nv; i++) {
            if(av[i].del) continue;
            if (mark[av[i].ul>>32^1] >= 0 && mark[av[i].v] >= 0) {
                uint32_t u = mark[(av[i].ul>>32)^1]^1;
                int l = ug->u.a[u>>1].len - av[i].ol;
                if (l < 0) l = 1;
                asg_arc_t *q = asg_arc_pushp(ug->g);
                q->ol = av[i].ol, q->del = 0;
                q->ul = (uint64_t)u<<32 | l;
                q->v = mark[av[i].v]; q->ou = 0;
            }
        }
    }
    // fprintf(stderr, "-4-[M::%s::] **************\n", __func__);
    for (i = 0; i < ug->u.n; ++i)
        asg_seq_set(ug->g, i, ug->u.a[i].len, 0);
    // fprintf(stderr, "-5-[M::%s::] **************\n", __func__);
    asg_cleanup(ug->g);
    free(mark);
    return ug;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movabsq $0x800000000000000, %r12 # imm = 0x800000000000000
movq %rdi, 0x28(%rsp)
movq 0x8(%rdi), %r15
leal (%r15,%r15), %r14d
movl $0x1, %edi
movl $0x38, %esi
callq 0x2120
movq %rax, %rbx
callq 0xa0485
movq %rbx, 0x18(%rsp)
movq %rax, 0x48(%rsp)
movq %rax, 0x18(%rbx)
movl $0x4, %esi
movq %r14, %rdi
callq 0x2120
movq %rax, 0x8(%rsp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x2120
movq %rax, %rbx
movq %r12, %r13
movq %r12, (%rax)
movq $0x3, 0x10(%rax)
movl $0x20, %edi
callq 0x2280
movq %rbx, %r10
movq %rax, %r11
movq %rax, 0x18(%rbx)
movq %r14, 0x38(%rsp)
testl %r14d, %r14d
je 0x21ab47
movq %r15, 0x60(%rsp)
movq $0x0, 0x10(%rsp)
xorl %r8d, %r8d
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x8(%rsp), %r15
movq %r10, (%rsp)
movq %r13, %r9
movq 0x28(%rsp), %rax
movq (%rax), %rcx
movl %r12d, %ebp
shrl %ebp
imulq $0x78, %rbp, %r14
cmpb $0x0, 0x70(%rcx,%r14)
jne 0x21ab26
cmpl $0x0, (%r15,%r12,4)
jne 0x21ab26
leaq (%rcx,%r14), %rax
movl %r12d, %r13d
andl $0x1, %r13d
movl %r12d, %edx
andl $0x1, %edx
leaq (%rdx,%rdx,2), %rsi
movq 0x10(%rax,%rsi,8), %rdi
testq %rdi, %rdi
je 0x21a6dd
movq %r14, 0x30(%rsp)
movq %rbx, 0x58(%rsp)
movq %r8, 0x40(%rsp)
movl $0x1, (%r15,%r12,4)
movq $0x0, 0x8(%r10)
movl %r12d, %r8d
xorl $0x1, %r8d
movl %r8d, 0x10(%rsp)
cmpq $0x1, %rdi
movq %r13, 0x50(%rsp)
jne 0x21a721
movq %r9, %r14
movq 0x20(%rax,%rsi,8), %rax
movl 0x8(%rax), %esi
movq %rsi, %r8
xorq $0x1, %r8
movl %esi, %edi
shrl %edi
movl %r8d, %eax
andl $0x1, %eax
imulq $0x78, %rdi, %r9
addq %rcx, %r9
leaq (%rax,%rax,2), %rax
cmpq $0x1, 0x10(%r9,%rax,8)
jne 0x21a728
xorl %r13d, %r13d
movl %r12d, %ebx
xorl %eax, %eax
movq %r14, %r9
movl %esi, %r10d
movl %r8d, 0x10(%rsp)
imulq $0x78, %rbp, %rsi
movq %rdi, %rbp
movl %ebx, %edi
movl $0x1, %r8d
xorl %r8d, %edi
movl %r8d, (%r15,%rdi,4)
movl %r10d, 0x20(%rsp)
movl %r10d, %r14d
movq %r15, %r10
movl %r8d, (%r15,%r14,4)
addq %rcx, %rsi
leaq (%rdx,%rdx,2), %rcx
movq 0x20(%rsi,%rcx,8), %rcx
movq (%rcx), %r15
movq %r9, %rcx
shrq $0x3a, %rcx
movl $0x1, %edx
shlq %cl, %rdx
cmpq %rdx, %rax
jne 0x21a631
incl %ecx
movq (%rsp), %rdi
movl %ecx, %esi
callq 0x22c84f
movq (%rsp), %rcx
movq 0x8(%rsp), %r10
movq (%rcx), %r9
movq 0x8(%rcx), %rax
movq 0x18(%rcx), %r11
movl %r15d, %ecx
shlq $0x20, %rbx
movq %r9, %rdx
movabsq $0x3ffffffffffffff, %rsi # imm = 0x3FFFFFFFFFFFFFF
andq %rsi, %rdx
addq %rax, %rdx
incq %rax
movq (%rsp), %rsi
movq %rax, 0x8(%rsi)
andq 0x10(%rsi), %rdx
orq %rcx, %rbx
movq %rbx, (%r11,%rdx,8)
addl %r15d, %r13d
cmpq %r14, %r12
je 0x21a732
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movl %r14d, %edx
andl $0x1, %edx
imulq $0x78, %rbp, %rsi
addq %rcx, %rsi
leaq (%rdx,%rdx,2), %rdi
cmpq $0x1, 0x10(%rsi,%rdi,8)
movq %r10, %r15
jne 0x21a735
leaq (%rsi,%rdi,8), %rsi
addq $0x10, %rsi
movq 0x10(%rsi), %rsi
movl 0x8(%rsi), %esi
movq %rsi, %r8
xorq $0x1, %r8
movl %esi, %edi
shrl %edi
movq %r9, %rbx
movl %r8d, %r9d
andl $0x1, %r9d
imulq $0x78, %rdi, %r10
addq %rcx, %r10
leaq (%r9,%r9,2), %r9
cmpq $0x1, 0x10(%r10,%r9,8)
movq %rbx, %r9
movq (%rsp), %r10
movl 0x20(%rsp), %ebx
je 0x21a5c0
jmp 0x21a739
movl %r13d, %ecx
xorl $0x1, %ecx
leaq (%rcx,%rcx,2), %rcx
cmpq $0x0, 0x10(%rax,%rcx,8)
jne 0x21ab26
movq %r13, 0x50(%rsp)
movq %r14, 0x30(%rsp)
movq %rbx, 0x58(%rsp)
movq %r8, 0x40(%rsp)
movl $0x1, (%r15,%r12,4)
movq $0x0, 0x8(%r10)
movl %r12d, %eax
xorl $0x1, %eax
movl %eax, 0x10(%rsp)
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0x21a739
xorl %eax, %eax
xorl %r13d, %r13d
movq %r14, %r9
jmp 0x21a739
movq %r10, %r15
movq (%rsp), %r10
movl 0x10(%rsp), %esi
movl %esi, %ebx
xorl $0x1, %ebx
cmpq %rbx, %r12
jne 0x21a767
testq %rax, %rax
je 0x21a767
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x18(%rsp), %rcx
movl $0x80000000, %r15d      # imm = 0x80000000
jmp 0x21a9d7
movq 0x28(%rsp), %rcx
movq (%rcx), %r10
movl %esi, %ecx
shrl %ecx
imulq $0x78, %rcx, %rcx
movl 0x8(%r10,%rcx), %r14d
movq %r9, %rcx
shrq $0x3a, %rcx
movl $0x1, %esi
shlq %cl, %rsi
cmpq %rsi, %rax
jne 0x21a7b9
incl %ecx
movq (%rsp), %rdi
movl %ecx, %esi
callq 0x22c84f
movq (%rsp), %rcx
movq 0x8(%rsp), %r15
movq (%rcx), %r9
movq 0x8(%rcx), %rax
movq 0x18(%rcx), %r11
movq 0x28(%rsp), %rcx
movq (%rcx), %r10
shlq $0x20, %rbx
leaq 0x1(%rax), %rcx
movq (%rsp), %rdx
movq %rcx, 0x8(%rdx)
movq %r9, %rcx
movabsq $0x3ffffffffffffff, %rsi # imm = 0x3FFFFFFFFFFFFFF
andq %rsi, %rcx
addq %rax, %rcx
andq 0x10(%rdx), %rcx
orq %r14, %rbx
movq %rbx, (%r11,%rcx,8)
addl %r14d, %r13d
movq 0x50(%rsp), %rax
xorl $0x1, %eax
movq 0x30(%rsp), %rcx
addq %r10, %rcx
leaq (%rax,%rax,2), %rax
cmpq $0x1, 0x10(%rcx,%rax,8)
jne 0x21a990
leaq (%rcx,%rax,8), %rax
addq $0x10, %rax
movq 0x10(%rax), %rax
movl 0x8(%rax), %eax
movq %rax, %rcx
xorq $0x1, %rcx
movl %eax, %esi
shrl %esi
movl %ecx, %ebp
andl $0x1, %ebp
imulq $0x78, %rsi, %rdi
addq %r10, %rdi
leaq (,%rbp,2), %r8
addq %rbp, %r8
cmpq $0x1, 0x10(%rdi,%r8,8)
movl %r12d, %r8d
jne 0x21a99d
movq %r13, 0x20(%rsp)
movl %r8d, %edi
movl %ecx, %r8d
movl %eax, %eax
movl $0x1, %ecx
movl %ecx, (%r15,%rax,4)
movl %ecx, (%r15,%rdi,4)
imulq $0x78, %rsi, %r14
leaq (%r10,%r14), %rax
leaq (,%rbp,2), %rcx
addq %rbp, %rcx
movq 0x20(%rax,%rcx,8), %rax
movq (%rax), %r15
movq (%rsp), %r13
movq 0x8(%r13), %rax
movq %r9, %rcx
shrq $0x3a, %rcx
movl $0x1, %esi
shlq %cl, %rsi
cmpq %rsi, %rax
jne 0x21a8ce
incl %ecx
movq %r13, %rdi
movl %ecx, %esi
movq %r8, %rbx
callq 0x22c84f
movq %rbx, %r8
movq (%rsp), %r13
movq (%r13), %r9
movq 0x8(%r13), %rax
movq %r9, %rcx
shrq $0x3a, %rcx
movq 0x18(%r13), %rbx
movq 0x28(%rsp), %rdx
movq (%rdx), %r10
jmp 0x21a8d1
movq %r11, %rbx
movl %r15d, %esi
movq %r8, %rdx
movq %r8, %rdi
shlq $0x20, %rdi
orq %rsi, %rdi
incq %rax
movabsq $0x3ffffffffffffff, %r11 # imm = 0x3FFFFFFFFFFFFFF
leaq (%r9,%r11), %rsi
movq $-0x1, %r8
shlq %cl, %r8
testq %r11, %r9
notq %r8
cmovneq %rsi, %r8
movq %rax, 0x8(%r13)
andq %r11, %r8
movabsq $-0x400000000000000, %rax # imm = 0xFC00000000000000
andq %rax, %r9
orq %r8, %r9
movq %r9, (%r13)
movq %rdi, (%rbx,%r8,8)
movq 0x20(%rsp), %r13
addl %r15d, %r13d
xorl $0x1, %ebp
addq %r10, %r14
leaq (,%rbp,2), %rax
addq %rbp, %rax
cmpq $0x1, 0x10(%r14,%rax,8)
movq %rbx, %r11
jne 0x21a995
leaq (%r14,%rax,8), %rax
addq $0x10, %rax
movq 0x10(%rax), %rax
movl 0x8(%rax), %eax
movq %rax, %rcx
xorq $0x1, %rcx
movl %eax, %esi
shrl %esi
movl %ecx, %ebp
andl $0x1, %ebp
imulq $0x78, %rsi, %rdi
addq %r10, %rdi
leaq (,%rbp,2), %r8
addq %rbp, %r8
cmpq $0x1, 0x10(%rdi,%r8,8)
movq 0x8(%rsp), %r15
movq %rdx, %r8
je 0x21a84a
jmp 0x21a99d
movl %r12d, %r8d
jmp 0x21a99d
movq 0x8(%rsp), %r15
movq %rdx, %r8
cmpl $-0x1, %r8d
movq 0x18(%rsp), %rcx
je 0x21a9c3
movl 0x10(%rsp), %esi
movl %esi, %eax
movl $0x1, %edx
movl %edx, (%r15,%rax,4)
movl %r8d, %eax
movl %edx, (%r15,%rax,4)
xorl %r15d, %r15d
jmp 0x21a9d3
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl 0x10(%rsp), %esi
movl $0x80000000, %r15d      # imm = 0x80000000
movq (%rsp), %r10
movq %r9, 0x20(%rsp)
movq %r11, 0x30(%rsp)
movq (%rcx), %r14
cmpq 0x8(%rcx), %r14
jne 0x21aa2c
leaq (%r14,%r14), %rax
testq %r14, %r14
movl $0x2, %edx
cmoveq %rdx, %rax
movq %rax, 0x8(%rcx)
shlq $0x3, %rax
movl %esi, %ebx
leaq (%rax,%rax,4), %rsi
movq 0x58(%rsp), %rdi
movq %r8, %rbp
callq 0x2370
movq %rbp, %r8
movl %ebx, %esi
movq (%rsp), %r10
movq 0x18(%rsp), %rcx
movq %rax, 0x40(%rsp)
movq %rax, 0x10(%rcx)
leaq 0x1(%r14), %rdx
movq %rdx, 0x10(%rsp)
movq %rdx, (%rcx)
leaq (%r14,%r14,4), %r14
movq 0x40(%rsp), %rbp
movq $0x0, 0x20(%rbp,%r14,8)
movl %r8d, 0x4(%rbp,%r14,8)
movl %esi, 0x8(%rbp,%r14,8)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl (%rbp,%r14,8), %eax
movl $0x80000000, %ecx       # imm = 0x80000000
andl %ecx, %eax
orl %r13d, %eax
movl %eax, (%rbp,%r14,8)
movq 0x8(%r10), %rbx
movl %ebx, 0x10(%rbp,%r14,8)
orl %r15d, %r13d
movl %r13d, (%rbp,%r14,8)
leal -0x1(%rbx), %eax
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x10, %ecx
orl %eax, %ecx
leal 0x1(%rcx), %eax
movl %eax, 0xc(%rbp,%r14,8)
leal 0x8(,%rcx,8), %edi
movq %r10, %r15
callq 0x2280
movq %rax, 0x18(%rbp,%r14,8)
movq %rbp, %r8
testq %rbx, %rbx
je 0x21ab0e
movq 0x10(%r15), %rcx
movq 0x18(%r15), %r11
movq 0x20(%rsp), %r9
movq %r9, %rdx
movabsq $0x3ffffffffffffff, %rsi # imm = 0x3FFFFFFFFFFFFFF
andq %rsi, %rdx
xorl %esi, %esi
movq %r15, %r10
leaq (%rdx,%rsi), %rdi
andq %rcx, %rdi
movq (%r11,%rdi,8), %rdi
movq %rdi, (%rax,%rsi,8)
incq %rsi
movl %esi, %edi
cmpq %rdi, %rbx
ja 0x21aaeb
movq %r8, %rbx
movq 0x8(%rsp), %r15
jmp 0x21ab26
movq %r8, %rbx
movq 0x8(%rsp), %rax
movq %r15, %r10
movq %rax, %r15
movq 0x20(%rsp), %r9
movq 0x30(%rsp), %r11
incq %r12
cmpq 0x38(%rsp), %r12
jne 0x21a4fd
movq 0x18(%r10), %r11
movq 0x60(%rsp), %r15
movq %r10, %rbx
movq 0x10(%rsp), %r14
jmp 0x21ab4d
xorl %r14d, %r14d
movq %r10, %rbx
movq %r11, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x2220
cmpq $0x0, 0x38(%rsp)
je 0x21ab82
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
shlq $0x3, %r15
movq 0x8(%rsp), %rdi
movl $0xff, %esi
movq %r15, %rdx
callq 0x20e0
testq %r14, %r14
movq 0x18(%rsp), %r8
movq 0x48(%rsp), %rdi
movq 0x8(%rsp), %r10
je 0x21abcf
movq 0x10(%r8), %rax
addq $0x8, %rax
movl $0x1, %ecx
movl $0x1, %edx
cmpl $0x0, -0x8(%rax)
js 0x21abbf
leal -0x1(%rcx), %esi
movl -0x4(%rax), %r9d
movl %esi, (%r10,%r9,4)
movl (%rax), %esi
movl %ecx, (%r10,%rsi,4)
movl %edx, %esi
addq $0x28, %rax
incl %edx
addl $0x2, %ecx
cmpq %rsi, %r14
ja 0x21aba8
movq %r14, 0x10(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x21ad2a
xorl %ecx, %ecx
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl $0x1, %r9d
movl %ecx, %eax
shrl %eax
movq %rcx, (%rsp)
imulq $0x78, %rax, %rax
movq 0x28(%rsp), %rdx
addq (%rdx), %rax
andl $0x1, %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0x10(%rax,%rcx,8), %r13d
testq %r13, %r13
je 0x21ad1a
movq 0x20(%rax,%rcx,8), %r12
shlq $0x5, %r13
xorl %r14d, %r14d
movl 0xc(%r12,%r14), %eax
testl %eax, %eax
js 0x21ad0d
movl 0x4(%r12,%r14), %ecx
shlq $0x2, %rcx
xorq $0x4, %rcx
movl (%r10,%rcx), %r15d
testl %r15d, %r15d
js 0x21ad0d
movl 0x8(%r12,%r14), %ecx
cmpl $0x0, (%r10,%rcx,4)
js 0x21ad0d
movq 0x10(%r8), %rcx
movl %r15d, %edx
shrl %edx
leaq (%rdx,%rdx,4), %rdx
movl (%rcx,%rdx,8), %ebx
andl %ebp, %ebx
subl %eax, %ebx
cmovsl %r9d, %ebx
movl 0x4(%rdi), %edx
movl %edx, %ecx
andl %ebp, %ecx
cmpl (%rdi), %ecx
jne 0x21acc2
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
movl $0x10, %ecx
cmovel %ecx, %eax
movl %eax, (%rdi)
movq 0x8(%rdi), %rdi
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x2370
movl $0x1, %r9d
movq 0x8(%rsp), %r10
movq 0x48(%rsp), %rdi
movq 0x18(%rsp), %r8
movq %rax, 0x8(%rdi)
movl 0x4(%rdi), %edx
movl %edx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
jmp 0x21acc6
movq 0x8(%rdi), %rax
xorl $0x1, %r15d
leal 0x1(%rdx), %esi
andl %ebp, %esi
andl $0x80000000, %edx       # imm = 0x80000000
orl %esi, %edx
movl %edx, 0x4(%rdi)
movl %ecx, %ecx
leaq (%rcx,%rcx,2), %rcx
movl 0xc(%r12,%r14), %edx
andl %ebp, %edx
movl %edx, 0xc(%rax,%rcx,8)
shlq $0x20, %r15
movslq %ebx, %rdx
orq %r15, %rdx
movq %rdx, (%rax,%rcx,8)
movl 0x8(%r12,%r14), %edx
movl (%r10,%rdx,4), %edx
movl %edx, 0x8(%rax,%rcx,8)
andw $0xc000, 0x10(%rax,%rcx,8) # imm = 0xC000
addq $0x20, %r14
cmpq %r14, %r13
jne 0x21ac22
movq (%rsp), %rcx
incl %ecx
cmpl 0x38(%rsp), %ecx
jne 0x21abed
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x21ad65
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rbx
xorl %r12d, %r12d
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
leaq (%r12,%r12,4), %rax
movl (%rbx,%rax,8), %edx
andl %ebp, %edx
movl %r12d, %esi
xorl %ecx, %ecx
callq 0xa0887
movq 0x48(%rsp), %rdi
incl %r12d
cmpq %r12, %r14
ja 0x21ad45
callq 0xa0a7d
movq 0x8(%rsp), %rdi
callq 0x2220
movq 0x18(%rsp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq