// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: ma_ug_gen_phase(asg_t*, unsigned int, double)
ma_ug_t *ma_ug_gen_phase(asg_t *g, uint32_t min_occ, double cutoff)
{
    // fprintf(stderr, "\n-0-[M::%s] min_occ::%u, cutoff::%f\n", __func__, min_occ, cutoff);
    asg_cleanup(g);
	int32_t *mark; 
	uint32_t i, v, n_vtx = g->n_seq * 2, fn, mn, fn0, mn0, fn1, mn1, n1, cn, k, st, pt, ct, sz, ez;
    uint64_t z;
	///is a queue
	kdq_t(uint64_t) *q;
    asg64_v uidx; kv_init(uidx); 
    
	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) {
		uint32_t w, x, l, start, end, len;
		ma_utg_t *p;
        if (g->seq[v>>1].del || mark[v]) continue;
        if (arc_cnt(g, v) == 0 && arc_cnt(g, (v^1)) != 0) continue;
		mark[v] = 1;
		q->count = 0, start = v, end = v^1, len = 0; fn = mn = 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 (arc_cnt(g, w) != 1) break;
			x = arc_first(g, w).v; // w->x
			if (arc_cnt(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(arc_first(g, w));
			kdq_push(uint64_t, q, (uint64_t)w<<32 | l);
            if(R_INF.trio_flag[w>>1] == FATHER) fn++;
            if(R_INF.trio_flag[w>>1] == MOTHER) mn++;
			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->seq[end>>1].len;
			kdq_push(uint64_t, q, (uint64_t)(end^1)<<32 | l);
            if(R_INF.trio_flag[end>>1] == FATHER) fn++;
            if(R_INF.trio_flag[end>>1] == MOTHER) mn++;
			len += l;
		} else { // circular unitig
			start = end = UINT32_MAX;
			goto add_unitig; // then it is not necessary to do the backward
		}
		// backward
		x = v;
		while (1) { // similar to forward but not the same
			if (arc_cnt(g, x^1) != 1) break;
			w = arc_first(g, x^1).v ^ 1; // w->x
			if (arc_cnt(g, w) != 1) break;
			mark[x] = mark[w^1] = 1;
			l = asg_arc_len(arc_first(g, w));
			///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);
            if(R_INF.trio_flag[w>>1] == FATHER) fn++;
            if(R_INF.trio_flag[w>>1] == MOTHER) mn++;
            // 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_unitig:
		if (start != UINT32_MAX) mark[start] = mark[end] = 1;
        // fprintf(stderr, "\n-0-[M::%s] fn::%u, mn::%u\n", __func__, fn, mn);
        cn = MIN(fn, mn);
        // if((cn > min_occ) && (cn > ((fn+mn)*cutoff)))
        if((cn <= ((fn+mn)*cutoff)) || (cn <= min_occ)) {
            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);
        } else if(kdq_size(q)) {
            ct = R_INF.trio_flag[kdq_at(q, 0)>>33]; 
            if((ct != FATHER) && (ct != MOTHER)) ct = AMBIGU; 
            pt = ct;
            fn0 = fn; mn0 = mn; uidx.n = fn = mn = 0; 
            if(ct == FATHER) fn++; if(ct == MOTHER) mn++;
            for (k = 1, l = 0; k <= kdq_size(q); k++) {
                st = 0; ct = AMBIGU;
                if(k == kdq_size(q)) {
                    st = 1;
                } else {
                    ct = R_INF.trio_flag[kdq_at(q, k)>>33];
                    if((ct != FATHER) && (ct != MOTHER)) ct = AMBIGU; 
                    if((ct != AMBIGU) && (pt != AMBIGU) && (ct != pt)) {
                        st = 1;
                    }
                }
                if(st) {
                    // fprintf(stderr, "-1-[M::%s] l::%u, k::%u, kdq_size(q)::%u, fn::%u, mn::%u, ct::%u, pt::%u\n", 
                    // __func__, l, k, (uint32_t)kdq_size(q), fn, mn, ct, pt);
                    if(k < kdq_size(q)) {
                        assert(fn || mn); assert((!fn) || (!mn));
                    }
                    z = l<<1; z |= (((uint64_t)MAX(fn, mn))<<32);
                    if(mn) z |= 1;
                    kv_push(uint64_t, uidx, z);
                    fn = mn = 0; l = k;
                }
                if(ct != AMBIGU) pt = ct;
                if(ct == FATHER) fn++; if(ct == MOTHER) mn++;
            }


            fn = mn = 0; fn1 = mn1 = n1 = 0;
            if(uidx.a[0]&1) mn += uidx.a[0]>>32;
            else fn += uidx.a[0]>>32;
            for (k = 1, l = 0; k <= uidx.n; k++) {
                st = 0;
                if(k == uidx.n) {
                    st = 1;
                } else {
                    if(uidx.a[k]&1) mn += uidx.a[k]>>32;
                    else fn += uidx.a[k]>>32;
                    cn = MIN(fn, mn);
                    if((cn > min_occ) && (cn > ((fn+mn)*cutoff))) st = 1;
                    // fprintf(stderr, "-2-[M::%s] fn::%u, mn::%u, cn::%u, ((fn+mn)*cutoff)::%u, st::%u\n", 
                    // __func__, fn, mn, cn, (uint32_t)(((fn+mn)*cutoff)), st);
                }
                if(st) {
                    // fprintf(stderr, "-3-[M::%s] fn::%u, mn::%u\n", __func__, fn, mn);
                    sz = ((uint32_t)uidx.a[l])>>1;
                    ez = ((k<uidx.n)?(((uint32_t)uidx.a[k])>>1):(kdq_size(q)));
                    assert(ez > sz); n1 += ez - sz;
                    kv_pushp(ma_utg_t, ug->u, &p);
                    if ((start == UINT32_MAX) && (sz == 0) && (ez == kdq_size(q))) {///circle
                        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);
                            ct = R_INF.trio_flag[p->a[i]>>33];
                            if((ct != FATHER) && (ct != MOTHER)) ct = AMBIGU; 
                            if(ct == FATHER) fn1++; if(ct == MOTHER) mn1++;
                        }
                    } else {
                        p->s = 0; p->len = 0; p->circ = 0;
                        p->start = kdq_at(q, sz)>>32;
                        p->end = (kdq_at(q, (ez-1))>>32)^1;
                        p->m = p->n = ez - sz; kv_roundup32(p->m);
                        p->a = (uint64_t*)malloc(8 * p->m);

                        for (i = sz, z = 0; i+1 < ez; i++, z++) {
                            p->a[z] = kdq_at(q, i); p->len += (uint32_t)p->a[z];
                            ct = R_INF.trio_flag[p->a[z]>>33];
                            if((ct != FATHER) && (ct != MOTHER)) ct = AMBIGU; 
                            if(ct == FATHER) fn1++; if(ct == MOTHER) mn1++;
                        }
                        p->a[z] = kdq_at(q, i); p->a[z] >>= 32; p->a[z] <<= 32; 
                        p->a[z] |= g->seq[p->a[z]>>33].len; p->len += (uint32_t)p->a[z];
                        ct = R_INF.trio_flag[p->a[z]>>33];
                        if((ct != FATHER) && (ct != MOTHER)) ct = AMBIGU; 
                        if(ct == FATHER) fn1++; if(ct == MOTHER) mn1++;
                    }
                    fn = mn = 0; l = k;
                    if(k < uidx.n) {
                        if(uidx.a[k]&1) mn += uidx.a[k]>>32;
                        else fn += uidx.a[k]>>32;
                    }
                }
            }
            assert(n1 == kdq_size(q));
            assert(fn1 == fn0); assert(mn1 == mn0);
        }
	}
	kdq_destroy(uint64_t, q); kv_destroy(uidx); 

	// add arcs between unitigs; reusing mark for a different purpose
	//ug saves all unitigs
	for (v = 0; v < n_vtx; ++v) mark[v] = -1;

    //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;
	}

	//scan all edges
	for (i = 0; i < g->n_arc; ++i) {
		asg_arc_t *p = &g->arc[i];
		if (p->del) continue;
		///to connect two unitigs, we need to connect the end of unitig x to the start of unitig y
		///so we need to ^1 to get the reverse direction of (x's end)?
        ///>=0 means this node is a start/end node of an unitig
        ///means this node is a intersaction node
		if (mark[p->ul>>32^1] >= 0 && mark[p->v] >= 0) {
			asg_arc_t *q;
			uint32_t u = mark[p->ul>>32^1]^1;
			int l = ug->u.a[u>>1].len - p->ol;
			if (l < 0) l = 1;
			q = asg_arc_pushp(ug->g);
			q->ol = p->ol, q->del = 0;
			q->ul = (uint64_t)u<<32 | l;
			q->v = mark[p->v]; q->ou = 0;
            q->el = p->el;
		}
	}
	for (i = 0; i < ug->u.n; ++i)
		asg_seq_set(ug->g, i, ug->u.a[i].len, 0);
	asg_cleanup(ug->g);
	free(mark);
	return ug;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0xcdd10
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
shll %eax
movl %eax, -0x2c(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq $0x0, -0x80(%rbp)
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movq %rax, -0x98(%rbp)
callq 0xcd150
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x2c(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
callq 0x2140
movq %rax, -0x20(%rbp)
callq 0xe6120
movq %rax, -0x78(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jae 0xe77cd
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x28(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0xe639e
movq -0x20(%rbp), %rax
movl -0x28(%rbp), %ecx
cmpl $0x0, (%rax,%rcx,4)
je 0xe63a3
jmp 0xe77bf
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x28(%rbp), %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x0, %eax
jne 0xe63d5
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x28(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x0, %eax
je 0xe63d5
jmp 0xe77bf
movq -0x20(%rbp), %rax
movl -0x28(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x78(%rbp), %rax
movq $0x0, 0x8(%rax)
movl -0x28(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0x28(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0xac(%rbp)
movl $0x0, -0xb0(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x9c(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x9c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x1, %eax
je 0xe6441
jmp 0xe6590
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x9c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xa0(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x1, %eax
je 0xe6490
jmp 0xe6590
movq -0x20(%rbp), %rax
movl -0x9c(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl -0xa0(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x9c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0xa4(%rbp)
movq -0x78(%rbp), %rdi
movl -0x9c(%rbp), %eax
movl %eax, %esi
shlq $0x20, %rsi
movl -0xa4(%rbp), %eax
orq %rax, %rsi
callq 0xe61c0
leaq 0x2dedc6(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movl -0x9c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0xe652a
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
leaq 0x2ded9f(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movl -0x9c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0xe6551
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0xa0(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0xac(%rbp)
movl -0xa4(%rbp), %eax
addl -0xb0(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0xa0(%rbp), %eax
movl %eax, -0x9c(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0xe658b
jmp 0xe6590
jmp 0xe6425
movl -0xa8(%rbp), %eax
movl -0xac(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
jne 0xe65b2
movq -0x78(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xe6657
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0xa4(%rbp)
movq -0x78(%rbp), %rdi
movl -0xac(%rbp), %eax
xorl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
shlq $0x20, %rsi
movl -0xa4(%rbp), %eax
orq %rax, %rsi
callq 0xe61c0
leaq 0x2decd4(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0xe661c
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
leaq 0x2decad(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movl -0xac(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0xe6643
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0xa4(%rbp), %eax
addl -0xb0(%rbp), %eax
movl %eax, -0xb0(%rbp)
jmp 0xe6670
movl $0xffffffff, -0xac(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0xa8(%rbp) # imm = 0xFFFFFFFF
jmp 0xe67de
movl -0x28(%rbp), %eax
movl %eax, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0xa0(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x1, %eax
je 0xe669a
jmp 0xe67dc
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0xa0(%rbp), %edx
xorl $0x1, %edx
movl %edx, %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
xorl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x9c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x1, %eax
je 0xe66ec
jmp 0xe67dc
movq -0x20(%rbp), %rax
movl -0x9c(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl -0xa0(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movl -0x9c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, -0xa4(%rbp)
movq -0x78(%rbp), %rdi
movl -0x9c(%rbp), %eax
movl %eax, %esi
shlq $0x20, %rsi
movl -0xa4(%rbp), %eax
orq %rax, %rsi
callq 0xe6260
leaq 0x2deb6a(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movl -0x9c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0xe6786
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
leaq 0x2deb43(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movl -0x9c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpl $0x2, %eax
jne 0xe67ad
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0xa8(%rbp)
movl -0xa4(%rbp), %eax
addl -0xb0(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0xa0(%rbp)
jmp 0xe6679
jmp 0xe67de
cmpl $-0x1, -0xa8(%rbp)
je 0xe6809
movq -0x20(%rbp), %rax
movl -0xac(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl -0xa8(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
ja 0xe681c
movl -0x30(%rbp), %eax
movl %eax, -0xd4(%rbp)
jmp 0xe6825
movl -0x34(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cvtsi2sd %rax, %xmm1
movl -0x30(%rbp), %eax
movl -0x34(%rbp), %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm0
mulsd -0x18(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jae 0xe685a
movl -0x4c(%rbp), %eax
cmpl -0xc(%rbp), %eax
ja 0xe6ad3
jmp 0xe685c
movq -0x98(%rbp), %rax
movq (%rax), %rax
movq -0x98(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe68e2
movq -0x98(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe6898
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0xe0(%rbp)
jmp 0xe68a6
movl $0x2, %eax
movq %rax, -0xe0(%rbp)
jmp 0xe68a6
movq -0xe0(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x98(%rbp), %rax
imulq $0x28, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movq $0x0, 0x20(%rax)
movl -0xa8(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0xac(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0xb0(%rbp), %edx
movq -0xb8(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x10(%rax)
cmpl $-0x1, -0xa8(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %edx
movq -0xb8(%rbp), %rax
movl (%rax), %ecx
andl $0x1, %edx
shll $0x1f, %edx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl %edx, %ecx
movl %ecx, (%rax)
movq -0xb8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x2, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x4, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x8, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x10, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %eax
shll $0x3, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x2270
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xe6ace
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rdx
movabsq $0x3ffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFF
andq (%rdx), %rcx
movl -0x24(%rbp), %edx
addq %rdx, %rcx
movq -0x78(%rbp), %rdx
andq 0x10(%rdx), %rcx
movq (%rax,%rcx,8), %rdx
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe6a79
jmp 0xe77bd
movq -0x78(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe77bb
leaq 0x2de7e7(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x78(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x78(%rbp), %rsi
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
andq (%rsi), %rdx
addq $0x0, %rdx
movq -0x78(%rbp), %rsi
andq 0x10(%rsi), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x1, -0x5c(%rbp)
je 0xe6b34
cmpl $0x2, -0x5c(%rbp)
je 0xe6b34
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x30(%rbp)
movq $0x0, -0x90(%rbp)
cmpl $0x1, -0x5c(%rbp)
jne 0xe6b6e
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x2, -0x5c(%rbp)
jne 0xe6b7d
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl $0x1, -0x50(%rbp)
movl $0x0, -0xa4(%rbp)
movl -0x50(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpq 0x8(%rcx), %rax
ja 0xe6e08
movl $0x0, -0x54(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x50(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe6bc3
movl $0x1, -0x54(%rbp)
jmp 0xe6c34
leaq 0x2de706(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x78(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x78(%rbp), %rsi
movabsq $0x3ffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFF
andq (%rsi), %rdx
movl -0x50(%rbp), %esi
addq %rsi, %rdx
movq -0x78(%rbp), %rsi
andq 0x10(%rsi), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x1, -0x5c(%rbp)
je 0xe6c17
cmpl $0x2, -0x5c(%rbp)
je 0xe6c17
movl $0x0, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
je 0xe6c32
cmpl $0x0, -0x58(%rbp)
je 0xe6c32
movl -0x5c(%rbp), %eax
cmpl -0x58(%rbp), %eax
je 0xe6c32
movl $0x1, -0x54(%rbp)
jmp 0xe6c34
cmpl $0x0, -0x54(%rbp)
je 0xe6dce
movl -0x50(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xe6ce3
movb $0x1, %al
cmpl $0x0, -0x30(%rbp)
movb %al, -0xe1(%rbp)
jne 0xe6c6a
cmpl $0x0, -0x34(%rbp)
setne %al
movb %al, -0xe1(%rbp)
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0xe6c76
jmp 0xe6c78
jmp 0xe6c97
leaq 0x2a0078(%rip), %rdi    # 0x386cf7
leaq 0x29fc37(%rip), %rsi    # 0x3868bd
movl $0x2319, %edx           # imm = 0x2319
leaq 0x2a006e(%rip), %rcx    # 0x386d00
callq 0x2130
movb $0x1, %al
cmpl $0x0, -0x30(%rbp)
movb %al, -0xe2(%rbp)
je 0xe6cb4
cmpl $0x0, -0x34(%rbp)
setne %al
xorb $-0x1, %al
movb %al, -0xe2(%rbp)
movb -0xe2(%rbp), %al
testb $0x1, %al
jne 0xe6cc0
jmp 0xe6cc2
jmp 0xe6ce1
leaq 0x2a006b(%rip), %rdi    # 0x386d34
leaq 0x29fbed(%rip), %rsi    # 0x3868bd
movl $0x2319, %edx           # imm = 0x2319
leaq 0x2a0024(%rip), %rcx    # 0x386d00
callq 0x2130
jmp 0xe6ce3
movl -0xa4(%rbp), %eax
shll %eax
movl %eax, %eax
movq %rax, -0x70(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
jb 0xe6d04
movl -0x30(%rbp), %eax
movl %eax, -0xe8(%rbp)
jmp 0xe6d0d
movl -0x34(%rbp), %eax
movl %eax, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
movl %eax, %eax
shlq $0x20, %rax
orq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0xe6d33
movq -0x70(%rbp), %rax
orq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0xe6d35
movq -0x90(%rbp), %rax
cmpq -0x88(%rbp), %rax
jne 0xe6d96
cmpq $0x0, -0x88(%rbp)
je 0xe6d62
movq -0x88(%rbp), %rax
shlq %rax
movq %rax, -0xf0(%rbp)
jmp 0xe6d70
movl $0x2, %eax
movq %rax, -0xf0(%rbp)
jmp 0xe6d70
movq -0xf0(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rdx
movq -0x80(%rbp), %rax
movq -0x90(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x90(%rbp)
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0xa4(%rbp)
cmpl $0x0, -0x5c(%rbp)
je 0xe6dda
movl -0x5c(%rbp), %eax
movl %eax, -0x58(%rbp)
cmpl $0x1, -0x5c(%rbp)
jne 0xe6de9
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x2, -0x5c(%rbp)
jne 0xe6df8
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xe6dfa
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xe6b8e
movl $0x0, -0x34(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x80(%rbp), %rax
movq (%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xe6e52
movq -0x80(%rbp), %rax
movq (%rax), %rcx
shrq $0x20, %rcx
movl -0x34(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x34(%rbp)
jmp 0xe6e66
movq -0x80(%rbp), %rax
movq (%rax), %rcx
shrq $0x20, %rcx
movl -0x30(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x30(%rbp)
movl $0x1, -0x50(%rbp)
movl $0x0, -0xa4(%rbp)
movl -0x50(%rbp), %eax
cmpq -0x90(%rbp), %rax
ja 0xe7739
movl $0x0, -0x54(%rbp)
movl -0x50(%rbp), %eax
cmpq -0x90(%rbp), %rax
jne 0xe6ea6
movl $0x1, -0x54(%rbp)
jmp 0xe6f43
movq -0x80(%rbp), %rax
movl -0x50(%rbp), %ecx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xe6ed5
movq -0x80(%rbp), %rax
movl -0x50(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
shrq $0x20, %rcx
movl -0x34(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x34(%rbp)
jmp 0xe6eed
movq -0x80(%rbp), %rax
movl -0x50(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
shrq $0x20, %rcx
movl -0x30(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
ja 0xe6f00
movl -0x30(%rbp), %eax
movl %eax, -0xf4(%rbp)
jmp 0xe6f09
movl -0x34(%rbp), %eax
movl %eax, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jbe 0xe6f41
movl -0x4c(%rbp), %eax
cvtsi2sd %rax, %xmm0
movl -0x30(%rbp), %eax
movl -0x34(%rbp), %ecx
addl %ecx, %eax
cvtsi2sd %rax, %xmm1
mulsd -0x18(%rbp), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xe6f41
movl $0x1, -0x54(%rbp)
jmp 0xe6f43
cmpl $0x0, -0x54(%rbp)
je 0xe7729
movq -0x80(%rbp), %rax
movl -0xa4(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrl %eax
movl %eax, -0x60(%rbp)
movl -0x50(%rbp), %eax
cmpq -0x90(%rbp), %rax
jae 0xe6f84
movq -0x80(%rbp), %rax
movl -0x50(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrl %eax
movl %eax, %eax
movq %rax, -0x100(%rbp)
jmp 0xe6f93
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x60(%rbp), %eax
jbe 0xe6fa7
jmp 0xe6fc6
leaq 0x29fd95(%rip), %rdi    # 0x386d43
leaq 0x29f908(%rip), %rsi    # 0x3868bd
movl $0x2338, %edx           # imm = 0x2338
leaq 0x29fd3f(%rip), %rcx    # 0x386d00
callq 0x2130
movl -0x64(%rbp), %eax
subl -0x60(%rbp), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x98(%rbp), %rax
movq (%rax), %rax
movq -0x98(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe7058
movq -0x98(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xe700e
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rax
shlq %rax
movq %rax, -0x108(%rbp)
jmp 0xe701c
movl $0x2, %eax
movq %rax, -0x108(%rbp)
jmp 0xe701c
movq -0x108(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x98(%rbp), %rax
imulq $0x28, 0x8(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x98(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
cmpl $-0x1, -0xa8(%rbp)
jne 0xe72d3
cmpl $0x0, -0x60(%rbp)
jne 0xe72d3
movl -0x64(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe72d3
movq -0xb8(%rbp), %rax
movq $0x0, 0x20(%rax)
movl -0xa8(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0xac(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0xb0(%rbp), %edx
movq -0xb8(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x10(%rax)
cmpl $-0x1, -0xa8(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %edx
movq -0xb8(%rbp), %rax
movl (%rax), %ecx
andl $0x1, %edx
shll $0x1f, %edx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl %edx, %ecx
movl %ecx, (%rax)
movq -0xb8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x2, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x4, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x8, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x10, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %eax
shll $0x3, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x2270
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0xe72ce
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rdx
movabsq $0x3ffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFF
andq (%rdx), %rcx
movl -0x24(%rbp), %edx
addq %rdx, %rcx
movq -0x78(%rbp), %rdx
andq 0x10(%rdx), %rcx
movq (%rax,%rcx,8), %rdx
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
leaq 0x2de064(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x24(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x1, -0x5c(%rbp)
je 0xe72a0
cmpl $0x2, -0x5c(%rbp)
je 0xe72a0
movl $0x0, -0x5c(%rbp)
cmpl $0x1, -0x5c(%rbp)
jne 0xe72af
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
cmpl $0x2, -0x5c(%rbp)
jne 0xe72be
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xe72c0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe7217
jmp 0xe76bb
movq -0xb8(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0xb8(%rbp), %rax
movl (%rax), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0xb8(%rbp), %rax
movl (%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, (%rax)
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rdx
movabsq $0x3ffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFF
andq (%rdx), %rcx
movl -0x60(%rbp), %edx
addq %rdx, %rcx
movq -0x78(%rbp), %rdx
andq 0x10(%rdx), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rdx
movabsq $0x3ffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFF
andq (%rdx), %rcx
movl -0x64(%rbp), %edx
subl $0x1, %edx
movl %edx, %edx
addq %rdx, %rcx
movq -0x78(%rbp), %rdx
andq 0x10(%rdx), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
xorq $0x1, %rax
movl %eax, %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x64(%rbp), %ecx
subl -0x60(%rbp), %ecx
movq -0xb8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0xb8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x2, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x4, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x8, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
shrl $0x10, %ecx
movq -0xb8(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %eax
shll $0x3, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x2270
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x60(%rbp), %eax
movl %eax, -0x24(%rbp)
movq $0x0, -0x70(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
cmpl -0x64(%rbp), %eax
jae 0xe7571
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rdx
movabsq $0x3ffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFF
andq (%rdx), %rcx
movl -0x24(%rbp), %edx
addq %rdx, %rcx
movq -0x78(%rbp), %rdx
andq 0x10(%rdx), %rcx
movq (%rax,%rcx,8), %rdx
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x70(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %ecx
movq -0xb8(%rbp), %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
addl %ecx, %edx
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
leaq 0x2dddce(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x70(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x1, -0x5c(%rbp)
je 0xe7537
cmpl $0x2, -0x5c(%rbp)
je 0xe7537
movl $0x0, -0x5c(%rbp)
cmpl $0x1, -0x5c(%rbp)
jne 0xe7546
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
cmpl $0x2, -0x5c(%rbp)
jne 0xe7555
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xe7557
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0xe7476
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x78(%rbp), %rdx
movabsq $0x3ffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFF
andq (%rdx), %rcx
movl -0x24(%rbp), %edx
addq %rdx, %rcx
movq -0x78(%rbp), %rdx
andq 0x10(%rdx), %rcx
movq (%rax,%rcx,8), %rdx
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x70(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
shrq $0x20, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
shlq $0x20, %rdx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0xb8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x70(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movl (%rax,%rcx,8), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x70(%rbp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
movq -0xb8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %ecx
movq -0xb8(%rbp), %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
addl %ecx, %edx
movl (%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, (%rax)
leaq 0x2ddc6a(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0xb8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq -0x70(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x21, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x1, -0x5c(%rbp)
je 0xe769b
cmpl $0x2, -0x5c(%rbp)
je 0xe769b
movl $0x0, -0x5c(%rbp)
cmpl $0x1, -0x5c(%rbp)
jne 0xe76aa
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
cmpl $0x2, -0x5c(%rbp)
jne 0xe76b9
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xe76bb
movl $0x0, -0x34(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl -0x50(%rbp), %eax
cmpq -0x90(%rbp), %rax
jae 0xe7727
movq -0x80(%rbp), %rax
movl -0x50(%rbp), %ecx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xe770d
movq -0x80(%rbp), %rax
movl -0x50(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
shrq $0x20, %rcx
movl -0x34(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x34(%rbp)
jmp 0xe7725
movq -0x80(%rbp), %rax
movl -0x50(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
shrq $0x20, %rcx
movl -0x30(%rbp), %eax
addq %rcx, %rax
movl %eax, -0x30(%rbp)
jmp 0xe7727
jmp 0xe7729
jmp 0xe772b
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xe6e77
movl -0x48(%rbp), %eax
movq -0x78(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xe7748
jmp 0xe7767
leaq 0x29f5fc(%rip), %rdi    # 0x386d4b
leaq 0x29f167(%rip), %rsi    # 0x3868bd
movl $0x2360, %edx           # imm = 0x2360
leaq 0x29f59e(%rip), %rcx    # 0x386d00
callq 0x2130
movl -0x40(%rbp), %eax
cmpl -0x38(%rbp), %eax
jne 0xe7771
jmp 0xe7790
leaq 0x29f5e5(%rip), %rdi    # 0x386d5d
leaq 0x29f13e(%rip), %rsi    # 0x3868bd
movl $0x2361, %edx           # imm = 0x2361
leaq 0x29f575(%rip), %rcx    # 0x386d00
callq 0x2130
movl -0x44(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jne 0xe779a
jmp 0xe77b9
leaq 0x29f5c7(%rip), %rdi    # 0x386d68
leaq 0x29f115(%rip), %rsi    # 0x3868bd
movl $0x2361, %edx           # imm = 0x2361
leaq 0x29f54c(%rip), %rcx    # 0x386d00
callq 0x2130
jmp 0xe77bb
jmp 0xe77bd
jmp 0xe77bf
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xe636b
movq -0x78(%rbp), %rdi
callq 0xe6290
movq -0x80(%rbp), %rdi
callq 0x2210
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jae 0xe7807
movq -0x20(%rbp), %rax
movl -0x28(%rbp), %ecx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xe77e6
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x98(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xe789a
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe783e
jmp 0xe788c
movl -0x24(%rbp), %edx
shll %edx
orl $0x0, %edx
movq -0x20(%rbp), %rax
movq -0x98(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x24(%rbp), %esi
imulq $0x28, %rsi, %rsi
addq %rsi, %rcx
movl 0x4(%rcx), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %edx
shll %edx
orl $0x1, %edx
movq -0x20(%rbp), %rax
movq -0x98(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x24(%rbp), %esi
imulq $0x28, %rsi, %rsi
addq %rsi, %rcx
movl 0x8(%rcx), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe780e
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
cmpl %ecx, %eax
jae 0xe7a60
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xe78e9
jmp 0xe7a52
movq -0x20(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
xorq $0x1, %rcx
cmpl $0x0, (%rax,%rcx,4)
jl 0xe7a50
movq -0x20(%rbp), %rax
movq -0xc0(%rbp), %rcx
movl 0x8(%rcx), %ecx
cmpl $0x0, (%rax,%rcx,4)
jl 0xe7a50
movq -0x20(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
xorq $0x1, %rcx
movl (%rax,%rcx,4), %eax
xorl $0x1, %eax
movl %eax, -0xcc(%rbp)
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xcc(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movq -0xc0(%rbp), %rcx
movl 0xc(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
subl %ecx, %eax
movl %eax, -0xd0(%rbp)
cmpl $0x0, -0xd0(%rbp)
jge 0xe7991
movl $0x1, -0xd0(%rbp)
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xd4050
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rax
movl 0xc(%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq -0xc8(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, 0xc(%rax)
movq -0xc8(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0xc(%rax)
movl -0xcc(%rbp), %eax
movl %eax, %ecx
shlq $0x20, %rcx
movslq -0xd0(%rbp), %rax
orq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq -0xc0(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl (%rax,%rcx,4), %ecx
movq -0xc8(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0xc8(%rbp), %rax
movw 0x10(%rax), %cx
andw $0xc000, %cx            # imm = 0xC000
orw $0x0, %cx
movw %cx, 0x10(%rax)
movq -0xc0(%rbp), %rax
movb 0x12(%rax), %cl
movq -0xc8(%rbp), %rax
movb %cl, 0x12(%rax)
jmp 0xe7a52
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe78a1
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x98(%rbp), %rcx
cmpq (%rcx), %rax
jae 0xe7ab3
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x24(%rbp), %esi
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
callq 0xcd8f0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe7a67
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xcdd10
movq -0x20(%rbp), %rdi
callq 0x2210
movq -0x98(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax)