// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: SimulateFiniteDNAforSite
void SimulateFiniteDNAforSite (TreeNode *p, int genome, int site, long int *seed)
	{
    double	branchLength, Pij[4][4];
    int     cell, anccell, ancstate, newstate;
		
    if (p != NULL)
        {
		if (p->isHealthyRoot == NO)
			{
			cell = p->label;
			anccell = p->anc->label;
			ancstate = data[genome][anccell][site];
	
			if (doUserTree == YES)
				branchLength = p->branchLength;
			else
				{
				if (rateVarAmongSites == YES)
					branchLength = altModelMutationRate * p->length * allSites[site].rateMultiplier;
				else
					branchLength = altModelMutationRate * p->length;
				}
				
			FillSubstitutionMatrix (Pij, branchLength);
			newstate = data[genome][cell][site] = ChooseUniformState (Pij[ancstate], seed);
			
			if (newstate != ancstate)
				{
				if (genome == MATERNAL)
					allSites[site].numMutationsMaternal++;
				else if (genome == PATERNAL)
					allSites[site].numMutationsPaternal++;
				allSites[site].numMutations++;
				numMU++;
				}
			}
		SimulateFiniteDNAforSite (p->left,  genome, site, seed);
        SimulateFiniteDNAforSite (p->right, genome, site, seed);
        }
 	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1c572
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jne 0x1c545
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0xa4(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x1c(%rax), %eax
movl %eax, -0xa8(%rbp)
movq 0x333c9(%rip), %rax     # 0x4f7a0
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0xa8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x10(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xac(%rbp)
cmpl $0x1, 0x31fc6(%rip)     # 0x4e3c4
jne 0x1c410
movq -0x8(%rbp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x1c466
cmpl $0x1, 0x31f89(%rip)     # 0x4e3a0
jne 0x1c44e
movsd 0x321d7(%rip), %xmm0    # 0x4e5f8
movq -0x8(%rbp), %rax
mulsd 0x30(%rax), %xmm0
movq 0x33377(%rip), %rax     # 0x4f7a8
movslq -0x10(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
mulsd 0x80(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x1c464
movsd 0x321a2(%rip), %xmm0    # 0x4e5f8
movq -0x8(%rbp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x1c466
leaq -0xa0(%rbp), %rdi
movsd -0x20(%rbp), %xmm0
callq 0x1c580
movslq -0xac(%rbp), %rax
leaq -0xa0(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x1a6f0
movq 0x33304(%rip), %rcx     # 0x4f7a0
movslq -0xc(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0xa4(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x10(%rbp), %rdx
movl %eax, (%rcx,%rdx,4)
movl %eax, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
cmpl -0xac(%rbp), %eax
je 0x1c543
cmpl $0x0, -0xc(%rbp)
jne 0x1c4f0
movq 0x332d1(%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 0x1c516
cmpl $0x1, -0xc(%rbp)
jne 0x1c514
movq 0x332ab(%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 0x1c516
movq 0x3328b(%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 0x3322a(%rip), %eax     # 0x4f764
addl $0x1, %eax
movl %eax, 0x33221(%rip)     # 0x4f764
jmp 0x1c545
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rcx
callq 0x1c380
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rcx
callq 0x1c380
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)