// File: /workspace/github_c_makefile_star2_O3/jiqingxiaoxi[P]RPA/RPA.c
// Function: traceback
void traceback(int i,int j,int* ps1,int* ps2,double stackEntropies[],double stackEnthalpies[],double stackint2Entropies[],double stackint2Enthalpies[],double dangleEntropies3[],double dangleEnthalpies3[],double dangleEntropies5[],double dangleEnthalpies5[],double interiorLoopEntropies[],double bulgeLoopEntropies[],double interiorLoopEnthalpies[],double bulgeLoopEnthalpies[],double tstackEntropies[],double tstackEnthalpies[],double tstack2Entropies[],double tstack2Enthalpies[],double atpS[],double atpH[],double Initdouble[],int Initint[],double enthalpyDPT[],double entropyDPT[],char numSeq1[],char numSeq2[])
{
	int d,ii,jj,done;
	double SH[2];

	ps1[i-1]=j;
	ps2[j-1]=i;
	while(1)
	{
		SH[0]=-1.0;
		SH[1]=1.0*INFINITY;
		LSH(i,j,SH,dangleEntropies3,dangleEnthalpies3,dangleEntropies5,dangleEnthalpies5,tstack2Entropies,tstack2Enthalpies,atpS,atpH,Initdouble,Initint,enthalpyDPT,entropyDPT,numSeq1,numSeq2);
		if(equal(entropyDPT[(i-1)*Initint[2]+j-1],SH[0])&&equal(enthalpyDPT[(i-1)*Initint[2]+j-1],SH[1]))
			break;

		done = 0;
		if(i>1&&j>1&&equal(entropyDPT[(i-1)*Initint[2]+j-1],Ss(i-1,j-1,1,stackEntropies,Initint,numSeq1,numSeq2)+entropyDPT[(i-2)*Initint[2]+j-2]))
		{
			i=i-1;
			j=j-1;
			ps1[i-1]=j;
			ps2[j-1]=i;
			done=1;
		}
		for(d=3;!done&&d<=32;++d)
		{
			ii=i-1;
			jj=-ii-d+(j+i);
			if(jj<1)
			{
				ii-=abs(jj-1);
				jj=1;
			}
			for(;!done&&ii>0&&jj<j;--ii,++jj)
			{
				SH[0]=-1.0;
				SH[1]=1.0*INFINITY;
				calc_bulge_internal(ii,jj,i,j,SH,1,stackEntropies,stackEnthalpies,stackint2Entropies,stackint2Enthalpies,interiorLoopEntropies,bulgeLoopEntropies,interiorLoopEnthalpies,bulgeLoopEnthalpies,tstackEntropies,tstackEnthalpies,atpS,atpH,Initdouble,Initint,enthalpyDPT,entropyDPT,numSeq1,numSeq2);
				if(equal(entropyDPT[(i-1)*Initint[2]+j-1],SH[0])&&equal(enthalpyDPT[(i-1)*Initint[2]+j-1],SH[1]))
				{
					i=ii;
					j=jj;
					ps1[i-1]=j;
					ps2[j-1]=i;
					done=1;
					break;
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, -0x80(%rbp)
movq %r8, -0x60(%rbp)
movl %esi, %r9d
movl %edi, %r10d
movslq %edi, %rax
movq %rdx, -0x50(%rbp)
movl %esi, -0x4(%rdx,%rax,4)
movslq %esi, %rdx
movq %rcx, -0x58(%rbp)
movl %eax, -0x4(%rcx,%rdx,4)
movq %r10, -0x68(%rbp)
movq %r9, -0x70(%rbp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x40(%rbp)
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, -0x38(%rbp)
subq $0x8, %rsp
movl %r10d, %edi
movl %r9d, %esi
leaq -0x40(%rbp), %rdx
movq 0x20(%rbp), %rcx
movq 0x28(%rbp), %r8
movq 0x30(%rbp), %r9
pushq 0xb8(%rbp)
pushq 0xb0(%rbp)
movq 0xa8(%rbp), %rbx
pushq %rbx
pushq 0xa0(%rbp)
movq 0x98(%rbp), %r14
pushq %r14
pushq 0x90(%rbp)
pushq 0x88(%rbp)
pushq 0x80(%rbp)
pushq 0x78(%rbp)
pushq 0x70(%rbp)
pushq 0x38(%rbp)
callq 0x701f
movq -0x68(%rbp), %r10
movq -0x70(%rbp), %r9
addq $0x60, %rsp
leal -0x1(%r10), %eax
movl 0x8(%r14), %ecx
movl %ecx, %edx
imull %eax, %edx
addl %r9d, %edx
movslq %edx, %rdx
movsd -0x8(%rbx,%rdx,8), %xmm0
movapd %xmm0, %xmm1
movapd 0x5d91(%rip), %xmm5     # 0xe0c0
andpd %xmm5, %xmm1
movsd 0x5ce5(%rip), %xmm6     # 0xe020
ucomisd %xmm6, %xmm1
ja 0x83be
movsd -0x40(%rbp), %xmm2
movapd %xmm2, %xmm3
andpd %xmm5, %xmm3
ucomisd %xmm6, %xmm3
ja 0x83be
movapd %xmm0, %xmm3
subsd %xmm2, %xmm3
andpd 0x5d5c(%rip), %xmm3     # 0xe0c0
movsd 0x5cf4(%rip), %xmm2     # 0xe060
ucomisd %xmm3, %xmm2
jbe 0x83be
movq 0xa0(%rbp), %rsi
movsd -0x8(%rsi,%rdx,8), %xmm2
movapd %xmm2, %xmm3
andpd %xmm5, %xmm3
ucomisd %xmm6, %xmm3
ja 0x83be
movsd -0x38(%rbp), %xmm3
movapd %xmm3, %xmm4
andpd %xmm5, %xmm4
ucomisd %xmm6, %xmm4
ja 0x83be
subsd %xmm3, %xmm2
andpd 0x5d14(%rip), %xmm2     # 0xe0c0
movsd 0x5cac(%rip), %xmm3     # 0xe060
ucomisd %xmm2, %xmm3
ja 0x8683
cmpl $0x2, %r9d
jl 0x8473
cmpl $0x2, %r10d
jl 0x8473
ucomisd %xmm6, %xmm1
ja 0x8473
leal -0x1(%r9), %edx
movl %eax, %esi
movq 0xb0(%rbp), %r8
movsbq (%r8,%rsi), %rdi
movsbq 0x1(%r8,%rsi), %rsi
imulq $0x3e8, %rdi, %rdi      # imm = 0x3E8
addq -0x60(%rbp), %rdi
imulq $0xc8, %rsi, %rsi
addq %rdi, %rsi
leal -0x2(%r10), %edi
imull %edi, %ecx
addl %r9d, %ecx
movq 0xb8(%rbp), %r8
movsbq (%r8,%rdx), %rdi
movsbq 0x1(%r8,%rdx), %r8
leaq (%rdi,%rdi,4), %rdi
leaq (%rsi,%rdi,8), %rsi
movsd (%rsi,%r8,8), %xmm1
movslq %ecx, %rcx
movq 0xa8(%rbp), %rsi
addsd -0x10(%rsi,%rcx,8), %xmm1
movapd %xmm1, %xmm2
andpd 0x5c71(%rip), %xmm2     # 0xe0c0
ucomisd %xmm6, %xmm2
ja 0x8473
subsd %xmm1, %xmm0
andpd 0x5c5f(%rip), %xmm0     # 0xe0c0
movsd 0x5bf7(%rip), %xmm1     # 0xe060
ucomisd %xmm0, %xmm1
ja 0x8662
leal -0x1(%r10), %eax
movl %eax, -0x2c(%rbp)
movl $0x3, %eax
movl %r9d, %ecx
movq %rax, -0x78(%rbp)
subl %eax, %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl $0x0, %edx
cmovbl %edx, %eax
movl -0x2c(%rbp), %edx
subl %eax, %edx
jle 0x862d
leal 0x1(%rcx), %r12d
cmpl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl $0x1, %ecx
cmovael %ecx, %r12d
cmpl %r9d, %r12d
movl %r9d, %ecx
cmovgl %r12d, %ecx
movl %ecx, -0x44(%rbp)
movl %edx, %r15d
movl %r10d, %r13d
subl %eax, %r13d
cmpl %r12d, -0x44(%rbp)
je 0x862d
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x40(%rbp)
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, -0x38(%rbp)
movl %r15d, %edi
movl %r12d, %esi
movl %r10d, %edx
movl %r9d, %ecx
leaq -0x40(%rbp), %r8
movl $0x1, %r9d
pushq 0xb8(%rbp)
pushq 0xb0(%rbp)
movq 0xa8(%rbp), %r14
pushq %r14
pushq 0xa0(%rbp)
movq 0x98(%rbp), %rbx
pushq %rbx
pushq 0x90(%rbp)
pushq 0x88(%rbp)
pushq 0x80(%rbp)
pushq 0x68(%rbp)
pushq 0x60(%rbp)
pushq 0x58(%rbp)
pushq 0x50(%rbp)
pushq 0x48(%rbp)
pushq 0x40(%rbp)
pushq 0x18(%rbp)
pushq 0x10(%rbp)
pushq -0x80(%rbp)
pushq -0x60(%rbp)
callq 0x7462
movsd 0x5ab3(%rip), %xmm4     # 0xe020
movapd 0x5b4b(%rip), %xmm3     # 0xe0c0
movq -0x70(%rbp), %r9
addq $0x90, %rsp
movl 0x8(%rbx), %eax
imull -0x2c(%rbp), %eax
addl %r9d, %eax
cltq
movsd -0x8(%r14,%rax,8), %xmm0
movapd %xmm0, %xmm1
andpd %xmm3, %xmm1
ucomisd %xmm4, %xmm1
ja 0x8616
movsd -0x40(%rbp), %xmm1
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
ucomisd %xmm4, %xmm2
ja 0x8616
subsd %xmm1, %xmm0
andpd 0x5b00(%rip), %xmm0     # 0xe0c0
movsd 0x5a98(%rip), %xmm1     # 0xe060
ucomisd %xmm0, %xmm1
jbe 0x8616
movq 0xa0(%rbp), %rcx
movsd -0x8(%rcx,%rax,8), %xmm0
movapd %xmm0, %xmm1
andpd %xmm3, %xmm1
ucomisd %xmm4, %xmm1
ja 0x8616
movsd -0x38(%rbp), %xmm1
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
ucomisd %xmm4, %xmm2
ja 0x8616
subsd %xmm1, %xmm0
andpd 0x5ab8(%rip), %xmm0     # 0xe0c0
movsd 0x5a50(%rip), %xmm1     # 0xe060
ucomisd %xmm0, %xmm1
ja 0x8642
incl %r12d
decq %r15
decl %r13d
cmpl $0x1, %r13d
movq -0x68(%rbp), %r10
jg 0x84d1
movq -0x78(%rbp), %rcx
leal 0x1(%rcx), %eax
cmpl $0x20, %ecx
jb 0x847f
jmp 0x827d
movq -0x50(%rbp), %rax
movl %r12d, -0x4(%rax,%r15,4)
movslq %r12d, %rax
movq -0x58(%rbp), %rcx
movl %r15d, -0x4(%rcx,%rax,4)
movl %r12d, %r9d
movl %r15d, %r10d
jmp 0x827d
movl %r10d, %ecx
movq -0x50(%rbp), %rsi
movl %edx, -0x8(%rsi,%rcx,4)
movl %r9d, %ecx
movq -0x58(%rbp), %rsi
movl %eax, -0x8(%rsi,%rcx,4)
movl %edx, %r9d
movl %eax, %r10d
jmp 0x827d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq