// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: CountAllelesInObservedGenotypes
int CountAllelesInObservedGenotypes (void)
	{
	int		numAltAlleles, cell, site;
	int		countA, countC, countG, countT, countADO, countDEL, nSNVs;
	
	nSNVs = 0;
	
	for (site=0; site<numSites; site++)
		{
		countA = countC = countG = countT = countADO = countDEL = 0;
		for (cell=0; cell<numCells+1; cell++)
			{
			if (data[MATERNAL][cell][site] == A)
				countA++;
			else if (data[MATERNAL][cell][site] == C)
				countC++;
			else if (data[MATERNAL][cell][site] == G)
				countG++;
			else if (data[MATERNAL][cell][site] == T)
				countT++;
			else if (data[MATERNAL][cell][site] == ADO)
				countADO++;
			else if (data[MATERNAL][cell][site] == DELETION)
				countDEL++;

			if (data[PATERNAL][cell][site] == A)
				countA++;
			else if (data[PATERNAL][cell][site] == C)
				countC++;
			else if (data[PATERNAL][cell][site] == G)
				countG++;
			else if (data[PATERNAL][cell][site] == T)
				countT++;
			else if (data[PATERNAL][cell][site] == ADO)
				countADO++;
			else if (data[PATERNAL][cell][site] == DELETION)
				countDEL++;
			}

		allSites[site].countA = countA;
		allSites[site].countC = countC;
		allSites[site].countG = countG;
		allSites[site].countT = countT;
		allSites[site].countACGT = countA + countC + countG + countT;
		allSites[site].countDropped = countADO + countDEL;

		/* count number of alternate alleles, ignoring ADO or DELETION */
		numAltAlleles = 0;
		if (countA > 0 && allSites[site].referenceAllele != A)
			allSites[site].alternateAlleles[numAltAlleles++] = A;
		if (countC > 0 && allSites[site].referenceAllele != C)
			allSites[site].alternateAlleles[numAltAlleles++] = C;
		if (countG > 0 && allSites[site].referenceAllele != G)
			allSites[site].alternateAlleles[numAltAlleles++] = G;
		if (countT > 0 && allSites[site].referenceAllele != T)
			allSites[site].alternateAlleles[numAltAlleles++] = T;
		allSites[site].numAltAlleles = numAltAlleles;
		
		/* find out whether this site is a SNV */
		if (numAltAlleles > 0)
			{
			allSites[site].isSNV = YES;
			SNVsites[nSNVs++] = site;
			}
		}
	return nSNVs;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x0, -0x28(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x3c981(%rip), %eax     # 0x4e1dc
jge 0x11d04
movl $0x0, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl 0x3c939(%rip), %ecx     # 0x4e1d4
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x11aac
movq 0x3def3(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x118d0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1199e
movq 0x3dec9(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x118fa
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1199c
movq 0x3de9f(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x11921
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1199a
movq 0x3de78(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x3, (%rax,%rcx,4)
jne 0x11948
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x11998
movq 0x3de51(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x9, (%rax,%rcx,4)
jne 0x1196f
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x11996
movq 0x3de2a(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x7, (%rax,%rcx,4)
jne 0x11994
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x11996
jmp 0x11998
jmp 0x1199a
jmp 0x1199c
jmp 0x1199e
movq 0x3ddfb(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x119c9
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x11a9c
movq 0x3ddd0(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x119f4
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x11a9a
movq 0x3dda5(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x11a1c
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x11a98
movq 0x3dd7d(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x3, (%rax,%rcx,4)
jne 0x11a44
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x11a96
movq 0x3dd55(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x9, (%rax,%rcx,4)
jne 0x11a6c
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x11a94
movq 0x3dd2d(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x7, (%rax,%rcx,4)
jne 0x11a92
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x11a94
jmp 0x11a96
jmp 0x11a98
jmp 0x11a9a
jmp 0x11a9c
jmp 0x11a9e
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x11892
movl -0x10(%rbp), %ecx
movq 0x3dcf2(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x38(%rax)
movl -0x14(%rbp), %ecx
movq 0x3dcd7(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x3c(%rax)
movl -0x18(%rbp), %ecx
movq 0x3dcbc(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x40(%rax)
movl -0x1c(%rbp), %ecx
movq 0x3dca1(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x44(%rax)
movl -0x10(%rbp), %ecx
addl -0x14(%rbp), %ecx
addl -0x18(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movq 0x3dc7d(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4c(%rax)
movl -0x20(%rbp), %ecx
addl -0x24(%rbp), %ecx
movq 0x3dc5f(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x68(%rax)
movl $0x0, -0x4(%rbp)
cmpl $0x0, -0x10(%rbp)
jle 0x11bb0
movq 0x3dc3a(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x6c(%rax)
je 0x11bb0
movq 0x3dc1f(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x70(%rax), %rax
movl -0x4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4(%rbp)
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
cmpl $0x0, -0x14(%rbp)
jle 0x11bff
movq 0x3dbeb(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
cmpl $0x1, 0x6c(%rax)
je 0x11bff
movq 0x3dbd0(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x70(%rax), %rax
movl -0x4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4(%rbp)
movslq %ecx, %rcx
movl $0x1, (%rax,%rcx,4)
cmpl $0x0, -0x18(%rbp)
jle 0x11c4e
movq 0x3db9c(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
cmpl $0x2, 0x6c(%rax)
je 0x11c4e
movq 0x3db81(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x70(%rax), %rax
movl -0x4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4(%rbp)
movslq %ecx, %rcx
movl $0x2, (%rax,%rcx,4)
cmpl $0x0, -0x1c(%rbp)
jle 0x11c9d
movq 0x3db4d(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
cmpl $0x3, 0x6c(%rax)
je 0x11c9d
movq 0x3db32(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movq 0x70(%rax), %rax
movl -0x4(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x4(%rbp)
movslq %ecx, %rcx
movl $0x3, (%rax,%rcx,4)
movl -0x4(%rbp), %ecx
movq 0x3db01(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x78(%rax)
cmpl $0x0, -0x4(%rbp)
jle 0x11cf4
movq 0x3dae3(%rip), %rax     # 0x4f7a8
movslq -0xc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl $0x1, (%rax)
movl -0xc(%rbp), %edx
movq 0x3dacd(%rip), %rax     # 0x4f7b0
movl -0x28(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x28(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x11cf6
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x11852
movl -0x28(%rbp), %eax
popq %rbp
retq
nopl (%rax)