// File: chhylp123[P]hifiasm/inter.cpp
// Function: phase_mul_ways(vec_mg_pathv_t*, st_mt_t*, vec_sp_node_t*, int, mg_path_dst_t*, int, float)
int32_t phase_mul_ways(vec_mg_pathv_t *res, st_mt_t *dst_done, vec_sp_node_t *out, int32_t n_dst, mg_path_dst_t *dst, int32_t max_k, float len_dif)
{
	int64_t i, j, z, zl, n = 0, n_mpath, kk_p, od, res_n = res->n, pid; mg_pathv_t *h;
	dst_done->n = 0; kv_resize(uint64_t, *dst_done, out->n); 
	uint64_t *trans = dst_done->a; memset(dst_done->a, 0, out->n*sizeof(*(dst_done->a)));

	n_mpath = 0;
	for (i = 0; i < n_dst; ++i) { // mark dst vertices with a target distance
		mg_path_dst_t *t = &dst[i];
		if (t->n_path > 0 && t->target_dist >= 0 && t->path_end >= 0){
			assert((int32_t)(out->a[t->path_end]->di>>32) == t->target_dist);
			if(t->n_path >= max_k) {
				t->n_path = 0;
				for (z = zl = t->path_end; z >= 0;) {
					zl = z;
					z = out->a[z]->pre;
				}
				n += 2; trans[t->path_end] = trans[zl] = 1;
			} else {
				kk_p = 0;
				for (j = t->path_end; j < (int32_t)out->n; j++) {
					od = out->a[j]->di>>32;
					if(od >= (t->target_dist*(1-len_dif)) && 
							od <= (t->target_dist*(1+len_dif))) {
						if(out->a[j]->v == t->v) kk_p++;
					} else {
						break;
					}
				}
				for (j = t->path_end-1; j >=0; j--) {
					od = out->a[j]->di>>32;
					if(od >= (t->target_dist*(1-len_dif)) && 
							od <= (t->target_dist*(1+len_dif))) {
						if(out->a[j]->v == t->v) kk_p++;
					} else {
						break;
					}
				}
				assert(kk_p > 0 && kk_p <= t->n_path);
				n_mpath += kk_p;
			}
		}
	}

	// if(detect_mul_way && src == 74) {
	// 	fprintf(stderr, "+[M::%s::] src:%u, dst:%u, n_mpath:%d\n", __func__, src, dst[0].v, n_mpath);
	// }

	if(n_mpath > 1) {
		for (i = 0, pid = 0; i < n_dst; ++i) { // mark dst vertices with a target distance
			mg_path_dst_t *t = &dst[i];
			if (t->n_path > 0 && t->target_dist >= 0 && t->path_end >= 0){
				assert((int32_t)(out->a[t->path_end]->di>>32) == t->target_dist);
				assert(t->n_path < max_k);
				for (j = t->path_end; j < (int32_t)out->n; j++) {
					od = out->a[j]->di>>32;
					if(od >= (t->target_dist*(1-len_dif)) && 
							od <= (t->target_dist*(1+len_dif))) {
						if(out->a[j]->v == t->v) {
							for (z = j; z >= 0;) {
								kv_pushp(mg_pathv_t, *res, &h);
								h->v = out->a[z]->v; h->pre = z;
								h->d = pid; if(j!=t->path_end) h->d |= 0x80000000;
								z = out->a[z]->pre;
							}
							pid++;
						}
					} else {
						break;
					}
				}
				for (j = t->path_end-1; j >=0; j--) {
					od = out->a[j]->di>>32;
					if(od >= (t->target_dist*(1-len_dif)) && 
							od <= (t->target_dist*(1+len_dif))) {
						if(out->a[j]->v == t->v) {
							for (z = j; z >= 0;) {
								kv_pushp(mg_pathv_t, *res, &h);
								h->v = out->a[z]->v; h->pre = z;
								h->d = pid; if(j!=t->path_end) h->d |= 0x80000000;
								z = out->a[z]->pre;
							}
							pid++;
						}
					} else {
						break;
					}
				}
			}
		}

		radix_sort_mg_pathv_t_v_srt(res->a + res_n, res->a + res->n);
		for (i = res_n+1, j = res_n/**, n = 0**/; i <= (int64_t)res->n; ++i) {
			if (i == (int64_t)res->n || res->a[i].v != res->a[j].v) {
				n += select_mul_way_nodes(res->a + j, i - j, out, len_dif, n_mpath, trans);
				j = i;
			}
		}

		res->n = res_n;
	}


	if(n > 0) {//found some nodes
		for (i = n = 0; (uint32_t)i < out->n; ++i) { // generate coordinate translations
			if (trans[i]) {
				trans[i] = n++;
			} else {
				trans[i] = (uint32_t)-1;
			}
		}

		kv_resize(mg_pathv_t, *res, res->n + n); //res->n += n;
		for (i = 0; (uint32_t)i < out->n; ++i) { // generate the backtrack array
			mg_pathv_t *p;
			if (trans[i] == (uint32_t)-1) continue;
			p = &res->a[trans[i]+res->n];
			p->v = out->a[i]->v, p->d = out->a[i]->di >> 32;
			if(out->a[i]->pre < 0) {
				p->pre = out->a[i]->pre;
			} else {
				if(trans[out->a[i]->pre] == (uint32_t)-1) p->pre = -2;
				else p->pre = trans[out->a[i]->pre];
			}
		}

		res->n += n;
		for (i = 0; i < n_dst; ++i) // translate "path_end"
			if (dst[i].path_end >= 0)
				dst[i].path_end = trans[dst[i].path_end];
	}

	return n_mpath;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movss %xmm0, -0x30(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2d3477
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0x10(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0x10(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0x10(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0x10(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0x10(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x2d3479
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x2100
movq $0x0, -0x60(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpq %rcx, %rax
jge 0x2d3822
movq -0x28(%rbp), %rax
imulq $0x30, -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x0, %eax
jle 0x2d380f
movq -0x98(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0x2d380f
movq -0x98(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jl 0x2d380f
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x98(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq -0x98(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x2d353c
jmp 0x2d355b
leaq 0xbf9e7(%rip), %rdi     # 0x392f2a
leaq 0xbd2e5(%rip), %rsi     # 0x39082f
movl $0x3654, %edx           # imm = 0x3654
leaq 0xbfa0d(%rip), %rcx     # 0x392f63
callq 0x2130
movq -0x98(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl -0x2c(%rbp), %eax
jl 0x2d3602
movq -0x98(%rbp), %rax
movl 0x14(%rax), %ecx
andl $0x80000000, %ecx       # imm = 0x80000000
orl $0x0, %ecx
movl %ecx, 0x14(%rax)
movq -0x98(%rbp), %rax
movslq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jl 0x2d35c4
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0xc(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x2d359c
movq -0x58(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x58(%rbp)
movq -0x90(%rbp), %rax
movq -0x50(%rbp), %rcx
movq $0x1, (%rax,%rcx,8)
movq -0x90(%rbp), %rax
movq -0x98(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movq $0x1, (%rax,%rcx,8)
jmp 0x2d380d
movq $0x0, -0x68(%rbp)
movq -0x98(%rbp), %rax
movslq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x2d36db
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq %rax, -0x70(%rbp)
cvtsi2ssq -0x70(%rbp), %xmm0
movq -0x98(%rbp), %rax
cvtsi2ssl 0x4(%rax), %xmm1
movss 0xaba27(%rip), %xmm2    # 0x37f08c
subss -0x30(%rbp), %xmm2
mulss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jb 0x2d36c6
cvtsi2ssq -0x70(%rbp), %xmm1
movq -0x98(%rbp), %rax
cvtsi2ssl 0x4(%rax), %xmm0
movss 0xab9ff(%rip), %xmm2    # 0x37f08c
addss -0x30(%rbp), %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jb 0x2d36c6
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %eax
movq -0x98(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x2d36c4
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x2d36c8
jmp 0x2d36db
jmp 0x2d36ca
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2d3619
movq -0x98(%rbp), %rax
movl 0x18(%rax), %eax
subl $0x1, %eax
cltq
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jl 0x2d37a3
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq %rax, -0x70(%rbp)
cvtsi2ssq -0x70(%rbp), %xmm0
movq -0x98(%rbp), %rax
cvtsi2ssl 0x4(%rax), %xmm1
movss 0xab95f(%rip), %xmm2    # 0x37f08c
subss -0x30(%rbp), %xmm2
mulss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jb 0x2d378e
cvtsi2ssq -0x70(%rbp), %xmm1
movq -0x98(%rbp), %rax
cvtsi2ssl 0x4(%rax), %xmm0
movss 0xab937(%rip), %xmm2    # 0x37f08c
addss -0x30(%rbp), %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jb 0x2d378e
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %eax
movq -0x98(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x2d378c
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x2d3790
jmp 0x2d37a3
jmp 0x2d3792
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2d36ee
xorl %eax, %eax
cmpq $0x0, -0x68(%rbp)
movb %al, -0xa9(%rbp)
jle 0x2d37d4
movq -0x68(%rbp), %rax
movq -0x98(%rbp), %rcx
movl 0x14(%rcx), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, %ecx
cmpq %rcx, %rax
setle %al
movb %al, -0xa9(%rbp)
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x2d37e0
jmp 0x2d37e2
jmp 0x2d3801
leaq 0xbf7e9(%rip), %rdi     # 0x392fd2
leaq 0xbd03f(%rip), %rsi     # 0x39082f
movl $0x3670, %edx           # imm = 0x3670
leaq 0xbf767(%rip), %rcx     # 0x392f63
callq 0x2130
movq -0x68(%rbp), %rax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x2d380f
jmp 0x2d3811
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2d34b3
cmpq $0x1, -0x60(%rbp)
jle 0x2d3e10
movq $0x0, -0x38(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpq %rcx, %rax
jge 0x2d3d30
movq -0x28(%rbp), %rax
imulq $0x30, -0x38(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x0, %eax
jle 0x2d3d1d
movq -0xa0(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jl 0x2d3d1d
movq -0xa0(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jl 0x2d3d1d
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0xa0(%rbp), %rcx
movslq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq -0xa0(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x2d38c6
jmp 0x2d38e5
leaq 0xbf65d(%rip), %rdi     # 0x392f2a
leaq 0xbcf5b(%rip), %rsi     # 0x39082f
movl $0x367e, %edx           # imm = 0x367E
leaq 0xbf683(%rip), %rcx     # 0x392f63
callq 0x2130
movq -0xa0(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl -0x2c(%rbp), %eax
jge 0x2d38fb
jmp 0x2d391a
leaq 0xbf6ee(%rip), %rdi     # 0x392ff0
leaq 0xbcf26(%rip), %rsi     # 0x39082f
movl $0x367f, %edx           # imm = 0x367F
leaq 0xbf64e(%rip), %rcx     # 0x392f63
callq 0x2130
movq -0xa0(%rbp), %rax
movslq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x2d3b1f
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq %rax, -0x70(%rbp)
cvtsi2ssq -0x70(%rbp), %xmm0
movq -0xa0(%rbp), %rax
cvtsi2ssl 0x4(%rax), %xmm1
movss 0xab717(%rip), %xmm2    # 0x37f08c
subss -0x30(%rbp), %xmm2
mulss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jb 0x2d3b0a
cvtsi2ssq -0x70(%rbp), %xmm1
movq -0xa0(%rbp), %rax
cvtsi2ssl 0x4(%rax), %xmm0
movss 0xab6eb(%rip), %xmm2    # 0x37f08c
addss -0x30(%rbp), %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jb 0x2d3b0a
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %eax
movq -0xa0(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x2d3b08
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jl 0x2d3afc
jmp 0x2d39e9
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x2d3a56
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2d3a1a
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0xb8(%rbp)
jmp 0x2d3a28
movl $0x2, %eax
movq %rax, -0xb8(%rbp)
jmp 0x2d3a28
movq -0xb8(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0xc, 0x10(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %ecx
movq -0x88(%rbp), %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x80(%rbp), %rax
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
movslq 0x18(%rcx), %rcx
cmpq %rcx, %rax
je 0x2d3ae0
movq -0x88(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0xc(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x2d39dc
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x2d3b0c
jmp 0x2d3b1f
jmp 0x2d3b0e
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2d3929
movq -0xa0(%rbp), %rax
movl 0x18(%rax), %eax
subl $0x1, %eax
cltq
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jl 0x2d3d1b
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
shrq $0x20, %rax
movq %rax, -0x70(%rbp)
cvtsi2ssq -0x70(%rbp), %xmm0
movq -0xa0(%rbp), %rax
cvtsi2ssl 0x4(%rax), %xmm1
movss 0xab51b(%rip), %xmm2    # 0x37f08c
subss -0x30(%rbp), %xmm2
mulss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jb 0x2d3d06
cvtsi2ssq -0x70(%rbp), %xmm1
movq -0xa0(%rbp), %rax
cvtsi2ssl 0x4(%rax), %xmm0
movss 0xab4ef(%rip), %xmm2    # 0x37f08c
addss -0x30(%rbp), %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jb 0x2d3d06
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %eax
movq -0xa0(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x2d3d04
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jl 0x2d3cf8
jmp 0x2d3be5
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x2d3c52
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2d3c16
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0xc0(%rbp)
jmp 0x2d3c24
movl $0x2, %eax
movq %rax, -0xc0(%rbp)
jmp 0x2d3c24
movq -0xc0(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0xc, 0x10(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %ecx
movq -0x88(%rbp), %rax
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x80(%rbp), %rax
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x40(%rbp), %rax
movq -0xa0(%rbp), %rcx
movslq 0x18(%rcx), %rcx
cmpq %rcx, %rax
je 0x2d3cdc
movq -0x88(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0xc(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x2d3bd8
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x2d3d08
jmp 0x2d3d1b
jmp 0x2d3d0a
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2d3b32
jmp 0x2d3d1d
jmp 0x2d3d1f
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2d383d
movq -0x8(%rbp), %rax
movq (%rax), %rdi
imulq $0xc, -0x78(%rbp), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x8(%rbp), %rax
imulq $0xc, 0x8(%rax), %rax
addq %rax, %rsi
callq 0x27eed0
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jg 0x2d3e04
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
je 0x2d3daf
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xc, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xc, -0x40(%rbp), %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
je 0x2d3df1
movq -0x8(%rbp), %rax
movq (%rax), %rdi
imulq $0xc, -0x40(%rbp), %rax
addq %rax, %rdi
movq -0x38(%rbp), %rsi
subq -0x40(%rbp), %rsi
movq -0x18(%rbp), %rdx
movss -0x30(%rbp), %xmm0
movq -0x60(%rbp), %rax
movl %eax, %ecx
movq -0x90(%rbp), %r8
callq 0x2d3160
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x2d3df3
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2d3d6b
movq -0x78(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, -0x58(%rbp)
jle 0x2d4138
movq $0x0, -0x58(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl %eax, %eax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2d3e91
movq -0x90(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x2d3e6d
movq -0x58(%rbp), %rdx
movq %rdx, %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x90(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x2d3e81
movq -0x90(%rbp), %rax
movq -0x38(%rbp), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %rdx, (%rax,%rcx,8)
jmp 0x2d3e83
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2d3e2b
jmp 0x2d3e93
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
addq -0x58(%rbp), %rcx
cmpq %rcx, %rax
jae 0x2d3f7a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
addq -0x58(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
shrq %rcx
movq -0x8(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
shrq $0x2, %rcx
movq -0x8(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
shrq $0x4, %rcx
movq -0x8(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
shrq $0x8, %rcx
movq -0x8(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
shrq $0x10, %rcx
movq -0x8(%rbp), %rax
orq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0xc, 0x10(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2d3f7c
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl %eax, %eax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2d40c3
movq -0x90(%rbp), %rax
movq -0x38(%rbp), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, (%rax,%rcx,8)
jne 0x2d3fb3
jmp 0x2d40b2
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x90(%rbp), %rcx
movq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movq -0x8(%rbp), %rdx
addq 0x8(%rdx), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %ecx
movq -0xa8(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0xc(%rax)
jge 0x2d404f
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0xc(%rax), %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x2d40b0
movq -0x90(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq 0xc(%rcx), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpq %rdx, (%rax,%rcx,8)
jne 0x2d4084
movq -0xa8(%rbp), %rax
movl $0xfffffffe, 0x8(%rax)  # imm = 0xFFFFFFFE
jmp 0x2d40ae
movq -0x90(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq 0xc(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x2d40b0
jmp 0x2d40b2
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2d3f84
movq -0x58(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
cmpq %rcx, %rax
jge 0x2d4136
movq -0x28(%rbp), %rax
imulq $0x30, -0x38(%rbp), %rcx
addq %rcx, %rax
cmpl $0x0, 0x18(%rax)
jl 0x2d4126
movq -0x90(%rbp), %rax
movq -0x28(%rbp), %rcx
imulq $0x30, -0x38(%rbp), %rdx
addq %rdx, %rcx
movslq 0x18(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
imulq $0x30, -0x38(%rbp), %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
jmp 0x2d4128
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2d40db
jmp 0x2d4138
movq -0x60(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)