// File: /workspace/github_c_makefile_star2_O1/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, -0x78(%rbp)
movq %r8, -0x70(%rbp)
movl %esi, %r12d
movl %edi, %r10d
movslq %edi, %rax
movq %rdx, -0x60(%rbp)
movl %esi, -0x4(%rdx,%rax,4)
movslq %esi, %rdx
movq %rcx, -0x68(%rbp)
movl %eax, -0x4(%rcx,%rdx,4)
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 %r12d, %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)
movq %r10, %r15
callq 0x730b
movsd 0x599c(%rip), %xmm5     # 0xe030
movq %r15, %r10
addq $0x60, %rsp
movslq %r10d, %rax
decq %rax
movl 0x8(%r14), %ecx
movl %ecx, %edx
imull %eax, %edx
addl %r12d, %edx
movslq %edx, %rdx
movsd -0x8(%rbx,%rdx,8), %xmm0
movapd %xmm0, %xmm1
andpd 0x59ee(%rip), %xmm1     # 0xe0b0
ucomisd %xmm5, %xmm1
ja 0x8755
movsd -0x40(%rbp), %xmm2
movapd %xmm2, %xmm3
andpd 0x59d3(%rip), %xmm3     # 0xe0b0
ucomisd %xmm5, %xmm3
ja 0x8755
movapd %xmm0, %xmm3
subsd %xmm2, %xmm3
andpd 0x59bd(%rip), %xmm3     # 0xe0b0
movsd 0x5975(%rip), %xmm2     # 0xe070
ucomisd %xmm3, %xmm2
jbe 0x8755
movq 0xa0(%rbp), %rsi
movsd -0x8(%rsi,%rdx,8), %xmm2
movapd %xmm2, %xmm3
andpd 0x5996(%rip), %xmm3     # 0xe0b0
ucomisd %xmm5, %xmm3
ja 0x8755
movsd -0x38(%rbp), %xmm3
movapd %xmm3, %xmm4
andpd 0x597f(%rip), %xmm4     # 0xe0b0
ucomisd %xmm5, %xmm4
ja 0x8755
subsd %xmm3, %xmm2
andpd 0x596d(%rip), %xmm2     # 0xe0b0
movsd 0x5925(%rip), %xmm3     # 0xe070
ucomisd %xmm2, %xmm3
ja 0x8a49
xorl %r11d, %r11d
movb $0x1, %dl
cmpl $0x2, %r12d
jl 0x8833
cmpl $0x2, %r10d
movapd 0x5940(%rip), %xmm2     # 0xe0b0
jl 0x8833
ucomisd %xmm5, %xmm1
ja 0x8833
movslq %r12d, %rsi
movq 0xb0(%rbp), %r8
movsbq (%r8,%rax), %rdi
movsbq 0x1(%r8,%rax), %r8
imulq $0x3e8, %rdi, %rdi      # imm = 0x3E8
addq -0x70(%rbp), %rdi
imulq $0xc8, %r8, %r8
addq %rdi, %r8
leal -0x2(%r10), %edi
imull %edi, %ecx
addl %r12d, %ecx
movq 0xb8(%rbp), %r9
movsbq -0x1(%r9,%rsi), %rdi
movsbq (%r9,%rsi), %r9
leaq (%rdi,%rdi,4), %rdi
leaq (%r8,%rdi,8), %rdi
movsd (%rdi,%r9,8), %xmm1
movslq %ecx, %rcx
movq 0xa8(%rbp), %rdi
addsd -0x10(%rdi,%rcx,8), %xmm1
movapd %xmm2, %xmm4
movapd %xmm1, %xmm2
andpd %xmm4, %xmm2
ucomisd %xmm5, %xmm2
ja 0x8833
subsd %xmm1, %xmm0
andpd %xmm4, %xmm0
movsd 0x586a(%rip), %xmm1     # 0xe070
ucomisd %xmm0, %xmm1
jbe 0x8833
decq %rsi
movl %r10d, %ecx
movq -0x60(%rbp), %rdx
movl %esi, -0x8(%rdx,%rcx,4)
movl %r12d, %ecx
movq -0x68(%rbp), %rdx
movl %eax, -0x8(%rdx,%rcx,4)
movl $0x1, %r11d
xorl %edx, %edx
movl %esi, %r12d
movl %eax, %r10d
testb %dl, %dl
je 0x8610
movl $0x3, %esi
leal -0x1(%r10), %edi
movl %r12d, %ecx
subl %esi, %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
cmpl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl $0x0, %edx
cmovbl %edx, %eax
movl %edi, -0x54(%rbp)
movl %edi, %edx
subl %eax, %edx
jle 0x8a0a
movq %rsi, -0x48(%rbp)
movl %r11d, -0x4c(%rbp)
leal 0x1(%rcx), %r13d
cmpl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl $0x1, %ecx
cmovael %ecx, %r13d
cmpl %r12d, %r13d
movl %r12d, %ecx
cmovgl %r13d, %ecx
movl %ecx, -0x50(%rbp)
movl %edx, %r15d
movl %r10d, %r14d
subl %eax, %r14d
movq %r10, -0x80(%rbp)
cmpl %r13d, -0x50(%rbp)
je 0x8a03
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x40(%rbp)
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, -0x38(%rbp)
movl %r15d, %edi
movl %r13d, %esi
movl %r10d, %edx
movl %r12d, %ecx
leaq -0x40(%rbp), %r8
movl $0x1, %r9d
pushq 0xb8(%rbp)
pushq 0xb0(%rbp)
movq 0xa8(%rbp), %rax
pushq %rax
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 -0x78(%rbp)
pushq -0x70(%rbp)
callq 0x77e1
movsd 0x56f5(%rip), %xmm4     # 0xe030
movapd 0x576d(%rip), %xmm3     # 0xe0b0
addq $0x90, %rsp
movl 0x8(%rbx), %eax
imull -0x54(%rbp), %eax
addl %r12d, %eax
cltq
movq 0xa8(%rbp), %rcx
movsd -0x8(%rcx,%rax,8), %xmm0
movapd %xmm0, %xmm1
andpd %xmm3, %xmm1
ucomisd %xmm4, %xmm1
ja 0x89e6
movsd -0x40(%rbp), %xmm1
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
ucomisd %xmm4, %xmm2
ja 0x89e6
subsd %xmm1, %xmm0
andpd 0x5720(%rip), %xmm0     # 0xe0b0
movsd 0x56d8(%rip), %xmm1     # 0xe070
ucomisd %xmm0, %xmm1
jbe 0x89e6
movq 0xa0(%rbp), %rcx
movsd -0x8(%rcx,%rax,8), %xmm0
movapd %xmm0, %xmm1
andpd %xmm3, %xmm1
ucomisd %xmm4, %xmm1
ja 0x89e6
movsd -0x38(%rbp), %xmm1
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
ucomisd %xmm4, %xmm2
ja 0x89e6
subsd %xmm1, %xmm0
andpd 0x56d8(%rip), %xmm0     # 0xe0b0
movsd 0x5690(%rip), %xmm1     # 0xe070
ucomisd %xmm0, %xmm1
ja 0x8a26
incl %r13d
decq %r15
decl %r14d
cmpl $0x1, %r14d
movq -0x80(%rbp), %r10
jg 0x88a0
movl -0x4c(%rbp), %r11d
jmp 0x8a06
xorl %r11d, %r11d
movq -0x48(%rbp), %rsi
leal 0x1(%rsi), %eax
testl %r11d, %r11d
jne 0x8610
cmpl $0x20, %esi
movl %eax, %esi
jb 0x8840
jmp 0x8610
movq -0x60(%rbp), %rax
movl %r13d, -0x4(%rax,%r15,4)
movslq %r13d, %rax
movq -0x68(%rbp), %rcx
movl %r15d, -0x4(%rcx,%rax,4)
movl $0x1, %r11d
movl %r13d, %r12d
movl %r15d, %r10d
jmp 0x8a06
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq