// File: /workspace/github_c_makefile_star2_O0/fukunagatsu[P]RIblast/raccess.cpp
// Function: Raccess::CalcBulgeAndInternalProbability(std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&)
void Raccess::CalcBulgeAndInternalProbability(vector<double> &biloop_probability, vector<double> &conditional_biloop_probability){
  double probability = 0;
  double temp = 0;
  int type = 0;
  int type2 = 0;
  vector<bool> b_flag_array; b_flag_array.resize(_seq_length,0);
  vector<bool> c_flag_array; c_flag_array.resize(_seq_length,0);
  int w = _min_accessible_length;
  
  for(int i = 1; i<_seq_length-TURN-2;i++){
    for(int j = i+TURN+3; j<=min(i+_maximal_span,_seq_length);j++){
      type = BP_pair[_int_sequence[i]][_int_sequence[j]];
      if (type!=0) {
	for (int p =i+1; p <= min(i+MAXLOOP+1,j-TURN-2); p++) {
	  int u1 = p-i-1;
	  for (int q=max(p+TURN+1,j-MAXLOOP+u1-1); q<j; q++) {
	    type2 = BP_pair[_int_sequence[p]][_int_sequence[q]];
	    if (type2 != 0 && !(p == i+1 && q == j-1)) {
	      type2 = rtype[type2];
	      if(_Beta_stemend[i][j-i-1] != -INF && _Alpha_stem[p-1][q-p+1] != -INF){
		temp = fmath::expd(_Beta_stemend[i][j-i-1] + LoopEnergy(type, type2,i,j,p,q)+_Alpha_stem[p-1][q-p+1]);
		
		for(int k = i+1; k <= p-w;k++){
		  if(k == p-w){
		    biloop_probability[k-1] += temp;		   
		  }else{
		    conditional_biloop_probability[k-1] += temp;		  
		  }
		}
		
		for(int k = q+1; k <= j-w;k++){
		  if(k == j-w){
		    biloop_probability[k-1] += temp;
		  }else{
		    conditional_biloop_probability[k-1] += temp;
		  }
		}
	      } 
	    }
	  }
	}
      }
    }
  }
  
  for(int i=0;i<_seq_length;i++){
    if(biloop_probability[i] != 0){
      biloop_probability[i] = fmath::log((float)(biloop_probability[i] + conditional_biloop_probability[i]));
      biloop_probability[i] = fmath::expd(biloop_probability[i]-_Alpha_outer[_seq_length]);
    }
    if(conditional_biloop_probability[i] != 0){
      conditional_biloop_probability[i] = fmath::log((float)(conditional_biloop_probability[i]));
      conditional_biloop_probability[i] = fmath::expd(conditional_biloop_probability[i]-_Alpha_outer[_seq_length]);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x156b0
movq -0xd8(%rbp), %rax
movq -0xd0(%rbp), %rdi
movslq 0x62110(%rax), %rsi
xorl %edx, %edx
callq 0x156d0
jmp 0x12dce
leaq -0x90(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x156b0
movq -0xd8(%rbp), %rax
movq -0xe0(%rbp), %rdi
movslq 0x62110(%rax), %rsi
xorl %edx, %edx
callq 0x156d0
jmp 0x12dff
movq -0xd8(%rbp), %rax
movl 0x62118(%rax), %eax
movl %eax, -0x94(%rbp)
movl $0x1, -0x98(%rbp)
movq -0xd8(%rbp), %rcx
movl -0x98(%rbp), %eax
movl 0x62110(%rcx), %ecx
subl $0x3, %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x1343a
movl -0x98(%rbp), %eax
addl $0x3, %eax
addl $0x3, %eax
movl %eax, -0x9c(%rbp)
movq -0xd8(%rbp), %rsi
movl -0x9c(%rbp), %eax
movl %eax, -0xec(%rbp)
movl -0x98(%rbp), %eax
movl 0x62114(%rsi), %ecx
addl %ecx, %eax
movl %eax, -0xa0(%rbp)
addq $0x62110, %rsi          # imm = 0x62110
leaq -0xa0(%rbp), %rdi
callq 0xc850
movq %rax, -0xe8(%rbp)
jmp 0x12e92
movl -0xec(%rbp), %eax
movq -0xe8(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x13424
movq -0xd8(%rbp), %rdi
addq $0x620f8, %rdi          # imm = 0x620F8
movslq -0x98(%rbp), %rsi
callq 0xbac0
movq -0xd8(%rbp), %rdi
movslq (%rax), %rcx
leaq 0x6a43e(%rip), %rax     # 0x7d310
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xf8(%rbp)
addq $0x620f8, %rdi          # imm = 0x620F8
movslq -0x9c(%rbp), %rsi
callq 0xbac0
movq %rax, %rcx
movq -0xf8(%rbp), %rax
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x1340e
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x104(%rbp)
movl -0x98(%rbp), %eax
addl $0x1f, %eax
movl %eax, -0xa8(%rbp)
movl -0x9c(%rbp), %eax
addl $-0x5, %eax
movl %eax, -0xac(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xac(%rbp), %rsi
callq 0xc850
movq %rax, -0x100(%rbp)
jmp 0x12f65
movl -0x104(%rbp), %eax
movq -0x100(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x1340c
movl -0xa4(%rbp), %ecx
movl -0x98(%rbp), %eax
notl %eax
addl %ecx, %eax
movl %eax, -0xb0(%rbp)
movl -0xa4(%rbp), %eax
addl $0x4, %eax
movl %eax, -0xb8(%rbp)
movl -0x9c(%rbp), %edx
movl -0xb0(%rbp), %eax
movl %eax, %ecx
movl %edx, %eax
leal -0x1f(%rax,%rcx), %eax
movl %eax, -0xbc(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xbc(%rbp), %rsi
callq 0x15060
movq %rax, -0x110(%rbp)
jmp 0x12fd5
movq -0x110(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jge 0x133f6
movq -0xd8(%rbp), %rdi
addq $0x620f8, %rdi          # imm = 0x620F8
movslq -0xa4(%rbp), %rsi
callq 0xbac0
movq -0xd8(%rbp), %rdi
movslq (%rax), %rcx
leaq 0x6a2ef(%rip), %rax     # 0x7d310
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
addq $0x620f8, %rdi          # imm = 0x620F8
movslq -0xb4(%rbp), %rsi
callq 0xbac0
movq %rax, %rcx
movq -0x118(%rbp), %rax
movslq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x133e0
movl -0xa4(%rbp), %eax
movl -0x98(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x13089
movl -0xb4(%rbp), %eax
movl -0x9c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
je 0x133e0
movq -0xd8(%rbp), %rdi
movslq -0x30(%rbp), %rcx
leaq 0x6a2e5(%rip), %rax     # 0x7d380
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
addq $0x62218, %rdi          # imm = 0x62218
movslq -0x98(%rbp), %rsi
callq 0x150a0
movq %rax, %rdi
movl -0x9c(%rbp), %eax
subl -0x98(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x150c0
movsd (%rax), %xmm0
movsd 0x25846(%rip), %xmm1    # 0x38920
ucomisd %xmm1, %xmm0
jne 0x130e7
jp 0x130e7
jmp 0x133de
movq -0xd8(%rbp), %rdi
addq $0x62158, %rdi          # imm = 0x62158
movl -0xa4(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x150a0
movq %rax, %rdi
movl -0xb4(%rbp), %eax
subl -0xa4(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x150c0
movsd (%rax), %xmm0
movsd 0x257f4(%rip), %xmm1    # 0x38920
ucomisd %xmm1, %xmm0
jne 0x13139
jp 0x13139
jmp 0x133de
movq -0xd8(%rbp), %rdi
addq $0x62218, %rdi          # imm = 0x62218
movslq -0x98(%rbp), %rsi
callq 0x150a0
movq %rax, %rdi
movl -0x9c(%rbp), %ecx
movl -0x98(%rbp), %eax
notl %eax
addl %ecx, %eax
movslq %eax, %rsi
callq 0x150c0
movq -0xd8(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x128(%rbp)
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x98(%rbp), %ecx
movl -0x9c(%rbp), %r8d
movl -0xa4(%rbp), %r9d
movl -0xb4(%rbp), %r10d
movq %rsp, %rax
movl %r10d, (%rax)
callq 0x123a0
movsd %xmm0, -0x120(%rbp)
jmp 0x131b7
movq -0xd8(%rbp), %rdi
movsd -0x120(%rbp), %xmm1
movsd -0x128(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x138(%rbp)
addq $0x62158, %rdi          # imm = 0x62158
movl -0xa4(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x150a0
movq %rax, %rdi
movl -0xb4(%rbp), %eax
movl -0xa4(%rbp), %ecx
subl %ecx, %eax
incl %eax
movslq %eax, %rsi
callq 0x150c0
movsd -0x138(%rbp), %xmm0
movsd (%rax), %xmm1
addsd %xmm1, %xmm0
callq 0x151d0
movsd %xmm0, -0x130(%rbp)
jmp 0x1322b
movsd -0x130(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc0(%rbp)
movl -0xc0(%rbp), %eax
movl -0xa4(%rbp), %ecx
subl -0x94(%rbp), %ecx
cmpl %ecx, %eax
jg 0x13321
movl -0xc0(%rbp), %eax
movl -0xa4(%rbp), %ecx
subl -0x94(%rbp), %ecx
cmpl %ecx, %eax
jne 0x132d9
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
movq -0x10(%rbp), %rdi
movl -0xc0(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x150c0
movsd -0x140(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x1330b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1369d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x157f0
jmp 0x1369d
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x148(%rbp)
movq -0x18(%rbp), %rdi
movl -0xc0(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x150c0
movsd -0x148(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x1330d
movl -0xc0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc0(%rbp)
jmp 0x13247
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
movl -0x9c(%rbp), %ecx
subl -0x94(%rbp), %ecx
cmpl %ecx, %eax
jg 0x133dc
movl -0xc4(%rbp), %eax
movl -0x9c(%rbp), %ecx
subl -0x94(%rbp), %ecx
cmpl %ecx, %eax
jne 0x13394
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
movq -0x10(%rbp), %rdi
movl -0xc4(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x150c0
movsd -0x150(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x133c6
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x158(%rbp)
movq -0x18(%rbp), %rdi
movl -0xc4(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x150c0
movsd -0x158(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x133c8
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x13330
jmp 0x133de
jmp 0x133e0
jmp 0x133e2
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x12fe4
jmp 0x133f8
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x12f1f
jmp 0x1340e
jmp 0x13410
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x12e4f
jmp 0x13426
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0x12e1c
movl $0x0, -0xc8(%rbp)
movq -0xd8(%rbp), %rcx
movl -0xc8(%rbp), %eax
cmpl 0x62110(%rcx), %eax
jge 0x1367f
movq -0x10(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x13481
jp 0x13481
jmp 0x13577
movq -0x10(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movsd (%rax), %xmm0
movsd %xmm0, -0x168(%rbp)
movq -0x18(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movsd -0x168(%rbp), %xmm0
movsd (%rax), %xmm1
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x150e0
movss %xmm0, -0x15c(%rbp)
jmp 0x134d0
movss -0x15c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x180(%rbp)
movq -0x10(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movsd -0x180(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movq %rax, %rcx
movq -0xd8(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x178(%rbp)
movq %rax, %rdi
addq $0x62140, %rdi          # imm = 0x62140
movslq 0x62110(%rax), %rsi
callq 0x150c0
movsd -0x178(%rbp), %xmm0
movsd (%rax), %xmm1
subsd %xmm1, %xmm0
callq 0x151d0
movsd %xmm0, -0x170(%rbp)
jmp 0x1355b
movq -0x10(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movsd -0x170(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x18(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1359b
jp 0x1359b
jmp 0x13669
movq -0x18(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movsd (%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x150e0
movss %xmm0, -0x184(%rbp)
jmp 0x135c2
movss -0x184(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x1a0(%rbp)
movq -0x18(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movsd -0x1a0(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0x18(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movq %rax, %rcx
movq -0xd8(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x198(%rbp)
movq %rax, %rdi
addq $0x62140, %rdi          # imm = 0x62140
movslq 0x62110(%rax), %rsi
callq 0x150c0
movsd -0x198(%rbp), %xmm0
movsd (%rax), %xmm1
subsd %xmm1, %xmm0
callq 0x151d0
movsd %xmm0, -0x190(%rbp)
jmp 0x1364d
movq -0x18(%rbp), %rdi
movslq -0xc8(%rbp), %rsi
callq 0x150c0
movsd -0x190(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0x1366b
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x13444
leaq -0x90(%rbp), %rdi
callq 0x157f0
leaq -0x58(%rbp), %rdi
callq 0x157f0
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
leaq -0x58(%rbp), %rdi
callq 0x157f0
movq -0x60(%rbp), %rdi
callq 0x34d0
nop