// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: InitializeGenomes
void InitializeGenomes (TreeNode *p, long int *seed)
    {
    int     i, cell, anccell, site;
    double  ran;
		
    if (p != NULL)
        {
        cell = p->label;
        if (alphabet == DNA)
            {
            if (p->isHealthyRoot == YES)
                {
				if (doUserGenome == YES)
					{
					for (site=0; site<numSites; site++) /* initialize genome with the user provided sequences */
						{
						data[MATERNAL][cell][site] = WhichNucChar(maternalUserGenome[site]);
						data[PATERNAL][cell][site] = WhichNucChar(paternalUserGenome[site]);
						allSites[site].referenceAllele = data[MATERNAL][cell][site];   // then allSites[site].referenceAllele hosts the reference genome
						}
					}
  				else if (doGeneticSignatures == NO) /* initialize genome with mononucleotide frequencies */
					{
					for (site=0; site<numSites; site++)
						{
						ran = RandomUniform(seed);
						for (i=0; i<4; i++)
							{
							if (ran <= cumfreq[i])
								{
								allSites[site].referenceAllele = data[MATERNAL][cell][site] = data[PATERNAL][cell][site] = i;
								// then allSites[site].referenceAllele hosts the reference genome
								break;
								}
							}
						}
					}
				else /* initialize genome with trinucleotide frequencies */
					{
					SimulateTriNucFreqGenome (cell, seed);
					}
				}
            else
                {
                anccell = p->anc->label;
                for (site=0; site<numSites; site++)
                    {
                    data[MATERNAL][cell][site] = data[MATERNAL][anccell][site];
                    data[PATERNAL][cell][site] = data[PATERNAL][anccell][site];
                    }
                }
             }
        else /* binary alphabet */
            for (site=0; site<numSites; site++)
                data[MATERNAL][cell][site] = data[PATERNAL][cell][site] = 0;

        InitializeGenomes (p->left, seed);
        InitializeGenomes (p->right, seed);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xe7d1
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x1, 0x3fd18(%rip)     # 0x4e224
jne 0xe756
movq -0x8(%rbp), %rax
cmpl $0x1, 0x24(%rax)
jne 0xe6c1
cmpl $0x1, 0x3fea1(%rip)     # 0x4e3c8
jne 0xe5e6
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl 0x3fc9f(%rip), %eax     # 0x4e1dc
jge 0xe5e1
movq 0x413ce(%rip), %rax     # 0x4f918
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x1a360
movl %eax, %edx
movq 0x41240(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x41397(%rip), %rax     # 0x4f910
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x1a360
movl %eax, %edx
movq 0x41211(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x411f7(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq 0x411e6(%rip), %rax     # 0x4f7a8
movslq -0x20(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x6c(%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xe534
jmp 0xe6bc
cmpl $0x0, 0x3fe1f(%rip)     # 0x4e40c
jne 0xe6ae
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl 0x3fbd9(%rip), %eax     # 0x4e1dc
jge 0xe6ac
movq -0x10(%rbp), %rdi
callq 0xa500
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0xe69c
movsd -0x28(%rbp), %xmm1
movslq -0x14(%rbp), %rcx
leaq 0x3ffcc(%rip), %rax     # 0x4e600
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jb 0xe68f
movl -0x14(%rbp), %ecx
movq 0x41157(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x20(%rbp), %rdx
movl %ecx, (%rax,%rdx,4)
movq 0x4113d(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x18(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x20(%rbp), %rdx
movl %ecx, (%rax,%rdx,4)
movq 0x4112c(%rip), %rax     # 0x4f7a8
movslq -0x20(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x6c(%rax)
jmp 0xe69c
jmp 0xe691
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xe61e
jmp 0xe69e
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xe5fa
jmp 0xe6ba
movl -0x18(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1a410
jmp 0xe6bc
jmp 0xe754
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl 0x3fafd(%rip), %eax     # 0x4e1dc
jge 0xe752
movq 0x410b8(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x4109f(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x41086(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq 0x4106c(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xe6d6
jmp 0xe754
jmp 0xe7b0
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl 0x3fa76(%rip), %eax     # 0x4e1dc
jge 0xe7ae
movq 0x41031(%rip), %rax     # 0x4f7a0
movq 0x8(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq 0x41013(%rip), %rax     # 0x4f7a0
movq (%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xe75d
jmp 0xe7b0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0xe4e0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0xe4e0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)