// File: /workspace/github_c_makefile_star2_O3/jiqingxiaoxi[P]RPA/RPA.c
// Function: END5_2
double END5_2(int i,int hs,double dangleEntropies5[],double dangleEnthalpies5[],double atpS[],double atpH[],double Initdouble[],int Initint[],double enthalpyDPT[],double entropyDPT[],double send5[],double hend5[],char numSeq1[])
{
	int k;
	double max_tm,T1,T2,H,S,H_max,S_max;

	H_max=1.0*INFINITY;
	max_tm=-1.0*INFINITY;
	S_max=-1.0;
	for(k=0;k<=i-6;++k)
	{
		T1=(hend5[k]+Initdouble[0])/(send5[k]+Initdouble[1]+Initdouble[2]);
		T2=Initdouble[0]/(Initdouble[1]+Initdouble[2]);
		if(T1>=T2)
		{
			H=hend5[k]+atpH[numSeq1[k+2]*5+numSeq1[i]]+Hd5(i,k+2,dangleEnthalpies5,numSeq1)+enthalpyDPT[(k+1)*Initint[2]+i-1];
			S=send5[k]+atpS[numSeq1[k+2]*5+numSeq1[i]]+Sd5(i,k+2,dangleEntropies5,numSeq1)+entropyDPT[(k+1)*Initint[2]+i-1];
			if(fabs(H)>999999999||H>0||S>0)
			{
				H=1.0*INFINITY;
				S=-1.0;
			}
			T1=(H+Initdouble[0])/(S+Initdouble[1]+Initdouble[2]);
		}
		else
		{
			H=atpH[numSeq1[k+2]*5+numSeq1[i]]+Hd5(i,k+2,dangleEnthalpies5,numSeq1)+enthalpyDPT[(k+1)*Initint[2]+i-1];
			S=atpS[numSeq1[k+2]*5+numSeq1[i]]+Sd5(i,k+2,dangleEntropies5,numSeq1)+entropyDPT[(k+1)*Initint[2]+i-1];
			if(fabs(H)>999999999||H>0||S>0)
			{
				H=1.0*INFINITY;
				S=-1.0;
			}
			T1=(H+Initdouble[0])/(S+Initdouble[1]+Initdouble[2]);
		}

		if(max_tm<T1)
		{
			if(S>-2500.0)
			{
				H_max=H;
				S_max=S;
				max_tm=T1;
			}
		}
	}
	if(hs==1)
		return H_max;
	return S_max;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, -0x2c(%rbp)
cmpl $0x6, %edi
jge 0x48b6
movsd 0x9787(%rip), %xmm7     # 0xe030
movsd 0x9767(%rip), %xmm0     # 0xe018
jmp 0x4abf
movq 0x40(%rbp), %rax
movq 0x28(%rbp), %rbx
movq 0x20(%rbp), %r14
movq 0x18(%rbp), %r15
movq 0x10(%rbp), %rsi
movsd (%rsi), %xmm1
movsd 0x8(%rsi), %xmm2
movsd 0x10(%rsi), %xmm3
movapd %xmm2, %xmm0
addsd %xmm3, %xmm0
movapd %xmm1, %xmm4
divsd %xmm0, %xmm4
movl %edi, %esi
leal -0x5(%rdi), %r12d
movsbq (%rax,%rsi), %rsi
leaq (%r9,%rsi,8), %r9
leaq (%r8,%rsi,8), %r8
imulq $0xc8, %rsi, %rsi
addq %rsi, %rcx
movsd 0x9742(%rip), %xmm11    # 0xe050
movsd 0x9701(%rip), %xmm13    # 0xe018
movsd 0x9711(%rip), %xmm6     # 0xe030
addq %rsi, %rdx
xorl %r13d, %r13d
movsd 0x96f2(%rip), %xmm9     # 0xe020
movsd 0x9702(%rip), %xmm5     # 0xe038
movapd %xmm6, %xmm12
movapd %xmm13, %xmm8
movq 0x38(%rbp), %rsi
movsd (%rsi,%r13,8), %xmm7
movapd %xmm7, %xmm0
addsd %xmm1, %xmm0
movq 0x30(%rbp), %rsi
movsd (%rsi,%r13,8), %xmm15
movapd %xmm15, %xmm14
addsd %xmm2, %xmm14
addsd %xmm3, %xmm14
divsd %xmm14, %xmm0
movsbq 0x2(%rax,%r13), %rsi
shlq $0x3, %rsi
ucomisd %xmm4, %xmm0
leaq (%rsi,%rsi,4), %r10
movsd (%r9,%r10), %xmm0
jae 0x49be
movsbq 0x1(%rax,%r13), %rsi
leaq (%rcx,%r10), %r11
addsd (%r11,%rsi,8), %xmm0
incq %r13
movl 0x8(%r15), %r11d
imull %r13d, %r11d
addl %edi, %r11d
movslq %r11d, %r11
addsd -0x8(%r14,%r11,8), %xmm0
movsd (%r8,%r10), %xmm15
movapd %xmm0, %xmm7
jmp 0x49f0
addsd %xmm0, %xmm7
movsbq 0x1(%rax,%r13), %rsi
leaq (%rcx,%r10), %r11
addsd (%r11,%rsi,8), %xmm7
incq %r13
movl 0x8(%r15), %r11d
imull %r13d, %r11d
addl %edi, %r11d
movslq %r11d, %r11
addsd -0x8(%r14,%r11,8), %xmm7
addsd (%r8,%r10), %xmm15
addq %rdx, %r10
addsd (%r10,%rsi,8), %xmm15
addsd -0x8(%rbx,%r11,8), %xmm15
movapd %xmm7, %xmm0
andpd 0x96b4(%rip), %xmm0     # 0xe0c0
movapd %xmm9, %xmm14
cmpltpd %xmm0, %xmm14
xorpd %xmm0, %xmm0
cmpltpd %xmm7, %xmm0
orpd %xmm14, %xmm0
ucomisd 0x962a(%rip), %xmm15    # 0xe058
seta %sil
movd %xmm0, %r10d
orb %r10b, %sil
movapd %xmm8, %xmm0
testb $0x1, %sil
jne 0x4a49
movapd %xmm7, %xmm0
movapd %xmm6, %xmm7
jne 0x4a54
movapd %xmm15, %xmm7
movapd %xmm1, %xmm14
addsd %xmm0, %xmm14
movapd %xmm7, %xmm15
addsd %xmm2, %xmm15
addsd %xmm3, %xmm15
divsd %xmm15, %xmm14
movapd %xmm11, %xmm15
cmpltpd %xmm14, %xmm15
movapd %xmm5, %xmm10
cmpltpd %xmm7, %xmm10
andpd %xmm15, %xmm10
movd %xmm10, %esi
testb $0x1, %sil
jne 0x4aa7
movapd %xmm11, %xmm14
movapd %xmm13, %xmm0
movapd %xmm12, %xmm7
movapd %xmm7, %xmm12
movapd %xmm0, %xmm13
movapd %xmm14, %xmm11
cmpq %r12, %r13
jne 0x4940
cmpl $0x1, -0x2c(%rbp)
je 0x4ac9
movapd %xmm7, %xmm0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq