// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movl %esi, 0x4(%rsp)
movq %rdi, 0x8(%rsp)
cmpb $0x1, 0x2e452(%rip)     # 0x42360
jne 0x13f5d
cmpl $0x0, 0x2e291(%rip)     # 0x421a8
jle 0x13f5d
movl $0x80, %r14d
xorl %r15d, %r15d
movsd 0x2e43e(%rip), %xmm0    # 0x42368
movq %rbx, %rdi
callq 0x166ff
divsd 0x2e42e(%rip), %xmm0    # 0x42368
movq 0x2f67f(%rip), %rax     # 0x435c0
movsd %xmm0, (%rax,%r14)
incq %r15
movslq 0x2e257(%rip), %rax     # 0x421a8
addq $0x88, %r14
cmpq %rax, %r15
jl 0x13f22
cmpb $0x1, 0x2e468(%rip)     # 0x423cc
jne 0x140f4
movl $0x40, %edi
movl $0x10, %esi
callq 0x21a0
movq %rax, 0x2f700(%rip)     # 0x43680
testq %rax, %rax
je 0x147d3
xorl %r14d, %r14d
movq 0x2f6ed(%rip), %r15     # 0x43680
movq $0x64, (%r15,%r14)
movl $0x64, %edi
movl $0x4, %esi
callq 0x21a0
movq %rax, 0x8(%r15,%r14)
addq $0x10, %r14
cmpq $0x400, %r14            # imm = 0x400
jne 0x13f8c
movl $0x40, %edi
movl $0x10, %esi
callq 0x21a0
movq %rax, 0x2f6b6(%rip)     # 0x43688
testq %rax, %rax
je 0x147d8
xorl %r14d, %r14d
movq 0x2f6a3(%rip), %r15     # 0x43688
movq $0x64, (%r15,%r14)
movl $0x64, %edi
movl $0x4, %esi
callq 0x21a0
movq %rax, 0x8(%r15,%r14)
addq $0x10, %r14
cmpq $0x400, %r14            # imm = 0x400
jne 0x13fde
cmpl $0x0, 0x4(%rsp)
leaq 0x2f666(%rip), %rcx     # 0x43680
leaq 0x2f667(%rip), %rax     # 0x43688
cmoveq %rcx, %rax
movl 0x2e17d(%rip), %ecx     # 0x421a8
movq %rcx, 0x10(%rsp)
cmpl $0x3, %ecx
jl 0x140cb
movq 0x2f578(%rip), %rcx     # 0x435b8
movl 0x4(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
movslq 0x2f511(%rip), %rdx     # 0x43560
movq (%rcx,%rdx,8), %r15
movq (%rax), %r12
movq 0x10(%rsp), %rax
leal -0x2(%rax), %r13d
xorl %ebp, %ebp
movslq (%r15,%rbp,4), %rax
movslq 0x4(%r15,%rbp,4), %rcx
movslq 0x8(%r15,%rbp,4), %rdx
shlq $0x4, %rax
leaq (%rax,%rcx,4), %rax
addq %rdx, %rax
shlq $0x4, %rax
leaq (%r12,%rax), %r14
movslq (%r12,%rax), %rsi
cmpl %esi, 0x4(%r12,%rax)
jne 0x140ad
leal (%rsi,%rsi), %eax
movl %eax, (%r14)
movq 0x8(%r14), %rdi
shlq $0x3, %rsi
callq 0x2230
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x147ce
movq 0x8(%r14), %rax
movslq 0x4(%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r14)
movl %ebp, (%rax,%rcx,4)
leaq 0x1(%rbp), %rax
movq %rax, %rbp
cmpq %rax, %r13
jne 0x14061
cmpb $0x1, 0x2e2ae(%rip)     # 0x42380
jne 0x14161
movl 0x2f6ca(%rip), %ebp     # 0x437a8
cmpl $0x0, 0x4(%rsp)
je 0x14229
subl 0x2f479(%rip), %ebp     # 0x43568
jmp 0x14243
movsd 0x2e104(%rip), %xmm0    # 0x42200
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x141c0
jp 0x141c0
movslq 0x2e091(%rip), %rax     # 0x421a8
movl %eax, 0x2f683(%rip)     # 0x437a0
movl $0x0, 0x2f67d(%rip)     # 0x437a4
testq %rax, %rax
jle 0x14140
movq 0x2f4a5(%rip), %rcx     # 0x435d8
xorl %edx, %edx
movl %edx, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x14135
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
xorl %edx, %edx
movq %rbx, %rcx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16dfd
xorps %xmm0, %xmm0
cvtsi2sdl 0x10(%rsp), %xmm0
mulsd 0x2f42e(%rip), %xmm0    # 0x435a0
movsd %xmm0, 0x18(%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
movq %rbx, %rdi
callq 0x165c5
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movsd 0x10(%rsp), %xmm0
incl %ebp
movsd 0x1fe53(%rip), %xmm1    # 0x34008
ucomisd %xmm0, %xmm1
jae 0x14181
jmp 0x14243
ucomisd 0x1fe40(%rip), %xmm0    # 0x34008
movl $0x0, 0x2f5ce(%rip)     # 0x437a0
jne 0x1466b
jp 0x1466b
movslq 0x2dfc3(%rip), %rax     # 0x421a8
movl %eax, 0x2f5b9(%rip)     # 0x437a4
testq %rax, %rax
jle 0x14204
movq 0x2f3e9(%rip), %rcx     # 0x435e0
xorl %edx, %edx
movl %edx, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %rax
jne 0x141f9
movl 0x2dfee(%rip), %eax     # 0x421f8
cmpl $0x2, %eax
je 0x1479b
cmpl $0x1, %eax
je 0x1477c
testl %eax, %eax
je 0x14769
callq 0x507f
movsd 0x1fdef(%rip), %xmm0    # 0x34020
movl %ebp, %edi
movq %rbx, %rsi
callq 0x17391
movl %eax, %ebp
movl %eax, 0x2f325(%rip)     # 0x43568
movl 0x2f39f(%rip), %eax     # 0x435e8
addl %ebp, %eax
cmpl 0x2df57(%rip), %eax     # 0x421a8
jg 0x147dd
movl %eax, 0x2f38b(%rip)     # 0x435e8
testl %ebp, %ebp
jle 0x1465c
xorl %eax, %eax
movl %ebp, 0x18(%rsp)
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x4(%rsp)
leaq 0x2f40d(%rip), %rax     # 0x43688
leaq 0x2f3fe(%rip), %rcx     # 0x43680
cmoveq %rcx, %rax
movq (%rax), %r15
movq 0x2f458(%rip), %r12     # 0x436e8
movq %r12, %rdi
movq %rbx, %rsi
callq 0x16d83
movq 0x2f44e(%rip), %r13     # 0x436f0
cltq
movslq (%r13,%rax,4), %rax
leaq 0x2fec8(%rip), %rcx     # 0x44178
movq (%rcx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movq %rbx, %rsi
callq 0x16d83
cltq
imulq $0x2aaaaaab, %rax, %rdi # imm = 0x2AAAAAAB
movq %rdi, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rdi
addl %ecx, %edi
leal (,%rdi,8), %ecx
leal (%rcx,%rcx,2), %ecx
movl %eax, %r8d
subl %ecx, %r8d
negl %ecx
addl %ecx, %eax
addl $0x3, %eax
testl %r8d, %r8d
cmovnsl %r8d, %eax
movl %eax, %esi
sarl $0x2, %esi
xorl %r9d, %r9d
cmpl $0xc, %r8d
setge %r9b
andl $-0x4, %eax
subl %eax, %r8d
movq (%rbx), %rcx
movq %rcx, %rax
movabsq $0x41a705af1fe3fb79, %rdx # imm = 0x41A705AF1FE3FB79
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xf, %rdx
addq %rax, %rdx
imulq $0x1f31d, %rdx, %rax    # imm = 0x1F31D
subq %rax, %rcx
imulq $0x41a7, %rcx, %rax     # imm = 0x41A7
imulq $-0xb14, %rdx, %rcx     # imm = 0xF4EC
leaq (%rcx,%rax), %rdx
testq %rdx, %rdx
leaq 0x7fffffff(%rcx,%rax), %rcx
cmovgq %rdx, %rcx
leal 0x1(%r9,%r9), %eax
movq %rcx, (%rbx)
cvtsi2sd %rcx, %xmm0
divsd 0x1fcbd(%rip), %xmm0    # 0x34028
ucomisd 0x1fcad(%rip), %xmm0    # 0x34020
movslq %esi, %rcx
jbe 0x14385
leaq 0x20111(%rip), %rdx     # 0x34490
leaq (%rdx,%rcx,4), %rsi
jmp 0x143af
movslq %r8d, %rdx
movslq %edi, %rsi
leaq 0x27a6e(%rip), %rdi     # 0x3be00
movl (%rdi,%rdx,4), %edx
movl %eax, %eax
movl (%rdi,%rax,4), %eax
movl (%rdi,%rsi,4), %r8d
leaq 0x200eb(%rip), %rsi     # 0x34490
movslq (%rsi,%rcx,4), %rcx
leaq (%rdi,%rcx,4), %rsi
movl %edx, %edi
shll $0x4, %edi
leal (%r8,%rax,4), %eax
addl %edi, %eax
imull $0x64, 0x2dde9(%rip), %ecx # 0x421a8
movq %rcx, 0x20(%rsp)
leal 0x1(%rcx), %ebp
testl %ebp, %ebp
movl $0x0, %ecx
cmovlel %ecx, %ebp
incl %ebp
movslq %eax, %r14
shlq $0x4, %r14
movl 0x4(%r15,%r14), %edi
testl %edi, %edi
jne 0x14515
movq %r12, %rdi
movq %rbx, %rsi
callq 0x16d83
cltq
movslq (%r13,%rax,4), %rax
leaq 0x2fd78(%rip), %rcx     # 0x44178
movq (%rcx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movq %rbx, %rsi
callq 0x16d83
cltq
imulq $0x2aaaaaab, %rax, %rdi # imm = 0x2AAAAAAB
movq %rdi, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rdi
addl %ecx, %edi
leal (,%rdi,8), %ecx
leal (%rcx,%rcx,2), %ecx
movl %eax, %r8d
subl %ecx, %r8d
negl %ecx
addl %ecx, %eax
addl $0x3, %eax
testl %r8d, %r8d
cmovnsl %r8d, %eax
movl %eax, %esi
sarl $0x2, %esi
xorl %r9d, %r9d
cmpl $0xc, %r8d
setge %r9b
andl $-0x4, %eax
subl %eax, %r8d
movq (%rbx), %rcx
movq %rcx, %rax
movabsq $0x41a705af1fe3fb79, %rdx # imm = 0x41A705AF1FE3FB79
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xf, %rdx
addq %rax, %rdx
imulq $0x1f31d, %rdx, %rax    # imm = 0x1F31D
subq %rax, %rcx
imulq $0x41a7, %rcx, %rax     # imm = 0x41A7
imulq $-0xb14, %rdx, %rcx     # imm = 0xF4EC
leaq (%rcx,%rax), %rdx
testq %rdx, %rdx
leaq 0x7fffffff(%rcx,%rax), %rcx
cmovgq %rdx, %rcx
leal 0x1(%r9,%r9), %eax
movq %rcx, (%rbx)
cvtsi2sd %rcx, %xmm0
divsd 0x1fb6d(%rip), %xmm0    # 0x34028
ucomisd 0x1fb5d(%rip), %xmm0    # 0x34020
movslq %esi, %rcx
jbe 0x144d5
leaq 0x1ffc1(%rip), %rdx     # 0x34490
leaq (%rdx,%rcx,4), %rsi
jmp 0x144ff
movslq %r8d, %rdx
movslq %edi, %rsi
leaq 0x2791e(%rip), %rdi     # 0x3be00
movl (%rdi,%rdx,4), %edx
movl %eax, %eax
movl (%rdi,%rax,4), %eax
movl (%rdi,%rsi,4), %r8d
leaq 0x1ff9b(%rip), %rsi     # 0x34490
movslq (%rsi,%rcx,4), %rcx
leaq (%rdi,%rcx,4), %rsi
movl %edx, %edi
shll $0x4, %edi
leal (%r8,%rax,4), %eax
addl %edi, %eax
decl %ebp
jne 0x143d3
jmp 0x147ba
cmpl $0x1, %edi
jne 0x14521
movl (%rsi), %r12d
xorl %eax, %eax
jmp 0x1459a
jle 0x147c9
movq (%rbx), %rcx
movq %rcx, %rax
movabsq $0x41a705af1fe3fb79, %rdx # imm = 0x41A705AF1FE3FB79
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xf, %rdx
addq %rax, %rdx
imulq $0x1f31d, %rdx, %rax    # imm = 0x1F31D
subq %rax, %rcx
imulq $0x41a7, %rcx, %rax     # imm = 0x41A7
imulq $-0xb14, %rdx, %rcx     # imm = 0xF4EC
leaq (%rcx,%rax), %rdx
testq %rdx, %rdx
leaq 0x7fffffff(%rcx,%rax), %rax
cmovgq %rdx, %rax
movl (%rsi), %r12d
movq %rax, (%rbx)
cvtsi2sd %rax, %xmm1
divsd 0x1faa2(%rip), %xmm1    # 0x34028
xorps %xmm0, %xmm0
cvtsi2sd %edi, %xmm0
mulsd %xmm1, %xmm0
callq 0x2270
cvttsd2si %xmm0, %eax
addq %r14, %r15
movq 0x8(%r15), %rdi
cltq
movslq (%rdi,%rax,4), %r13
movl (%r15), %ecx
decl %ecx
cmpl %eax, %ecx
jle 0x145c9
movl 0x4(%rdi,%rax,4), %ecx
movl %ecx, (%rdi,%rax,4)
leaq 0x1(%rax), %rcx
movslq (%r15), %rdx
decq %rdx
movq %rcx, %rax
cmpq %rdx, %rcx
jl 0x145b0
movslq 0x4(%r15), %rax
leaq -0x1(%rax), %rsi
movl %esi, 0x4(%r15)
movl %esi, (%r15)
cmpq $0x2, %rax
jl 0x1460a
movl %esi, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
imull $0x64, %eax, %eax
movl %esi, %ecx
subl %eax, %ecx
jne 0x1460a
shlq $0x2, %rsi
callq 0x2230
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x147c4
movq 0x2efaf(%rip), %rax     # 0x435c0
movq %r13, %rcx
shlq $0x7, %rcx
leaq (%rcx,%r13,8), %rcx
cmpl $0x0, 0x94(%rax,%rcx)
je 0x14630
movl 0x18(%rsp), %ebp
movl 0x10(%rsp), %eax
jmp 0x14654
incl %r13d
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movl %r13d, %edx
movl %r12d, %ecx
movq %rbx, %r8
callq 0x17410
movl 0x10(%rsp), %eax
incl %eax
movl 0x18(%rsp), %ebp
cmpl %ebp, %eax
jl 0x1426b
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x0, 0x2f12f(%rip)     # 0x437a4
movl 0x2db2d(%rip), %esi     # 0x421a8
testl %esi, %esi
jle 0x1472c
movq 0x2ef4e(%rip), %rdi     # 0x435d8
movq 0x2ef4f(%rip), %r8      # 0x435e0
movq (%rbx), %rcx
xorl %r9d, %r9d
movabsq $0x41a705af1fe3fb79, %r10 # imm = 0x41A705AF1FE3FB79
movsd 0x1f97f(%rip), %xmm1    # 0x34028
leaq 0x2f0f4(%rip), %r11     # 0x437a4
leaq 0x2f0e9(%rip), %r14     # 0x437a0
movq %rcx, %rax
imulq %r10
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xf, %rdx
addq %rax, %rdx
imulq $0x1f31d, %rdx, %rax    # imm = 0x1F31D
subq %rax, %rcx
imulq $0x41a7, %rcx, %rax     # imm = 0x41A7
imulq $-0xb14, %rdx, %rcx     # imm = 0xF4EC
leaq (%rcx,%rax), %rdx
testq %rdx, %rdx
leaq 0x7fffffff(%rcx,%rax), %rcx
cmovgq %rdx, %rcx
xorps %xmm2, %xmm2
cvtsi2sd %rcx, %xmm2
divsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
movq %r14, %rax
cmovaq %r11, %rax
movq %rdi, %rdx
cmovaq %r8, %rdx
movslq (%rax), %r15
leal 0x1(%r15), %ebp
movl %ebp, (%rax)
movl %r9d, (%rdx,%r15,4)
incl %r9d
cmpl %r9d, %esi
jne 0x146b7
movq %rcx, (%rbx)
cmpl $0x0, 0x2f06d(%rip)     # 0x437a0
jle 0x14748
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x16dfd
cmpl $0x0, 0x2f055(%rip)     # 0x437a4
jle 0x1465c
movl 0x2da9d(%rip), %eax     # 0x421f8
cmpl $0x2, %eax
je 0x1479b
cmpl $0x1, %eax
je 0x1477c
testl %eax, %eax
jne 0x147e4
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movl $0x1, %edx
jmp 0x1414b
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movq %rbx, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1715a
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movq %rbx, %rdx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x171a7
movq 0x20(%rsp), %rdi
callq 0x50a3
callq 0x50eb
callq 0x50c6
callq 0x519c
callq 0x51e6
callq 0x51c1
movl %ebp, %edi
callq 0x5110
callq 0x505a