// File: /workspace/github_c_makefile_star2_O0/jiqingxiaoxi[P]RPA/RPA.c
// Function: END5_4
double END5_4(int i,int hs,double tstack2Entropies[],double tstack2Enthalpies[],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-7;++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-1]]+Htstack(i-1,k+2,tstack2Enthalpies,numSeq1)+enthalpyDPT[(k+1)*Initint[2]+i-2];
			S=send5[k]+atpS[numSeq1[k+2]*5+numSeq1[i-1]]+Ststack(i-1,k+2,tstack2Entropies,numSeq1)+entropyDPT[(k+1)*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+2]*5+numSeq1[i-1]]+Htstack(i-1,k+2,tstack2Enthalpies,numSeq1)+enthalpyDPT[(k+1)*Initint[2]+i-2];
			S=atpS[numSeq1[k+2]*5+numSeq1[i-1]]+Ststack(i-1,k+2,tstack2Entropies,numSeq1)+entropyDPT[(k+1)*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
subq $0x90, %rsp
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movsd 0x104ab(%rip), %xmm0    # 0x17130
movsd %xmm0, -0x68(%rbp)
movsd 0x104de(%rip), %xmm0    # 0x17170
movsd %xmm0, -0x40(%rbp)
movsd 0x104a1(%rip), %xmm0    # 0x17140
movsd %xmm0, -0x70(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x7, %ecx
cmpl %ecx, %eax
jg 0x70b4
movq 0x38(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x10(%rbp), %rax
addsd (%rax), %xmm0
movq 0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x10(%rbp), %rax
addsd 0x8(%rax), %xmm1
movq 0x10(%rbp), %rax
addsd 0x10(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movq 0x10(%rbp), %rax
movsd (%rax), %xmm0
movq 0x10(%rbp), %rax
movsd 0x8(%rax), %xmm1
movq 0x10(%rbp), %rax
addsd 0x10(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x48(%rbp), %xmm0
ucomisd -0x50(%rbp), %xmm0
jb 0x6ed0
movq 0x38(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x30(%rbp), %rax
movq 0x40(%rbp), %rcx
movl -0x34(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
imull $0x5, %ecx, %ecx
movq 0x40(%rbp), %rdx
movl -0xc(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
movsbl (%rdx,%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x80(%rbp)
movl -0xc(%rbp), %edi
subl $0x1, %edi
movl -0x34(%rbp), %esi
addl $0x2, %esi
movq -0x20(%rbp), %rdx
movq 0x40(%rbp), %rcx
callq 0x5ef0
movaps %xmm0, %xmm1
movsd -0x80(%rbp), %xmm0
addsd %xmm1, %xmm0
movq 0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movq 0x18(%rbp), %rdx
imull 0x8(%rdx), %ecx
addl -0xc(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movq 0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x28(%rbp), %rax
movq 0x40(%rbp), %rcx
movl -0x34(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
imull $0x5, %ecx, %ecx
movq 0x40(%rbp), %rdx
movl -0xc(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
movsbl (%rdx,%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x78(%rbp)
movl -0xc(%rbp), %edi
subl $0x1, %edi
movl -0x34(%rbp), %esi
addl $0x2, %esi
movq -0x18(%rbp), %rdx
movq 0x40(%rbp), %rcx
callq 0x5e80
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
addsd %xmm1, %xmm0
movq 0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movq 0x18(%rbp), %rdx
imull 0x8(%rdx), %ecx
addl -0xc(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x58(%rbp), %xmm0
movaps 0x1039a(%rip), %xmm1    # 0x171f0
pand %xmm1, %xmm0
movsd 0x102d6(%rip), %xmm1    # 0x17138
ucomisd %xmm1, %xmm0
ja 0x6e84
movsd -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
ja 0x6e84
movsd -0x60(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x6e9e
movsd 0x102a4(%rip), %xmm0    # 0x17130
movsd %xmm0, -0x58(%rbp)
movsd 0x102a7(%rip), %xmm0    # 0x17140
movsd %xmm0, -0x60(%rbp)
movsd -0x58(%rbp), %xmm0
movq 0x10(%rbp), %rax
addsd (%rax), %xmm0
movsd -0x60(%rbp), %xmm1
movq 0x10(%rbp), %rax
addsd 0x8(%rax), %xmm1
movq 0x10(%rbp), %rax
addsd 0x10(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0x7061
movq -0x30(%rbp), %rax
movq 0x40(%rbp), %rcx
movl -0x34(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
imull $0x5, %ecx, %ecx
movq 0x40(%rbp), %rdx
movl -0xc(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
movsbl (%rdx,%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x90(%rbp)
movl -0xc(%rbp), %edi
subl $0x1, %edi
movl -0x34(%rbp), %esi
addl $0x2, %esi
movq -0x20(%rbp), %rdx
movq 0x40(%rbp), %rcx
callq 0x5ef0
movaps %xmm0, %xmm1
movsd -0x90(%rbp), %xmm0
addsd %xmm1, %xmm0
movq 0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movq 0x18(%rbp), %rdx
imull 0x8(%rdx), %ecx
addl -0xc(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x28(%rbp), %rax
movq 0x40(%rbp), %rcx
movl -0x34(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
imull $0x5, %ecx, %ecx
movq 0x40(%rbp), %rdx
movl -0xc(%rbp), %esi
subl $0x1, %esi
movslq %esi, %rsi
movsbl (%rdx,%rsi), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x88(%rbp)
movl -0xc(%rbp), %edi
subl $0x1, %edi
movl -0x34(%rbp), %esi
addl $0x2, %esi
movq -0x18(%rbp), %rdx
movq 0x40(%rbp), %rcx
callq 0x5e80
movaps %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
addsd %xmm1, %xmm0
movq 0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movq 0x18(%rbp), %rdx
imull 0x8(%rdx), %ecx
addl -0xc(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x58(%rbp), %xmm0
movaps 0x10204(%rip), %xmm1    # 0x171f0
pand %xmm1, %xmm0
movsd 0x10140(%rip), %xmm1    # 0x17138
ucomisd %xmm1, %xmm0
ja 0x701a
movsd -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
ja 0x701a
movsd -0x60(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x7034
movsd 0x1010e(%rip), %xmm0    # 0x17130
movsd %xmm0, -0x58(%rbp)
movsd 0x10111(%rip), %xmm0    # 0x17140
movsd %xmm0, -0x60(%rbp)
movsd -0x58(%rbp), %xmm0
movq 0x10(%rbp), %rax
addsd (%rax), %xmm0
movsd -0x60(%rbp), %xmm1
movq 0x10(%rbp), %rax
addsd 0x8(%rax), %xmm1
movq 0x10(%rbp), %rax
addsd 0x10(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm1
movsd -0x48(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x70a4
movsd -0x60(%rbp), %xmm0
movsd 0x100da(%rip), %xmm1    # 0x17158
ucomisd %xmm1, %xmm0
jbe 0x70a2
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
jmp 0x70a4
jmp 0x70a6
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x6cab
cmpl $0x1, -0x10(%rbp)
jne 0x70c6
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x70d0
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x90, %rsp
popq %rbp
retq
nop