// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: EvolveSitesOnTree
void EvolveSitesOnTree (TreeNode *treeRoot, int genome, long int *seed)
    {
    int i = 0;
		
    if (rateVarAmongSites == YES)
        for (i=0; i<numSites; i++)
            allSites[i].rateMultiplier = RandomGamma (alphaSites, seed) / alphaSites;

	if (doGeneticSignatures == YES)
		{
		SimulateSignatureISM(treeRoot, genome, seed); /* we assume diploid ISM for genetic signatures */
		}
	else
		{
		if (propAltModelSites == 0)  /* only default model (ISM diploid) sites */
			{
			numDefaultModelSites = numSites;
			numAltModelSites = 0;
			for (i=0; i<numSites; i++)
				DefaultModelSites[i] = i;
			SimulateISM (treeRoot, genome, NO, seed);
			}
	   else if (propAltModelSites == 1.0)  /* only alternative model sites */
			{
			numDefaultModelSites = 0;
			numAltModelSites = numSites;
			for (i=0; i<numSites; i++)
				AltModelSites[i] = i;
			if (altModel == ISMhap)
				SimulateISM (treeRoot, genome, YES, seed);
			else if (altModel == Mk2)
				SimulateMk2 (treeRoot, genome, seed);
			else if (altModel == finiteDNA)
				SimulateFiniteDNA (treeRoot, genome, seed);
			else
				{
				fprintf (stderr, "\n\nERROR: Sorry, the specified model is unknown for me");
				exit(0);
				}
			  }
		else /* both ISM and non-ISM sites */
			{
			numDefaultModelSites = 0;
			numAltModelSites = 0;

			for (i=0; i<numSites; i++)
				{
				if (RandomUniform (seed) < propAltModelSites)
					AltModelSites[numAltModelSites++] = i;
				else
					DefaultModelSites[numDefaultModelSites++] = i;
				}
	 
			/* Evolve ISM sites */
			if (numDefaultModelSites > 0)
				SimulateISM (treeRoot, genome, NO, seed);
	 
			/* Evolve non-SIM sites */
			if (numAltModelSites > 0)
				{
				if (altModel == ISMhap)
					SimulateISM (treeRoot, genome, YES, seed);
				else if (altModel == Mk2)
					SimulateMk2 (treeRoot, genome, seed);
				else if (altModel == finiteDNA)
					SimulateFiniteDNA (treeRoot, genome, seed);
				else
					{
					fprintf (stderr, "\n\nERROR: Sorry, the specified model is unknown for me");
					exit(-1);
					}
				}
			}
		}
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x1, 0x3fa0f(%rip)     # 0x4e3a0
jne 0xe9e8
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x3f839(%rip), %eax     # 0x4e1dc
jge 0xe9e6
movsd 0x3f9fb(%rip), %xmm0    # 0x4e3a8
movq -0x18(%rbp), %rdi
callq 0x19ca0
divsd 0x3f9ea(%rip), %xmm0    # 0x4e3a8
movq 0x40de3(%rip), %rax     # 0x4f7a8
movslq -0x1c(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x80(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe99a
jmp 0xe9e8
cmpl $0x1, 0x3fa1d(%rip)     # 0x4e40c
jne 0xea06
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x1a760
jmp 0xec8f
movsd 0x3f822(%rip), %xmm0    # 0x4e230
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xea74
jp 0xea74
movl 0x3f7bd(%rip), %eax     # 0x4e1dc
movl %eax, 0x40fa3(%rip)     # 0x4f9c8
movl $0x0, 0x40f9d(%rip)     # 0x4f9cc
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x3f79d(%rip), %eax     # 0x4e1dc
jge 0xea5d
movl -0x1c(%rbp), %edx
movq 0x40d75(%rip), %rax     # 0x4f7c0
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xea36
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rcx
xorl %edx, %edx
callq 0x1aa90
jmp 0xec8d
movsd 0x3f7b4(%rip), %xmm0    # 0x4e230
movsd 0x3059c(%rip), %xmm1    # 0x3f020
ucomisd %xmm1, %xmm0
jne 0xeb56
jp 0xeb56
movl $0x0, 0x40f2a(%rip)     # 0x4f9c8
movl 0x3f738(%rip), %eax     # 0x4e1dc
movl %eax, 0x40f22(%rip)     # 0x4f9cc
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x3f722(%rip), %eax     # 0x4e1dc
jge 0xead8
movl -0x1c(%rbp), %edx
movq 0x40d02(%rip), %rax     # 0x4f7c8
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xeab1
cmpl $0x0, 0x3f749(%rip)     # 0x4e228
jne 0xeaf8
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rcx
movl $0x1, %edx
callq 0x1aa90
jmp 0xeb51
cmpl $0x1, 0x3f729(%rip)     # 0x4e228
jne 0xeb13
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x1aec0
jmp 0xeb4f
cmpl $0x2, 0x3f70e(%rip)     # 0x4e228
jne 0xeb2e
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x1af20
jmp 0xeb4d
movq 0x3f4c3(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x3251d(%rip), %rsi     # 0x4105c
movb $0x0, %al
callq 0x21b0
xorl %edi, %edi
callq 0x2290
jmp 0xeb4f
jmp 0xeb51
jmp 0xec8b
movl $0x0, 0x40e68(%rip)     # 0x4f9c8
movl $0x0, 0x40e62(%rip)     # 0x4f9cc
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x3f662(%rip), %eax     # 0x4e1dc
jge 0xebe7
movq -0x18(%rbp), %rdi
callq 0xa500
movaps %xmm0, %xmm1
movsd 0x3f6a0(%rip), %xmm0    # 0x4e230
ucomisd %xmm1, %xmm0
jbe 0xebb9
movl -0x1c(%rbp), %edx
movq 0x40c28(%rip), %rax     # 0x4f7c8
movl 0x40e26(%rip), %ecx     # 0x4f9cc
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x40e1b(%rip)     # 0x4f9cc
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xebda
movl -0x1c(%rbp), %edx
movq 0x40bfd(%rip), %rax     # 0x4f7c0
movl 0x40dff(%rip), %ecx     # 0x4f9c8
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x40df4(%rip)     # 0x4f9c8
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0xebdc
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xeb71
cmpl $0x0, 0x40dda(%rip)     # 0x4f9c8
jle 0xec02
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rcx
xorl %edx, %edx
callq 0x1aa90
cmpl $0x0, 0x40dc3(%rip)     # 0x4f9cc
jle 0xec89
cmpl $0x0, 0x3f616(%rip)     # 0x4e228
jne 0xec2b
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rcx
movl $0x1, %edx
callq 0x1aa90
jmp 0xec87
cmpl $0x1, 0x3f5f6(%rip)     # 0x4e228
jne 0xec46
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x1aec0
jmp 0xec85
cmpl $0x2, 0x3f5db(%rip)     # 0x4e228
jne 0xec61
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x1af20
jmp 0xec83
movq 0x3f390(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x323ea(%rip), %rsi     # 0x4105c
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
jmp 0xec85
jmp 0xec87
jmp 0xec89
jmp 0xec8b
jmp 0xec8d
jmp 0xec8f
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)