// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/cellcoal.c
// Function: MakeCoalescenceTree
void MakeCoalescenceTree(int numCells, int N, long int *seed)
	{
    int			i, *activeNodes, numActiveNodes,nextAvailableNode,
				firstNode, secondNode, newNode, eventNum,period;
    double		rateCA, timeCA, currentTime, eventTime;
    TreeNode	*p, *q, *r;
	
    p = q = r = NULL;
	
    /* allocate space for tree */
    treeNodes = (TreeNode *) calloc(numNodes, sizeof(TreeNode));
    if (!treeNodes)
        {
        fprintf (stderr, "Could not allocate nodes (%ld)\n", numNodes * sizeof(TreeNode));
        exit (-1);
        }
    activeNodes = (int *) calloc(numNodes, sizeof(int));
    if (!activeNodes)
        {
        fprintf (stderr, "Could not allocate activeNodes (%ld)\n", numNodes * sizeof(int));
        exit (-1);
        }
	
    /* set everything to null */
    for (i=0; i<numNodes; i++)
        {
        treeNodes[i].left = NULL;
        treeNodes[i].right = NULL;
        treeNodes[i].anc = NULL;
        treeNodes[i].time = 0.0;
        treeNodes[i].length = 0.0;
        treeNodes[i].index = 0;
        treeNodes[i].label = 0;
        treeNodes[i].isHealthyRoot = NO;
        treeNodes[i].isHealthyTip = NO;
		treeNodes[i].rateSwitch = 0.0;
		treeNodes[i].name = (char*) calloc (MAX_NAME, sizeof(char));
		if (!treeNodes[i].name)
			{
			fprintf (stderr, "Could not allocate the treeNodes[i].name structure\n");
			exit (-1);
			}
		}
	
    /* set up initial nodes */
    numActiveNodes = 0;
    for (i=0; i<numCells; i++)
        {
        p = treeNodes + i;
        activeNodes[numActiveNodes] = i;
        p->index = i;
        numActiveNodes++;
        }
    nextAvailableNode = numActiveNodes;
	
    /* make coalescence tree */
    eventNum = 0;
    period = 1;
    currentTime = 0.0;
    eventTime = 0.0;
    while (numActiveNodes > 1)
        {
        rateCA = numActiveNodes * (numActiveNodes - 1) / 2.0;
			
        if (doDemographics == YES)
            {
            periodGrowth[period] = -log (Nend[period] / (double) Nbegin[period]) / (double) (cumDuration[period] - cumDuration[period-1]);
            if (isnan(periodGrowth[period]) == YES)
                {
                fprintf (stderr, "\nERROR: period growth (%f) is NaN", periodGrowth[period]);
                fprintf (stderr, "\n       This might suggest that the growth rate is too negative");
                fprintf (stderr, "\n       and the coalescent time is therefore infinite.");
                fprintf (stderr, "\n       Try a smaller value");
                exit (-1);
                }
				
            timeCA =  log (1 + RandomExponential (rateCA, seed) * periodGrowth[period] * 2.0 * Nbegin[period] *
                           exp (-periodGrowth[period] * (currentTime - cumDuration[period-1]))) / periodGrowth[period]; /* time is kept in generations (scaled by 2N)  */
				
            /*	When growth rate is very negative, coalescent time may be infinite
             this results in log (-x) => timCA = NaN. If this not the last period
             just jump to the next. If this is the last period, we have to exit
             the program
             */
            if (isnan(timeCA) == YES)
                {
                if (period < numPeriods)
                    {
                    currentTime = cumDuration[period];
                    period++;
                    periodGrowth[period] = -log (Nend[period] / (double) Nbegin[period]) / (double) cumDuration[period];
                    continue;
                    }
                else
                    {
                    fprintf (stderr, "\nERROR: Coalescent time (%f) is infinite ", timeCA);
                    fprintf (stderr, "\n       This might suggest that the exponential growth rate is too negative");
                    fprintf (stderr, "\n       and the coalescent time is therefore infinite.");
                    fprintf (stderr, "\n       Try a smaller value");
                    exit (-1);
                    }
                }
            }
        else
            {
            timeCA = RandomExponential (rateCA, seed) * N; /* time is kept in N generations */
            if (doExponential == YES)
                {
                timeCA = log (exp(growthRate*currentTime) + growthRate * timeCA) / growthRate - currentTime;
					
                /*	When growth rate is very negative, coalescent time may be infinite
                 this results in log (-x) => timCA = NaN. We have to exit
                 the program
                 */
                if (isnan(timeCA) == YES)
                    {
                    fprintf (stderr, "\nERROR: Coalescent time (%f) is infinite ", timeCA);
                    fprintf (stderr, "\n       This might suggest that the exponential growth rate is too negative");
                    fprintf (stderr, "\n       and the coalescent time is therefore infinite.");
                    fprintf (stderr, "\n       Try a smaller value");
                    exit (-1);
                    }
                }
			else if (doOthsukiInnanCoal == YES)
				{
				timeCA = RandomExponential (rateCA * 2.0 * birthRate, seed) * N;
				timeCA = log (exp(growthRate*currentTime) + growthRate * timeCA) / growthRate - currentTime;

				/*	When growth rate is very negative, coalescent time may be infinite
				 this results in log (-x) => timCA = NaN. We have to exit
				 the program
				 */
				if (isnan(timeCA) == YES)
					{
					fprintf (stderr, "\nERROR: Coalescent time (%f) is infinite ", timeCA);
					fprintf (stderr, "\n       This might suggest that the exponential growth rate is too negative");
					fprintf (stderr, "\n       and the coalescent time is therefore infinite.");
					fprintf (stderr, "\n       Try a smaller value");
					exit (-1);
					}
				}
}
			
        eventTime = timeCA;
			
        /*	if this period is not the last one and if the event time is outside the current interval,
            update period and start again */
        if (doDemographics == YES && period < numPeriods  &&  (currentTime + eventTime) > cumDuration [period])
            {
            currentTime = cumDuration[period];
            period++;
            periodGrowth[period] = -log (Nend[period] - Nbegin[period]) / (double) cumDuration[period];
            continue;
            }
        numCA++;
			
        /* set time */
        currentTime += eventTime;
			
        if (noisy > 2)
            fprintf (stderr, "\nEvent %3d :  rateCA = %lf, currentTime = %lf\n", ++eventNum, rateCA, currentTime);
			
        /* figure out which two nodes will coalesce */
        firstNode = numActiveNodes * RandomUniform(seed);
        if (firstNode >= numActiveNodes)
            {
            fprintf (stderr, "\n\nERROR: firstNode out of range!\n");
            exit (-1);
            }
        do
            {
            secondNode = numActiveNodes * RandomUniform(seed);
            } while (firstNode == secondNode);
			
        newNode = nextAvailableNode;
        if (noisy > 2)
            fprintf (stderr, "  Coalescence involving %d and %d to create node %d\n",
                     activeNodes[firstNode]+1, activeNodes[secondNode]+1, newNode+1);
			
        /* readjust MRCA, pointers and active sites */
        p = treeNodes + activeNodes[firstNode];
        q = treeNodes + activeNodes[secondNode];
        r = treeNodes + newNode;
        r->index = nextAvailableNode;
        r->left = p;
        r->right = q;
        p->anc = r;
        q->anc = r;
        r->time = currentTime;
        p->length = r->time - p->time;
        q->length = r->time - q->time;
        p->branchLength = p->length * mutationRate;
        q->branchLength = q->length * mutationRate;
			
        /* readjust active nodes */
        activeNodes[firstNode] = newNode;
        activeNodes[secondNode] = activeNodes[numActiveNodes-1];
        numActiveNodes--;
        nextAvailableNode++;
        if (nextAvailableNode >= numNodes)
            {
            fprintf (stderr, "\n\nERROR: Too many nodes!\n");
            exit (-1);
            }
    } /* coalescent cell tree finished */
	
  	TMRCA = currentTime / N ;  /* TMRCA is now is back in N coalescent generations */
	coalTreeMRCA = r;
	
    /* Connect the coalescent cell MRCA node with the healthy ancestral cell */
    if (noisy > 2)
        fprintf (stderr, "\n>> Adding healthy root ... ");
    healthyRoot = treeNodes + nextAvailableNode;
    healthyRoot->index = nextAvailableNode;
    healthyRoot->left = coalTreeMRCA;
    coalTreeMRCA->anc = healthyRoot;
    healthyRoot->time = currentTime + (currentTime * transformingBranchLengthRatio);
    healthyRoot->length = 0;
    healthyRoot->isHealthyRoot = YES;
	coalTreeMRCA->length = healthyRoot->time - coalTreeMRCA->time;
	coalTreeMRCA->branchLength = coalTreeMRCA->length * mutationRate;
   if (noisy > 2)
        fprintf (stderr, "DONE");

    nextAvailableNode++;
	
    /* Connect the healthy ancestral cell with the tip healthy cell*/
    if (noisy > 2)
        fprintf (stderr, "\n>> Adding healthy tip ... ");
    healthyTip = treeNodes + nextAvailableNode;
	healthyTip->index = nextAvailableNode;
  	healthyTip->left = NULL;
    healthyTip->right = NULL;
    healthyTip->anc = healthyRoot;
    healthyRoot->right = healthyTip;
    healthyTip->time = 0;
    healthyTip->length = (healthyRoot->time - healthyTip->time) * healthyTipBranchLengthRatio;
	healthyTipBranchLength = healthyTip->branchLength = healthyTip->length * mutationRate;
	healthyTip->isHealthyTip = YES;
    if (noisy > 2)
        fprintf (stderr, "DONE");

    /* Relabel nodes on tree (label tips with indexes) */
    if (noisy > 2)
        fprintf (stderr, "\n>> Relabeling nodes on tree ... ");
    tipLabel = numCells;
    intLabel = numCells+1;
    RelabelNodes(healthyRoot);
    if (noisy > 2)
        fprintf (stderr, "DONE");
	
    free (activeNodes);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq $0x0, -0x78(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x68(%rbp)
movslq 0x41924(%rip), %rdi     # 0x4e4d8
movl $0x60, %esi
callq 0x2190
movq %rax, 0x42c9b(%rip)     # 0x4f860
cmpq $0x0, 0x42c93(%rip)     # 0x4f860
jne 0xcbfc
movq 0x41422(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movslq 0x418f8(%rip), %rax     # 0x4e4d8
imulq $0x60, %rax, %rdx
leaq 0x33d2c(%rip), %rsi     # 0x40917
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
movslq 0x418d5(%rip), %rdi     # 0x4e4d8
movl $0x4, %esi
callq 0x2190
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xcc45
movq 0x413d9(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movslq 0x418af(%rip), %rdx     # 0x4e4d8
shlq $0x2, %rdx
leaq 0x33d03(%rip), %rsi     # 0x40937
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl 0x41883(%rip), %eax     # 0x4e4d8
jge 0xcdcd
movq 0x42bfe(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq 0x42be5(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movq 0x42bcb(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movq 0x42bb1(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x38(%rax)
movq 0x42b97(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rax)
movq 0x42b7d(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x18(%rax)
movq 0x42b64(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x1c(%rax)
movq 0x42b4b(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x24(%rax)
movq 0x42b32(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x20(%rax)
movq 0x42b19(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rax)
movl $0x78, %edi
movl $0x1, %esi
callq 0x2190
movq %rax, %rcx
movq 0x42aed(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rdx
imulq $0x60, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x58(%rax)
movq 0x42ad7(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x58(%rax)
jne 0xcdbd
movq 0x41256(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x33bb1(%rip), %rsi     # 0x4095d
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
jmp 0xcdbf
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xcc4c
movl $0x0, -0x24(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0xce25
movq 0x42a76(%rip), %rax     # 0x4f860
movslq -0x14(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %ecx
movq -0x68(%rbp), %rax
movl %ecx, 0x18(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xcddb
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x1, -0x3c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
cmpl $0x1, -0x24(%rbp)
jle 0xd6db
movl -0x24(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0x321dd(%rip), %xmm1    # 0x3f048
divsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
cmpl $0x1, 0x4136d(%rip)     # 0x4e1e8
jne 0xd17c
movq 0x42ab8(%rip), %rax     # 0x4f940
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq 0x42ab0(%rip), %rax     # 0x4f948
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
divsd %xmm1, %xmm0
callq 0x2150
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x42a88(%rip), %rax     # 0x4f950
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x42a7a(%rip), %rcx     # 0x4f950
movl -0x3c(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
subl (%rcx,%rdx,4), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movq 0x42a67(%rip), %rax     # 0x4f958
movslq -0x3c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x42a57(%rip), %rax     # 0x4f958
movslq -0x3c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm0, %xmm0
setp %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xcf95
movq 0x410d6(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movq 0x42a2c(%rip), %rax     # 0x4f958
movslq -0x3c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x33a55(%rip), %rsi     # 0x40991
movb $0x1, %al
callq 0x21b0
movq 0x410ae(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x33a5f(%rip), %rsi     # 0x409b3
movb $0x0, %al
callq 0x21b0
movq 0x41096(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x33a87(%rip), %rsi     # 0x409f3
movb $0x0, %al
callq 0x21b0
movq 0x4107e(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x33aa6(%rip), %rsi     # 0x40a2a
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
movsd -0x48(%rbp), %xmm0
movq -0x10(%rbp), %rdi
callq 0x196e0
movq 0x429ae(%rip), %rax     # 0x4f958
movslq -0x3c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd 0x3208d(%rip), %xmm1    # 0x3f048
mulsd %xmm1, %xmm0
movq 0x42982(%rip), %rax     # 0x4f948
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movq 0x42979(%rip), %rax     # 0x4f958
movslq -0x3c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd -0x58(%rbp), %xmm1
movq 0x42945(%rip), %rax     # 0x4f950
movl -0x3c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm2
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
callq 0x22b0
movaps %xmm0, %xmm1
movsd -0x80(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd 0x31fe6(%rip), %xmm1    # 0x3f020
addsd %xmm1, %xmm0
callq 0x2150
movq 0x4290e(%rip), %rax     # 0x4f958
movslq -0x3c(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xd177
movl -0x3c(%rbp), %eax
cmpl 0x41169(%rip), %eax     # 0x4e1e4
jge 0xd108
movq 0x428c8(%rip), %rax     # 0x4f950
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq 0x4289a(%rip), %rax     # 0x4f940
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movq 0x42892(%rip), %rax     # 0x4f948
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
divsd %xmm1, %xmm0
callq 0x2150
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x4286a(%rip), %rax     # 0x4f950
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
divsd %xmm1, %xmm0
movq 0x4285e(%rip), %rax     # 0x4f958
movslq -0x3c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xce49
movq 0x40ee9(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movsd -0x50(%rbp), %xmm0
leaq 0x33928(%rip), %rsi     # 0x40a46
movb $0x1, %al
callq 0x21b0
movq 0x40ecc(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x3393a(%rip), %rsi     # 0x40a70
movb $0x0, %al
callq 0x21b0
movq 0x40eb4(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x338a5(%rip), %rsi     # 0x409f3
movb $0x0, %al
callq 0x21b0
movq 0x40e9c(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x338c4(%rip), %rsi     # 0x40a2a
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
jmp 0xd375
movsd -0x48(%rbp), %xmm0
movq -0x10(%rbp), %rdi
callq 0x196e0
cvtsi2sdl -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
cmpl $0x1, 0x4104d(%rip)     # 0x4e1ec
jne 0xd270
movsd 0x41043(%rip), %xmm0    # 0x4e1f0
mulsd -0x58(%rbp), %xmm0
callq 0x22b0
movaps %xmm0, %xmm1
movsd 0x4102e(%rip), %xmm0    # 0x4e1f0
movsd -0x50(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x2150
divsd 0x41014(%rip), %xmm0    # 0x4e1f0
subsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xd26b
movq 0x40df5(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movsd -0x50(%rbp), %xmm0
leaq 0x33834(%rip), %rsi     # 0x40a46
movb $0x1, %al
callq 0x21b0
movq 0x40dd8(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x33846(%rip), %rsi     # 0x40a70
movb $0x0, %al
callq 0x21b0
movq 0x40dc0(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x337b1(%rip), %rsi     # 0x409f3
movb $0x0, %al
callq 0x21b0
movq 0x40da8(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x337d0(%rip), %rsi     # 0x40a2a
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
jmp 0xd373
cmpl $0x1, 0x414a9(%rip)     # 0x4e720
jne 0xd371
movsd 0x31dc3(%rip), %xmm0    # 0x3f048
mulsd -0x48(%rbp), %xmm0
mulsd 0x40f66(%rip), %xmm0    # 0x4e1f8
movq -0x10(%rbp), %rdi
callq 0x196e0
cvtsi2sdl -0x8(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0x40f3f(%rip), %xmm0    # 0x4e1f0
mulsd -0x58(%rbp), %xmm0
callq 0x22b0
movaps %xmm0, %xmm1
movsd 0x40f2a(%rip), %xmm0    # 0x4e1f0
movsd -0x50(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x2150
divsd 0x40f10(%rip), %xmm0    # 0x4e1f0
subsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xd36f
movq 0x40cf1(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movsd -0x50(%rbp), %xmm0
leaq 0x33730(%rip), %rsi     # 0x40a46
movb $0x1, %al
callq 0x21b0
movq 0x40cd4(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x33742(%rip), %rsi     # 0x40a70
movb $0x0, %al
callq 0x21b0
movq 0x40cbc(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x336ad(%rip), %rsi     # 0x409f3
movb $0x0, %al
callq 0x21b0
movq 0x40ca4(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x336cc(%rip), %rsi     # 0x40a2a
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
jmp 0xd371
jmp 0xd373
jmp 0xd375
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
cmpl $0x1, 0x40e62(%rip)     # 0x4e1e8
jne 0xd442
movl -0x3c(%rbp), %eax
cmpl 0x40e4f(%rip), %eax     # 0x4e1e4
jge 0xd442
movsd -0x58(%rbp), %xmm0
addsd -0x60(%rbp), %xmm0
movq 0x425a4(%rip), %rax     # 0x4f950
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
ucomisd %xmm1, %xmm0
jbe 0xd442
movq 0x4258a(%rip), %rax     # 0x4f950
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq 0x4255c(%rip), %rax     # 0x4f940
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq 0x42556(%rip), %rcx     # 0x4f948
movslq -0x3c(%rbp), %rdx
subl (%rcx,%rdx,4), %eax
cvtsi2sd %eax, %xmm0
callq 0x2150
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x42530(%rip), %rax     # 0x4f950
movslq -0x3c(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
divsd %xmm1, %xmm0
movq 0x42524(%rip), %rax     # 0x4f958
movslq -0x3c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xce49
movl 0x42320(%rip), %eax     # 0x4f768
addl $0x1, %eax
movl %eax, 0x42317(%rip)     # 0x4f768
movsd -0x60(%rbp), %xmm0
addsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
cmpl $0x2, 0x41081(%rip)     # 0x4e4e8
jle 0xd494
movq 0x40b88(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movl -0x38(%rbp), %edx
addl $0x1, %edx
movl %edx, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
leaq 0x3362f(%rip), %rsi     # 0x40abc
movb $0x2, %al
callq 0x21b0
cvtsi2sdl -0x24(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa500
movaps %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0xd4ea
movq 0x40b29(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x33612(%rip), %rsi     # 0x40aeb
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
jmp 0xd4ec
cvtsi2sdl -0x24(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa500
movaps %xmm0, %xmm1
movsd -0x90(%rbp), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0xd4ec
movl -0x28(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpl $0x2, 0x40fbb(%rip)     # 0x4e4e8
jle 0xd56b
movq 0x40ac2(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
addl $0x1, %ecx
movl -0x34(%rbp), %r8d
addl $0x1, %r8d
leaq 0x335a9(%rip), %rsi     # 0x40b0d
movb $0x0, %al
callq 0x21b0
movq 0x422ee(%rip), %rax     # 0x4f860
movq -0x20(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq 0x422d0(%rip), %rax     # 0x4f860
movq -0x20(%rbp), %rcx
movslq -0x30(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq 0x422b2(%rip), %rax     # 0x4f860
movslq -0x34(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movl -0x28(%rbp), %ecx
movq -0x78(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x68(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, (%rax)
movq -0x70(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x78(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x78(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x10(%rax)
movsd -0x58(%rbp), %xmm0
movq -0x78(%rbp), %rax
movsd %xmm0, 0x38(%rax)
movq -0x78(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq -0x68(%rbp), %rax
subsd 0x38(%rax), %xmm0
movq -0x68(%rbp), %rax
movsd %xmm0, 0x30(%rax)
movq -0x78(%rbp), %rax
movsd 0x38(%rax), %xmm0
movq -0x70(%rbp), %rax
subsd 0x38(%rax), %xmm0
movq -0x70(%rbp), %rax
movsd %xmm0, 0x30(%rax)
movq -0x68(%rbp), %rax
movsd 0x30(%rax), %xmm0
mulsd 0x40bbd(%rip), %xmm0    # 0x4e208
movq -0x68(%rbp), %rax
movsd %xmm0, 0x40(%rax)
movq -0x70(%rbp), %rax
movsd 0x30(%rax), %xmm0
mulsd 0x40ba3(%rip), %xmm0    # 0x4e208
movq -0x70(%rbp), %rax
movsd %xmm0, 0x40(%rax)
movl -0x34(%rbp), %edx
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl 0x40e26(%rip), %eax     # 0x4e4d8
jl 0xd6d6
movq 0x4093d(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x3347d(%rip), %rsi     # 0x40b42
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2290
jmp 0xce49
movsd -0x58(%rbp), %xmm0
cvtsi2sdl -0x8(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x4205f(%rip)    # 0x4f750
movq -0x78(%rbp), %rax
movq %rax, 0x42074(%rip)     # 0x4f770
cmpl $0x2, 0x40de5(%rip)     # 0x4e4e8
jle 0xd71d
movq 0x408ec(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x33446(%rip), %rsi     # 0x40b5c
movb $0x0, %al
callq 0x21b0
movq 0x4213c(%rip), %rax     # 0x4f860
movslq -0x28(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x4204a(%rip)     # 0x4f780
movl -0x28(%rbp), %ecx
movq 0x42040(%rip), %rax     # 0x4f780
movl %ecx, 0x18(%rax)
movq 0x42026(%rip), %rcx     # 0x4f770
movq 0x4202f(%rip), %rax     # 0x4f780
movq %rcx, (%rax)
movq 0x42025(%rip), %rcx     # 0x4f780
movq 0x4200e(%rip), %rax     # 0x4f770
movq %rcx, 0x10(%rax)
movsd -0x58(%rbp), %xmm1
movsd -0x58(%rbp), %xmm0
movsd 0x40ca0(%rip), %xmm2    # 0x4e418
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x41ff9(%rip), %rax     # 0x4f780
movsd %xmm0, 0x38(%rax)
movq 0x41fed(%rip), %rax     # 0x4f780
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rax)
movq 0x41fde(%rip), %rax     # 0x4f780
movl $0x1, 0x24(%rax)
movq 0x41fd0(%rip), %rax     # 0x4f780
movsd 0x38(%rax), %xmm0
movq 0x41fb4(%rip), %rax     # 0x4f770
subsd 0x38(%rax), %xmm0
movq 0x41fa8(%rip), %rax     # 0x4f770
movsd %xmm0, 0x30(%rax)
movq 0x41f9c(%rip), %rax     # 0x4f770
movsd 0x30(%rax), %xmm0
mulsd 0x40a27(%rip), %xmm0    # 0x4e208
movq 0x41f88(%rip), %rax     # 0x4f770
movsd %xmm0, 0x40(%rax)
cmpl $0x2, 0x40cf4(%rip)     # 0x4e4e8
jle 0xd80e
movq 0x407fb(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x31e42(%rip), %rsi     # 0x3f649
movb $0x0, %al
callq 0x21b0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
cmpl $0x2, 0x40cca(%rip)     # 0x4e4e8
jle 0xd838
movq 0x407d1(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x33348(%rip), %rsi     # 0x40b79
movb $0x0, %al
callq 0x21b0
movq 0x42021(%rip), %rax     # 0x4f860
movslq -0x28(%rbp), %rcx
imulq $0x60, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x420d7(%rip)     # 0x4f928
movl -0x28(%rbp), %ecx
movq 0x420cd(%rip), %rax     # 0x4f928
movl %ecx, 0x18(%rax)
movq 0x420c3(%rip), %rax     # 0x4f928
movq $0x0, (%rax)
movq 0x420b5(%rip), %rax     # 0x4f928
movq $0x0, 0x8(%rax)
movq 0x41efe(%rip), %rcx     # 0x4f780
movq 0x4209f(%rip), %rax     # 0x4f928
movq %rcx, 0x10(%rax)
movq 0x42094(%rip), %rcx     # 0x4f928
movq 0x41ee5(%rip), %rax     # 0x4f780
movq %rcx, 0x8(%rax)
movq 0x42082(%rip), %rax     # 0x4f928
xorps %xmm0, %xmm0
movsd %xmm0, 0x38(%rax)
movq 0x41ecb(%rip), %rax     # 0x4f780
movsd 0x38(%rax), %xmm0
movq 0x42067(%rip), %rax     # 0x4f928
subsd 0x38(%rax), %xmm0
mulsd 0x40b52(%rip), %xmm0    # 0x4e420
movq 0x42053(%rip), %rax     # 0x4f928
movsd %xmm0, 0x30(%rax)
movq 0x42047(%rip), %rax     # 0x4f928
movsd 0x30(%rax), %xmm0
mulsd 0x4091a(%rip), %xmm0    # 0x4e208
movq 0x42033(%rip), %rax     # 0x4f928
movsd %xmm0, 0x40(%rax)
movsd %xmm0, 0x4205e(%rip)    # 0x4f960
movq 0x4201f(%rip), %rax     # 0x4f928
movl $0x1, 0x20(%rax)
cmpl $0x2, 0x40bd1(%rip)     # 0x4e4e8
jle 0xd931
movq 0x406d8(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x31d1f(%rip), %rsi     # 0x3f649
movb $0x0, %al
callq 0x21b0
cmpl $0x2, 0x40bb0(%rip)     # 0x4e4e8
jle 0xd952
movq 0x406b7(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x3324a(%rip), %rsi     # 0x40b95
movb $0x0, %al
callq 0x21b0
movl -0x4(%rbp), %eax
movl %eax, 0x4200d(%rip)     # 0x4f968
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, 0x42005(%rip)     # 0x4f96c
movq 0x41e12(%rip), %rdi     # 0x4f780
callq 0x19750
cmpl $0x2, 0x40b6e(%rip)     # 0x4e4e8
jle 0xd994
movq 0x40675(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
leaq 0x31cbc(%rip), %rsi     # 0x3f649
movb $0x0, %al
callq 0x21b0
movq -0x20(%rbp), %rdi
callq 0x2030
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)