// File: /workspace/github_c_makefile_star2_O0/genevalab[P]msmove/ms.c
// Function: gensam
int gensam(char **list, double *pprobss, double *ptmrca, double *pttot, int *migflag) 
{
	int nsegs, i, k, seg, ns, start, end, len, segsit;
	int *ss, segsitesin, nsites, nsam, mfreq;
	double nsinv, tseg, tt, theta, es, *pk;
	struct segl *seglst;

	nsites = pars.cp.nsites;
	nsinv = 1.0/nsites;
	*migflag = 0;
	seglst = segtre_mig(&(pars.cp), &nsegs, migflag);
	nsam = pars.cp.nsam;
	segsitesin = pars.mp.segsitesin;
	theta = pars.mp.theta;
	mfreq = pars.mp.mfreq;

	if (pars.mp.treeflag) 
	{
	  	ns = 0;
	    for (seg=0, k=0; k < nsegs; seg = seglst[seg].next, k++)
		{
			if ( (pars.cp.r > 0) || (pars.cp.f > 0) )
			{
				end = k < nsegs-1 ? seglst[seglst[seg].next].beg-1 : nsites-1;
				start = seglst[seg].beg;
				len = end-start+1;
				fprintf(stdout, "[%d]", len);
			}
			prtree(seglst[seg].ptree, nsam);
			if ((segsitesin == 0) && (theta == 0) && (pars.mp.timeflag == 0)) 
				free(seglst[seg].ptree);
		}
	}

	if (pars.mp.timeflag)
	{
		tt = 0;
		for (seg=0, k=0; k < nsegs; seg = seglst[seg].next, k++)
		{ 
			if (mfreq > 1) 
				ndes_setup(seglst[seg].ptree, nsam);
			end = k < nsegs-1 ? seglst[seglst[seg].next].beg-1 : nsites-1;
			start = seglst[seg].beg;
			if ((nsegs == 1) || ((start <= nsites/2) && (end >= nsites/2)))
				*ptmrca = (seglst[seg].ptree+2*nsam-2)->time;
			len = end-start+1;
			tseg = len / (double)nsites;
			if (mfreq == 1)
				tt += ttime(seglst[seg].ptree, nsam) * tseg;
			else 
				tt += ttimemf(seglst[seg].ptree, nsam, mfreq)*tseg;
			if ((segsitesin == 0) && (theta == 0)) 
				free(seglst[seg].ptree);
		}
		*pttot = tt;
	}	
	
    if ((segsitesin == 0) && (theta > 0))
	{
		ns = 0;
		for (seg=0, k=0; k < nsegs; seg = seglst[seg].next, k++)
		{ 
			if (mfreq > 1)
				ndes_setup(seglst[seg].ptree, nsam);
			end = k < nsegs-1 ? seglst[seglst[seg].next].beg-1 : nsites-1;
			start = seglst[seg].beg;
			len = end-start+1;
			tseg = len*theta/nsites;
			if (mfreq == 1)
				tt = ttime(seglst[seg].ptree, nsam);
			else
				tt = ttimemf(seglst[seg].ptree, nsam, mfreq);
			segsit = poisso(tseg*tt);
			if ((unsigned int)(segsit+ns) >= maxsites)
			{
				maxsites = segsit+ns+SITESINC;
				posit = (double*)realloc(posit, (size_t)maxsites*sizeof(double));
				if (posit == NULL)
					perror("Realloc failure for posit");
				biggerlist(nsam, list); 
			}
			make_gametes(nsam, mfreq, seglst[seg].ptree, tt, segsit, ns, list);
			free(seglst[seg].ptree);
			locate(segsit, start * nsinv, len * nsinv, posit + ns);   
			ns += segsit;
		}
	}
	else
		if (segsitesin > 0)
		{
			pk = (double*)malloc((size_t)nsegs*sizeof(double));
			ss = (int*)malloc((size_t)nsegs*sizeof(int));
			if ((pk == 0) || (ss == 0))
				perror("malloc error. gensam.2");
			tt = 0;
			for (seg=0, k=0; k < nsegs; seg = seglst[seg].next, k++)
			{ 
				if (mfreq > 1)
					ndes_setup(seglst[seg].ptree, nsam);
				end = k < nsegs-1 ? seglst[seglst[seg].next].beg-1 : nsites-1;
				start = seglst[seg].beg;
				len = end-start+1;
				tseg = len/(double)nsites;
				if (mfreq == 1)
					pk[k] = ttime(seglst[seg].ptree, nsam)*tseg;
				else 
					pk[k] = ttimemf(seglst[seg].ptree, nsam, mfreq)*tseg;
				tt += pk[k];
			}
			if (theta > 0)
			{ 
				es = theta*tt;
				*pprobss = exp(-1.0*es)*pow(es, (double)segsitesin)/segfac;
			}
			if (tt > 0)
			{
				for (k=0; k < nsegs; k++)
					pk[k] *= 1.0/tt;
				mnmial(segsitesin, nsegs, pk, ss);
			}
			else
				for (k=0; k < nsegs; k++)
					ss[k] = 0;
			ns = 0;
			for (seg=0, k=0; k < nsegs; seg = seglst[seg].next, k++)
			{ 
				end = k < nsegs-1 ? seglst[seglst[seg].next].beg-1 : nsites-1;
				start = seglst[seg].beg;
				len = end-start+1;
				tseg = len/(double)nsites;
				make_gametes(nsam, mfreq, seglst[seg].ptree, tt*pk[k]/tseg, ss[k], ns, list);
				free(seglst[seg].ptree);
				locate(ss[k], start*nsinv, len*nsinv, posit+ns);
				ns += ss[k];
			}
			free(pk);
			free(ss);
		}
		
		for (i=0; i < nsam; i++)
			list[i][ns] = '\0';
		return ns;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl 0x840b(%rip), %eax      # 0xb140
movl %eax, -0x60(%rbp)
cvtsi2sdl -0x60(%rbp), %xmm1
movsd 0x52c3(%rip), %xmm0     # 0x8008
divsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq -0x28(%rbp), %rdx
leaq 0x83bd(%rip), %rdi      # 0xb120
leaq -0x2c(%rbp), %rsi
callq 0x4fc0
movq %rax, -0xa0(%rbp)
movl 0x83ab(%rip), %eax      # 0xb124
movl %eax, -0x64(%rbp)
movl 0x83f6(%rip), %eax      # 0xb178
movl %eax, -0x5c(%rbp)
movsd 0x83e3(%rip), %xmm0     # 0xb170
movsd %xmm0, -0x88(%rbp)
movl 0x83e9(%rip), %eax      # 0xb184
movl %eax, -0x68(%rbp)
cmpl $0x0, 0x83d7(%rip)      # 0xb17c
je 0x2f08
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x2f06
movsd 0x8364(%rip), %xmm0     # 0xb138
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
ja 0x2df2
movsd 0x8363(%rip), %xmm0     # 0xb148
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x2e83
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x2e30
movq -0xa0(%rbp), %rax
movq -0xa0(%rbp), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x10(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x2e3c
movl -0x60(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x44(%rbp), %eax
subl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movq 0x8159(%rip), %rax      # 0xafc8
movq (%rax), %rdi
movl -0x48(%rbp), %edx
leaq 0x53a7(%rip), %rsi      # 0x8223
movb $0x0, %al
callq 0x1110
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
callq 0x3840
cmpl $0x0, -0x5c(%rbp)
jne 0x2ede
movsd -0x88(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2ede
jp 0x2ede
cmpl $0x0, 0x82bf(%rip)      # 0xb180
jne 0x2ede
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x10c0
jmp 0x2ee0
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2dc0
jmp 0x2f08
cmpl $0x0, 0x8271(%rip)      # 0xb180
je 0x313a
xorps %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x312d
cmpl $0x1, -0x68(%rbp)
jle 0x2f5b
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
callq 0x3970
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x2f99
movq -0xa0(%rbp), %rax
movq -0xa0(%rbp), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x10(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0x2fa5
movl -0x60(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
cmpl $0x1, -0x2c(%rbp)
je 0x300b
movl -0x40(%rbp), %eax
movl %eax, -0xac(%rbp)
movl -0x60(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xac(%rbp), %eax
cmpl %ecx, %eax
jg 0x303d
movl -0x44(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0x60(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0xb0(%rbp), %eax
cmpl %ecx, %eax
jl 0x303d
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0x64(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd -0x18(%rax), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movl -0x44(%rbp), %eax
subl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
cvtsi2sdl -0x48(%rbp), %xmm0
cvtsi2sdl -0x60(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
cmpl $0x1, -0x68(%rbp)
jne 0x3099
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
callq 0x3a40
movsd -0x78(%rbp), %xmm2
movsd -0x80(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
jmp 0x30d1
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
movl -0x68(%rbp), %edx
callq 0x3ab0
movsd -0x78(%rbp), %xmm2
movsd -0x80(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x3105
movsd -0x88(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3105
jp 0x3105
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x10c0
jmp 0x3107
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2f2b
movsd -0x80(%rbp), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
cmpl $0x0, -0x5c(%rbp)
jne 0x339e
movsd -0x88(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x339e
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x3399
cmpl $0x1, -0x68(%rbp)
jle 0x319e
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
callq 0x3970
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x31dc
movq -0xa0(%rbp), %rax
movq -0xa0(%rbp), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x10(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x31e8
movl -0x60(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x44(%rbp), %eax
subl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
cvtsi2sdl -0x48(%rbp), %xmm0
mulsd -0x88(%rbp), %xmm0
cvtsi2sdl -0x60(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
cmpl $0x1, -0x68(%rbp)
jne 0x325a
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
callq 0x3a40
movsd %xmm0, -0x80(%rbp)
jmp 0x3280
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
movl -0x68(%rbp), %edx
callq 0x3ab0
movsd %xmm0, -0x80(%rbp)
movsd -0x78(%rbp), %xmm0
mulsd -0x80(%rbp), %xmm0
callq 0x3b70
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
addl -0x3c(%rbp), %eax
cmpl 0x7e32(%rip), %eax      # 0xb0d0
jb 0x32f0
movl -0x4c(%rbp), %eax
addl -0x3c(%rbp), %eax
addl $0xa, %eax
movl %eax, 0x7e21(%rip)      # 0xb0d0
movq 0x7ed2(%rip), %rdi      # 0xb188
movl 0x7e14(%rip), %eax      # 0xb0d0
movl %eax, %esi
shlq $0x3, %rsi
callq 0x1130
movq %rax, 0x7eba(%rip)      # 0xb188
cmpq $0x0, 0x7eb2(%rip)      # 0xb188
jne 0x32e4
leaq 0x4f49(%rip), %rdi      # 0x8228
callq 0x1070
movl -0x64(%rbp), %edi
movq -0x8(%rbp), %rsi
callq 0x3c80
movl -0x64(%rbp), %edi
movl -0x68(%rbp), %esi
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movsd -0x80(%rbp), %xmm0
movl -0x4c(%rbp), %ecx
movl -0x3c(%rbp), %r8d
movq -0x8(%rbp), %r9
callq 0x3d00
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x10c0
movl -0x4c(%rbp), %edi
cvtsi2sdl -0x40(%rbp), %xmm0
mulsd -0x70(%rbp), %xmm0
cvtsi2sdl -0x48(%rbp), %xmm1
mulsd -0x70(%rbp), %xmm1
movq 0x7e2e(%rip), %rsi      # 0xb188
movslq -0x3c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x3de0
movl -0x4c(%rbp), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x316e
jmp 0x3802
cmpl $0x0, -0x5c(%rbp)
jle 0x3800
movslq -0x2c(%rbp), %rdi
shlq $0x3, %rdi
callq 0x10f0
movq %rax, -0x98(%rbp)
movslq -0x2c(%rbp), %rdi
shlq $0x2, %rdi
callq 0x10f0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x98(%rbp)
je 0x33de
cmpq $0x0, -0x58(%rbp)
jne 0x33ea
leaq 0x4e5d(%rip), %rdi      # 0x8242
callq 0x1070
xorps %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x356a
cmpl $0x1, -0x68(%rbp)
jle 0x3430
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
callq 0x3970
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x346e
movq -0xa0(%rbp), %rax
movq -0xa0(%rbp), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x10(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x347a
movl -0x60(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x44(%rbp), %eax
subl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
cvtsi2sdl -0x48(%rbp), %xmm0
cvtsi2sdl -0x60(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
cmpl $0x1, -0x68(%rbp)
jne 0x34f4
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
callq 0x3a40
mulsd -0x78(%rbp), %xmm0
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x352a
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movl -0x64(%rbp), %esi
movl -0x68(%rbp), %edx
callq 0x3ab0
mulsd -0x78(%rbp), %xmm0
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3400
movsd -0x88(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x35de
movsd -0x88(%rbp), %xmm0
mulsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd 0x4a78(%rip), %xmm0     # 0x8010
mulsd -0x90(%rbp), %xmm0
callq 0x1160
movsd %xmm0, -0xc0(%rbp)
movsd -0x90(%rbp), %xmm0
cvtsi2sdl -0x5c(%rbp), %xmm1
callq 0x1150
movaps %xmm0, %xmm1
movsd -0xc0(%rbp), %xmm0
mulsd %xmm1, %xmm0
divsd 0x7bba(%rip), %xmm0     # 0xb190
movq -0x10(%rbp), %rax
movsd %xmm0, (%rax)
movsd -0x80(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x3640
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x3628
movsd 0x4a05(%rip), %xmm0     # 0x8008
divsd -0x80(%rbp), %xmm0
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x35f3
movl -0x5c(%rbp), %edi
movl -0x2c(%rbp), %esi
movq -0x98(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0x3e60
jmp 0x366b
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x3669
movq -0x58(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3647
jmp 0x366b
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x37eb
movl -0x34(%rbp), %eax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x36ca
movq -0xa0(%rbp), %rax
movq -0xa0(%rbp), %rcx
movslq -0x38(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x10(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x36d6
movl -0x60(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x44(%rbp), %eax
subl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
cvtsi2sdl -0x48(%rbp), %xmm0
cvtsi2sdl -0x60(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movl -0x64(%rbp), %edi
movl -0x68(%rbp), %esi
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movsd -0x80(%rbp), %xmm0
movq -0x98(%rbp), %rax
movslq -0x34(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
divsd -0x78(%rbp), %xmm0
movq -0x58(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movl -0x3c(%rbp), %r8d
movq -0x8(%rbp), %r9
callq 0x3d00
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x10c0
movq -0x58(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edi
cvtsi2sdl -0x40(%rbp), %xmm0
mulsd -0x70(%rbp), %xmm0
cvtsi2sdl -0x48(%rbp), %xmm1
mulsd -0x70(%rbp), %xmm1
movq 0x79e4(%rip), %rsi      # 0xb188
movslq -0x3c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x3de0
movq -0x58(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0xa0(%rbp), %rax
movslq -0x38(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x3680
movq -0x98(%rbp), %rdi
callq 0x10c0
movq -0x58(%rbp), %rdi
callq 0x10c0
jmp 0x3802
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x3830
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3809
movl -0x3c(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)