// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: merge_ug_nodes(ma_ug_t*, asg_t*, kvec_t_u64_warp*)
void merge_ug_nodes(ma_ug_t *ug, asg_t* read_g, kvec_t_u64_warp* array)
{
    if(array->a.n == 0) return;
    uint32_t i, k, v, w;
    ma_utg_t result;
    memset(&result, 0, sizeof(ma_utg_t));
    v = w = (uint32_t)-1;
    for (i = 0; i < array->a.n; i++)
    {
        w = array->a.a[i];
        collect_ma_utg_ts(ug, v, w, &result);
        v = w;
    }

    

    if(result.n == 0) return;
    asg_arc_t *av = NULL;
    uint32_t nv, l;
    result.len = 0;
    for (i = 0; i < result.n - 1; i++)
    {
        
        v = (uint64_t)(result.a[i])>>32;
        w = (uint64_t)(result.a[i + 1])>>32; 
        av = asg_arc_a(read_g, v);
        nv = asg_arc_n(read_g, v);
        l = 0;
        
        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) fprintf(stderr ,"******error, i: %u, k: %u, nv: %u\n", i, k, nv);
        result.a[i] = v; result.a[i] = result.a[i]<<32; result.a[i] = result.a[i] | (uint64_t)(l);
        result.len += l;
    }
    

    if(i < result.n)
    {
        v = (uint64_t)(result.a[i])>>32;
        l = read_g->seq[v>>1].len;
        result.a[i] = v;
        result.a[i] = result.a[i]<<32;
        result.a[i] = result.a[i] | (uint64_t)(l);
        result.len += l;
    }
    //has already set result.a, result.len, result.n, result.m
    result.circ = 0;
    result.start = result.a[0]>>32;
    result.end = (result.a[result.n-1]>>32)^1;

    
    uint32_t beg_uid = array->a.a[0];
    uint32_t end_uid = array->a.a[array->a.n-1];
    uint32_t realLen = array->a.n;
    uint32_t new_uid = array->a.a[0]>>1;
    uint64_t kmp;





    /*******************************just for debug**********************************/
    /**
    if(beg_uid&1)
    {
        if(result.start != ug->u.a[beg_uid>>1].end)
        {
            fprintf(stderr, "ERROR\n");
        }
    }
    else
    {
        if(result.start != ug->u.a[beg_uid>>1].start)
        {
            fprintf(stderr, "ERROR\n");
        }
    }

    if(end_uid&1)
    {
        if(result.end != ug->u.a[end_uid>>1].start)
        {
            fprintf(stderr, "ERROR\n");
        }
    }
    else
    {
        if(result.end != ug->u.a[end_uid>>1].end)
        {
            fprintf(stderr, "ERROR\n");
        }
    }
    **/
    /*******************************just for debug**********************************/

    asg_arc_t *aw = NULL;
    uint32_t nw = 0;
    ///corresponding to direction 1 of new node
    v = beg_uid^1;
    av = asg_arc_a(ug->g, v);
    nv = asg_arc_n(ug->g, v);
    ///fprintf(stderr, "beg_uid_v>>1: %u, beg_uid_v&1: %u, nv: %u\n", v>>1, v&1, nv);
    for (k = 0; k < nv; k++)
    {
        if(av[k].del) continue;
        kmp = new_uid<<1; kmp = kmp^1; kmp = kmp << 32;

        ///if((av[k].v>>1) == (end_uid>>1)) continue;
        w = av[k].v^1; aw = asg_arc_a(ug->g, w); nw = asg_arc_n(ug->g, w);
        for (i = 0; i < nw; i++)
        {
            if(aw[i].del) continue;
            if(aw[i].v == (v^1)) break;
        }
        if(i == nw) fprintf(stderr, "ERROR at %s:%d\n", __FILE__, __LINE__);
        kmp = kmp | (uint64_t)(aw[i].ol);


        ///kmp = kmp | (uint64_t)(((ug->g)->idx[v]>>32) + k);/**kmp = kmp | av[k].v;**/
        ///here kmp is ul
        kv_push(uint64_t, array->a, kmp);
        kmp = av[k].ol; kmp = kmp<<32; kmp = kmp|(uint64_t)(av[k].v);
        ///here kmp is ol + v
        kv_push(uint64_t, array->a, kmp);
        ///fprintf(stderr, "*av[%u].v>>1: %u, v&1: %u, ol: %u\n", k, av[k].v>>1, av[k].v&1, av[k].ol);
    }

    ///corresponding to direction 0 of new node
    v = end_uid;
    av = asg_arc_a(ug->g, v);
    nv = asg_arc_n(ug->g, v);
    ///fprintf(stderr, "end_uid_v>>1: %u, end_uid_v&1: %u, nv: %u\n", v>>1, v&1, nv);
    for (k = 0; k < nv; k++)
    {
        if(av[k].del) continue;
        kmp = new_uid<<1; kmp = kmp << 32;

        w = av[k].v^1; 
        aw = asg_arc_a(ug->g, w); 
        nw = asg_arc_n(ug->g, w);
        for (i = 0; i < nw; i++)
        {
            if(aw[i].del) continue;
            if(aw[i].v == (v^1)) break;
        }
        if(i == nw) fprintf(stderr, "ERROR at %s:%d\n", __FILE__, __LINE__);
        kmp = kmp | (uint64_t)(aw[i].ol);


        ///here kmp is ul
        kv_push(uint64_t, array->a, kmp);
        kmp = av[k].ol; kmp = kmp<<32; kmp = kmp|(uint64_t)(av[k].v);
        ///here kmp is ol + v
        kv_push(uint64_t, array->a, kmp);
        ///fprintf(stderr, "#av[%u].v>>1: %u, v&1: %u, ol: %u\n", k, av[k].v>>1, av[k].v&1, av[k].ol);
    }

    
    ma_utg_t* tmp;
    for (i = 0; i < realLen; i++)
    {
        w = array->a.a[i];
        tmp = &(ug->u.a[w>>1]);
        if(tmp->m != 0)
        {
            tmp->circ = tmp->end = tmp->len = tmp->m = tmp->n = tmp->start = 0;
            free(tmp->a);
            tmp->a = NULL;
        }
        asg_seq_del(ug->g, w>>1);
    }
    
    ug->u.a[beg_uid>>1] = result;
    ug->g->seq[beg_uid>>1].del = 0;
    ug->g->seq[beg_uid>>1].len = result.len;

    uint32_t oLen = 0;
    for (; i < array->a.n; i += 2)
    {
        v = array->a.a[i]>>32;
        w = (uint32_t)array->a.a[i+1];
        /****************************may have bugs********************************/
        ///may have bug here, if there is an edge between beg_uid and end_uid
        ///if(((w>>1) == (beg_uid>>1)) || ((w>>1) == (end_uid>>1))) continue;
        if(((w>>1) == (beg_uid>>1)) || ((w>>1) == (end_uid>>1))) w = v;
        /****************************may have bugs********************************/

        oLen = array->a.a[i+1]>>32;
        asg_append_edges_to_srt(ug->g, v, ug->u.a[v>>1].len, w, oLen, 0, 0, 0);
        oLen = (uint32_t)array->a.a[i];
        asg_append_edges_to_srt(ug->g, w^1, ug->u.a[w>>1].len, v^1, oLen, 0, 0, 0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x14a956
jmp 0x14b566
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x2100
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x14a9bd
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x28(%rbp), %edx
leaq -0x50(%rbp), %rcx
callq 0x1495a0
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x14a97b
cmpl $0x0, -0x40(%rbp)
jne 0x14a9c8
jmp 0x14b566
movq $0x0, -0x58(%rbp)
movl -0x50(%rbp), %eax
andl $0x80000000, %eax       # imm = 0x80000000
orl $0x0, %eax
movl %eax, -0x50(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0x40(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x14ab60
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x24(%rbp)
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x24(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jae 0x14aac1
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x14aa88
jmp 0x14aab6
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x28(%rbp), %eax
jne 0x14aab4
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0x60(%rbp)
jmp 0x14aac1
jmp 0x14aab6
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x14aa65
movl -0x20(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jne 0x14aaeb
movq 0x279510(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl -0x5c(%rbp), %r8d
leaq 0x23e94c(%rip), %rsi    # 0x389430
movb $0x0, %al
callq 0x22a0
movl -0x24(%rbp), %eax
movl %eax, %edx
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl -0x60(%rbp), %eax
orq %rax, %rdx
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x60(%rbp), %eax
movl -0x50(%rbp), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addl %eax, %ecx
movl -0x50(%rbp), %eax
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, -0x50(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x14a9e5
movl -0x1c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jae 0x14abff
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x24(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0x60(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %edx
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl -0x60(%rbp), %eax
orq %rax, %rdx
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x60(%rbp), %eax
movl -0x50(%rbp), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
addl %eax, %ecx
movl -0x50(%rbp), %eax
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %eax       # imm = 0x80000000
orl %ecx, %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
orl $0x0, %eax
movl %eax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movl -0x40(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movl %eax, -0x64(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x6c(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
shrq %rax
movl %eax, -0x70(%rbp)
movq $0x0, -0x80(%rbp)
movl $0x0, -0x84(%rbp)
movl -0x64(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x24(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x5c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jae 0x14afac
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x14ad09
jmp 0x14af9e
movl -0x70(%rbp), %eax
shll %eax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
xorq $0x1, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x28(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x28(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x84(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jae 0x14ade1
movq -0x80(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x14adb7
jmp 0x14add6
movq -0x80(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x24(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x14add4
jmp 0x14ade1
jmp 0x14add6
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x14ad91
movl -0x1c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jne 0x14ae10
movq 0x2791ed(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x23b641(%rip), %rsi    # 0x38643e
leaq 0x23bab9(%rip), %rdx    # 0x3868bd
movl $0x7983, %ecx           # imm = 0x7983
movb $0x0, %al
callq 0x22a0
movq -0x78(%rbp), %rax
movq -0x80(%rbp), %rcx
movl -0x1c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
orq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x14aea5
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x14ae64
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xa0(%rbp)
jmp 0x14ae72
movl $0x2, %eax
movq %rax, -0xa0(%rbp)
jmp 0x14ae72
movq -0xa0(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x78(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0x58(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x14af7b
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x14af3a
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xa8(%rbp)
jmp 0x14af48
movl $0x2, %eax
movq %rax, -0xa8(%rbp)
jmp 0x14af48
movq -0xa8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x78(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x14af9e
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x14acdf
movl -0x68(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x24(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x5c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jae 0x14b2be
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x14b027
jmp 0x14b2b0
movl -0x70(%rbp), %eax
shll %eax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x28(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x28(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x84(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jae 0x14b0f3
movq -0x80(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x14b0c9
jmp 0x14b0e8
movq -0x80(%rbp), %rax
movl -0x1c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl -0x24(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0x14b0e6
jmp 0x14b0f3
jmp 0x14b0e8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x14b0a3
movl -0x1c(%rbp), %eax
cmpl -0x84(%rbp), %eax
jne 0x14b122
movq 0x278edb(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x23b32f(%rip), %rsi    # 0x38643e
leaq 0x23b7a7(%rip), %rdx    # 0x3868bd
movl $0x79a2, %ecx           # imm = 0x79A2
movb $0x0, %al
callq 0x22a0
movq -0x78(%rbp), %rax
movq -0x80(%rbp), %rcx
movl -0x1c(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
orq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x14b1b7
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x14b176
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xb0(%rbp)
jmp 0x14b184
movl $0x2, %eax
movq %rax, -0xb0(%rbp)
jmp 0x14b184
movq -0xb0(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x78(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
movq -0x58(%rbp), %rax
movl -0x20(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0x58(%rbp), %rcx
movl -0x20(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x14b28d
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x14b24c
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xb8(%rbp)
jmp 0x14b25a
movl $0x2, %eax
movq %rax, -0xb8(%rbp)
jmp 0x14b25a
movq -0xb8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x78(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rsi
movq (%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, (%rsi)
movq %rdx, (%rax,%rcx,8)
jmp 0x14b2b0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x14affd
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x6c(%rbp), %eax
jae 0x14b3ac
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x14b38c
movq -0x90(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x90(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x90(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x90(%rbp), %rax
movl (%rax), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x90(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x90(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x90(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2210
movq -0x90(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x28(%rbp), %esi
shrl %esi
callq 0xd9510
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x14b2c5
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x64(%rbp), %eax
shrl %eax
movl %eax, %eax
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq -0x50(%rbp), %rsi
movl $0x28, %edx
callq 0x2180
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x64(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
orl $0x0, %edx
movl %edx, (%rax,%rcx,8)
movl -0x50(%rbp), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x64(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %edx
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
andl $0x80000000, %edx       # imm = 0x80000000
orl %esi, %edx
movl %edx, (%rax,%rcx,8)
movl $0x0, -0x94(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x14b566
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
shrl %eax
movl -0x64(%rbp), %ecx
shrl %ecx
cmpl %ecx, %eax
je 0x14b485
movl -0x28(%rbp), %eax
shrl %eax
movl -0x68(%rbp), %ecx
shrl %ecx
cmpl %ecx, %eax
jne 0x14b48b
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, -0x94(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x24(%rbp), %esi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl -0x28(%rbp), %ecx
movl -0x94(%rbp), %r8d
xorl %r9d, %r9d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x141be0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x94(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x28(%rbp), %esi
xorl $0x1, %esi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl -0x24(%rbp), %ecx
xorl $0x1, %ecx
movl -0x94(%rbp), %r8d
xorl %r9d, %r9d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x141be0
movl -0x1c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x1c(%rbp)
jmp 0x14b42c
addq $0xd0, %rsp
popq %rbp
retq
nop