// File: /workspace/github_c_makefile_star2_O1/jiqingxiaoxi[P]RPA/RPA.c
// Function: thal
double thal(char oligo_f[],char oligo_r[],double stackEntropies[],double stackEnthalpies[],double stackint2Entropies[],double stackint2Enthalpies[],double dangleEntropies3[],double dangleEnthalpies3[],double dangleEntropies5[],double dangleEnthalpies5[],double hairpinLoopEntropies[],double interiorLoopEntropies[],double bulgeLoopEntropies[],double hairpinLoopEnthalpies[],double interiorLoopEnthalpies[],double bulgeLoopEnthalpies[],double tstackEntropies[],double tstackEnthalpies[],double tstack2Entropies[],double tstack2Enthalpies[],char *triloopEntropies1,char *triloopEnthalpies1,char *tetraloopEntropies1,char *tetraloopEnthalpies1,double *triloopEntropies2,double *triloopEnthalpies2,double *tetraloopEntropies2,double *tetraloopEnthalpies2,int numTriloops,int numTetraloops,double atpS[],double atpH[],int type)
{
	double SH[2],Initdouble[4];//0 is dplx_init_H, 1 is dplx_init_S, 2 is RC, 3 is SHleft
	int Initint[5]; //0 is len1, 1 is len2, 2 is len3, 3 is bestI, 4 is bestJ
	int i, j;
	double T1,enthalpyDPT[3600],entropyDPT[3600],send5[60],hend5[60],result_TH;
	int ps1[60],ps2[60];
	char numSeq1[60],numSeq2[60];
	double mh, ms;

/*** INIT values for unimolecular and bimolecular structures ***/
	if (type==4) /* unimolecular folding */
	{
		Initdouble[0]= 0.0;
		Initdouble[1] = -0.00000000001;
		Initdouble[2]=0;
	}
	else /* hybridization of two oligos */
	{
		Initdouble[0]= 200;
		Initdouble[1]= -5.7;
		if(symmetry_thermo(oligo_f) && symmetry_thermo(oligo_r))
			Initdouble[2]=1.9872* log(38/1000000000.0);
		else
			Initdouble[2]=1.9872* log(38/4000000000.0);
	}
/* convert nucleotides to numbers */
	if(type==1 || type==2)
	{
		Initint[0]=strlen(oligo_f);
		Initint[1]=strlen(oligo_r);
	 	for(i=1;i<=Initint[0];++i)
			numSeq1[i]=str2int(oligo_f[i-1]);
		for(i=1;i<=Initint[1];++i)
			numSeq2[i]=str2int(oligo_r[Initint[1]-i]);
	}
	else if(type==3)
	{
		Initint[0]=strlen(oligo_r);
		Initint[1]=strlen(oligo_f);
		for(i=1;i<=Initint[0];++i)
			numSeq1[i]=str2int(oligo_r[i-1]);
		for(i=1;i<=Initint[1];++i)
			numSeq2[i]=str2int(oligo_f[Initint[1]-i]);
	}
	else
	{
		Initint[0]=strlen(oligo_f);
                Initint[1]=strlen(oligo_r);
		Initint[2]=Initint[1]-1;
                for(i=1;i<=Initint[0];++i)      
                        numSeq1[i]=str2int(oligo_f[i-1]);   
                for(i=1;i<=Initint[1];++i)      
                        numSeq2[i]=str2int(oligo_r[i-1]);
	}
	numSeq1[0]=numSeq1[Initint[0]+1]=numSeq2[0]=numSeq2[Initint[1]+1]=4; /* mark as N-s */

	result_TH=0;
	if (type==4) /* calculate structure of monomer */
	{
		initMatrix2(Initint,enthalpyDPT,entropyDPT,numSeq1);
		fillMatrix2(stackEntropies,stackEnthalpies,stackint2Entropies,stackint2Enthalpies,hairpinLoopEntropies,interiorLoopEntropies,bulgeLoopEntropies,hairpinLoopEnthalpies,interiorLoopEnthalpies,bulgeLoopEnthalpies,tstackEntropies,tstackEnthalpies,tstack2Entropies,tstack2Enthalpies,triloopEntropies1,triloopEnthalpies1,tetraloopEntropies1,tetraloopEnthalpies1,triloopEntropies2,triloopEnthalpies2,tetraloopEntropies2,tetraloopEnthalpies2,numTriloops,numTetraloops,atpS,atpH,Initdouble,Initint,enthalpyDPT,entropyDPT,numSeq1,numSeq2);
		calc_terminal_bp(310.15,dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,tstack2Entropies,tstack2Enthalpies,atpS,atpH,Initdouble,Initint,enthalpyDPT,entropyDPT,send5,hend5,numSeq1);
		mh=hend5[Initint[0]];
		ms=send5[Initint[0]];
		for (i=0;i<Initint[0];i++)
			ps1[i]=0;
		if(fabs(mh)<999999999)
		{
			tracebacku(ps1,stackEntropies,stackEnthalpies,stackint2Entropies,stackint2Enthalpies,dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,hairpinLoopEntropies,interiorLoopEntropies,bulgeLoopEntropies,hairpinLoopEnthalpies,interiorLoopEnthalpies,bulgeLoopEnthalpies,tstackEntropies,tstackEnthalpies,tstack2Entropies,tstack2Enthalpies,triloopEntropies1,triloopEnthalpies1,tetraloopEntropies1,tetraloopEnthalpies1,triloopEntropies2,triloopEnthalpies2,tetraloopEntropies2,tetraloopEnthalpies2,numTriloops,numTetraloops,atpS,atpH,Initdouble,Initint,enthalpyDPT,entropyDPT,send5,hend5,numSeq1,numSeq2);
			result_TH=drawHairpin(ps1,mh,ms,Initint);
			result_TH=(int)(result_TH*100+0.5)/100.0;
		}
	}
	else if(type!=4) /* Hybridization of two moleculs */
	{
		Initint[2]=Initint[1];
		initMatrix(Initint,enthalpyDPT,entropyDPT,numSeq1,numSeq2);
		fillMatrix(stackEntropies,stackEnthalpies,stackint2Entropies,stackint2Enthalpies,dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,interiorLoopEntropies,bulgeLoopEntropies,interiorLoopEnthalpies,bulgeLoopEnthalpies,tstackEntropies,tstackEnthalpies,tstack2Entropies,tstack2Enthalpies,atpS,atpH,Initdouble,Initint,enthalpyDPT,entropyDPT,numSeq1,numSeq2);

		Initdouble[3]=-1.0*INFINITY;
	/* calculate terminal basepairs */
		Initint[3]=Initint[4]=0;
		if(type==1)
			for (i=1;i<=Initint[0];i++)
			{
				for (j=1;j<=Initint[1];j++)
				{
					RSH(i,j,SH,dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,tstack2Entropies,tstack2Enthalpies,atpS,atpH,Initdouble,numSeq1,numSeq2);
					SH[0]=SH[0]+0.000001; /* this adding is done for compiler, optimization -O2 vs -O0 */
					SH[1]=SH[1]+0.000001;
					T1=((enthalpyDPT[(i-1)*Initint[2]+j-1]+ SH[1] +Initdouble[0]) / ((entropyDPT[(i-1)*Initint[2]+j-1]) + SH[0] +Initdouble[1] + Initdouble[2])) -273.15;
					if(T1>Initdouble[3]&&((entropyDPT[(i-1)*Initint[2]+j-1]+SH[0])<0&&(SH[1]+enthalpyDPT[(i-1)*Initint[2]+j-1])<0))
					{
						Initdouble[3]=T1;
						Initint[3]=i;
						Initint[4]=j;
					}
				}
			}
		if(type==2||type==3)
		{
		 //THAL_END1
			Initint[4]=0;
			Initint[3]=Initint[0];
			i=Initint[0];
			Initdouble[3]=-1.0*INFINITY;
			for (j=1;j<=Initint[1];++j)
			{
				RSH(i,j,SH,dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,tstack2Entropies,tstack2Enthalpies,atpS,atpH,Initdouble,numSeq1,numSeq2);
				SH[0]=SH[0]+0.000001; // this adding is done for compiler, optimization -O2 vs -O0,that compiler could understand that SH is changed in this cycle 
				SH[1]=SH[1]+0.000001;
				T1=((enthalpyDPT[(i-1)*Initint[2]+j-1]+SH[1]+Initdouble[0])/((entropyDPT[(i-1)*Initint[2]+j-1])+SH[0]+Initdouble[1]+Initdouble[2]))-273.15;
				if (T1>Initdouble[3]&&((SH[0]+entropyDPT[(i-1)*Initint[2]+j-1])<0&&(SH[1]+enthalpyDPT[(i-1)*Initint[2]+j-1])<0))
				{
					Initdouble[3]=T1;
					Initint[4]=j;
				}
			}
		}
		if(fabs(Initdouble[3])>999999999)
			Initint[3]=Initint[4]=1;
		RSH(Initint[3], Initint[4], SH,dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,tstack2Entropies,tstack2Enthalpies,atpS,atpH,Initdouble,numSeq1,numSeq2);
	 // tracebacking 
		for (i=0;i<Initint[0];++i)
			ps1[i]=0;
		for (j=0;j<Initint[1];++j)
			ps2[j] = 0;
		if(fabs(enthalpyDPT[(Initint[3]-1)*Initint[2]+Initint[4]-1])<999999999)
		{
			traceback(Initint[3],Initint[4],ps1,ps2,stackEntropies,stackEnthalpies,stackint2Entropies,stackint2Enthalpies,dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,interiorLoopEntropies,bulgeLoopEntropies,interiorLoopEnthalpies,bulgeLoopEnthalpies,tstackEntropies,tstackEnthalpies,tstack2Entropies,tstack2Enthalpies,atpS,atpH,Initdouble,Initint,enthalpyDPT,entropyDPT,numSeq1,numSeq2);
			result_TH=drawDimer(ps1,ps2,(enthalpyDPT[(Initint[3]-1)*Initint[2]+Initint[4]-1]+SH[1]+Initdouble[0]),(entropyDPT[(Initint[3]-1)*Initint[2]+Initint[4]-1]+SH[0]+Initdouble[1]),Initdouble,Initint);
			result_TH=(int)(result_TH*100+0.5)/100.0;
		}
	}
	return result_TH;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe6d8, %rsp           # imm = 0xE6D8
movq %r9, -0xa0(%rbp)
movq %r8, -0x98(%rbp)
movq %rcx, -0x90(%rbp)
movq %rdx, -0x88(%rbp)
movq %rsi, %rbx
movq %rdi, %r14
movl 0xe0(%rbp), %r15d
cmpl $0x4, %r15d
jne 0x8c61
movq $0x0, -0x60(%rbp)
movabsq $-0x425a02801e869b6b, %rax # imm = 0xBDA5FD7FE1796495
movq %rax, -0x58(%rbp)
xorpd %xmm0, %xmm0
jmp 0x8ca7
movabsq $0x4069000000000000, %rax # imm = 0x4069000000000000
movq %rax, -0x60(%rbp)
movabsq $-0x3fe9333333333333, %rax # imm = 0xC016CCCCCCCCCCCD
movq %rax, -0x58(%rbp)
movq %r14, %rdi
callq 0x8afd
testl %eax, %eax
je 0x8c9f
movq %rbx, %rdi
callq 0x8afd
testl %eax, %eax
je 0x8c9f
movsd 0x53eb(%rip), %xmm0     # 0xe088
jmp 0x8ca7
movsd 0x53e9(%rip), %xmm0     # 0xe090
movsd %xmm0, -0x50(%rbp)
leal -0x1(%r15), %eax
cmpl $0x1, %eax
ja 0x8d3f
movq %r14, %rdi
callq 0x10b0
movq %rax, %r12
movl %r12d, -0x40(%rbp)
movq %rbx, %rdi
callq 0x10b0
movq %rax, %r15
movl %r15d, -0x3c(%rbp)
testl %r12d, %r12d
jle 0x8cff
incl %r12d
decq %r12
xorl %r13d, %r13d
movsbl (%r14,%r13), %edi
callq 0x130c
movb %al, -0x10f(%rbp,%r13)
incq %r13
cmpq %r13, %r12
jne 0x8ce5
testl %r15d, %r15d
jle 0x8e40
movl %r15d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
incl %r15d
addq %rax, %rbx
decq %rbx
movl $0x1, %r14d
movsbl (%rbx), %edi
callq 0x130c
movb %al, -0x150(%rbp,%r14)
incq %r14
decq %rbx
cmpq %r14, %r15
jne 0x8d1f
jmp 0x8e40
cmpl $0x3, %r15d
jne 0x8dcd
movq %rbx, %rdi
callq 0x10b0
movq %rax, %r12
movl %r12d, -0x40(%rbp)
movq %r14, %rdi
callq 0x10b0
movq %rax, %r15
movl %r15d, -0x3c(%rbp)
testl %r12d, %r12d
jle 0x8d8f
incl %r12d
decq %r12
xorl %r13d, %r13d
movsbl (%rbx,%r13), %edi
callq 0x130c
movb %al, -0x10f(%rbp,%r13)
incq %r13
cmpq %r13, %r12
jne 0x8d75
testl %r15d, %r15d
jle 0x8e40
movl %r15d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
incl %r15d
leaq (%rax,%r14), %rbx
decq %rbx
movl $0x1, %r14d
movsbl (%rbx), %edi
callq 0x130c
movb %al, -0x150(%rbp,%r14)
incq %r14
decq %rbx
cmpq %r14, %r15
jne 0x8db0
jmp 0x8e40
movq %r14, %rdi
callq 0x10b0
movq %rax, %r12
movl %r12d, -0x40(%rbp)
movq %rbx, %rdi
callq 0x10b0
movq %rax, %r15
movl %r15d, -0x3c(%rbp)
decl %eax
movl %eax, -0x38(%rbp)
testl %r12d, %r12d
jle 0x8e18
incl %r12d
decq %r12
xorl %r13d, %r13d
movsbl (%r14,%r13), %edi
callq 0x130c
movb %al, -0x10f(%rbp,%r13)
incq %r13
cmpq %r13, %r12
jne 0x8dfe
testl %r15d, %r15d
jle 0x8e40
incl %r15d
decq %r15
xorl %r14d, %r14d
movsbl (%rbx,%r14), %edi
callq 0x130c
movb %al, -0x14f(%rbp,%r14)
incq %r14
cmpq %r14, %r15
jne 0x8e26
movq 0x70(%rbp), %r13
movslq -0x3c(%rbp), %rdx
movb $0x4, %al
leaq -0x150(%rbp), %r8
movb %al, 0x1(%rdx,%r8)
movb %al, -0x150(%rbp)
movl -0x40(%rbp), %r14d
movslq %r14d, %r12
leaq -0x110(%rbp), %rcx
movb %al, 0x1(%r12,%rcx)
movb %al, -0x110(%rbp)
movl 0xe0(%rbp), %r15d
cmpl $0x4, %r15d
jne 0x9121
leaq -0x40(%rbp), %rdi
leaq -0x7680(%rbp), %rsi
leaq -0xe700(%rbp), %r15
movq %r15, %rdx
movq %rcx, %r13
movq %r8, %rbx
callq 0x3196
leaq -0x60(%rbp), %r10
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0xa0(%rbp), %rcx
movq 0x30(%rbp), %r8
movq 0x38(%rbp), %r9
pushq %rbx
pushq %r13
pushq %r15
leaq -0x7680(%rbp), %rax
pushq %rax
leaq -0x40(%rbp), %rax
pushq %rax
pushq %r10
movq 0xd8(%rbp), %r13
pushq %r13
movq 0xd0(%rbp), %r15
pushq %r15
movl 0xc8(%rbp), %eax
pushq %rax
movl 0xc0(%rbp), %eax
pushq %rax
pushq 0xb8(%rbp)
pushq 0xb0(%rbp)
pushq 0xa8(%rbp)
pushq 0xa0(%rbp)
pushq 0x98(%rbp)
pushq 0x90(%rbp)
pushq 0x88(%rbp)
pushq 0x80(%rbp)
movq 0x78(%rbp), %rbx
pushq %rbx
movq 0x70(%rbp), %r15
pushq %r15
pushq 0x68(%rbp)
pushq 0x60(%rbp)
pushq 0x58(%rbp)
pushq 0x50(%rbp)
pushq 0x48(%rbp)
pushq 0x40(%rbp)
callq 0x4316
addq $0xc8, %rsp
leaq -0x330(%rbp), %rax
leaq -0x600(%rbp), %r10
movsd 0x5137(%rip), %xmm0     # 0xe0a8
movq 0x10(%rbp), %rdi
movq 0x18(%rbp), %rsi
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %rcx
movq %r15, %r8
movq %rbx, %r9
leaq -0x40(%rbp), %rbx
leaq -0x110(%rbp), %r11
pushq %r11
pushq %rax
pushq %r10
leaq -0xe700(%rbp), %rax
pushq %rax
leaq -0x7680(%rbp), %rax
pushq %rax
pushq %rbx
leaq -0x60(%rbp), %rax
pushq %rax
movq %r13, %r15
pushq %r13
pushq 0xd0(%rbp)
callq 0x50b6
addq $0x50, %rsp
movsd -0x330(%rbp,%r12,8), %xmm3
movsd -0x600(%rbp,%r12,8), %xmm0
movsd %xmm0, -0x78(%rbp)
testl %r14d, %r14d
movapd %xmm3, -0xb0(%rbp)
jle 0x9005
leaq (,%r14,4), %rdx
leaq -0x420(%rbp), %rdi
xorl %esi, %esi
callq 0x1100
movapd -0xb0(%rbp), %xmm3
movapd 0x50a3(%rip), %xmm1     # 0xe0b0
andpd %xmm3, %xmm1
xorpd %xmm0, %xmm0
movsd 0x5013(%rip), %xmm2     # 0xe030
ucomisd %xmm1, %xmm2
jbe 0x974a
subq $0x8, %rsp
leaq -0x420(%rbp), %r12
movq %r12, %rdi
movq -0x88(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq -0x98(%rbp), %rcx
movq -0xa0(%rbp), %r8
movq 0x10(%rbp), %r9
leaq -0x150(%rbp), %rax
pushq %rax
leaq -0x110(%rbp), %rax
pushq %rax
leaq -0x330(%rbp), %rax
pushq %rax
leaq -0x600(%rbp), %rax
pushq %rax
leaq -0xe700(%rbp), %rax
pushq %rax
leaq -0x7680(%rbp), %rax
pushq %rax
pushq %rbx
leaq -0x60(%rbp), %rax
pushq %rax
pushq %r15
pushq 0xd0(%rbp)
movl 0xc8(%rbp), %eax
pushq %rax
movl 0xc0(%rbp), %eax
pushq %rax
pushq 0xb8(%rbp)
pushq 0xb0(%rbp)
pushq 0xa8(%rbp)
pushq 0xa0(%rbp)
pushq 0x98(%rbp)
pushq 0x90(%rbp)
pushq 0x88(%rbp)
pushq 0x80(%rbp)
pushq 0x78(%rbp)
pushq 0x70(%rbp)
pushq 0x68(%rbp)
pushq 0x60(%rbp)
pushq 0x58(%rbp)
pushq 0x50(%rbp)
pushq 0x48(%rbp)
pushq 0x40(%rbp)
pushq 0x38(%rbp)
pushq 0x30(%rbp)
pushq 0x28(%rbp)
pushq 0x20(%rbp)
pushq 0x18(%rbp)
callq 0x5656
addq $0x110, %rsp            # imm = 0x110
movq %r12, %rdi
movapd -0xb0(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movq %rbx, %rsi
callq 0x71cc
jmp 0x972a
movq %r14, -0x70(%rbp)
movl %edx, %eax
movq %rax, -0xd0(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdx, -0x68(%rbp)
movl %edx, 0x8(%rdi)
leaq -0x7680(%rbp), %rsi
leaq -0xe700(%rbp), %rdx
movq %rdi, %rbx
movq %rcx, %r14
movq %r8, %r12
callq 0x7257
leaq -0x60(%rbp), %r10
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0xa0(%rbp), %rcx
movq 0x10(%rbp), %r8
movq 0x18(%rbp), %r9
pushq %r12
pushq %r14
leaq -0xe700(%rbp), %rax
pushq %rax
leaq -0x7680(%rbp), %rax
pushq %rax
pushq %rbx
pushq %r10
pushq 0xd8(%rbp)
pushq 0xd0(%rbp)
movq 0x78(%rbp), %r14
pushq %r14
pushq %r13
pushq 0x68(%rbp)
pushq 0x60(%rbp)
movq 0x58(%rbp), %rbx
pushq %rbx
pushq 0x50(%rbp)
pushq 0x40(%rbp)
pushq 0x38(%rbp)
movq 0x28(%rbp), %r12
pushq %r12
movq 0x20(%rbp), %r14
pushq %r14
callq 0x7df0
addq $0x90, %rsp
movabsq $-0x10000000000000, %rdx # imm = 0xFFF0000000000000
leaq -0x60(%rbp), %rax
movq %rdx, 0x18(%rax)
leaq -0x40(%rbp), %rax
movq $0x0, 0xc(%rax)
cmpl $0x1, %r15d
movq 0x78(%rbp), %r10
movq 0x18(%rbp), %r8
movq %r14, %r9
movq %r12, %r11
movq 0x10(%rbp), %rcx
movq %rbx, %r14
jne 0x93d2
movl -0x34(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x80(%rbp)
cmpl $0x0, -0x70(%rbp)
jle 0x93ad
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movq -0x68(%rbp), %rdx
leal 0x1(%rdx), %r14d
movl $0x1, %r13d
xorl %r15d, %r15d
leaq -0x330(%rbp), %r12
testl %edx, %edx
movl %r15d, -0xc4(%rbp)
jle 0x938e
movl $0x1, %ebx
movl %r13d, %edi
movl %ebx, %esi
movq %r12, %rdx
leaq -0x150(%rbp), %rax
pushq %rax
leaq -0x110(%rbp), %rax
pushq %rax
leaq -0x60(%rbp), %rax
pushq %rax
pushq 0xd8(%rbp)
pushq 0xd0(%rbp)
pushq %r10
pushq 0x70(%rbp)
pushq %r11
callq 0x81d4
addq $0x40, %rsp
movsd -0x330(%rbp), %xmm0
movsd 0x4d8b(%rip), %xmm2     # 0xe058
addsd %xmm2, %xmm0
movsd %xmm0, -0x330(%rbp)
movsd -0x328(%rbp), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, -0x328(%rbp)
movslq %r15d, %rax
addsd -0x7680(%rbp,%rax,8), %xmm1
xorpd %xmm3, %xmm3
ucomisd %xmm1, %xmm3
addsd -0x78(%rbp), %xmm1
addsd -0xe700(%rbp,%rax,8), %xmm0
movapd %xmm0, %xmm2
addsd -0xc0(%rbp), %xmm2
addsd -0xb8(%rbp), %xmm2
divsd %xmm2, %xmm1
addsd 0x4d51(%rip), %xmm1     # 0xe080
jbe 0x936b
ucomisd %xmm0, %xmm3
jbe 0x936b
ucomisd -0xb0(%rbp), %xmm1
movq 0x78(%rbp), %r10
movq 0x18(%rbp), %r8
movq 0x20(%rbp), %r9
movq 0x28(%rbp), %r11
movq 0x10(%rbp), %rcx
jbe 0x937f
movsd %xmm1, -0x48(%rbp)
movsd %xmm1, -0xb0(%rbp)
movl %ebx, -0x80(%rbp)
movl %r13d, -0x7c(%rbp)
jmp 0x937f
movq 0x78(%rbp), %r10
movq 0x18(%rbp), %r8
movq 0x20(%rbp), %r9
movq 0x28(%rbp), %r11
movq 0x10(%rbp), %rcx
incq %rbx
incl %r15d
cmpq %rbx, %r14
jne 0x9284
leal 0x1(%r13), %eax
movq -0x68(%rbp), %rdx
movl -0xc4(%rbp), %r15d
addl %edx, %r15d
cmpl -0x70(%rbp), %r13d
movl %eax, %r13d
jne 0x9270
movl -0x7c(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x30(%rbp)
movq 0x58(%rbp), %r14
movq 0x70(%rbp), %r13
movl 0xe0(%rbp), %r15d
movabsq $-0x10000000000000, %rdx # imm = 0xFFF0000000000000
andl $-0x2, %r15d
cmpl $0x2, %r15d
movq 0xd0(%rbp), %r15
jne 0x9575
movq %r13, %r12
movl $0x0, -0x30(%rbp)
movq -0x70(%rbp), %rax
movl %eax, -0x34(%rbp)
movq %rdx, -0x48(%rbp)
movq -0x68(%rbp), %rdx
testl %edx, %edx
jle 0x9560
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
leal -0x1(%rax), %r14d
imull %edx, %r14d
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movq -0xd0(%rbp), %rax
leaq 0x1(%rax), %r13
xorl %r15d, %r15d
movl $0x1, %ebx
movq -0x70(%rbp), %rdi
movl %ebx, %esi
leaq -0x330(%rbp), %rdx
leaq -0x150(%rbp), %rax
pushq %rax
leaq -0x110(%rbp), %rax
pushq %rax
leaq -0x60(%rbp), %rax
pushq %rax
pushq 0xd8(%rbp)
pushq 0xd0(%rbp)
pushq %r10
pushq %r12
pushq %r11
callq 0x81d4
xorpd %xmm3, %xmm3
addq $0x40, %rsp
movsd -0x330(%rbp), %xmm0
movsd 0x4bb3(%rip), %xmm2     # 0xe058
addsd %xmm2, %xmm0
movsd %xmm0, -0x330(%rbp)
movsd -0x328(%rbp), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, -0x328(%rbp)
movslq %r14d, %rax
addsd -0x7680(%rbp,%rax,8), %xmm1
ucomisd %xmm1, %xmm3
addsd -0x78(%rbp), %xmm1
addsd -0xe700(%rbp,%rax,8), %xmm0
movapd %xmm0, %xmm2
addsd -0xc0(%rbp), %xmm2
addsd -0xb8(%rbp), %xmm2
divsd %xmm2, %xmm1
addsd 0x4b7d(%rip), %xmm1     # 0xe080
jbe 0x953b
ucomisd %xmm0, %xmm3
jbe 0x953b
ucomisd -0xb0(%rbp), %xmm1
movq 0x78(%rbp), %r10
movq 0x18(%rbp), %r8
movq 0x20(%rbp), %r9
movq 0x28(%rbp), %r11
movq 0x10(%rbp), %rcx
jbe 0x954f
movsd %xmm1, -0x48(%rbp)
movl %ebx, %r15d
movsd %xmm1, -0xb0(%rbp)
jmp 0x954f
movq 0x78(%rbp), %r10
movq 0x18(%rbp), %r8
movq 0x20(%rbp), %r9
movq 0x28(%rbp), %r11
movq 0x10(%rbp), %rcx
incq %rbx
incl %r14d
cmpq %rbx, %r13
jne 0x9454
jmp 0x9563
xorl %r15d, %r15d
movl %r15d, -0x30(%rbp)
movq 0x58(%rbp), %r14
movq %r12, %r13
movq 0xd0(%rbp), %r15
movsd -0x48(%rbp), %xmm0
andpd 0x4b2e(%rip), %xmm0     # 0xe0b0
ucomisd 0x4aa6(%rip), %xmm0     # 0xe030
jbe 0x959a
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, -0x34(%rbp)
movl -0x34(%rbp), %r12d
movl -0x30(%rbp), %ebx
leaq -0x330(%rbp), %rdx
movl %r12d, %edi
movl %ebx, %esi
leaq -0x150(%rbp), %rax
pushq %rax
leaq -0x110(%rbp), %rax
pushq %rax
leaq -0x60(%rbp), %rax
pushq %rax
pushq 0xd8(%rbp)
pushq %r15
pushq %r10
pushq %r13
pushq %r11
callq 0x81d4
addq $0x40, %rsp
movq -0x70(%rbp), %rax
testl %eax, %eax
jle 0x95f7
leaq (,%rax,4), %rdx
leaq -0x420(%rbp), %rdi
xorl %esi, %esi
callq 0x1100
movq %r14, %r15
cmpl $0x0, -0x68(%rbp)
jle 0x9619
movq -0xd0(%rbp), %rdx
shlq $0x2, %rdx
leaq -0x600(%rbp), %rdi
xorl %esi, %esi
callq 0x1100
leal -0x1(%r12), %eax
imull -0x68(%rbp), %eax
addl %ebx, %eax
decl %eax
movslq %eax, %r14
movsd -0x7680(%rbp,%r14,8), %xmm1
andpd 0x4a75(%rip), %xmm1     # 0xe0b0
xorpd %xmm0, %xmm0
movsd 0x49e9(%rip), %xmm2     # 0xe030
ucomisd %xmm1, %xmm2
jbe 0x974a
leaq -0x420(%rbp), %rdx
leaq -0x600(%rbp), %rcx
movl %r12d, %edi
movl %ebx, %esi
movq -0x88(%rbp), %r8
movq -0x90(%rbp), %r9
leaq -0x150(%rbp), %rax
pushq %rax
leaq -0x110(%rbp), %rax
pushq %rax
leaq -0xe700(%rbp), %rax
pushq %rax
leaq -0x7680(%rbp), %rax
pushq %rax
leaq -0x40(%rbp), %rbx
pushq %rbx
leaq -0x60(%rbp), %r12
pushq %r12
pushq 0xd8(%rbp)
pushq 0xd0(%rbp)
pushq 0x78(%rbp)
pushq %r13
pushq 0x68(%rbp)
pushq 0x60(%rbp)
pushq %r15
pushq 0x50(%rbp)
pushq 0x40(%rbp)
pushq 0x38(%rbp)
pushq 0x28(%rbp)
pushq 0x20(%rbp)
pushq 0x18(%rbp)
pushq 0x10(%rbp)
pushq -0xa0(%rbp)
pushq -0x98(%rbp)
callq 0x85db
addq $0xb0, %rsp
movsd -0x7680(%rbp,%r14,8), %xmm0
addsd -0x328(%rbp), %xmm0
addsd -0x60(%rbp), %xmm0
movsd -0xe700(%rbp,%r14,8), %xmm1
addsd -0x330(%rbp), %xmm1
addsd -0x58(%rbp), %xmm1
leaq -0x420(%rbp), %rdi
leaq -0x600(%rbp), %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x8a58
movsd 0x4966(%rip), %xmm1     # 0xe098
mulsd %xmm1, %xmm0
addsd 0x4962(%rip), %xmm0     # 0xe0a0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
divsd %xmm1, %xmm0
addq $0xe6d8, %rsp           # imm = 0xE6D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq