// File: /workspace/github_c_makefile_star2_O1/fukunagatsu[P]RIblast/raccess.cpp
// Function: Raccess::CalcInsideVariable()
void Raccess::CalcInsideVariable(){
  for (int j =TURN+1; j <= _seq_length; j++){
    for (int i=j-TURN; i >= max(0,j-_maximal_span-1); i--){
      //Alpha_stem
      int type = BP_pair[_int_sequence[i+1]][_int_sequence[j]];
      int type2 = BP_pair[_int_sequence[i+2]][_int_sequence[j-1]];
      
      double temp = 0; bool flag = 0;
      if (type != 0) {
	type2 = rtype[type2];
	if(_Alpha_stem[i+1][j-i-2] != -INF){
	  //Stem¨Stem
	  if(type2 != 0){
	    temp = _Alpha_stem[i+1][j-i-2]+ LoopEnergy(type, type2,i+1,j,i+2,j-1);
	  }
	  flag = 1;
	}
    
	if(_Alpha_stemend[i+1][j-i-2] != -INF){
	  //Stem¨StemEnd
	  temp = flag == 1 ? logsumexp(temp,_Alpha_stemend[i+1][j-i-2]) : _Alpha_stemend[i+1][j-i-2];
	  flag = 1;
	}

	_Alpha_stem[i][j-i] = flag == 0 ? -INF : temp;
      }else{
	_Alpha_stem[i][j-i] = -INF;
      }
      
      //Alpha_multiBif
      temp = 0; flag = 0;
      for (int k=i+1; k<=j-1; k++){
	if(_Alpha_multi1[i][k-i] != -INF && _Alpha_multi2[k][j-k] != -INF){
	  temp = flag == 0 ? _Alpha_multi1[i][k-i]+_Alpha_multi2[k][j-k] : logsumexp(temp,_Alpha_multi1[i][k-i]+_Alpha_multi2[k][j-k]);
	  flag = 1;
	}
      }
      _Alpha_multibif[i][j-i] = flag == 0 ? -INF : temp;
      
      //Alpha_multi2
      temp = 0; flag = 0; 
      if (type != 0) {
	if(_Alpha_stem[i][j-i] != -INF){
	  temp = _Alpha_stem[i][j-i]+MLintern+CalcDangleEnergy(type,i,j);
	  flag = 1;
	}
      }
      if(_Alpha_multi2[i][j-i-1] != -INF){
	_Alpha_multi2[i][j-i] = _Alpha_multi2[i][j-i-1]+MLbase;
	if(flag == 1){
	  _Alpha_multi2[i][j-i] = logsumexp(temp,_Alpha_multi2[i][j-i]);
	}
      }else{
	_Alpha_multi2[i][j-i] = flag == 0 ? -INF : temp;
      }
      
      //Alpha_multi1
      if(_Alpha_multi2[i][j-i] != -INF && _Alpha_multibif[i][j-i] != -INF){
	_Alpha_multi1[i][j-i] = logsumexp(_Alpha_multi2[i][j-i],_Alpha_multibif[i][j-i]);
      }else if(_Alpha_multi2[i][j-i] == -INF){
	_Alpha_multi1[i][j-i] = _Alpha_multibif[i][j-i];
      }else if(_Alpha_multibif[i][j-i] == -INF){
	_Alpha_multi1[i][j-i] = _Alpha_multi2[i][j-i];
      }else{
	_Alpha_multi1[i][j-i] = -INF;
      }
      
      //Alpha_multi
      flag = 0;
      if(_Alpha_multi[i+1][j-i-1] != -INF){
	_Alpha_multi[i][j-i] = _Alpha_multi[i+1][j-i-1]+MLbase;
	flag = 1;
      }
      
      if(flag == 1){
	if(_Alpha_multibif[i][j-i] != -INF){
	  _Alpha_multi[i][j-i] = logsumexp(_Alpha_multi[i][j-i],_Alpha_multibif[i][j-i]);
	}
      }else{
	_Alpha_multi[i][j-i] = _Alpha_multibif[i][j-i];
      }
      
      //Alpha_stemend
      if(j != _seq_length){
	temp = 0;
	type = BP_pair[_int_sequence[i]][_int_sequence[j+1]];
	if (type!=0) {
	  //StemEnd¨sn
	  temp = HairpinEnergy(type, i,j+1);
	  
	  //StemEnd¨sm_Stem_sn
	  for (int p =i; p <= min(i+MAXLOOP,j-TURN-2); p++) {
	    int u1 = p-i;
	    for (int q=max(p+TURN+2,j-MAXLOOP+u1); q<=j; q++) {
	      type2 = BP_pair[_int_sequence[p+1]][_int_sequence[q]];
	      if(_Alpha_stem[p][q-p] != -INF){
		if (type2 != 0 && !(p == i && q == j)) {
		  type2 = rtype[type2];
		  temp = logsumexp(temp,_Alpha_stem[p][q-p]+LoopEnergy(type, type2,i,j+1,p+1,q)); 
		}
	      }
	    }
	  }
	  
	  //StemEnd¨Multi
	  int tt = rtype[type];
	  temp = logsumexp(temp,_Alpha_multi[i][j-i]+MLclosing+MLintern+dangle3[tt][_int_sequence[i+1]]+dangle5[tt][_int_sequence[j]]);
	  _Alpha_stemend[i][j-i] = temp;
	}else{
	  _Alpha_stemend[i][j-i] = -INF;
	}
      }
    }
  }
  
  //Alpha_Outer
  for(int i = 1;i <= _seq_length;i++){
    double temp = _Alpha_outer[i-1];
    for(int p = max(0,i-_maximal_span-1); p <i;p++){
      if(_Alpha_stem[p][i-p] != -INF){
	int type = BP_pair[_int_sequence[p+1]][_int_sequence[i]];
	double ao = _Alpha_stem[p][i-p]+CalcDangleEnergy(type,p,i);
	temp = logsumexp(temp,ao+_Alpha_outer[p]);
      }
    }
    _Alpha_outer[i] = temp;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
movl 0x62110(%rdi), %ecx
cmpl $0x4, %ecx
jl 0x8e79
leaq 0x62158(%rbx), %r13
leaq 0x61ec0(%rbx), %rax
movq %rax, 0xb0(%rsp)
leaq 0x61d80(%rbx), %rax
movq %rax, 0xa8(%rsp)
movl $0x6, 0x34(%rsp)
movl $0xffffffe6, 0x38(%rsp) # imm = 0xFFFFFFE6
movl $0x1, %eax
movq %rax, 0x80(%rsp)
movl $0x4, %r14d
movl $0x30, %eax
movq %rax, 0x78(%rsp)
movq $-0x8, 0x70(%rsp)
movsd 0x441b2(%rip), %xmm3    # 0x4c930
movq %r13, 0x88(%rsp)
movl 0x62114(%rbx), %eax
movl $0x2, %ecx
subq %r14, %rcx
subl %r14d, %eax
cmpl $-0x1, %eax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmovgel %edx, %eax
cltq
cmpq %rax, %rcx
ja 0x8e46
leal -0x1(%r14), %eax
movl %eax, 0x6c(%rsp)
leal 0x1(%r14), %eax
movl %eax, 0x40(%rsp)
leaq -0x5(%r14), %rax
movq %rax, 0xb8(%rsp)
leal -0x1e(%r14), %eax
movl %eax, 0x68(%rsp)
movl $0x2, %eax
movq %rax, 0xa0(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x90(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x80(%rsp), %r8
movl 0x34(%rsp), %eax
movl %eax, 0x3c(%rsp)
leaq 0x1(%r8), %rdi
movq 0x620f8(%rbx), %rax
movslq 0x4(%rax,%r8,4), %rcx
movslq (%rax,%r14,4), %rdx
leaq (%rcx,%rcx,4), %rcx
leaq 0x441a9(%rip), %rsi     # 0x4c9d0
leaq (%rsi,%rcx,4), %rcx
movl (%rcx,%rdx,4), %ecx
movl %ecx, 0x28(%rsp)
testl %ecx, %ecx
movq %r8, 0x8(%rsp)
movq %rdi, 0x10(%rsp)
je 0x88d9
movq (%r13), %rcx
leaq (%rdi,%rdi,2), %r12
movq %r14, %r15
subq %r8, %r15
movq (%rcx,%r12,8), %rcx
movsd -0x10(%rcx,%r15,8), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm3, %xmm1
jne 0x8869
jnp 0x88e5
movslq 0x8(%rax,%r8,4), %rcx
movslq -0x4(%rax,%r14,4), %rax
leaq (%rcx,%rcx,4), %rcx
leaq 0x44152(%rip), %rdx     # 0x4c9d0
leaq (%rdx,%rcx,4), %rcx
movslq (%rcx,%rax,4), %rax
movb $0x1, %bpl
testl %eax, %eax
je 0x88e7
leal 0x2(%r8), %r9d
leaq 0x441a8(%rip), %rcx     # 0x4ca40
movl (%rcx,%rax,4), %edx
movl 0x6c(%rsp), %eax
movl %eax, (%rsp)
movq %rbx, %rdi
movl 0x28(%rsp), %esi
movq 0x10(%rsp), %rcx
movl %r14d, %r8d
movsd %xmm1, 0x18(%rsp)
callq 0xa8b6
movq 0x8(%rsp), %r8
movsd 0x44067(%rip), %xmm3    # 0x4c930
movsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x88e7
movq %r14, %r15
subq %r8, %r15
movapd %xmm3, %xmm1
jmp 0x8938
xorl %ebp, %ebp
movq 0x62170(%rbx), %rax
movq (%rax,%r12,8), %rax
movsd -0x10(%rax,%r15,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x8901
jnp 0x891d
movb $0x1, %r12b
testb %bpl, %bpl
je 0x8922
callq 0xabc8
movq 0x8(%rsp), %r8
movsd 0x44015(%rip), %xmm3    # 0x4c930
jmp 0x8926
movl %ebp, %r12d
jmp 0x8926
movapd %xmm1, %xmm0
movq 0x10(%rsp), %rdi
movapd %xmm3, %xmm1
testb %r12b, %r12b
je 0x8938
movapd %xmm0, %xmm1
movq (%r13), %rax
leaq (%r8,%r8,2), %r12
movq (%rax,%r12,8), %rax
movsd %xmm1, (%rax,%r15,8)
movapd %xmm3, %xmm1
cmpq %r14, %rdi
jge 0x89f5
movq 0x621b8(%rbx), %rax
movq %r12, 0x48(%rsp)
movq (%rax,%r12,8), %r15
movq 0x621d0(%rbx), %rbp
addq 0x98(%rsp), %rbp
addq $0x8, %r15
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
movq 0xa0(%rsp), %r13
movsd (%r15), %xmm1
ucomisd %xmm3, %xmm1
jne 0x8996
jnp 0x89cd
movq (%rbp), %rax
movsd (%rax,%r13,8), %xmm2
ucomisd %xmm3, %xmm2
jne 0x89a8
jnp 0x89cd
addsd %xmm2, %xmm1
testb $0x1, %r12b
movb $0x1, %r12b
jne 0x89bb
movapd %xmm1, %xmm0
jmp 0x89cd
callq 0xabc8
movq 0x8(%rsp), %r8
movsd 0x43f63(%rip), %xmm3    # 0x4c930
addq $0x18, %rbp
addq $0x8, %r15
decq %r13
jne 0x8989
movapd %xmm3, %xmm1
testb $0x1, %r12b
je 0x89e8
movapd %xmm0, %xmm1
movq 0x88(%rsp), %r13
movq 0x48(%rsp), %r12
movq %r14, %rdx
subq %r8, %rdx
movq 0x621a0(%rbx), %rax
movq (%rax,%r12,8), %rbp
movsd %xmm1, (%rbp,%rdx,8)
xorpd %xmm0, %xmm0
movl 0x28(%rsp), %esi
testl %esi, %esi
movq %rdx, 0x20(%rsp)
je 0x8a6d
movq 0x62158(%rbx), %rax
movq (%rax,%r12,8), %rax
movsd (%rax,%rdx,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x8a35
jnp 0x8a6d
addsd 0x61d70(%rbx), %xmm1
movsd %xmm1, 0x18(%rsp)
movq %rbx, %rdi
movl %r8d, %edx
movl %r14d, %ecx
callq 0xad36
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %r8
movsd 0x43ecd(%rip), %xmm3    # 0x4c930
addsd 0x18(%rsp), %xmm0
movb $0x1, %al
jmp 0x8a6f
xorl %eax, %eax
movq 0x621d0(%rbx), %rcx
movq (%rcx,%r12,8), %r15
movsd -0x8(%r15,%rdx,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x8a89
jnp 0x8ab4
addsd 0x61d78(%rbx), %xmm1
movsd %xmm1, (%r15,%rdx,8)
testb %al, %al
je 0x8ac2
callq 0xabc8
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %r8
movsd 0x43e7e(%rip), %xmm3    # 0x4c930
jmp 0x8abc
testb %al, %al
jne 0x8abc
movapd %xmm3, %xmm0
movsd %xmm0, (%r15,%rdx,8)
movsd (%r15,%rdx,8), %xmm0
ucomisd %xmm3, %xmm0
jne 0x8ad0
jnp 0x8afb
movsd (%rbp,%rdx,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x8ade
jnp 0x8afb
callq 0xabc8
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %r8
movsd 0x43e3b(%rip), %xmm3    # 0x4c930
movapd %xmm0, %xmm1
jmp 0x8b1a
ucomisd %xmm3, %xmm0
movsd (%rbp,%rdx,8), %xmm1
jne 0x8b09
jnp 0x8b1a
cmpeqsd %xmm3, %xmm1
andpd %xmm1, %xmm0
andnpd %xmm3, %xmm1
orpd %xmm0, %xmm1
movq 0x621b8(%rbx), %rax
movq (%rax,%r12,8), %rax
movsd %xmm1, (%rax,%rdx,8)
movq 0x62188(%rbx), %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rcx
movsd -0x8(%rcx,%rdx,8), %xmm0
ucomisd %xmm3, %xmm0
jne 0x8b4c
jnp 0x8b8b
addsd 0x61d78(%rbx), %xmm0
movq (%rax,%r12,8), %r15
movsd %xmm0, (%r15,%rdx,8)
movsd (%rbp,%rdx,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x8b6c
jnp 0x8b9a
callq 0xabc8
movq 0x8(%rsp), %r8
movsd 0x43db2(%rip), %xmm3    # 0x4c930
movq 0x20(%rsp), %rax
movsd %xmm0, (%r15,%rax,8)
jmp 0x8b9a
movsd (%rbp,%rdx,8), %xmm0
movq (%rax,%r12,8), %rax
movsd %xmm0, (%rax,%rdx,8)
movl 0x62110(%rbx), %eax
cmpq %rax, %r14
je 0x8e03
movq 0x620f8(%rbx), %rax
movslq (%rax,%r8,4), %rcx
movslq 0x4(%rax,%r14,4), %rax
leaq (%rcx,%rcx,4), %rcx
leaq 0x43e0c(%rip), %rdx     # 0x4c9d0
leaq (%rdx,%rcx,4), %rcx
movslq (%rcx,%rax,4), %rsi
movapd %xmm3, %xmm0
testq %rsi, %rsi
je 0x8dee
movq %r12, 0x48(%rsp)
movq %rbx, %rdi
movq %rsi, 0x18(%rsp)
movl %r8d, %edx
movl 0x40(%rsp), %ecx
callq 0xadb2
movq 0x8(%rsp), %r8
movq 0xb8(%rsp), %rcx
cmpq %r8, %rcx
jl 0x8d65
movslq 0x3c(%rsp), %rdx
leal 0x1e(%r8), %eax
cmpl %eax, %ecx
cmovll %ecx, %eax
movl 0x68(%rsp), %ecx
subl %r8d, %ecx
movq %rcx, 0x50(%rsp)
cltq
movq %rax, 0xc0(%rsp)
movq 0x90(%rsp), %rbp
movq %r8, %r15
movl 0x38(%rsp), %esi
movsd 0x43ced(%rip), %xmm1    # 0x4c930
movq 0x50(%rsp), %rax
addl %r15d, %eax
leal 0x5(%r15), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
cltq
cmpq %rax, %r14
movq %rdx, 0x60(%rsp)
movl %esi, 0x58(%rsp)
jl 0x8d3e
movslq %esi, %r12
cmpq %r12, %rdx
cmovgq %rdx, %r12
leal 0x1(%r15), %r13d
movq %r15, %rax
xorq %r8, %rax
movq 0x62158(%rbx), %rcx
leaq (%r15,%r15,2), %rdx
movq (%rcx,%rdx,8), %rcx
addq %rbp, %rcx
movsd (%rcx,%r12,8), %xmm2
movl %r12d, %ecx
xorq %r14, %rcx
orq %rax, %rcx
sete %al
ucomisd %xmm1, %xmm2
jne 0x8cac
jnp 0x8d2d
movq 0x620f8(%rbx), %rcx
movslq 0x4(%rcx,%r15,4), %rdx
movslq (%rcx,%r12,4), %rcx
leaq (%rdx,%rdx,4), %rdx
leaq 0x43d09(%rip), %rsi     # 0x4c9d0
leaq (%rsi,%rdx,4), %rdx
movl (%rdx,%rcx,4), %ecx
testl %ecx, %ecx
je 0x8d2d
testb %al, %al
jne 0x8d2d
movslq %ecx, %rax
leaq 0x43d60(%rip), %rcx     # 0x4ca40
movl (%rcx,%rax,4), %edx
movl %r12d, (%rsp)
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
movl %r8d, %ecx
movl 0x40(%rsp), %r8d
movl %r13d, %r9d
movsd %xmm0, 0x10(%rsp)
movsd %xmm2, 0x28(%rsp)
callq 0xa8b6
movsd 0x28(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
callq 0xabc8
movq 0x8(%rsp), %r8
movsd 0x43c03(%rip), %xmm1    # 0x4c930
leaq 0x1(%r12), %rax
cmpq %r14, %r12
movq %rax, %r12
jl 0x8c76
leaq 0x1(%r15), %rax
movq 0x60(%rsp), %rdx
incq %rdx
movl 0x58(%rsp), %esi
incl %esi
addq $-0x8, %rbp
cmpq 0xc0(%rsp), %r15
movq %rax, %r15
jl 0x8c43
leaq 0x43cd4(%rip), %rax     # 0x4ca40
movq 0x18(%rsp), %rcx
movslq (%rax,%rcx,4), %rax
movq 0x620f8(%rbx), %rcx
movq 0x62188(%rbx), %rdx
movq 0x48(%rsp), %r12
movq (%rdx,%r12,8), %rdx
movq 0x20(%rsp), %rsi
movsd (%rdx,%rsi,8), %xmm1
addsd 0x61d68(%rbx), %xmm1
addsd 0x61d70(%rbx), %xmm1
movslq 0x4(%rcx,%r8,4), %rdx
shlq $0x3, %rax
leaq (%rax,%rax,4), %rax
movq 0xb0(%rsp), %rsi
addq %rax, %rsi
addsd (%rsi,%rdx,8), %xmm1
movslq (%rcx,%r14,4), %rcx
addq 0xa8(%rsp), %rax
addsd (%rax,%rcx,8), %xmm1
callq 0xabc8
movq 0x8(%rsp), %r8
movsd 0x43b4a(%rip), %xmm3    # 0x4c930
movq 0x88(%rsp), %r13
movq 0x62170(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x20(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
leaq -0x1(%r8), %rax
movl 0x62114(%rbx), %ecx
notl %ecx
addl %r14d, %ecx
testl %ecx, %ecx
movl $0x0, %edx
cmovlel %edx, %ecx
decl 0x3c(%rsp)
incq 0xa0(%rsp)
addq $-0x18, 0x98(%rsp)
addq $0x8, 0x90(%rsp)
cmpq %rcx, %r8
movq %rax, %r8
jg 0x8808
leaq 0x1(%r14), %rax
movslq 0x62110(%rbx), %rcx
incl 0x34(%rsp)
incl 0x38(%rsp)
incq 0x80(%rsp)
addq $0x18, 0x78(%rsp)
addq $-0x8, 0x70(%rsp)
cmpq %rcx, %r14
movq %rax, %r14
jl 0x8786
testl %ecx, %ecx
jle 0x8fbd
movq 0x62140(%rbx), %rdx
movl 0x62114(%rbx), %esi
movl %esi, %eax
notl %eax
movq %rax, 0x58(%rsp)
movq 0x62158(%rbx), %rax
movq %rax, 0x50(%rsp)
negl %esi
incl %ecx
movl $0x1, %r14d
movl $0x8, %r12d
movq %rcx, 0x60(%rsp)
movq %rdx, 0x8(%rsp)
testl %esi, %esi
movl $0x0, %eax
cmovgl %esi, %eax
movsd -0x8(%rdx,%r14,8), %xmm0
movq 0x58(%rsp), %rcx
addl %r14d, %ecx
movslq %ecx, %rcx
cmpq %rcx, %r14
movl %esi, 0x18(%rsp)
movq %r12, 0x40(%rsp)
jle 0x8f92
leaq (,%rax,8), %rcx
subq %rcx, %r12
leaq (%rax,%rax,2), %rax
movq 0x50(%rsp), %rcx
leaq (%rcx,%rax,8), %rbp
testl %esi, %esi
movl $0x0, %r15d
cmovgl %esi, %r15d
movq 0x620f8(%rbx), %r13
movq (%rbp), %rax
movsd (%rax,%r12), %xmm1
ucomisd 0x43a08(%rip), %xmm1    # 0x4c930
jne 0x8f2c
jnp 0x8f82
movslq 0x4(%r13,%r15,4), %rax
movslq (%r13,%r14,4), %rcx
leaq (%rax,%rax,4), %rax
leaq 0x43a8f(%rip), %rdx     # 0x4c9d0
leaq (%rdx,%rax,4), %rax
movl (%rax,%rcx,4), %esi
movq %rbx, %rdi
movl %r15d, %edx
movl %r14d, %ecx
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x28(%rsp)
callq 0xad36
movsd 0x28(%rsp), %xmm1
addsd %xmm0, %xmm1
movq 0x8(%rsp), %rax
addsd (%rax,%r15,8), %xmm1
movsd 0x10(%rsp), %xmm0
callq 0xabc8
incq %r15
addq $-0x8, %r12
addq $0x18, %rbp
cmpq %r14, %r15
jb 0x8f16
movq 0x8(%rsp), %rdx
movsd %xmm0, (%rdx,%r14,8)
incq %r14
movl 0x18(%rsp), %esi
incl %esi
movq 0x40(%rsp), %r12
addq $0x8, %r12
movq 0x60(%rsp), %rcx
cmpq %rcx, %r14
jne 0x8ebd
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop