// File: /workspace/github_c_makefile_star2_O1/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 0x8331
movq 0x30(%rbp), %rdi
movq 0x28(%rbp), %r10
movsbl 0x1(%r14,%r15), %r14d
imull $0x7d, %eax, %r15d
leal (%r14,%r14,4), %r12d
movsbl 0x1(%r11,%rbx), %ebx
leal (%rsi,%rsi,4), %r11d
addl %r11d, %ebx
leal (%r12,%r12,4), %r11d
addl %ebx, %r11d
addl %r15d, %r11d
movq 0x18(%rbp), %r14
movslq %r11d, %r11
movsd (%r14,%r11,8), %xmm6
movq 0x20(%rbp), %r14
movsd (%r14,%r11,8), %xmm0
leal (%rax,%rax,4), %r15d
leal (%r15,%rsi), %r11d
movslq %r11d, %r11
movsd (%r10,%r11,8), %xmm3
movsd (%rdi,%r11,8), %xmm5
addsd %xmm3, %xmm6
addsd %xmm5, %xmm0
movapd 0x5e42(%rip), %xmm4     # 0xe0b0
movapd %xmm0, %xmm9
andpd %xmm4, %xmm9
movsd 0x5db0(%rip), %xmm2     # 0xe030
ucomisd %xmm2, %xmm9
movapd %xmm2, %xmm1
cmpnltsd %xmm9, %xmm1
andpd %xmm1, %xmm6
movsd 0x5d9d(%rip), %xmm7     # 0xe038
andnpd %xmm7, %xmm1
orpd %xmm6, %xmm1
jbe 0x82ad
movsd 0x5d7b(%rip), %xmm0     # 0xe028
movq 0x38(%rbp), %r11
movq 0x10(%rbp), %r14
leal (%r15,%r15,4), %r15d
addl %esi, %r12d
addl %r15d, %r12d
movslq %r12d, %r12
movsd (%r8,%r12,8), %xmm7
movapd %xmm7, %xmm8
andpd %xmm4, %xmm8
ucomisd %xmm8, %xmm2
jbe 0x8351
leal (%rbx,%r15), %r8d
movslq %r8d, %r8
movsd (%r14,%r8,8), %xmm10
movapd 0x5dc2(%rip), %xmm6     # 0xe0b0
andpd %xmm10, %xmm6
ucomisd %xmm6, %xmm2
jbe 0x8351
movapd %xmm5, %xmm6
addsd %xmm7, %xmm6
addsd %xmm10, %xmm6
movapd %xmm6, %xmm11
andpd %xmm4, %xmm11
ucomisd %xmm2, %xmm11
ja 0x853b
movsd (%rcx,%r12,8), %xmm10
addsd %xmm3, %xmm10
addsd (%r9,%r8,8), %xmm10
jmp 0x8544
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, (%rdx)
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, 0x8(%rdx)
jmp 0x8532
ucomisd %xmm8, %xmm2
jbe 0x840d
addsd %xmm5, %xmm7
movapd %xmm7, %xmm6
andpd %xmm4, %xmm6
ucomisd %xmm2, %xmm6
ja 0x837b
movsd (%rcx,%r12,8), %xmm8
addsd %xmm3, %xmm8
jmp 0x8384
movsd 0x5cb4(%rip), %xmm8     # 0xe038
movapd %xmm2, %xmm10
cmpltsd %xmm6, %xmm10
movsd 0x5c90(%rip), %xmm9     # 0xe028
andpd %xmm10, %xmm9
andnpd %xmm7, %xmm10
orpd %xmm10, %xmm9
movsd (%r11), %xmm6
movsd 0x8(%r11), %xmm10
movapd %xmm9, %xmm7
addsd %xmm6, %xmm7
movapd %xmm8, %xmm12
addsd %xmm10, %xmm12
movsd 0x10(%r11), %xmm11
addsd %xmm11, %xmm12
divsd %xmm12, %xmm7
movapd %xmm0, %xmm12
andpd %xmm4, %xmm12
ucomisd %xmm12, %xmm2
jbe 0x83ff
addsd %xmm0, %xmm6
addsd %xmm1, %xmm10
addsd %xmm11, %xmm10
divsd %xmm10, %xmm6
ucomisd %xmm6, %xmm7
jbe 0x840d
movapd %xmm8, %xmm1
movapd %xmm9, %xmm0
movapd %xmm7, %xmm6
addl %r15d, %ebx
movslq %ebx, %rcx
movsd (%r14,%rcx,8), %xmm7
movapd 0x5c8e(%rip), %xmm8     # 0xe0b0
andpd %xmm7, %xmm8
ucomisd %xmm8, %xmm2
jbe 0x84d2
addsd %xmm7, %xmm5
movapd %xmm5, %xmm6
andpd %xmm4, %xmm6
ucomisd %xmm2, %xmm6
ja 0x844c
addsd (%r9,%rcx,8), %xmm3
jmp 0x8454
movsd 0x5be4(%rip), %xmm3     # 0xe038
movapd %xmm2, %xmm8
cmpltsd %xmm6, %xmm8
movsd 0x5bc1(%rip), %xmm7     # 0xe028
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 0x84c6
addsd %xmm0, %xmm6
addsd %xmm1, %xmm8
addsd %xmm9, %xmm8
divsd %xmm8, %xmm6
ucomisd %xmm6, %xmm5
jbe 0x84d2
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 0x5bbf(%rip), %xmm5     # 0xe0b0
andpd %xmm0, %xmm5
ucomisd %xmm5, %xmm2
jbe 0x851e
movsd (%r11), %xmm2
movsd 0x8(%r11), %xmm5
addsd %xmm4, %xmm5
addsd 0x10(%r11), %xmm5
addsd %xmm3, %xmm2
divsd %xmm5, %xmm2
ucomisd %xmm6, %xmm2
jbe 0x8529
movsd %xmm4, (%rdx)
movsd %xmm3, 0x8(%rdx)
jmp 0x8532
movsd %xmm1, (%rdx)
movsd %xmm0, 0x8(%rdx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movsd 0x5af4(%rip), %xmm10    # 0xe038
ucomisd %xmm2, %xmm9
movapd %xmm2, %xmm12
cmpltsd %xmm11, %xmm12
movsd 0x5acb(%rip), %xmm11    # 0xe028
andpd %xmm12, %xmm11
andnpd %xmm6, %xmm12
orpd %xmm12, %xmm11
movsd (%r11), %xmm6
movsd 0x8(%r11), %xmm13
movapd %xmm11, %xmm12
addsd %xmm6, %xmm12
movapd %xmm10, %xmm15
addsd %xmm13, %xmm15
movsd 0x10(%r11), %xmm14
addsd %xmm14, %xmm15
divsd %xmm15, %xmm12
ja 0x85c7
ucomisd %xmm9, %xmm2
jbe 0x85c7
addsd %xmm0, %xmm6
movapd %xmm1, %xmm9
addsd %xmm13, %xmm9
addsd %xmm14, %xmm9
divsd %xmm9, %xmm6
ucomisd %xmm6, %xmm12
jbe 0x8351
movapd %xmm10, %xmm1
movapd %xmm11, %xmm0
movapd %xmm12, %xmm6
jmp 0x8351