// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: GenotypeError
void GenotypeError (long int *seed)
	{
	int 	i,j;
	double	genotypingError, alleleError;
	
	
	if (alphabet == DNA)
		{
		for (i=0; i<numCells+1; i++)
			{
			for (j=0; j<numSites; j++)
				{
				genotypingError = RandomBetaMeanVar(meanGenotypingError, varGenotypingError, seed);
				alleleError = 1.0 - sqrt (1.0 -  genotypingError);

				if (data[MATERNAL][i][j] != ADO && data[MATERNAL][i][j] != DELETION && RandomUniform(seed) < alleleError)
					{
					data[MATERNAL][i][j] = ChooseUniformState (Eij[data[MATERNAL][i][j]], seed);
					allSites[j].hasGenotypeError = YES;
					}
				if (data[PATERNAL][i][j] != ADO && data[PATERNAL][i][j] != DELETION && RandomUniform(seed) < alleleError)
					{
					data[PATERNAL][i][j] = ChooseUniformState (Eij[data[PATERNAL][i][j]], seed);
					allSites[j].hasGenotypeError = YES;
					}
				}
			}
		}
	else  /* for binary data */
		{
		for (i=0; i<numCells+1; i++)
			{
			for (j=0; j<numSites; j++)
				{
				genotypingError = RandomBetaMeanVar(meanGenotypingError, varGenotypingError, seed);
				alleleError = 1.0 - sqrt (1.0 -  genotypingError);
				if (data[MATERNAL][i][j] != ADO && data[MATERNAL][i][j] != DELETION && RandomUniform(seed) < alleleError)
					{
					if (data[MATERNAL][i][j] == 0)
						data[MATERNAL][i][j] = 1;
					else if (data[MATERNAL][i][j] == 1)
						data[MATERNAL][i][j] = 0;
					allSites[j].hasGenotypeError = YES;
					}
				if (data[PATERNAL][i][j] != ADO && data[PATERNAL][i][j] != DELETION && RandomUniform(seed) < alleleError)
					{
					if (data[PATERNAL][i][j] == 0)
						data[PATERNAL][i][j] = 1;
					else if (data[PATERNAL][i][j] == 1)
						data[PATERNAL][i][j] = 0;
					allSites[j].hasGenotypeError = YES;
					}
				}
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x1, 0x3dc81(%rip)     # 0x4e224
jne 0x107c1
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl 0x3dc1b(%rip), %ecx     # 0x4e1d4
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x107bc
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x3dc08(%rip), %eax     # 0x4e1dc
jge 0x107ac
movsd 0x3de9e(%rip), %xmm0    # 0x4e480
movsd 0x3de9e(%rip), %xmm1    # 0x4e488
movq -0x8(%rbp), %rdi
callq 0x1d1e0
movsd %xmm0, -0x18(%rbp)
movsd 0x2ea20(%rip), %xmm0    # 0x3f020
subsd -0x18(%rbp), %xmm0
callq 0x22a0
movaps %xmm0, %xmm1
movsd 0x2ea0b(%rip), %xmm0    # 0x3f020
subsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movq 0x3f17b(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x9, (%rax,%rcx,4)
je 0x106d9
movq 0x3f15b(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x7, (%rax,%rcx,4)
je 0x106d9
movq -0x8(%rbp), %rdi
callq 0xa500
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x106d9
movq 0x3f128(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
leaq 0x3dc7e(%rip), %rdi     # 0x4e310
shlq $0x5, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x1a6f0
movl %eax, %edx
movq 0x3f0f5(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x3f0e4(%rip), %rax     # 0x4f7a8
movslq -0x10(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x34(%rax)
movq 0x3f0c0(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x9, (%rax,%rcx,4)
je 0x1079c
movq 0x3f09f(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x7, (%rax,%rcx,4)
je 0x1079c
movq -0x8(%rbp), %rdi
callq 0xa500
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1079c
movq 0x3f067(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
leaq 0x3dbbc(%rip), %rdi     # 0x4e310
shlq $0x5, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x1a6f0
movl %eax, %edx
movq 0x3f033(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x3f021(%rip), %rax     # 0x4f7a8
movslq -0x10(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x34(%rax)
jmp 0x1079e
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x105cb
jmp 0x107ae
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x105b0
jmp 0x10a38
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl 0x3da03(%rip), %ecx     # 0x4e1d4
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x10a36
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl 0x3d9f0(%rip), %eax     # 0x4e1dc
jge 0x10a26
movsd 0x3dc86(%rip), %xmm0    # 0x4e480
movsd 0x3dc86(%rip), %xmm1    # 0x4e488
movq -0x8(%rbp), %rdi
callq 0x1d1e0
movsd %xmm0, -0x18(%rbp)
movsd 0x2e808(%rip), %xmm0    # 0x3f020
subsd -0x18(%rbp), %xmm0
callq 0x22a0
movaps %xmm0, %xmm1
movsd 0x2e7f3(%rip), %xmm0    # 0x3f020
subsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movq 0x3ef63(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x9, (%rax,%rcx,4)
je 0x10923
movq 0x3ef43(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x7, (%rax,%rcx,4)
je 0x10923
movq -0x8(%rbp), %rdi
callq 0xa500
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x10923
movq 0x3ef08(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x108cc
movq 0x3eeec(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x10907
movq 0x3eecd(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x10905
movq 0x3eeb1(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x10907
movq 0x3ee9a(%rip), %rax     # 0x4f7a8
movslq -0x10(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x34(%rax)
movq 0x3ee76(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x9, (%rax,%rcx,4)
je 0x10a16
movq 0x3ee55(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x7, (%rax,%rcx,4)
je 0x10a16
movq -0x8(%rbp), %rdi
callq 0xa500
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x10a16
movq 0x3ee19(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x109bd
movq 0x3edfc(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x109fa
movq 0x3eddc(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x109f8
movq 0x3edbf(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x109fa
movq 0x3eda7(%rip), %rax     # 0x4f7a8
movslq -0x10(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x34(%rax)
jmp 0x10a18
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x107e3
jmp 0x10a28
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x107c8
jmp 0x10a38
addq $0x20, %rsp
popq %rbp
retq
nop