// File: /workspace/github_c_makefile_star2_O0/genevalab[P]msmove/streec.c
// Function: xover
int xover(int nsam, int ic, int is)
{
	int i, k, lsgm1, newsg, jseg, in;
	int lsg = chrom[ic].nseg;	
	struct seg *pseg = chrom[ic].pseg;
	struct seg *pseg2;
	double len = (pseg+lsg-1)->end - pseg->beg;
	
	cleft -= 1.0-pow(pc, len);

	for (jseg=0; is >= (pseg + jseg)->end; jseg++);
	if (is >= (pseg+jseg)->beg)
		in = 1;
	else
		in = 0;
	newsg = lsg-jseg;
	nchrom++;
	if ((unsigned int)nchrom >= maxchr)
	{
		maxchr += 20;
		chrom = (struct chromo*)realloc(chrom, (size_t)maxchr*sizeof(struct chromo));
		if (chrom == NULL)
			perror("malloc error. segtre2");
	}
	if (!(pseg2 = chrom[nchrom-1].pseg = (struct seg*)calloc((size_t)newsg, sizeof(struct seg))))
		perror(" alloc error. re1");
	chrom[nchrom-1].nseg = newsg;
	chrom[nchrom-1].pop = chrom[ic].pop;
	pseg2->end = (pseg+jseg)->end;
	if (in)
	{
		pseg2->beg = is+1;
		(pseg+jseg)->end = is;
	}
	else
		pseg2->beg = (pseg+jseg)->beg;
	pseg2->desc = (pseg+jseg)->desc;
	for (k=1; k < newsg; k++)
	{
		(pseg2+k)->beg = (pseg+jseg+k)->beg;
		(pseg2+k)->end = (pseg+jseg+k)->end;
		(pseg2+k)->desc = (pseg+jseg+k)->desc;
	}
	lsg = chrom[ic].nseg = lsg-newsg+in;
	lsgm1 = lsg-1;
	nlinks -= pseg2->beg - (pseg+lsgm1)->end;
	len = (pseg+lsgm1)->end - (pseg->beg);
	cleft += 1.0-pow(pc, len);
	len = (pseg2+newsg-1)->end - pseg2->beg;
	cleft += 1.0-pow(pc, len);
	if (!(chrom[ic].pseg = (struct seg*)realloc(chrom[ic].pseg, (size_t)lsg*sizeof(struct seg))))
		perror("realloc error. re2");
	if (in)
	{
		begs = pseg2->beg;
		for (i=0, k=0; (k < nsegs-1) && (begs > seglst[seglst[i].next].beg-1); i=seglst[i].next, k++);
		if (begs != seglst[i].beg)
		{
			if ((unsigned int)nsegs >= seglimit)
			{
				seglimit += SEGINC;
				nnodes = (int*)realloc(nnodes, (size_t)seglimit*sizeof(int));
				if (nnodes == NULL)
					perror("realloc error. 1. segtre_mig.c");
				seglst = (struct segl*)realloc(seglst,(size_t)seglimit*sizeof(struct segl));
				if (seglst == NULL)
					perror("realloc error. 2. segtre_mig.c");
			}
			seglst[nsegs].next = seglst[i].next;
			seglst[i].next = nsegs;
			seglst[nsegs].beg = begs;
			if (!(seglst[nsegs].ptree = (struct node*)calloc((size_t)(2*nsam), sizeof(struct node))))
				perror("calloc error. re3.");
			nnodes[nsegs] = nnodes[i];
			ptree1 = seglst[i].ptree;
			ptree2 = seglst[nsegs].ptree;
			nsegs++;
			for (k=0; k <= nnodes[i]; k++)
			{
				(ptree2+k)->abv = (ptree1+k)->abv;
				(ptree2+k)->time = (ptree1+k)->time;
			}
		}
	}
	return ic;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq 0x5188(%rip), %rax      # 0xc530
movslq -0x8(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movq 0x5171(%rip), %rax      # 0xc530
movslq -0x8(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl -0x8(%rax), %eax
movq -0x30(%rbp), %rcx
subl (%rcx), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x5175(%rip), %xmm0     # 0xc570
movsd -0x40(%rbp), %xmm1
callq 0x1150
movsd 0xbfb(%rip), %xmm1      # 0x8008
subsd %xmm0, %xmm1
movsd 0x5167(%rip), %xmm0     # 0xc580
subsd %xmm1, %xmm0
movsd %xmm0, 0x515b(%rip)     # 0xc580
movl $0x0, -0x20(%rbp)
movl -0xc(%rbp), %eax
movq -0x30(%rbp), %rcx
movslq -0x20(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
jl 0x7450
jmp 0x7445
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x742c
movl -0xc(%rbp), %eax
movq -0x30(%rbp), %rcx
movslq -0x20(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jl 0x746f
movl $0x1, -0x24(%rbp)
jmp 0x7476
movl $0x0, -0x24(%rbp)
movl -0x28(%rbp), %eax
subl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl 0x50cb(%rip), %eax      # 0xc550
addl $0x1, %eax
movl %eax, 0x50c2(%rip)      # 0xc550
movl 0x50bc(%rip), %eax      # 0xc550
cmpl 0x509e(%rip), %eax      # 0xc538
jb 0x74e2
movl 0x5096(%rip), %eax      # 0xc538
addl $0x14, %eax
movl %eax, 0x508d(%rip)      # 0xc538
movq 0x507e(%rip), %rdi      # 0xc530
movl 0x5080(%rip), %eax      # 0xc538
movl %eax, %esi
shlq $0x4, %rsi
callq 0x1130
movq %rax, 0x5066(%rip)      # 0xc530
cmpq $0x0, 0x505e(%rip)      # 0xc530
jne 0x74e0
leaq 0x1acc(%rip), %rdi      # 0x8fa7
callq 0x1070
jmp 0x74e2
movslq -0x1c(%rbp), %rdi
movl $0xc, %esi
callq 0x1040
movq 0x5039(%rip), %rcx      # 0xc530
movl 0x5053(%rip), %edx      # 0xc550
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq %rax, 0x8(%rcx)
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x7524
leaq 0x1a9e(%rip), %rdi      # 0x8fbd
callq 0x1070
movl -0x1c(%rbp), %ecx
movq 0x5002(%rip), %rax      # 0xc530
movl 0x501c(%rip), %edx      # 0xc550
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq 0x4fe6(%rip), %rax      # 0xc530
movslq -0x8(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq 0x4fd1(%rip), %rax      # 0xc530
movl 0x4feb(%rip), %edx      # 0xc550
subl $0x1, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpl $0x0, -0x24(%rbp)
je 0x75b7
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %ecx
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
jmp 0x75ce
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x7693
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x38(%rbp), %rax
movslq -0x14(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x75ee
movl -0x28(%rbp), %eax
subl -0x1c(%rbp), %eax
addl -0x24(%rbp), %eax
movq 0x4e8d(%rip), %rcx      # 0xc530
movslq -0x8(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movl %eax, (%rcx)
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %eax
movq -0x30(%rbp), %rcx
movslq -0x18(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
movslq %eax, %rcx
movq 0x4e7a(%rip), %rax      # 0xc558
subq %rcx, %rax
movq %rax, 0x4e70(%rip)      # 0xc558
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x30(%rbp), %rcx
subl (%rcx), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x4e5f(%rip), %xmm0     # 0xc570
movsd -0x40(%rbp), %xmm1
callq 0x1150
movaps %xmm0, %xmm1
movsd 0x8e2(%rip), %xmm0      # 0x8008
subsd %xmm1, %xmm0
addsd 0x4e4e(%rip), %xmm0     # 0xc580
movsd %xmm0, 0x4e46(%rip)     # 0xc580
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl -0x8(%rax), %eax
movq -0x38(%rbp), %rcx
subl (%rcx), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd 0x4e0d(%rip), %xmm0     # 0xc570
movsd -0x40(%rbp), %xmm1
callq 0x1150
movaps %xmm0, %xmm1
movsd 0x890(%rip), %xmm0      # 0x8008
subsd %xmm1, %xmm0
addsd 0x4dfc(%rip), %xmm0     # 0xc580
movsd %xmm0, 0x4df4(%rip)     # 0xc580
movq 0x4d9d(%rip), %rax      # 0xc530
movslq -0x8(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movslq -0x28(%rbp), %rax
imulq $0xc, %rax, %rsi
callq 0x1130
movq 0x4d7a(%rip), %rcx      # 0xc530
movslq -0x8(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0x77d7
leaq 0x17fd(%rip), %rdi      # 0x8fcf
callq 0x1070
cmpl $0x0, -0x24(%rbp)
je 0x7aa8
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl %eax, 0x4d9b(%rip)      # 0xc588
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movl 0x4d5c(%rip), %edx      # 0xc560
subl $0x1, %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x41(%rbp)
jge 0x7847
movl 0x4d72(%rip), %eax      # 0xc588
movq 0x4d2b(%rip), %rcx      # 0xc548
movq 0x4d24(%rip), %rdx      # 0xc548
movslq -0x10(%rbp), %rsi
imulq $0x18, %rsi, %rsi
addq %rsi, %rdx
movslq 0x10(%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
setg %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x7850
jmp 0x7875
jmp 0x7852
movq 0x4cef(%rip), %rax      # 0xc548
movslq -0x10(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x77fb
movl 0x4d0d(%rip), %eax      # 0xc588
movq 0x4cc6(%rip), %rcx      # 0xc548
movslq -0x10(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
je 0x7aa6
movl 0x4cc5(%rip), %eax      # 0xc560
cmpl 0x385f(%rip), %eax      # 0xb100
jb 0x791c
movl 0x3857(%rip), %eax      # 0xb100
addl $0x50, %eax
movl %eax, 0x384e(%rip)      # 0xb100
movq 0x4c87(%rip), %rdi      # 0xc540
movl 0x3841(%rip), %eax      # 0xb100
movl %eax, %esi
shlq $0x2, %rsi
callq 0x1130
movq %rax, 0x4c6f(%rip)      # 0xc540
cmpq $0x0, 0x4c67(%rip)      # 0xc540
jne 0x78e7
leaq 0x1700(%rip), %rdi      # 0x8fe2
callq 0x1070
movq 0x4c5a(%rip), %rdi      # 0xc548
movl 0x380c(%rip), %eax      # 0xb100
imulq $0x18, %rax, %rsi
callq 0x1130
movq %rax, 0x4c44(%rip)      # 0xc548
cmpq $0x0, 0x4c3c(%rip)      # 0xc548
jne 0x791a
leaq 0x16ec(%rip), %rdi      # 0x9001
callq 0x1070
jmp 0x791c
movq 0x4c25(%rip), %rax      # 0xc548
movslq -0x10(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq 0x4c10(%rip), %rax      # 0xc548
movslq 0x4c21(%rip), %rdx      # 0xc560
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movl 0x4c11(%rip), %ecx      # 0xc560
movq 0x4bf2(%rip), %rax      # 0xc548
movslq -0x10(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movl 0x4c1e(%rip), %ecx      # 0xc588
movq 0x4bd7(%rip), %rax      # 0xc548
movslq 0x4be8(%rip), %rdx      # 0xc560
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x4(%rbp), %eax
shll %eax
movslq %eax, %rdi
movl $0x10, %esi
callq 0x1040
movq 0x4bae(%rip), %rcx      # 0xc548
movslq 0x4bbf(%rip), %rdx      # 0xc560
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0x79be
leaq 0x1667(%rip), %rdi      # 0x9020
callq 0x1070
movq 0x4b7b(%rip), %rax      # 0xc540
movslq -0x10(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x4b6d(%rip), %rax      # 0xc540
movslq 0x4b86(%rip), %rcx      # 0xc560
movl %edx, (%rax,%rcx,4)
movq 0x4b64(%rip), %rax      # 0xc548
movslq -0x10(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x4b96(%rip)      # 0xc590
movq 0x4b47(%rip), %rax      # 0xc548
movslq 0x4b58(%rip), %rcx      # 0xc560
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x4b7e(%rip)      # 0xc598
movl 0x4b40(%rip), %eax      # 0xc560
addl $0x1, %eax
movl %eax, 0x4b37(%rip)      # 0xc560
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq 0x4b06(%rip), %rcx      # 0xc540
movslq -0x10(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jg 0x7aa4
movq 0x4b46(%rip), %rax      # 0xc590
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq 0x4b3a(%rip), %rax      # 0xc598
movslq -0x14(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq 0x4b1e(%rip), %rax      # 0xc590
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq 0x4b0f(%rip), %rax      # 0xc598
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7a30
jmp 0x7aa6
jmp 0x7aa8
movl -0x8(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)