// File: /workspace/github_c_makefile_star2_O3/jiqingxiaoxi[P]RPA/RPA.c
// Function: RSH
void RSH(int i,int j,double EntropyEnthalpy[],double dangleEntropies3[],double dangleEnthalpies3[],double dangleEntropies5[],double dangleEnthalpies5[],double tstack2Entropies[],double tstack2Enthalpies[],double atpS[],double atpH[],double Initdouble[],char numSeq1[],char numSeq2[])
{
	double S1,S2,H1,H2,T1,T2;

	if(numSeq1[i]+numSeq2[j]!=3)
	{
		EntropyEnthalpy[0]=-1.0;
		EntropyEnthalpy[1]=1.0*INFINITY;
		return;
	}
	S1=atpS[numSeq1[i]*5+numSeq2[j]]+tstack2Entropies[numSeq1[i]*125+numSeq1[i+1]*25+numSeq2[j]*5+numSeq2[j+1]];
	H1=atpH[numSeq1[i]*5+numSeq2[j]]+tstack2Enthalpies[numSeq1[i]*125+numSeq1[i+1]*25+numSeq2[j]*5+numSeq2[j+1]];
	if(fabs(H1)>999999999)
	{
		H1=1.0*INFINITY;
		S1=-1.0;
	}
	if(fabs(dangleEnthalpies3[numSeq1[i]*25+numSeq1[i+1]*5+numSeq2[j]])<999999999&&fabs(dangleEnthalpies5[numSeq1[i]*25+numSeq2[j]*5+numSeq2[j+1]])<999999999)
	{
		S2=atpS[numSeq1[i]*5+numSeq2[j]]+dangleEntropies3[numSeq1[i]*25+numSeq1[i+1]*5+numSeq2[j]]+dangleEntropies5[numSeq1[i]*25+numSeq2[j]*5+numSeq2[j+1]];
		H2=atpH[numSeq1[i]*5+numSeq2[j]]+dangleEnthalpies3[numSeq1[i]*25+numSeq1[i+1]*5+numSeq2[j]]+dangleEnthalpies5[numSeq1[i]*25+numSeq2[j]*5+numSeq2[j+1]];
		if(fabs(H2)>999999999)
		{
			H2=1.0*INFINITY;
			S2=-1.0;
		}
		T2=(H2+Initdouble[0])/(S2+Initdouble[1]+Initdouble[2]);
		if(fabs(H1)<999999999)
		{
			T1=(H1+Initdouble[0])/(S1+Initdouble[1]+Initdouble[2]);
			if(T1<T2)
			{
				S1=S2;
				H1=H2;
				T1=T2;
			}
		}
		else
		{
			S1=S2;
			H1=H2;
			T1=T2;
		}
	}

	if(fabs(dangleEnthalpies3[numSeq1[i]*25+numSeq1[i+1]*5+numSeq2[j]])<999999999)
	{
		S2=atpS[numSeq1[i]*5+numSeq2[j]]+dangleEntropies3[numSeq1[i]*25+numSeq1[i+1]*5+numSeq2[j]];
		H2=atpH[numSeq1[i]*5+numSeq2[j]]+dangleEnthalpies3[numSeq1[i]*25+numSeq1[i+1]*5+numSeq2[j]];
		if(fabs(H2)>999999999)
		{
			H2=1.0*INFINITY;
			S2=-1.0;
		}
		T2=(H2+Initdouble[0])/(S2+Initdouble[1]+Initdouble[2]);
		if(fabs(H1)<999999999)
		{
			T1=(H1+Initdouble[0])/(S1+Initdouble[1]+Initdouble[2]);
			if(T1<T2)
			{
				S1=S2;
				H1=H2;
				T1=T2;
			}
		}
		else
		{
			S1=S2;
			H1=H2;
			T1=T2;
		}
	}

	if(fabs(dangleEnthalpies5[numSeq1[i]*25+numSeq2[j]*5+numSeq2[j+1]])<999999999)
	{
		S2=atpS[numSeq1[i]*5+numSeq2[j]]+dangleEntropies5[numSeq1[i]*25+numSeq2[j]*5+numSeq2[j+1]];
		H2=atpH[numSeq1[i]*5+numSeq2[j]]+dangleEnthalpies5[numSeq1[i]*25+numSeq2[j]*5+numSeq2[j+1]];
		if(fabs(H2)>999999999)
		{
			H2=1.0*INFINITY;
			S2=-1.0;
		}
		T2=(H2+Initdouble[0])/(S2+Initdouble[1]+Initdouble[2]);
		if(fabs(H1)<999999999)
		{
			T1=(H1+Initdouble[0])/(S1+Initdouble[1]+Initdouble[2]);
			if(T1<T2)
			{
				S1=S2;
				H1=H2;
				T1=T2;
			}
		}
		else
		{
			S1=S2;
			H1=H2;
			T1=T2;
		}
	}
	S2=atpS[numSeq1[i]*5+numSeq2[j]];
	H2=atpH[numSeq1[i]*5+numSeq2[j]];
	T2=(H2+Initdouble[0])/(S2+Initdouble[1]+Initdouble[2]);
	if(fabs(H1)<999999999)
	{
		if(T1<T2)
		{
			EntropyEnthalpy[0]=S2;
			EntropyEnthalpy[1]=H2;
		}
		else
		{
			EntropyEnthalpy[0]=S1;
			EntropyEnthalpy[1]=H1;
		}
	}
	else
	{
		EntropyEnthalpy[0]=S2;
		EntropyEnthalpy[1]=H2;
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x48(%rbp), %r11
movq 0x40(%rbp), %r14
movslq %edi, %r15
movsbl (%r14,%r15), %eax
movslq %esi, %rbx
movsbl (%r11,%rbx), %esi
leal (%rsi,%rax), %edi
cmpl $0x3, %edi
jne 0x7fb9
movq 0x30(%rbp), %rdi
movq 0x28(%rbp), %r10
movsbl 0x1(%r14,%r15), %r14d
imull $0x7d, %eax, %r12d
leal (%r14,%r14,4), %r15d
movsbl 0x1(%r11,%rbx), %r14d
leal (%rsi,%rsi,4), %r11d
addl %r11d, %r14d
leal (%r15,%r15,4), %r11d
addl %r14d, %r11d
addl %r12d, %r11d
movq 0x18(%rbp), %rbx
movslq %r11d, %r11
movsd (%rbx,%r11,8), %xmm7
movq 0x20(%rbp), %rbx
movsd (%rbx,%r11,8), %xmm0
leal (%rax,%rax,4), %r12d
leal (%r12,%rsi), %r11d
movslq %r11d, %r11
movsd (%r10,%r11,8), %xmm3
movsd (%rdi,%r11,8), %xmm5
addsd %xmm3, %xmm7
addsd %xmm5, %xmm0
movapd 0x61c3(%rip), %xmm4     # 0xe0c0
movapd %xmm0, %xmm6
andpd %xmm4, %xmm6
movsd 0x6113(%rip), %xmm2     # 0xe020
ucomisd %xmm2, %xmm6
movapd %xmm2, %xmm1
cmpnltsd %xmm6, %xmm1
andpd %xmm1, %xmm7
movsd 0x6109(%rip), %xmm8     # 0xe030
andnpd %xmm8, %xmm1
orpd %xmm7, %xmm1
jbe 0x7f3a
movsd 0x60de(%rip), %xmm0     # 0xe018
movq 0x38(%rbp), %r11
movq 0x10(%rbp), %rbx
leal (%r12,%r12,4), %r12d
addl %esi, %r15d
addl %r12d, %r15d
movslq %r15d, %r15
movsd (%r8,%r15,8), %xmm8
movapd %xmm8, %xmm7
andpd %xmm4, %xmm7
addl %r12d, %r14d
ucomisd %xmm7, %xmm2
movslq %r14d, %r8
jbe 0x7fd9
movsd (%rbx,%r8,8), %xmm11
movapd 0x6148(%rip), %xmm7     # 0xe0c0
andpd %xmm11, %xmm7
ucomisd %xmm7, %xmm2
movsd (%rcx,%r15,8), %xmm7
jbe 0x7fde
addsd %xmm3, %xmm7
addsd %xmm5, %xmm8
addsd %xmm8, %xmm11
movapd 0x6120(%rip), %xmm10    # 0xe0c0
andpd %xmm11, %xmm10
ucomisd %xmm2, %xmm10
ja 0x7ff1
movsd (%r9,%r8,8), %xmm9
addsd %xmm7, %xmm9
jmp 0x7ffa
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, (%rdx)
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, 0x8(%rdx)
jmp 0x823f
jmp 0x8120
movsd (%r11), %xmm6
addsd %xmm3, %xmm7
addsd %xmm5, %xmm8
jmp 0x8081
movsd 0x6036(%rip), %xmm9     # 0xe030
movapd %xmm2, %xmm12
cmpltsd %xmm10, %xmm12
movsd 0x600a(%rip), %xmm10    # 0xe018
andpd %xmm12, %xmm10
andnpd %xmm11, %xmm12
orpd %xmm12, %xmm10
ucomisd %xmm6, %xmm2
movsd (%r11), %xmm6
jbe 0x8077
movapd %xmm10, %xmm11
addsd %xmm6, %xmm11
movsd 0x8(%r11), %xmm12
movsd 0x10(%r11), %xmm13
movapd %xmm9, %xmm14
addsd %xmm12, %xmm14
addsd %xmm13, %xmm14
divsd %xmm14, %xmm11
movapd %xmm0, %xmm14
addsd %xmm6, %xmm14
movapd %xmm1, %xmm15
addsd %xmm12, %xmm15
addsd %xmm13, %xmm15
divsd %xmm15, %xmm14
ucomisd %xmm14, %xmm11
jbe 0x8081
movapd %xmm9, %xmm1
movapd %xmm10, %xmm0
movapd %xmm8, %xmm10
andpd %xmm4, %xmm10
ucomisd %xmm2, %xmm10
jbe 0x809a
movsd 0x5f96(%rip), %xmm7     # 0xe030
movapd %xmm2, %xmm9
cmpltsd %xmm10, %xmm9
movsd 0x5f6a(%rip), %xmm10    # 0xe018
andpd %xmm9, %xmm10
andnpd %xmm8, %xmm9
orpd %xmm10, %xmm9
movapd %xmm9, %xmm8
addsd %xmm6, %xmm8
movsd 0x8(%r11), %xmm10
movsd 0x10(%r11), %xmm11
movapd %xmm7, %xmm12
addsd %xmm10, %xmm12
addsd %xmm11, %xmm12
divsd %xmm12, %xmm8
movapd %xmm0, %xmm12
andpd %xmm4, %xmm12
ucomisd %xmm12, %xmm2
jbe 0x8112
addsd %xmm0, %xmm6
addsd %xmm1, %xmm10
addsd %xmm11, %xmm10
divsd %xmm10, %xmm6
ucomisd %xmm6, %xmm8
jbe 0x8120
movapd %xmm7, %xmm1
movapd %xmm9, %xmm0
movapd %xmm8, %xmm6
movsd (%rbx,%r8,8), %xmm7
movapd 0x5f91(%rip), %xmm8     # 0xe0c0
andpd %xmm7, %xmm8
ucomisd %xmm8, %xmm2
jbe 0x81df
addsd %xmm7, %xmm5
movapd %xmm5, %xmm6
andpd %xmm4, %xmm6
ucomisd %xmm2, %xmm6
ja 0x8159
addsd (%r9,%r8,8), %xmm3
jmp 0x8161
movsd 0x5ecf(%rip), %xmm3     # 0xe030
movapd %xmm2, %xmm8
cmpltsd %xmm6, %xmm8
movsd 0x5ea4(%rip), %xmm7     # 0xe018
andpd %xmm8, %xmm7
andnpd %xmm5, %xmm8
orpd %xmm8, %xmm7
movsd (%r11), %xmm6
movsd 0x8(%r11), %xmm8
movapd %xmm7, %xmm5
addsd %xmm6, %xmm5
movapd %xmm3, %xmm10
addsd %xmm8, %xmm10
movsd 0x10(%r11), %xmm9
addsd %xmm9, %xmm10
divsd %xmm10, %xmm5
andpd %xmm0, %xmm4
ucomisd %xmm4, %xmm2
jbe 0x81d3
addsd %xmm0, %xmm6
addsd %xmm1, %xmm8
addsd %xmm9, %xmm8
divsd %xmm8, %xmm6
ucomisd %xmm6, %xmm5
jbe 0x81df
movapd %xmm3, %xmm1
movapd %xmm7, %xmm0
movapd %xmm5, %xmm6
cltq
leaq (%rax,%rax,4), %rax
movslq %esi, %rcx
addq %rax, %rcx
movsd (%r10,%rcx,8), %xmm4
movsd (%rdi,%rcx,8), %xmm3
movapd 0x5ec2(%rip), %xmm5     # 0xe0c0
andpd %xmm0, %xmm5
ucomisd %xmm5, %xmm2
jbe 0x822b
movsd (%r11), %xmm2
movsd 0x8(%r11), %xmm5
addsd %xmm4, %xmm5
addsd 0x10(%r11), %xmm5
addsd %xmm3, %xmm2
divsd %xmm5, %xmm2
ucomisd %xmm6, %xmm2
jbe 0x8236
movsd %xmm4, (%rdx)
movsd %xmm3, 0x8(%rdx)
jmp 0x823f
movsd %xmm1, (%rdx)
movsd %xmm0, 0x8(%rdx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq