// File: /workspace/github_c_makefile_star2_O3/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 $0xe6f8, %rsp           # imm = 0xE6F8
movq %r9, -0xb0(%rbp)
movq %r8, -0xa8(%rbp)
movq %rcx, -0xa0(%rbp)
movq %rdx, -0x98(%rbp)
movq %rsi, %rbx
movq %rdi, %r14
movl 0xe0(%rbp), %r15d
cmpl $0x4, %r15d
jne 0x8943
xorl %ecx, %ecx
movq %rcx, -0xe0(%rbp)
movabsq $-0x425a02801e869b6b, %rax # imm = 0xBDA5FD7FE1796495
movq %rax, -0xd8(%rbp)
movq $0x0, -0x50(%rbp)
movq %rcx, -0xd0(%rbp)
movsd 0x57f9(%rip), %xmm0     # 0xe098
movsd %xmm0, -0x60(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd %xmm0, -0x88(%rbp)
movq %r14, %rdi
callq 0x10b0
movq %rax, %r12
movl %r12d, -0x80(%rbp)
movq %rbx, %rdi
callq 0x10b0
movl %eax, -0x7c(%rbp)
movq %rax, -0x30(%rbp)
decl %eax
movl %eax, -0x78(%rbp)
movq %r12, %r15
testl %r12d, %r12d
jle 0x8908
movl %r15d, %r12d
incl %r12d
decq %r12
xorl %r13d, %r13d
movsbl (%r14,%r13), %edi
callq 0x131c
movb %al, -0x12f(%rbp,%r13)
incq %r13
cmpq %r13, %r12
jne 0x88ee
movq -0x30(%rbp), %r12
testl %r12d, %r12d
jle 0x8a6a
movl %r12d, %r14d
incl %r14d
decq %r14
xorl %r12d, %r12d
movq %r15, %r13
movsbl (%rbx,%r12), %edi
callq 0x131c
movb %al, -0x16f(%rbp,%r12)
incq %r12
cmpq %r12, %r14
jne 0x8924
jmp 0x8a61
movabsq $0x4069000000000000, %rax # imm = 0x4069000000000000
movq %rax, -0xe0(%rbp)
movabsq $-0x3fe9333333333333, %rax # imm = 0xC016CCCCCCCCCCCD
movq %rax, -0xd8(%rbp)
movq %r14, %rdi
callq 0x8737
testl %eax, %eax
je 0x8987
movq %rbx, %rdi
callq 0x8737
testl %eax, %eax
je 0x8987
movsd 0x56f3(%rip), %xmm0     # 0xe078
jmp 0x898f
movsd 0x56f1(%rip), %xmm0     # 0xe080
movsd %xmm0, -0xd0(%rbp)
cmpl $0x1, %r15d
sete %cl
leal -0x1(%r15), %eax
cmpl $0x1, %eax
movsd %xmm0, -0xe8(%rbp)
ja 0x8a72
movq %rcx, -0x50(%rbp)
movq %r14, %rdi
callq 0x10b0
movq %rax, %r12
movl %r12d, -0x80(%rbp)
movq %rbx, %rdi
callq 0x10b0
movq %rax, -0x30(%rbp)
movl %eax, -0x7c(%rbp)
movq %r12, %r15
testl %r12d, %r12d
jle 0x8a03
movl %r15d, %r12d
incl %r12d
decq %r12
xorl %r13d, %r13d
movsbl (%r14,%r13), %edi
callq 0x131c
movb %al, -0x12f(%rbp,%r13)
incq %r13
cmpq %r13, %r12
jne 0x89e9
movsd 0x567d(%rip), %xmm0     # 0xe088
movsd %xmm0, -0x88(%rbp)
movsd 0x5675(%rip), %xmm0     # 0xe090
movsd %xmm0, -0x60(%rbp)
movq -0x30(%rbp), %r12
testl %r12d, %r12d
jle 0x8a6a
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %r12d, %r14d
incl %r14d
addq %rax, %rbx
decq %rbx
movl $0x1, %r12d
movq %r15, %r13
movsbl (%rbx), %edi
callq 0x131c
movb %al, -0x170(%rbp,%r12)
incq %r12
decq %rbx
cmpq %r12, %r14
jne 0x8a46
movq -0x30(%rbp), %r12
jmp 0x8b28
movq %r15, %r13
jmp 0x8b28
cmpl $0x3, %r15d
jne 0x90be
movq %rbx, %rdi
callq 0x10b0
movq %rax, %r13
movl %r13d, -0x80(%rbp)
movq %r14, %rdi
callq 0x10b0
movq %rax, -0x30(%rbp)
movl %eax, -0x7c(%rbp)
testl %r13d, %r13d
jle 0x8ac5
movl %r13d, %r15d
incl %r15d
decq %r15
xorl %r12d, %r12d
movsbl (%rbx,%r12), %edi
callq 0x131c
movb %al, -0x12f(%rbp,%r12)
incq %r12
cmpq %r12, %r15
jne 0x8aab
movsd 0x55bb(%rip), %xmm0     # 0xe088
movsd %xmm0, -0x88(%rbp)
movsd 0x55b3(%rip), %xmm0     # 0xe090
movsd %xmm0, -0x60(%rbp)
movq -0x30(%rbp), %r12
testl %r12d, %r12d
jle 0x8b20
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %r12d, %ebx
incl %ebx
addq %rax, %r14
decq %r14
movl $0x1, %r15d
movsbl (%r14), %edi
callq 0x131c
movb %al, -0x170(%rbp,%r15)
incq %r15
decq %r14
cmpq %r15, %rbx
jne 0x8b04
movq $0x0, -0x50(%rbp)
leal 0x1(%r12), %edx
movslq %edx, %rax
movb $0x4, %cl
movb %cl, -0x170(%rbp,%rax)
leal 0x1(%r13), %eax
cltq
movb %cl, -0x130(%rbp,%rax)
movb %cl, -0x170(%rbp)
movb %cl, -0x130(%rbp)
movl 0xe0(%rbp), %eax
cmpl $0x4, %eax
jne 0x8dfb
movq 0x30(%rbp), %r12
leaq -0x80(%rbp), %rdi
leaq -0x76a0(%rbp), %r14
leaq -0xe720(%rbp), %rbx
leaq -0x130(%rbp), %r15
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x30f1
leaq -0x170(%rbp), %rax
leaq -0xe0(%rbp), %r10
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0xb0(%rbp), %rcx
movq %r12, %r8
movq 0x38(%rbp), %r9
pushq %rax
pushq %r15
pushq %rbx
pushq %r14
leaq -0x80(%rbp), %rax
pushq %rax
pushq %r10
movq 0xd8(%rbp), %rbx
pushq %rbx
movq 0xd0(%rbp), %r12
pushq %r12
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), %r14
pushq %r14
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 0x4234
addq $0xc8, %rsp
leaq -0x350(%rbp), %rax
leaq -0x620(%rbp), %r10
movsd 0x5457(%rip), %xmm0     # 0xe0b0
movq 0x10(%rbp), %rdi
movq 0x18(%rbp), %rsi
movq 0x20(%rbp), %rdx
movq 0x28(%rbp), %rcx
movq %r15, %r8
leaq -0xe720(%rbp), %r15
movq %r14, %r9
leaq -0x76a0(%rbp), %r14
leaq -0x130(%rbp), %r11
pushq %r11
pushq %rax
pushq %r10
pushq %r15
pushq %r14
leaq -0x80(%rbp), %rax
pushq %rax
leaq -0xe0(%rbp), %rax
pushq %rax
pushq %rbx
movq %r12, %rbx
pushq %r12
callq 0x4fa7
addq $0x50, %rsp
movslq %r13d, %rax
movsd -0x350(%rbp,%rax,8), %xmm3
movsd -0x620(%rbp,%rax,8), %xmm0
movsd %xmm0, -0x60(%rbp)
testl %r13d, %r13d
movapd %xmm3, -0x50(%rbp)
jle 0x8ce7
movl %r13d, %edx
shlq $0x2, %rdx
leaq -0x440(%rbp), %rdi
xorl %esi, %esi
callq 0x1100
movapd -0x50(%rbp), %xmm3
movapd 0x53d1(%rip), %xmm1     # 0xe0c0
andpd %xmm3, %xmm1
xorpd %xmm0, %xmm0
movsd 0x5321(%rip), %xmm2     # 0xe020
ucomisd %xmm1, %xmm2
jbe 0x94c6
subq $0x8, %rsp
leaq -0x440(%rbp), %r12
movq %r12, %rdi
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
movq -0xb0(%rbp), %r8
movq 0x10(%rbp), %r9
leaq -0x170(%rbp), %rax
pushq %rax
leaq -0x130(%rbp), %rax
pushq %rax
leaq -0x350(%rbp), %rax
pushq %rax
leaq -0x620(%rbp), %rax
pushq %rax
pushq %r15
pushq %r14
leaq -0x80(%rbp), %r14
pushq %r14
leaq -0xe0(%rbp), %rax
pushq %rax
pushq 0xd8(%rbp)
pushq %rbx
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 0x5548
addq $0x110, %rsp            # imm = 0x110
movq %r12, %rdi
movapd -0x50(%rbp), %xmm0
movsd -0x60(%rbp), %xmm1
movq %r14, %rsi
callq 0x6ee0
jmp 0x94a6
movl %edx, -0x8c(%rbp)
movq %r13, -0xb8(%rbp)
leaq -0x80(%rbp), %r14
movl %r12d, 0x8(%r14)
leaq -0x76a0(%rbp), %rsi
leaq -0xe720(%rbp), %r15
leaq -0x130(%rbp), %r13
leaq -0x170(%rbp), %rbx
movq %r14, %rdi
movq %r15, %rdx
movq %r13, %rcx
movq %rbx, %r8
callq 0x6f6b
leaq -0xe0(%rbp), %rax
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
movq -0xb0(%rbp), %rcx
movq 0x10(%rbp), %r8
movq 0x18(%rbp), %r9
pushq %rbx
pushq %r13
pushq %r15
movq 0x50(%rbp), %r15
leaq -0x76a0(%rbp), %r10
pushq %r10
pushq %r14
pushq %rax
movq %rax, %rbx
pushq 0xd8(%rbp)
pushq 0xd0(%rbp)
pushq 0x78(%rbp)
pushq 0x70(%rbp)
pushq 0x68(%rbp)
pushq 0x60(%rbp)
pushq 0x58(%rbp)
pushq %r15
pushq 0x40(%rbp)
pushq 0x38(%rbp)
pushq 0x28(%rbp)
pushq 0x20(%rbp)
callq 0x7a71
addq $0x90, %rsp
movabsq $-0x10000000000000, %rdx # imm = 0xFFF0000000000000
movq %rdx, 0x18(%rbx)
movq $0x0, 0xc(%r14)
cmpb $0x0, -0x50(%rbp)
je 0x9084
cmpl $0x0, -0xb8(%rbp)
jle 0x90e4
movl -0x8c(%rbp), %r13d
movsd 0x515f(%rip), %xmm0     # 0xe050
movapd %xmm0, -0x50(%rbp)
movl $0x1, %r14d
xorl %edx, %edx
movq $0x0, -0x58(%rbp)
movq $0x0, -0x38(%rbp)
movq 0x70(%rbp), %r10
movq 0x78(%rbp), %r11
movq 0x18(%rbp), %r8
movq 0x20(%rbp), %r9
movq 0x10(%rbp), %rcx
movq %r12, -0x30(%rbp)
testl %r12d, %r12d
movl %edx, -0xec(%rbp)
jle 0x905e
movl $0x1, %ebx
movl %edx, %r12d
movq 0x28(%rbp), %rax
movl %r14d, %edi
movl %ebx, %esi
leaq -0x350(%rbp), %rdx
leaq -0x170(%rbp), %r15
pushq %r15
leaq -0x130(%rbp), %r15
pushq %r15
leaq -0xe0(%rbp), %r15
pushq %r15
pushq 0xd8(%rbp)
pushq 0xd0(%rbp)
pushq %r11
pushq %r10
pushq %rax
callq 0x7e63
addq $0x40, %rsp
movsd -0x350(%rbp), %xmm0
movsd 0x50b6(%rip), %xmm2     # 0xe048
addsd %xmm2, %xmm0
movsd %xmm0, -0x350(%rbp)
movsd -0x348(%rbp), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, -0x348(%rbp)
movslq %r12d, %rax
addsd -0x76a0(%rbp,%rax,8), %xmm1
xorpd %xmm3, %xmm3
ucomisd %xmm1, %xmm3
addsd -0x88(%rbp), %xmm1
addsd -0xe720(%rbp,%rax,8), %xmm0
movapd %xmm0, %xmm2
addsd -0x60(%rbp), %xmm2
addsd -0xe8(%rbp), %xmm2
divsd %xmm2, %xmm1
addsd 0x507c(%rip), %xmm1     # 0xe070
jbe 0x9037
ucomisd %xmm0, %xmm3
jbe 0x9037
ucomisd -0x50(%rbp), %xmm1
movq 0x70(%rbp), %r10
movq 0x78(%rbp), %r11
movq 0x18(%rbp), %r8
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %r9
movq 0x10(%rbp), %rcx
jbe 0x904f
movsd %xmm1, -0xc8(%rbp)
movapd %xmm1, -0x50(%rbp)
movl %ebx, %edx
movq %rdx, -0x38(%rbp)
movl %r14d, %edx
movq %rdx, -0x58(%rbp)
jmp 0x904f
movq 0x70(%rbp), %r10
movq 0x78(%rbp), %r11
movq 0x18(%rbp), %r8
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %r9
movq 0x10(%rbp), %rcx
incq %rbx
incl %r12d
cmpq %rbx, %r13
jne 0x8f41
leal 0x1(%r14), %eax
movq -0x30(%rbp), %r12
movl -0xec(%rbp), %edx
addl %r12d, %edx
cmpl -0xb8(%rbp), %r14d
movl %eax, %r14d
jne 0x8f26
jmp 0x9115
movsd 0x4fc4(%rip), %xmm0     # 0xe050
movapd %xmm0, -0x50(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x58(%rbp)
movq 0x70(%rbp), %r10
movq 0x78(%rbp), %r11
movq 0x18(%rbp), %r8
movq 0x20(%rbp), %r9
movq 0x10(%rbp), %rcx
movq -0xb8(%rbp), %r13
jmp 0x9138
movq %rcx, -0x50(%rbp)
movsd 0x4fbe(%rip), %xmm0     # 0xe088
movsd %xmm0, -0x88(%rbp)
movsd 0x4fb6(%rip), %xmm0     # 0xe090
movsd %xmm0, -0x60(%rbp)
jmp 0x88b7
movq $0x0, -0x38(%rbp)
movsd 0x4f5c(%rip), %xmm0     # 0xe050
movapd %xmm0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq 0x70(%rbp), %r10
movq 0x78(%rbp), %r11
movq 0x18(%rbp), %r8
movq 0x20(%rbp), %r9
movq 0x10(%rbp), %rcx
movq -0x58(%rbp), %rax
movl %eax, -0x74(%rbp)
movq -0x38(%rbp), %rax
movl %eax, -0x70(%rbp)
movq -0xb8(%rbp), %r13
movq 0x50(%rbp), %r15
movabsq $-0x10000000000000, %rdx # imm = 0xFFF0000000000000
movl 0xe0(%rbp), %eax
andl $-0x2, %eax
cmpl $0x2, %eax
movq 0x28(%rbp), %rax
jne 0x92d2
movl %r13d, -0x74(%rbp)
movq %rdx, -0xc8(%rbp)
testl %r12d, %r12d
movq %r12, -0x30(%rbp)
jle 0x92a7
leal -0x1(%r13), %r15d
imull %r12d, %r15d
movl -0x8c(%rbp), %r12d
movq $0x0, -0x38(%rbp)
movsd 0x4ecb(%rip), %xmm0     # 0xe050
movapd %xmm0, -0x50(%rbp)
movl $0x1, %ebx
movl %r13d, %edi
movl %ebx, %esi
leaq -0x350(%rbp), %rdx
leaq -0x170(%rbp), %r14
pushq %r14
leaq -0x130(%rbp), %r14
pushq %r14
leaq -0xe0(%rbp), %r14
pushq %r14
pushq 0xd8(%rbp)
pushq 0xd0(%rbp)
pushq %r11
pushq %r10
pushq %rax
callq 0x7e63
xorpd %xmm3, %xmm3
addq $0x40, %rsp
movsd -0x350(%rbp), %xmm0
movsd 0x4e64(%rip), %xmm2     # 0xe048
addsd %xmm2, %xmm0
movsd %xmm0, -0x350(%rbp)
movsd -0x348(%rbp), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, -0x348(%rbp)
movslq %r15d, %rax
addsd -0x76a0(%rbp,%rax,8), %xmm1
ucomisd %xmm1, %xmm3
addsd -0x88(%rbp), %xmm1
addsd -0xe720(%rbp,%rax,8), %xmm0
movapd %xmm0, %xmm2
addsd -0x60(%rbp), %xmm2
addsd -0xe8(%rbp), %xmm2
divsd %xmm2, %xmm1
addsd 0x4e2e(%rip), %xmm1     # 0xe070
jbe 0x927e
ucomisd %xmm0, %xmm3
jbe 0x927e
ucomisd -0x50(%rbp), %xmm1
movq 0x70(%rbp), %r10
movq 0x78(%rbp), %r11
movq 0x18(%rbp), %r8
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %r9
movq 0x10(%rbp), %rcx
jbe 0x9296
movsd %xmm1, -0xc8(%rbp)
movl %ebx, %edx
movq %rdx, -0x38(%rbp)
movapd %xmm1, -0x50(%rbp)
jmp 0x9296
movq 0x70(%rbp), %r10
movq 0x78(%rbp), %r11
movq 0x18(%rbp), %r8
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %r9
movq 0x10(%rbp), %rcx
incq %rbx
incl %r15d
cmpq %rbx, %r12
jne 0x918f
jmp 0x92bc
movq $0x0, -0x38(%rbp)
movsd 0x4d99(%rip), %xmm0     # 0xe050
movapd %xmm0, -0x50(%rbp)
movq -0x38(%rbp), %rdx
movl %edx, -0x70(%rbp)
movl %r13d, %edx
movq %rdx, -0x58(%rbp)
movq -0x30(%rbp), %r12
movq 0x50(%rbp), %r15
movapd -0x50(%rbp), %xmm0
andpd 0x4de1(%rip), %xmm0     # 0xe0c0
ucomisd 0x4d39(%rip), %xmm0     # 0xe020
jbe 0x930d
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, -0x74(%rbp)
movq 0x28(%rbp), %rax
movl $0x1, %edx
movq %rdx, -0x38(%rbp)
movl $0x1, %edx
movq %rdx, -0x58(%rbp)
leaq -0x350(%rbp), %rdx
movq -0x58(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq -0x170(%rbp), %rbx
pushq %rbx
leaq -0x130(%rbp), %rbx
pushq %rbx
leaq -0xe0(%rbp), %r14
pushq %r14
pushq 0xd8(%rbp)
pushq 0xd0(%rbp)
pushq %r11
pushq %r10
pushq %rax
callq 0x7e63
addq $0x40, %rsp
testl %r13d, %r13d
jle 0x9369
movl %r13d, %edx
shlq $0x2, %rdx
leaq -0x440(%rbp), %rdi
xorl %esi, %esi
callq 0x1100
movq %r15, %r13
movq 0x40(%rbp), %rbx
movq 0x38(%rbp), %r14
testl %r12d, %r12d
jle 0x938e
movl %r12d, %edx
shlq $0x2, %rdx
leaq -0x620(%rbp), %rdi
xorl %esi, %esi
callq 0x1100
movq -0x58(%rbp), %rdi
leal -0x1(%rdi), %eax
imull %r12d, %eax
movq -0x38(%rbp), %rsi
addl %esi, %eax
decl %eax
movslq %eax, %r15
movsd -0x76a0(%rbp,%r15,8), %xmm1
andpd 0x4d0a(%rip), %xmm1     # 0xe0c0
xorpd %xmm0, %xmm0
movsd 0x4c5e(%rip), %xmm2     # 0xe020
ucomisd %xmm1, %xmm2
jbe 0x94c6
leaq -0x440(%rbp), %rdx
leaq -0x620(%rbp), %rcx
movq -0x98(%rbp), %r8
movq -0xa0(%rbp), %r9
leaq -0x170(%rbp), %rax
pushq %rax
leaq -0x130(%rbp), %rax
pushq %rax
leaq -0xe720(%rbp), %rax
pushq %rax
leaq -0x76a0(%rbp), %rax
pushq %rax
leaq -0x80(%rbp), %r12
pushq %r12
leaq -0xe0(%rbp), %r12
pushq %r12
pushq 0xd8(%rbp)
pushq 0xd0(%rbp)
pushq 0x78(%rbp)
pushq 0x70(%rbp)
pushq 0x68(%rbp)
pushq 0x60(%rbp)
pushq 0x58(%rbp)
pushq %r13
pushq %rbx
pushq %r14
pushq 0x28(%rbp)
pushq 0x20(%rbp)
pushq 0x18(%rbp)
pushq 0x10(%rbp)
pushq -0xb0(%rbp)
pushq -0xa8(%rbp)
callq 0x8248
addq $0xb0, %rsp
movsd -0x76a0(%rbp,%r15,8), %xmm0
addsd -0x348(%rbp), %xmm0
addsd -0x88(%rbp), %xmm0
movsd -0xe720(%rbp,%r15,8), %xmm1
addsd -0x350(%rbp), %xmm1
addsd -0x60(%rbp), %xmm1
leaq -0x440(%rbp), %rdi
leaq -0x620(%rbp), %rsi
movq %r12, %rdx
leaq -0x80(%rbp), %rcx
callq 0x8692
movsd 0x4bf2(%rip), %xmm1     # 0xe0a0
mulsd %xmm1, %xmm0
addsd 0x4bee(%rip), %xmm0     # 0xe0a8
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
divsd %xmm1, %xmm0
addq $0xe6f8, %rsp           # imm = 0xE6F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq