// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
movq 0x48(%rbp), %r11
movq 0x40(%rbp), %r14
movslq %edi, %r15
movsbl (%r14,%r15), %r10d
movslq %esi, %rbx
movsbl (%r11,%rbx), %esi
leal (%rsi,%r10), %edi
cmpl $0x3, %edi
jne 0x755e
movq %rcx, -0x40(%rbp)
movq %r9, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movq 0x30(%rbp), %rcx
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rdx
movq 0x18(%rbp), %r13
leal (%r10,%r10,4), %edi
addl %esi, %edi
movslq %edi, %rdi
movsd (%rax,%rdi,8), %xmm3
movq %r10, %r9
imull $0x7d, %r10d, %r10d
movsbl 0x1(%r14,%r15), %r15d
imull $0x19, %r15d, %eax
movq %rsi, %r12
leal (%rsi,%rsi,4), %esi
movsbl 0x1(%r11,%rbx), %r14d
addl %esi, %r14d
movq %rcx, %rsi
addl %r14d, %r10d
addl %eax, %r10d
movslq %r10d, %rax
movsd (%r13,%rax,8), %xmm7
addsd %xmm3, %xmm7
movsd (%rcx,%rdi,8), %xmm5
movsd (%rdx,%rax,8), %xmm0
addsd %xmm5, %xmm0
movapd 0x5c4d(%rip), %xmm4     # 0xd0e0
movapd %xmm0, %xmm6
andpd %xmm4, %xmm6
movsd 0x5b8d(%rip), %xmm2     # 0xd030
ucomisd %xmm2, %xmm6
movapd %xmm2, %xmm1
cmpnltsd %xmm6, %xmm1
andpd %xmm1, %xmm7
movsd 0x5b83(%rip), %xmm8     # 0xd040
andnpd %xmm8, %xmm1
orpd %xmm7, %xmm1
jbe 0x74d0
movsd 0x5b58(%rip), %xmm0     # 0xd028
movq 0x38(%rbp), %r11
movq 0x10(%rbp), %rbx
imull $0x19, %r9d, %eax
leal (%r15,%r15,4), %edx
addl %r12d, %edx
addl %eax, %edx
movslq %edx, %r15
movsd (%r8,%r15,8), %xmm8
movapd %xmm8, %xmm7
andpd %xmm4, %xmm7
addl %eax, %r14d
ucomisd %xmm7, %xmm2
movslq %r14d, %r8
jbe 0x757e
movsd (%rbx,%r8,8), %xmm11
movapd 0x5bcf(%rip), %xmm7     # 0xd0e0
andpd %xmm11, %xmm7
ucomisd %xmm7, %xmm2
movq -0x40(%rbp), %rax
movsd (%rax,%r15,8), %xmm7
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rax
jbe 0x758b
addsd %xmm3, %xmm7
addsd %xmm5, %xmm8
addsd %xmm8, %xmm11
movapd 0x5b9b(%rip), %xmm10    # 0xd0e0
andpd %xmm11, %xmm10
ucomisd %xmm2, %xmm10
ja 0x759e
movsd (%rax,%r8,8), %xmm9
addsd %xmm7, %xmm9
jmp 0x75a7
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, (%rdx)
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, 0x8(%rdx)
jmp 0x77f0
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rax
jmp 0x76cd
movsd (%r11), %xmm6
addsd %xmm3, %xmm7
addsd %xmm5, %xmm8
jmp 0x762e
movsd 0x5a99(%rip), %xmm9     # 0xd040
movapd %xmm2, %xmm12
cmpltsd %xmm10, %xmm12
movsd 0x5a6d(%rip), %xmm10    # 0xd028
andpd %xmm12, %xmm10
andnpd %xmm11, %xmm12
orpd %xmm12, %xmm10
ucomisd %xmm6, %xmm2
movsd (%r11), %xmm6
jbe 0x7624
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 0x762e
movapd %xmm9, %xmm1
movapd %xmm10, %xmm0
movapd %xmm8, %xmm10
andpd %xmm4, %xmm10
ucomisd %xmm2, %xmm10
jbe 0x7647
movsd 0x59f9(%rip), %xmm7     # 0xd040
movapd %xmm2, %xmm9
cmpltsd %xmm10, %xmm9
movsd 0x59cd(%rip), %xmm10    # 0xd028
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 0x76bf
addsd %xmm0, %xmm6
addsd %xmm1, %xmm10
addsd %xmm11, %xmm10
divsd %xmm10, %xmm6
ucomisd %xmm6, %xmm8
jbe 0x76cd
movapd %xmm7, %xmm1
movapd %xmm9, %xmm0
movapd %xmm8, %xmm6
movsd (%rbx,%r8,8), %xmm7
movapd 0x5a04(%rip), %xmm8     # 0xd0e0
andpd %xmm7, %xmm8
ucomisd %xmm8, %xmm2
jbe 0x778c
addsd %xmm7, %xmm5
movapd %xmm5, %xmm6
andpd %xmm4, %xmm6
ucomisd %xmm2, %xmm6
ja 0x7706
addsd (%rax,%r8,8), %xmm3
jmp 0x770e
movsd 0x5932(%rip), %xmm3     # 0xd040
movapd %xmm2, %xmm8
cmpltsd %xmm6, %xmm8
movsd 0x5907(%rip), %xmm7     # 0xd028
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 0x7780
addsd %xmm0, %xmm6
addsd %xmm1, %xmm8
addsd %xmm9, %xmm8
divsd %xmm8, %xmm6
ucomisd %xmm6, %xmm5
jbe 0x778c
movapd %xmm3, %xmm1
movapd %xmm7, %xmm0
movapd %xmm5, %xmm6
movslq %r9d, %rax
leaq (%rax,%rax,4), %rax
movslq %r12d, %rcx
addq %rax, %rcx
movq 0x28(%rbp), %rax
movsd (%rax,%rcx,8), %xmm4
movsd (%rsi,%rcx,8), %xmm3
movapd 0x5931(%rip), %xmm5     # 0xd0e0
andpd %xmm0, %xmm5
ucomisd %xmm5, %xmm2
jbe 0x77dc
movsd (%r11), %xmm2
movsd 0x8(%r11), %xmm5
addsd %xmm4, %xmm5
addsd 0x10(%r11), %xmm5
addsd %xmm3, %xmm2
divsd %xmm5, %xmm2
ucomisd %xmm6, %xmm2
jbe 0x77e7
movsd %xmm4, (%rdx)
movsd %xmm3, 0x8(%rdx)
jmp 0x77f0
movsd %xmm1, (%rdx)
movsd %xmm0, 0x8(%rdx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq