// File: /workspace/github_c_makefile_star2_O1/jiqingxiaoxi[P]RPA/RPA.c
// Function: END5_3
double END5_3(int i,int hs,double dangleEntropies3[],double dangleEnthalpies3[],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+1]*5+numSeq1[i-1]]+Hd3(i-1,k+1,dangleEnthalpies3,numSeq1)+enthalpyDPT[k*Initint[2]+i-2];
			S=send5[k]+atpS[numSeq1[k+1]*5+numSeq1[i-1]]+Sd3(i-1,k+1,dangleEntropies3,numSeq1)+entropyDPT[k*Initint[2]+i-2];
			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+1]*5+numSeq1[i-1]]+Hd3(i-1,k+1,dangleEnthalpies3,numSeq1)+enthalpyDPT[k*Initint[2]+i-2];
			S=atpS[numSeq1[k+1]*5+numSeq1[i-1]]+Sd3(i-1,k+1,dangleEntropies3,numSeq1)+entropyDPT[k*Initint[2]+i-2];
			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 0x4c10
movsd 0x9435(%rip), %xmm14    # 0xe038
movsd 0x941d(%rip), %xmm0     # 0xe028
jmp 0x4e3b
movq 0x40(%rbp), %rax
movq 0x10(%rbp), %rsi
movq 0x28(%rbp), %r15
addq $-0x10, %r15
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, %r12d
leal -0x5(%rdi), %r13d
movsd 0x9412(%rip), %xmm11    # 0xe060
movsd 0x93d2(%rip), %xmm5     # 0xe028
movsd 0x93da(%rip), %xmm6     # 0xe038
xorl %r10d, %r10d
movsd 0x93c6(%rip), %xmm9     # 0xe030
movsd 0x93d5(%rip), %xmm8     # 0xe048
movapd %xmm6, %xmm12
movapd %xmm5, %xmm13
movq 0x38(%rbp), %rsi
movsd (%rsi,%r10,8), %xmm14
movapd %xmm14, %xmm0
addsd %xmm1, %xmm0
movq 0x30(%rbp), %rsi
movsd (%rsi,%r10,8), %xmm7
movapd %xmm7, %xmm15
addsd %xmm2, %xmm15
addsd %xmm3, %xmm15
divsd %xmm15, %xmm0
movsbq 0x1(%rax,%r10), %rsi
shlq $0x3, %rsi
leaq (%rsi,%rsi,4), %rsi
leaq (%r9,%rsi), %r11
ucomisd %xmm4, %xmm0
jae 0x4d0f
movsbq -0x1(%rax,%r12), %rbx
movsd (%r11,%rbx,8), %xmm14
movsbq (%rax,%r12), %r14
movsbq 0x1(%rax,%r10), %r11
addq %r8, %rsi
movsd (%rsi,%rbx,8), %xmm7
imulq $0xc8, %rbx, %rsi
shlq $0x3, %r14
leaq (%r14,%r14,4), %rbx
leaq (%rcx,%rbx), %r14
addq %rsi, %r14
addsd (%r14,%r11,8), %xmm14
addq %rdx, %rbx
addq %rsi, %rbx
addsd (%rbx,%r11,8), %xmm7
jmp 0x4d56
movsbq -0x1(%rax,%r12), %rbx
addsd (%r11,%rbx,8), %xmm14
movsbq (%rax,%r12), %r11
addq %r8, %rsi
addsd (%rsi,%rbx,8), %xmm7
movsbq 0x1(%rax,%r10), %rsi
imulq $0xc8, %rbx, %rbx
shlq $0x3, %r11
leaq (%r11,%r11,4), %r11
leaq (%rcx,%r11), %r14
addq %rbx, %r14
addsd (%r14,%rsi,8), %xmm14
addq %rdx, %r11
addq %rbx, %r11
addsd (%r11,%rsi,8), %xmm7
movq 0x18(%rbp), %rsi
movl 0x8(%rsi), %esi
imull %r10d, %esi
addl %edi, %esi
movslq %esi, %rsi
movq 0x20(%rbp), %r11
addsd -0x10(%r11,%rsi,8), %xmm14
leaq (%r15,%rsi,8), %rsi
addsd (%rsi), %xmm7
movapd %xmm14, %xmm0
andpd 0x932a(%rip), %xmm0     # 0xe0b0
movapd %xmm9, %xmm15
cmpltpd %xmm0, %xmm15
xorpd %xmm0, %xmm0
cmpltpd %xmm14, %xmm0
orpd %xmm15, %xmm0
ucomisd 0x92c0(%rip), %xmm7     # 0xe068
seta %sil
movd %xmm0, %r11d
orb %r11b, %sil
movapd %xmm5, %xmm0
testb $0x1, %sil
jne 0x4dc3
movapd %xmm14, %xmm0
movapd %xmm6, %xmm14
jne 0x4dcf
movapd %xmm7, %xmm14
movapd %xmm1, %xmm15
addsd %xmm0, %xmm15
movapd %xmm14, %xmm7
addsd %xmm2, %xmm7
addsd %xmm3, %xmm7
divsd %xmm7, %xmm15
movapd %xmm11, %xmm7
cmpltpd %xmm15, %xmm7
movapd %xmm8, %xmm10
cmpltpd %xmm14, %xmm10
andpd %xmm7, %xmm10
movd %xmm10, %esi
testb $0x1, %sil
jne 0x4e20
movapd %xmm11, %xmm15
movapd %xmm13, %xmm0
movapd %xmm12, %xmm14
incq %r10
movapd %xmm14, %xmm12
movapd %xmm0, %xmm13
movapd %xmm15, %xmm11
cmpq %r10, %r13
jne 0x4c7d
cmpl $0x1, -0x2c(%rbp)
je 0x4e46
movapd %xmm14, %xmm0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq