// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: SimulateFiniteDNA
void SimulateFiniteDNA (TreeNode *p, int genome, long int *seed)
    {
    int     i, j;
		
	if (doJC == YES)
		{
		beta = 4./3;
		}
	else if (doHKY == YES)
        {
		freqR = freq[A] + freq[G];
		freqY = freq[C] + freq[T];
		freqAG = freq[A] * freq[G];
		freqCT = freq[C] * freq[T];
		kappa = (titv*freqR*freqY)/(freqAG+freqCT);
		beta = 0.5 / (freqR*freqY + kappa*(freqAG+freqCT));
		}
    else if (doGTR == YES || doGTnR == YES)
		{
		for (i=0; i<4; i++)
			for (j=0; j<4; j++)
				Qij[i*4+j] = Mij[i][j] / Mij[2][3] * freq[j];
		mr=0;
		for (i=0; i<4; i++)
			{
			Qij[i*4+i]=0;
			Qij[i*4+i]=-(Qij[i*4]+Qij[i*4+1]+Qij[i*4+2]+Qij[i*4+3]);
			mr-=freq[i]*Qij[i*4+i];
			}
		EigenREV(Root, Cijk);
		}
		
    for (i=0; i<numAltModelSites; i++)
        SimulateFiniteDNAforSite (p, genome, AltModelSites[i], seed);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
cmpl $0x1, 0x33456(%rip)     # 0x4e390
jne 0x1af51
movsd 0x24154(%rip), %xmm0    # 0x3f098
movsd %xmm0, 0x34ac4(%rip)    # 0x4fa10
jmp 0x1b21a
cmpl $0x1, 0x3343c(%rip)     # 0x4e394
jne 0x1b03f
movsd 0x332ea(%rip), %xmm0    # 0x4e250
addsd 0x332f2(%rip), %xmm0    # 0x4e260
movsd %xmm0, 0x34aa2(%rip)    # 0x4fa18
movsd 0x332da(%rip), %xmm0    # 0x4e258
addsd 0x332e2(%rip), %xmm0    # 0x4e268
movsd %xmm0, 0x34a92(%rip)    # 0x4fa20
movsd 0x332ba(%rip), %xmm0    # 0x4e250
mulsd 0x332c2(%rip), %xmm0    # 0x4e260
movsd %xmm0, 0x34a82(%rip)    # 0x4fa28
movsd 0x332aa(%rip), %xmm0    # 0x4e258
mulsd 0x332b2(%rip), %xmm0    # 0x4e268
movsd %xmm0, 0x34a72(%rip)    # 0x4fa30
movsd 0x332aa(%rip), %xmm0    # 0x4e270
mulsd 0x34a4a(%rip), %xmm0    # 0x4fa18
mulsd 0x34a4a(%rip), %xmm0    # 0x4fa20
movsd 0x34a4a(%rip), %xmm1    # 0x4fa28
addsd 0x34a4a(%rip), %xmm1    # 0x4fa30
divsd %xmm1, %xmm0
movsd %xmm0, 0x34a46(%rip)    # 0x4fa38
movsd 0x34a1e(%rip), %xmm1    # 0x4fa18
movsd 0x34a1e(%rip), %xmm2    # 0x4fa20
movsd 0x34a2e(%rip), %xmm0    # 0x4fa38
movsd 0x34a16(%rip), %xmm3    # 0x4fa28
addsd 0x34a16(%rip), %xmm3    # 0x4fa30
mulsd %xmm3, %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x23fe2(%rip), %xmm0    # 0x3f010
divsd %xmm1, %xmm0
movsd %xmm0, 0x349d6(%rip)    # 0x4fa10
jmp 0x1b218
cmpl $0x1, 0x33352(%rip)     # 0x4e398
je 0x1b055
cmpl $0x1, 0x3334d(%rip)     # 0x4e39c
jne 0x1b216
movl $0x0, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jge 0x1b0d2
movl $0x0, -0x20(%rbp)
cmpl $0x4, -0x20(%rbp)
jge 0x1b0c5
movslq -0x1c(%rbp), %rcx
leaq 0x33206(%rip), %rax     # 0x4e280
shlq $0x5, %rcx
addq %rcx, %rax
movslq -0x20(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
divsd 0x33246(%rip), %xmm0    # 0x4e2d8
movslq -0x20(%rbp), %rcx
leaq 0x331b3(%rip), %rax     # 0x4e250
mulsd (%rax,%rcx,8), %xmm0
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl -0x20(%rbp), %eax
movslq %eax, %rcx
leaq 0x3527b(%rip), %rax     # 0x50330
movsd %xmm0, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1b069
jmp 0x1b0c7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1b05c
leaq 0x35247(%rip), %rax     # 0x50320
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movl $0x0, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jge 0x1b203
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl -0x1c(%rbp), %eax
movslq %eax, %rcx
leaq 0x3522c(%rip), %rax     # 0x50330
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
shll $0x2, %eax
movslq %eax, %rcx
leaq 0x35214(%rip), %rax     # 0x50330
movsd (%rax,%rcx,8), %xmm0
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x351fc(%rip), %rax     # 0x50330
addsd (%rax,%rcx,8), %xmm0
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x351e4(%rip), %rax     # 0x50330
addsd (%rax,%rcx,8), %xmm0
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl $0x3, %eax
movslq %eax, %rcx
leaq 0x351cc(%rip), %rax     # 0x50330
addsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl -0x1c(%rbp), %eax
movslq %eax, %rcx
leaq 0x3519d(%rip), %rax     # 0x50330
movsd %xmm0, (%rax,%rcx,8)
movslq -0x1c(%rbp), %rcx
leaq 0x330ad(%rip), %rax     # 0x4e250
movsd (%rax,%rcx,8), %xmm0
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl -0x1c(%rbp), %eax
movslq %eax, %rcx
leaq 0x35175(%rip), %rax     # 0x50330
movsd (%rax,%rcx,8), %xmm2
leaq 0x35159(%rip), %rax     # 0x50320
movsd (%rax), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
leaq 0x3512f(%rip), %rax     # 0x50320
movsd %xmm0, (%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1b0e7
leaq 0x34836(%rip), %rdi     # 0x4fa40
leaq 0x3484f(%rip), %rsi     # 0x4fa60
callq 0x221b0
jmp 0x1b218
jmp 0x1b21a
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x347a2(%rip), %eax     # 0x4f9cc
jge 0x1b255
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq 0x3458e(%rip), %rax     # 0x4f7c8
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rcx
callq 0x1c380
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1b221
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)