// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x61ec0(%rdi), %rax
movq %rax, 0xb8(%rsp)
leaq 0x61d80(%rdi), %rax
movq %rax, 0xb0(%rsp)
pushq $0x2
popq %rax
pushq $-0x1a
popq %rcx
movl %ecx, 0x50(%rsp)
pushq $0x6
popq %rcx
movl %ecx, 0x4c(%rsp)
pushq $0x1
popq %rcx
movq %rcx, 0x88(%rsp)
pushq $0x4
popq %r10
pushq $0x6
popq %rcx
movq %rcx, 0x80(%rsp)
pushq $-0x8
popq %rcx
movq %rcx, 0x78(%rsp)
movsd 0x404e9(%rip), %xmm3    # 0x47930
movq %rax, %rcx
movslq 0x62110(%rbx), %rax
cmpq %rax, %r10
jg 0x7b9f
leal -0x1(%r10), %eax
movl %eax, 0x70(%rsp)
leaq 0x1(%r10), %rax
movq %rax, 0x58(%rsp)
leal -0x5(%r10), %eax
movl %eax, 0x6c(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x90(%rsp)
pushq $0x2
popq %r13
movq 0x80(%rsp), %rbp
movq 0x88(%rsp), %r8
movl 0x4c(%rsp), %eax
movl %eax, 0x54(%rsp)
movq %rcx, 0xa8(%rsp)
movq %rcx, 0x28(%rsp)
movq %r10, 0x18(%rsp)
movl 0x62114(%rbx), %eax
notl %eax
addl %r10d, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
cmpq %rax, %r8
jl 0x7b6b
leaq 0x1(%r8), %rdi
movq 0x620f8(%rbx), %rax
movslq 0x4(%rax,%r8,4), %rcx
movslq (%rax,%r10,4), %rdx
imulq $0x14, %rcx, %rcx
leaq 0x404f5(%rip), %rsi     # 0x479e0
addq %rsi, %rcx
movl (%rcx,%rdx,4), %ecx
testl %ecx, %ecx
movq %r8, 0x10(%rsp)
movq %rdi, 0x40(%rsp)
movl %ecx, 0x30(%rsp)
je 0x75c7
movq 0x62158(%rbx), %rcx
imulq $0x18, %rdi, %r12
movq %r10, %r15
subq %r8, %r15
movq (%rcx,%r12), %rcx
movsd -0x10(%rcx,%r15,8), %xmm2
ucomisd %xmm3, %xmm2
xorpd %xmm0, %xmm0
jne 0x752f
jnp 0x759a
movslq 0x8(%rax,%r8,4), %rcx
movslq -0x4(%rax,%r10,4), %rax
imulq $0x14, %rcx, %rcx
leaq 0x4049c(%rip), %rdx     # 0x479e0
addq %rdx, %rcx
movl (%rcx,%rax,4), %eax
testl %eax, %eax
je 0x759a
leal 0x1(%r8), %ecx
leaq 0x2(%r8), %r9
cltq
leaq 0x404f1(%rip), %rdx     # 0x47a50
movl (%rdx,%rax,4), %edx
movl 0x70(%rsp), %eax
movl %eax, (%rsp)
movq %rbx, %rdi
movl 0x30(%rsp), %esi
movl %r10d, %r8d
movsd %xmm2, 0x38(%rsp)
callq 0x918e
movsd 0x38(%rsp), %xmm2
movq 0x18(%rsp), %r10
movq 0x10(%rsp), %r8
movsd 0x4039a(%rip), %xmm3    # 0x47930
addsd %xmm2, %xmm0
movq 0x62170(%rbx), %rax
movq (%rax,%r12), %rax
movsd -0x10(%rax,%r15,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x75b4
jnp 0x75d8
ucomisd %xmm3, %xmm2
movq 0x28(%rsp), %rcx
jne 0x75eb
jp 0x75eb
movapd %xmm1, %xmm0
jmp 0x7607
movq %r10, %r15
subq %r8, %r15
movapd %xmm3, %xmm0
movq 0x28(%rsp), %rcx
jmp 0x7607
ucomisd %xmm3, %xmm2
movq 0x28(%rsp), %rcx
jne 0x7607
jp 0x7607
movapd %xmm3, %xmm0
jmp 0x7607
callq 0x94a2
movq 0x18(%rsp), %r10
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %r8
movsd 0x40329(%rip), %xmm3    # 0x47930
movq 0x62158(%rbx), %rax
imulq $0x18, %r8, %rdx
movq %rdx, 0x38(%rsp)
movq (%rax,%rdx), %rax
movsd %xmm0, (%rax,%r15,8)
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
movq %r13, 0xa0(%rsp)
movq %r13, %r12
movq %rbp, 0x98(%rsp)
movq %rbp, %r13
xorl %ebp, %ebp
leaq (%rcx,%r15), %rax
cmpq %r10, %rax
jge 0x76bc
movq 0x621b8(%rbx), %rax
movq 0x38(%rsp), %rdx
movq (%rax,%rdx), %rax
movsd 0x8(%rax,%r15,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x7668
jnp 0x76b0
movq 0x621d0(%rbx), %rax
movq (%rax,%r13,8), %rax
movsd (%rax,%r12,8), %xmm2
ucomisd %xmm3, %xmm2
jne 0x7681
jnp 0x76b0
addsd %xmm2, %xmm1
testb $0x1, %bpl
movb $0x1, %bpl
jne 0x7694
movapd %xmm1, %xmm0
jmp 0x76b0
callq 0x94a2
movq 0x18(%rsp), %r10
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %r8
movsd 0x40280(%rip), %xmm3    # 0x47930
incq %r15
addq $0x3, %r13
decq %r12
jmp 0x7640
movapd %xmm3, %xmm1
testb $0x1, %bpl
je 0x76ca
movapd %xmm0, %xmm1
movq %r10, %rcx
subq %r8, %rcx
movq 0x621a0(%rbx), %rax
movq 0x38(%rsp), %r15
movq (%rax,%r15), %rax
movsd %xmm1, (%rax,%rcx,8)
xorpd %xmm0, %xmm0
movl 0x30(%rsp), %esi
testl %esi, %esi
movq 0xa0(%rsp), %r13
movq 0x98(%rsp), %rbp
movq %rcx, 0x20(%rsp)
je 0x7756
movq 0x62158(%rbx), %rax
movq (%rax,%r15), %rax
movsd (%rax,%rcx,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x771e
jnp 0x7756
addsd 0x61d70(%rbx), %xmm1
movsd %xmm1, 0x60(%rsp)
movq %rbx, %rdi
movl %r8d, %edx
movl %r10d, %ecx
callq 0x94f6
movq 0x18(%rsp), %r10
movq 0x10(%rsp), %r8
movsd 0x401e4(%rip), %xmm3    # 0x47930
addsd 0x60(%rsp), %xmm0
movb $0x1, %al
jmp 0x7758
xorl %eax, %eax
movq 0x621d0(%rbx), %rcx
movq (%rcx,%r15), %rcx
movq 0x20(%rsp), %rdx
movsd -0x8(%rcx,%rdx,8), %xmm2
ucomisd %xmm3, %xmm2
jne 0x7776
jnp 0x77af
addsd 0x61d78(%rbx), %xmm2
movsd %xmm2, (%rcx,%rdx,8)
testb %al, %al
je 0x77ca
movapd %xmm2, %xmm1
callq 0x94a2
movq 0x18(%rsp), %r10
movq 0x10(%rsp), %r8
movsd 0x4018e(%rip), %xmm3    # 0x47930
movq 0x621d0(%rbx), %rax
movq (%rax,%r15), %rcx
jmp 0x77b7
testb %al, %al
jne 0x77b7
movapd %xmm3, %xmm0
movq 0x20(%rsp), %rax
movsd %xmm0, (%rcx,%rax,8)
movq %rax, %rcx
movapd %xmm0, %xmm2
jmp 0x77cd
movq %rdx, %rcx
ucomisd %xmm3, %xmm2
jne 0x77d5
jnp 0x781e
movq 0x621a0(%rbx), %rax
movq (%rax,%r15), %rax
movsd (%rax,%rcx,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x77ed
jnp 0x781e
movapd %xmm2, %xmm0
movq %rcx, %r12
callq 0x94a2
movq 0x18(%rsp), %r10
movq 0x10(%rsp), %r8
movsd 0x40125(%rip), %xmm3    # 0x47930
movq 0x621b8(%rbx), %rax
movq (%rax,%r15), %rax
movsd %xmm0, (%rax,%r12,8)
jmp 0x786b
ucomisd %xmm3, %xmm2
movq 0x621a0(%rbx), %rax
movq (%rax,%r15), %rax
movsd (%rax,%rcx,8), %xmm0
jne 0x7848
jp 0x7848
movq 0x621b8(%rbx), %rax
movq (%rax,%r15), %rax
movsd %xmm0, (%rax,%rcx,8)
jmp 0x7868
ucomisd %xmm3, %xmm0
movq 0x621b8(%rbx), %rax
movq (%rax,%r15), %rax
jne 0x7b55
jp 0x7b55
movsd %xmm2, (%rax,%rcx,8)
movq %rcx, %r12
movq 0x62188(%rbx), %rax
imulq $0x18, 0x40(%rsp), %rcx
movq (%rax,%rcx), %rcx
movsd -0x8(%rcx,%r12,8), %xmm0
ucomisd %xmm3, %xmm0
jne 0x788b
jnp 0x78db
addsd 0x61d78(%rbx), %xmm0
movq (%rax,%r15), %rax
movsd %xmm0, (%rax,%r12,8)
movq 0x621a0(%rbx), %rax
movq (%rax,%r15), %rax
movsd (%rax,%r12,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x78b6
jnp 0x78fe
callq 0x94a2
movq 0x18(%rsp), %r10
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %r8
movsd 0x4005e(%rip), %xmm3    # 0x47930
movq 0x62188(%rbx), %rax
jmp 0x78f5
movq 0x621a0(%rbx), %rcx
movq (%rcx,%r15), %rcx
movq 0x20(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movq 0x20(%rsp), %rcx
movq (%rax,%r15), %rax
movsd %xmm0, (%rax,%rcx,8)
movl 0x62110(%rbx), %eax
cmpq %rax, %r10
je 0x7b34
movq 0x620f8(%rbx), %rax
movslq (%rax,%r8,4), %rcx
movq 0x58(%rsp), %rdx
movslq (%rax,%rdx,4), %rax
imulq $0x14, %rcx, %rcx
leaq 0x400b4(%rip), %rdx     # 0x479e0
addq %rdx, %rcx
movslq (%rcx,%rax,4), %rsi
movapd %xmm3, %xmm0
testq %rsi, %rsi
je 0x7b1f
movq %rbx, %rdi
movq %rsi, %r14
movl %r8d, %edx
movq 0x58(%rsp), %rcx
callq 0x9570
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %r8
movsd 0x3ffcb(%rip), %xmm1    # 0x47930
leal 0x1e(%r8), %eax
movl 0x6c(%rsp), %ecx
cmpl %eax, %ecx
cmovll %ecx, %eax
cltq
movq %rax, 0xc0(%rsp)
movq 0x90(%rsp), %r15
movq %r8, %rbp
movl 0x54(%rsp), %eax
movl 0x50(%rsp), %ecx
cmpq 0xc0(%rsp), %rbp
jg 0x7a92
cmpl %eax, %ecx
movl %eax, 0x60(%rsp)
movl %ecx, 0x74(%rsp)
cmovgl %ecx, %eax
movslq %eax, %r13
leaq 0x1(%rbp), %r12
cmpq %rdi, %r13
jg 0x7a7a
movq %rbp, %rax
xorq %r8, %rax
movq 0x62158(%rbx), %rcx
imulq $0x18, %rbp, %rdx
movq (%rcx,%rdx), %rcx
addq %r15, %rcx
movsd (%rcx,%r13,8), %xmm2
movl %r13d, %ecx
xorq %rdi, %rcx
orq %rax, %rcx
sete %al
ucomisd %xmm1, %xmm2
jne 0x79f0
jnp 0x7a72
movq 0x620f8(%rbx), %rcx
movslq (%rcx,%r12,4), %rdx
movslq (%rcx,%r13,4), %rcx
imulq $0x14, %rdx, %rdx
leaq 0x3ffd6(%rip), %rsi     # 0x479e0
addq %rsi, %rdx
movl (%rdx,%rcx,4), %ecx
testl %ecx, %ecx
je 0x7a72
testb %al, %al
jne 0x7a72
movslq %ecx, %rax
leaq 0x4002e(%rip), %rcx     # 0x47a50
movl (%rcx,%rax,4), %edx
movl %r13d, (%rsp)
movq %rbx, %rdi
movl %r14d, %esi
movl %r8d, %ecx
movq 0x58(%rsp), %r8
movl %r12d, %r9d
movsd %xmm0, 0x30(%rsp)
movsd %xmm2, 0x40(%rsp)
callq 0x918e
movsd 0x40(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
callq 0x94a2
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %r8
movsd 0x3febe(%rip), %xmm1    # 0x47930
incq %r13
jmp 0x79b1
movl 0x74(%rsp), %ecx
incl %ecx
movl 0x60(%rsp), %eax
incl %eax
addq $-0x8, %r15
movq %r12, %rbp
jmp 0x798f
leaq 0x3ffb7(%rip), %rax     # 0x47a50
movslq (%rax,%r14,4), %rax
movq 0x62188(%rbx), %rcx
movq 0x38(%rsp), %r15
movq (%rcx,%r15), %rcx
movq 0x20(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm1
addsd 0x61d68(%rbx), %xmm1
movq 0x620f8(%rbx), %rcx
addsd 0x61d70(%rbx), %xmm1
movslq 0x4(%rcx,%r8,4), %rdx
imulq $0x28, %rax, %rax
movq 0xb8(%rsp), %rsi
addq %rax, %rsi
addsd (%rsi,%rdx,8), %xmm1
movslq (%rcx,%rdi,4), %rcx
addq 0xb0(%rsp), %rax
addsd (%rax,%rcx,8), %xmm1
callq 0x94a2
movq 0x18(%rsp), %r10
movq 0x10(%rsp), %r8
movsd 0x3fe21(%rip), %xmm3    # 0x47930
movq 0xa0(%rsp), %r13
movq 0x98(%rsp), %rbp
movq 0x62170(%rbx), %rax
movq (%rax,%r15), %rax
movq 0x20(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
decq %r8
decq 0x28(%rsp)
decl 0x54(%rsp)
addq $-0x3, %rbp
incq %r13
addq $0x8, 0x90(%rsp)
jmp 0x74ae
movq %rcx, %r12
movabsq $-0x3ed17b8000000000, %rcx # imm = 0xC12E848000000000
movq %rcx, (%rax,%r12,8)
jmp 0x786b
movq 0xa8(%rsp), %rcx
incq %rcx
incl 0x50(%rsp)
incl 0x4c(%rsp)
incq 0x88(%rsp)
addq $0x3, 0x80(%rsp)
addq $-0x8, 0x78(%rsp)
movq 0x58(%rsp), %r10
jmp 0x744a
pushq $0x1
popq %r14
pushq $0x8
popq %r12
xorl %r13d, %r13d
cltq
cmpq %rax, %r14
jg 0x7ca7
movq 0x62140(%rbx), %rax
movl %r13d, %r15d
subl 0x62114(%rbx), %r15d
movsd -0x8(%rax,%r14,8), %xmm0
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
imulq $0x18, %r15, %rbp
leaq (,%r15,8), %rax
movq %r12, 0x10(%rsp)
subq %rax, %r12
cmpq %r14, %r15
jae 0x7c80
movq 0x62158(%rbx), %rax
movq (%rax,%rbp), %rax
movsd (%rax,%r12), %xmm1
ucomisd 0x3fd21(%rip), %xmm1    # 0x47930
jne 0x7c13
jnp 0x7c70
movq 0x620f8(%rbx), %rax
movslq 0x4(%rax,%r15,4), %rcx
movslq (%rax,%r14,4), %rax
imulq $0x14, %rcx, %rcx
leaq 0x3fdb2(%rip), %rdx     # 0x479e0
addq %rdx, %rcx
movl (%rcx,%rax,4), %esi
movq %rbx, %rdi
movl %r15d, %edx
movl %r14d, %ecx
movsd %xmm0, 0x30(%rsp)
movsd %xmm1, 0x40(%rsp)
callq 0x94f6
movsd 0x40(%rsp), %xmm1
addsd %xmm0, %xmm1
movq 0x62140(%rbx), %rax
addsd (%rax,%r15,8), %xmm1
movsd 0x30(%rsp), %xmm0
callq 0x94a2
incq %r15
addq $0x18, %rbp
addq $-0x8, %r12
jmp 0x7bed
movq 0x62140(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
incl %r13d
movl 0x62110(%rbx), %eax
movq 0x10(%rsp), %r12
addq $0x8, %r12
jmp 0x7baa
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop