// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movq %rdx, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq %rdi, %r13
cmpb $0x1, 0x1f50d(%rip)     # 0x30360
jne 0x10e9b
movl $0x80, %ebx
xorl %r14d, %r14d
movslq 0x1f344(%rip), %rax     # 0x301a8
cmpq %rax, %r14
jge 0x10e9b
movsd 0x1f4f7(%rip), %xmm0    # 0x30368
movq 0x10(%rsp), %rdi
callq 0x133bd
divsd 0x1f4e5(%rip), %xmm0    # 0x30368
movq 0x20736(%rip), %rax     # 0x315c0
movsd %xmm0, (%rax,%rbx)
incq %r14
addq $0x88, %rbx
jmp 0x10e5d
cmpb $0x1, 0x1f52a(%rip)     # 0x303cc
jne 0x10ef7
pushq $0x40
popq %rdi
pushq $0x10
popq %rsi
callq 0x21a0
movq %rax, 0x207ca(%rip)     # 0x31680
testq %rax, %rax
je 0x1158c
xorl %ebx, %ebx
pushq $0x64
popq %r14
pushq $0x4
popq %r15
cmpq $0x400, %rbx            # imm = 0x400
je 0x10f45
movq 0x207a7(%rip), %r12     # 0x31680
movq $0x64, (%r12,%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x21a0
movq %rax, 0x8(%r12,%rbx)
addq $0x10, %rbx
jmp 0x10ec9
movsd 0x1f301(%rip), %xmm0    # 0x30200
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x110bf
jp 0x110bf
movl 0x1f28f(%rip), %eax     # 0x301a8
movl %eax, 0x20881(%rip)     # 0x317a0
andl $0x0, 0x2087e(%rip)     # 0x317a4
movq 0x206ab(%rip), %rcx     # 0x315d8
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
cmpq %rdx, %rax
je 0x1107b
movl %edx, (%rcx,%rdx,4)
incq %rdx
jmp 0x10f34
pushq $0x40
popq %rdi
pushq $0x10
popq %rsi
callq 0x21a0
movq %rax, 0x20731(%rip)     # 0x31688
testq %rax, %rax
je 0x1159f
xorl %ebx, %ebx
pushq $0x64
popq %r14
pushq $0x4
popq %r15
cmpq $0x400, %rbx            # imm = 0x400
je 0x10f98
movq 0x2070e(%rip), %r12     # 0x31688
movq $0x64, (%r12,%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x21a0
movq %rax, 0x8(%r12,%rbx)
addq $0x10, %rbx
jmp 0x10f6a
movq %r13, 0x18(%rsp)
movq 0x20614(%rip), %rax     # 0x315b8
movl 0xc(%rsp), %edx
movl %edx, %ecx
movq (%rax,%rcx,8), %rax
movslq 0x205ab(%rip), %rcx     # 0x31560
movq (%rax,%rcx,8), %r14
testl %edx, %edx
leaq 0x206be(%rip), %rcx     # 0x31680
leaq 0x206bf(%rip), %rax     # 0x31688
cmoveq %rcx, %rax
movq (%rax), %r15
movl 0x1f1d2(%rip), %ebx     # 0x301a8
cmpl $0x3, %ebx
pushq $0x2
popq %r12
cmovgel %ebx, %r12d
addl $-0x2, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x11056
movslq (%r14,%r13,4), %rax
movslq 0x4(%r14,%r13,4), %rcx
movslq 0x8(%r14,%r13,4), %rdx
shlq $0x4, %rax
leaq (%rax,%rcx,4), %rax
addq %rdx, %rax
shlq $0x4, %rax
leaq (%r15,%rax), %rbp
movl 0x4(%r15,%rax), %ecx
cmpl (%r15,%rax), %ecx
jne 0x11040
movslq %ecx, %rsi
addl %ecx, %ecx
movl %ecx, (%rbp)
movq 0x8(%rbp), %rdi
shlq $0x3, %rsi
callq 0x2230
movq %rax, 0x8(%rbp)
testq %rax, %rax
je 0x11544
movl 0x4(%rbp), %ecx
jmp 0x11044
movq 0x8(%rbp), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rbp)
movslq %ecx, %rcx
movl %r13d, (%rax,%rcx,4)
incq %r13
jmp 0x10fe8
cmpb $0x1, 0x1f323(%rip)     # 0x30380
jne 0x1109c
movl 0x20743(%rip), %ebp     # 0x317a8
cmpl $0x0, 0xc(%rsp)
je 0x1112c
subl 0x204f2(%rip), %ebp     # 0x31568
jmp 0x11148
movq %r13, %rdi
movl 0xc(%rsp), %esi
xorl %edx, %edx
movq 0x10(%rsp), %rcx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13901
cvtsi2sd %ebx, %xmm0
mulsd 0x204f8(%rip), %xmm0    # 0x315a0
movq 0x10(%rsp), %rdi
callq 0x13e90
movl %eax, %ebp
movl 0x1f0ee(%rip), %ebx     # 0x301a8
jmp 0x11148
andl $0x0, 0x206da(%rip)     # 0x317a0
ucomisd 0xdfe2(%rip), %xmm0     # 0x1f0b0
jne 0x1140f
jp 0x1140f
movl 0x1f0c8(%rip), %eax     # 0x301a8
movl %eax, 0x206be(%rip)     # 0x317a4
movq 0x204f3(%rip), %rcx     # 0x315e0
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
cmpq %rdx, %rax
je 0x11101
movl %edx, (%rcx,%rdx,4)
incq %rdx
jmp 0x110f4
movl 0x1f0f1(%rip), %eax     # 0x301f8
cmpl $0x2, %eax
je 0x114f9
cmpl $0x1, %eax
je 0x114da
testl %eax, %eax
jne 0x11632
pushq $0x1
popq %rdx
movq %r13, %rdi
jmp 0x114c2
movsd 0xdf94(%rip), %xmm0     # 0x1f0c8
movl %ebp, %edi
movq 0x10(%rsp), %rsi
callq 0x13e47
movl %eax, %ebp
movl %eax, 0x20420(%rip)     # 0x31568
movl 0x2049a(%rip), %eax     # 0x315e8
addl %ebp, %eax
cmpl %ebx, %eax
jg 0x115b4
movl %eax, 0x2048a(%rip)     # 0x315e8
movl $0x0, 0x20(%rsp)
movl %ebp, 0x24(%rsp)
cmpl %ebp, 0x20(%rsp)
jge 0x114cb
cmpl $0x0, 0xc(%rsp)
leaq 0x20508(%rip), %rax     # 0x31688
leaq 0x204f9(%rip), %rcx     # 0x31680
cmoveq %rcx, %rax
movq (%rax), %r15
movq 0x20553(%rip), %rdi     # 0x316e8
movq %rdi, 0x40(%rsp)
movq 0x10(%rsp), %r12
movq %r12, %rsi
callq 0x138c8
movq 0x20542(%rip), %rcx     # 0x316f0
cltq
movq %rcx, 0x38(%rsp)
movslq (%rcx,%rax,4), %rax
leaq 0x20fb8(%rip), %rcx     # 0x32178
movq (%rcx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movq %r12, %rsi
callq 0x138c8
cltd
pushq $0x18
popq %rcx
idivl %ecx
movl %eax, %ebp
movsbl %dl, %eax
movb $0x4, %cl
idivb %cl
movl %eax, %r14d
movsbl %ah, %eax
movl %eax, %r13d
xorl %eax, %eax
cmpl $0xc, %edx
setge %al
leal 0x1(,%rax,2), %ebx
movq %r12, %rdi
callq 0x10279
ucomisd 0xdec1(%rip), %xmm0     # 0x1f0c8
movsbq %r14b, %rax
jbe 0x1121e
movsbl %r13b, %ecx
leaq 0xe2e8(%rip), %rdx      # 0x1f500
leaq (%rdx,%rax,4), %rax
jmp 0x11246
movsbq %r13b, %rcx
movslq %ebp, %rdx
leaq 0x15bf4(%rip), %rsi     # 0x26e20
movl (%rsi,%rcx,4), %ebp
movl %ebx, %ecx
movl (%rsi,%rcx,4), %ebx
movl (%rsi,%rdx,4), %ecx
leaq 0xe2c2(%rip), %rdx      # 0x1f500
movslq (%rdx,%rax,4), %rax
leaq (%rsi,%rax,4), %rax
shll $0x4, %ebp
leal (%rcx,%rbx,4), %ecx
addl %ebp, %ecx
imull $0x64, 0x1ef53(%rip), %edx # 0x301a8
movq %rdx, 0x28(%rsp)
leal 0x1(%rdx), %ebx
testl %ebx, %ebx
movl $0x0, %edx
cmovlel %edx, %ebx
incl %ebx
movq %r15, 0x30(%rsp)
movslq %ecx, %r14
shlq $0x4, %r14
movl 0x4(%r15,%r14), %edi
testl %edi, %edi
jne 0x1134d
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %r13
movq %r13, %rsi
callq 0x138c8
cltq
movq 0x38(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
leaq 0x20ed2(%rip), %rcx     # 0x32178
movq (%rcx), %rcx
movq -0x8(%rcx,%rax,8), %rdi
movq %r13, %rsi
callq 0x138c8
cltd
pushq $0x18
popq %rcx
idivl %ecx
movl %eax, %r14d
movsbl %dl, %eax
movb $0x4, %cl
idivb %cl
movl %eax, %ebp
movsbl %ah, %eax
movl %eax, %r15d
xorl %eax, %eax
cmpl $0xc, %edx
setge %al
leal 0x1(,%rax,2), %r12d
movq %r13, %rdi
callq 0x10279
ucomisd 0xddda(%rip), %xmm0     # 0x1f0c8
movsbq %bpl, %rax
jbe 0x11305
movsbl %r15b, %ecx
leaq 0xe201(%rip), %rdx      # 0x1f500
leaq (%rdx,%rax,4), %rax
jmp 0x11330
movsbq %r15b, %rcx
movslq %r14d, %rdx
leaq 0x15b0d(%rip), %rsi     # 0x26e20
movl (%rsi,%rcx,4), %r14d
movl %r12d, %ecx
movl (%rsi,%rcx,4), %r12d
movl (%rsi,%rdx,4), %ecx
leaq 0xe1d8(%rip), %rdx      # 0x1f500
movslq (%rdx,%rax,4), %rax
leaq (%rsi,%rax,4), %rax
shll $0x4, %r14d
leal (%rcx,%r12,4), %ecx
addl %r14d, %ecx
decl %ebx
movq 0x30(%rsp), %r15
jne 0x1126e
jmp 0x1151f
cmpl $0x1, %edi
jne 0x11359
movl (%rax), %r12d
xorl %eax, %eax
jmp 0x1136e
jle 0x11559
movl (%rax), %r12d
movq 0x10(%rsp), %rsi
callq 0x14020
cltq
addq %r14, %r15
movq 0x8(%r15), %rdi
movslq (%rdi,%rax,4), %r13
movslq (%r15), %rcx
decq %rcx
cmpq %rcx, %rax
jge 0x11390
movl 0x4(%rdi,%rax,4), %ecx
movl %ecx, (%rdi,%rax,4)
incq %rax
jmp 0x11379
movl 0x4(%r15), %esi
leal -0x1(%rsi), %ecx
movl %ecx, 0x4(%r15)
movl %ecx, (%r15)
movl %ecx, %eax
xorl %edx, %edx
pushq $0x64
popq %r8
divl %r8d
cmpl $0x2, %esi
jl 0x113ca
testl %edx, %edx
jne 0x113ca
movl %ecx, %esi
shlq $0x2, %rsi
callq 0x2230
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x1156e
movq 0x201ef(%rip), %rax     # 0x315c0
imulq $0x88, %r13, %rcx
cmpl $0x0, 0x94(%rcx,%rax)
movl 0x24(%rsp), %ebp
jne 0x1116a
incl %r13d
movq 0x18(%rsp), %rdi
movl 0xc(%rsp), %esi
movl %r13d, %edx
movl %r12d, %ecx
movq 0x10(%rsp), %r8
callq 0x13eeb
incl 0x20(%rsp)
jmp 0x1116a
movq %r13, 0x18(%rsp)
andl $0x0, 0x20389(%rip)     # 0x317a4
movl 0x1ed87(%rip), %ebx     # 0x301a8
xorl %ebp, %ebp
testl %ebx, %ebx
cmovlel %ebp, %ebx
movq 0x201b1(%rip), %r14     # 0x315e0
movq 0x201a2(%rip), %r15     # 0x315d8
leaq 0x20367(%rip), %r12     # 0x317a4
leaq 0x2035c(%rip), %r13     # 0x317a0
cmpl %ebp, %ebx
je 0x1147b
movq 0x10(%rsp), %rdi
callq 0x10279
movsd 0x1eda6(%rip), %xmm1    # 0x30200
ucomisd %xmm0, %xmm1
movq %r12, %rax
movq %r14, %rcx
ja 0x1146c
movq %r13, %rax
movq %r15, %rcx
movslq (%rax), %rdx
leal 0x1(%rdx), %esi
movl %esi, (%rax)
movl %ebp, (%rcx,%rdx,4)
incl %ebp
jmp 0x11444
cmpl $0x0, 0x2031e(%rip)     # 0x317a0
jle 0x11499
movq 0x18(%rsp), %rdi
movl 0xc(%rsp), %esi
xorl %edx, %edx
movq 0x10(%rsp), %rcx
callq 0x13901
cmpl $0x0, 0x20304(%rip)     # 0x317a4
jle 0x114cb
movl 0x1ed50(%rip), %eax     # 0x301f8
cmpl $0x2, %eax
je 0x114fe
cmpl $0x1, %eax
movq 0x18(%rsp), %rdi
je 0x114dd
testl %eax, %eax
jne 0x11655
pushq $0x1
popq %rdx
movl 0xc(%rsp), %esi
jmp 0x11084
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13c2f
movq %r13, %rdi
jmp 0x11503
movq 0x18(%rsp), %rdi
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13c75
movq 0x1ead2(%rip), %rax     # 0x2fff8
movq (%rax), %rdi
leaq 0xff1f(%rip), %rsi      # 0x2144f
movq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x21c0
pushq $-0x1
popq %rdi
callq 0x22a0
movq 0x1eaad(%rip), %rax     # 0x2fff8
movq (%rax), %rcx
leaq 0xfebb(%rip), %rdi      # 0x21410
pushq $0x3e
jmp 0x11581
movq 0x1ea98(%rip), %rax     # 0x2fff8
movq (%rax), %rcx
leaq 0xff4f(%rip), %rdi      # 0x214b9
pushq $0x31
jmp 0x11581
movq 0x1ea83(%rip), %rax     # 0x2fff8
movq (%rax), %rcx
leaq 0xff6c(%rip), %rdi      # 0x214eb
pushq $0x40
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
jmp 0x1153c
movq 0x1ea65(%rip), %rax     # 0x2fff8
movq (%rax), %rcx
leaq 0xfc78(%rip), %rdi      # 0x21215
jmp 0x115b0
movq 0x1ea52(%rip), %rax     # 0x2fff8
movq (%rax), %rcx
leaq 0xfc9a(%rip), %rdi      # 0x2124a
pushq $0x34
jmp 0x11581
movq 0x1ea3d(%rip), %r14     # 0x2fff8
movq (%r14), %rcx
leaq 0xfcba(%rip), %rdi      # 0x2127f
pushq $0x50
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x22b0
movq (%r14), %rdi
movl 0x2000c(%rip), %edx     # 0x315e8
movl 0x201bd(%rip), %r8d     # 0x317a0
leaq 0xfce6(%rip), %rsi      # 0x212d0
movl %ebp, %ecx
xorl %eax, %eax
callq 0x21c0
movq (%r14), %rcx
leaq 0xfd2c(%rip), %rdi      # 0x21329
pushq $0x3f
popq %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%r14), %rcx
leaq 0xfd57(%rip), %rdi      # 0x21369
pushq $0x3a
popq %rsi
movq %rbx, %rdx
callq 0x22b0
movq (%r14), %rcx
leaq 0xfd7d(%rip), %rdi      # 0x213a4
pushq $0x6b
popq %rsi
movq %rbx, %rdx
jmp 0x11585
movq 0x1e9bf(%rip), %rax     # 0x2fff8
movq (%rax), %rcx
leaq 0xfb9c(%rip), %rdi      # 0x211df
pushq $0x35
popq %rsi
pushq $0x1
popq %rdx
callq 0x22b0
xorl %edi, %edi
callq 0x22a0
movq 0x1e99c(%rip), %rax     # 0x2fff8
movq (%rax), %rcx
leaq 0xfb79(%rip), %rdi      # 0x211df
pushq $0x35
jmp 0x11581