// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: SimulateMk2forSite
void SimulateMk2forSite (TreeNode *p, int genome, int site, long int *seed)
    {
    double	probOfChange, uniform, branchLength;
    int     cell, anccell;
		
    if (p != NULL)
		{
		if (p->isHealthyRoot == NO)
			{
			cell = p->label;
			anccell = p->anc->label;
			
			if (doUserTree == YES)
				branchLength = p->branchLength;
			else
				{
				if (rateVarAmongSites == YES)
					branchLength = altModelMutationRate * p->length * allSites[site].rateMultiplier;
				else
					branchLength = altModelMutationRate * p->length;
				}
	
			probOfChange = 0.5 - 0.5 * exp (-2.0 * branchLength);

			uniform = RandomUniform(seed);
			if (uniform >= probOfChange) /* => no change */
				data[genome][cell][site] = data[genome][anccell][site];
			else /* => there will be change */
				{
				if (data[genome][anccell][site] == 0)
					data[genome][cell][site] = 1;
				else
					data[genome][cell][site] = 0;
					
				if (genome == MATERNAL)
					allSites[site].numMutationsMaternal++;
				else if (genome == PATERNAL)
					allSites[site].numMutationsPaternal++;
				allSites[site].numMutations++;
				numMU++;
				}
			}
		SimulateMk2forSite (p->left,  genome, site, seed);
		SimulateMk2forSite (p->right, genome, site, seed);
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1c36f
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jne 0x1c342
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x38(%rbp)
cmpl $0x1, 0x32256(%rip)     # 0x4e3c4
jne 0x1c180
movq -0x8(%rbp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x1c1d6
cmpl $0x1, 0x32219(%rip)     # 0x4e3a0
jne 0x1c1be
movsd 0x32467(%rip), %xmm0    # 0x4e5f8
movq -0x8(%rbp), %rax
mulsd 0x30(%rax), %xmm0
movq 0x33607(%rip), %rax     # 0x4f7a8
movslq -0x10(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
mulsd 0x80(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x1c1d4
movsd 0x32432(%rip), %xmm0    # 0x4e5f8
movq -0x8(%rbp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0x1c1d6
movsd 0x22eca(%rip), %xmm0    # 0x3f0a8
mulsd -0x30(%rbp), %xmm0
callq 0x22b0
movsd 0x22eb0(%rip), %xmm1    # 0x3f0a0
mulsd %xmm1, %xmm0
movsd 0x22e14(%rip), %xmm1    # 0x3f010
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa500
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
ucomisd -0x20(%rbp), %xmm0
jb 0x1c260
movq 0x3357a(%rip), %rax     # 0x4f7a0
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x3355c(%rip), %rax     # 0x4f7a0
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x1c340
movq 0x33539(%rip), %rax     # 0x4f7a0
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x1c2a5
movq 0x33518(%rip), %rax     # 0x4f7a0
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x1c2c7
movq 0x334f4(%rip), %rax     # 0x4f7a0
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
cmpl $0x0, -0xc(%rbp)
jne 0x1c2ed
movq 0x334d4(%rip), %rax     # 0x4f7a8
movslq -0x10(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x1c313
cmpl $0x1, -0xc(%rbp)
jne 0x1c311
movq 0x334ae(%rip), %rax     # 0x4f7a8
movslq -0x10(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
jmp 0x1c313
movq 0x3348e(%rip), %rax     # 0x4f7a8
movslq -0x10(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movl 0x3342d(%rip), %eax     # 0x4f764
addl $0x1, %eax
movl %eax, 0x33424(%rip)     # 0x4f764
jmp 0x1c342
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rcx
callq 0x1c120
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rcx
callq 0x1c120
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)