// File: /workspace/github_c_makefile_star2_O2/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, -0x68(%rbp)
movl %esi, %r12d
movl %edi, %r8d
movq 0xa0(%rbp), %r10
movslq %edi, %rax
movq %rdx, -0x60(%rbp)
movl %esi, -0x4(%rdx,%rax,4)
movslq %esi, %rdx
movl %eax, -0x4(%rcx,%rdx,4)
movq %rcx, -0x70(%rbp)
leaq -0x4(%rcx), %rax
movq %rax, -0x78(%rbp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x40(%rbp)
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, -0x38(%rbp)
subq $0x8, %rsp
movl %r8d, %edi
movl %r12d, %esi
leaq -0x40(%rbp), %rdx
movq 0x20(%rbp), %rcx
movq %r8, %r14
movq 0x28(%rbp), %r8
movq %r12, %r13
movq 0x30(%rbp), %r9
pushq 0xb8(%rbp)
pushq 0xb0(%rbp)
movq 0xa8(%rbp), %rax
pushq %rax
pushq %r10
movq 0x98(%rbp), %rbx
pushq %rbx
pushq 0x90(%rbp)
pushq 0x88(%rbp)
pushq 0x80(%rbp)
pushq 0x78(%rbp)
pushq 0x70(%rbp)
pushq 0x38(%rbp)
movq %r10, %r15
callq 0x6630
addq $0x60, %rsp
movq %r14, -0x48(%rbp)
leal -0x1(%r14), %ecx
movl 0x8(%rbx), %r12d
movl %r12d, %eax
movl %ecx, -0x2c(%rbp)
imull %ecx, %eax
movq %r13, %r14
addl %r13d, %eax
movslq %eax, %rbx
movq 0xa8(%rbp), %rax
movsd -0x8(%rax,%rbx,8), %xmm0
movsd -0x40(%rbp), %xmm1
movsd %xmm0, -0x50(%rbp)
callq 0x52ff
testl %eax, %eax
je 0x7917
movsd -0x8(%r15,%rbx,8), %xmm0
movsd -0x38(%rbp), %xmm1
callq 0x52ff
testl %eax, %eax
jne 0x7b79
xorl %ebx, %ebx
movq %r14, %r15
cmpl $0x2, %r15d
jl 0x79d3
movq -0x48(%rbp), %rdi
cmpl $0x2, %edi
jl 0x79cb
leal -0x1(%r15), %r13d
movl -0x2c(%rbp), %r14d
movl %r14d, %eax
movq 0xb0(%rbp), %rdx
movsbq (%rdx,%rax), %rcx
movsbq 0x1(%rdx,%rax), %rax
movq 0xb8(%rbp), %rsi
movsbq (%rsi,%r13), %rdx
movsbq 0x1(%rsi,%r13), %rsi
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
addq -0x68(%rbp), %rcx
imulq $0xc8, %rax, %rax
imulq $0x28, %rdx, %rdx
addq %rax, %rdx
addq %rcx, %rdx
movsd (%rdx,%rsi,8), %xmm1
leal -0x2(%rdi), %eax
imull %eax, %r12d
addl %r15d, %r12d
movslq %r12d, %rax
movq 0xa8(%rbp), %rcx
addsd -0x10(%rcx,%rax,8), %xmm1
movsd -0x50(%rbp), %xmm0
movq %rdi, %r12
callq 0x52ff
testl %eax, %eax
je 0x79df
movl %r12d, %eax
movq -0x60(%rbp), %rcx
movl %r13d, -0x8(%rcx,%rax,4)
movl %r15d, %eax
movq -0x70(%rbp), %rcx
movl %r14d, -0x8(%rcx,%rax,4)
pushq $0x1
popq %rbx
jmp 0x79e5
movl %r15d, %r13d
movl %edi, %r14d
jmp 0x79e5
movl %r15d, %r13d
movq -0x48(%rbp), %rax
movl %eax, %r14d
jmp 0x79e5
movl %r15d, %r13d
movl %r12d, %r14d
movq 0xa0(%rbp), %r10
movl %r13d, %r12d
movl %r14d, %r8d
pushq $0x3
popq %rcx
testl %ebx, %ebx
jne 0x783f
cmpl $0x20, %ecx
ja 0x783f
leal -0x1(%r8), %edx
movl %r12d, %eax
movl %ecx, -0x54(%rbp)
subl %ecx, %eax
leal 0x1(%rax), %esi
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0x0, %eax
cmovbl %eax, %ecx
pushq $0x1
popq %rax
cmovael %eax, %esi
movl %edx, -0x58(%rbp)
movl %edx, %r13d
subl %ecx, %r13d
movslq %esi, %rax
movq -0x78(%rbp), %rcx
leaq (%rcx,%rax,4), %rax
movq %r8, -0x48(%rbp)
xorl %ebx, %ebx
testl %r13d, %r13d
jle 0x7b4b
cmpl %r12d, %esi
jge 0x7b4b
movq %rax, -0x50(%rbp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x40(%rbp)
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
movq %rax, -0x38(%rbp)
movl %r13d, %edi
movl %esi, -0x2c(%rbp)
movl %r8d, %edx
movl %r12d, %ecx
leaq -0x40(%rbp), %r8
pushq $0x1
popq %r9
pushq 0xb8(%rbp)
pushq 0xb0(%rbp)
movq 0xa8(%rbp), %rax
pushq %rax
pushq %r10
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 -0x68(%rbp)
movq %r10, %r14
callq 0x6a6a
addq $0x90, %rsp
movl 0x8(%rbx), %eax
imull -0x58(%rbp), %eax
movq %r12, %r15
addl %r12d, %eax
movslq %eax, %rbx
movq 0xa8(%rbp), %rax
movsd -0x8(%rax,%rbx,8), %xmm0
movsd -0x40(%rbp), %xmm1
callq 0x52ff
testl %eax, %eax
je 0x7b2c
movsd -0x8(%r14,%rbx,8), %xmm0
movsd -0x38(%rbp), %xmm1
callq 0x52ff
testl %eax, %eax
jne 0x7b50
movl -0x2c(%rbp), %esi
incl %esi
decq %r13
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %r14, %r10
movq -0x48(%rbp), %r8
movq %r15, %r12
jmp 0x7a47
movl %r12d, %edx
jmp 0x7b6c
movq -0x60(%rbp), %rax
movl -0x2c(%rbp), %edx
movl %edx, -0x4(%rax,%r13,4)
movq -0x50(%rbp), %rax
movl %r13d, (%rax)
movl %r13d, %r8d
pushq $0x1
popq %rbx
movq %r14, %r10
movl -0x54(%rbp), %ecx
incl %ecx
movl %edx, %r12d
jmp 0x79f5
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq