// File: /workspace/github_c_makefile_star2_O0/fukunagatsu[P]RIblast/raccess.cpp
// Function: Raccess::CalcAccessibility(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::vector<float, std::allocator<float>>&, std::vector<float, std::allocator<float>>&)
void Raccess::CalcAccessibility(string &sequence,vector<float> &accessibility, vector<float> &conditional_accessibility){
  double prob = 0.0;
  accessibility.resize(_seq_length, 0.0);
  conditional_accessibility.resize(_seq_length, 0.0);

  vector<double> biloop_probability; biloop_probability.resize(_seq_length, 0.0);
  vector<double> conditional_biloop_probability; conditional_biloop_probability.resize(_seq_length, 0.0);

  vector<double> hairpin_probability; hairpin_probability.resize(_seq_length, 0.0);
  vector<double> conditional_hairpin_probability; conditional_hairpin_probability.resize(_seq_length, 0.0);

  double pf = _Alpha_outer[_seq_length];
  if(pf >= -690 && pf <= 690){
    CalcBulgeAndInternalProbability(biloop_probability, conditional_biloop_probability);
  }else{
    CalcLogSumBulgeAndInternalProbability(biloop_probability, conditional_biloop_probability);
  }
  CalcHairpinProbability(hairpin_probability, conditional_hairpin_probability);

  for(int i = 1; i+_min_accessible_length-1 <=_seq_length;i++){
    prob += CalcExteriorProbability(i,_min_accessible_length);
    prob += hairpin_probability[i-1];
    prob += biloop_probability[i-1];
    prob += CalcMultiProbability(i,_min_accessible_length);
    accessibility[i-1] = (-fmath::log((float)prob)*kT)/1000;
    prob = 0.0;
  }
  
  for(int i = 1; i+_min_accessible_length-1 < _seq_length;i++){
    prob += CalcExteriorProbability(i,_min_accessible_length+1);
    prob += conditional_hairpin_probability[i-1];
    prob += conditional_biloop_probability[i-1];
    prob += CalcMultiProbability(i,_min_accessible_length+1);
    conditional_accessibility[i+_min_accessible_length-1] = (-fmath::log((float)prob)*kT)/1000 - accessibility[i-1];
    prob = 0.0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movslq 0x62110(%rax), %rsi
movl $0x0, -0x2c(%rbp)
leaq -0x2c(%rbp), %rdx
callq 0x155e0
movq -0xe0(%rbp), %rax
movq -0x20(%rbp), %rdi
movslq 0x62110(%rax), %rsi
movl $0x0, -0x30(%rbp)
leaq -0x30(%rbp), %rdx
callq 0x155e0
leaq -0x48(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0xbef0
movq -0xe0(%rbp), %rax
movq -0xd8(%rbp), %rdi
movslq 0x62110(%rax), %rsi
movq $0x0, -0x50(%rbp)
leaq -0x50(%rbp), %rdx
callq 0x14e80
jmp 0x11e63
leaq -0x78(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0xbef0
movq -0xe0(%rbp), %rax
movq -0xe8(%rbp), %rdi
movslq 0x62110(%rax), %rsi
movq $0x0, -0x80(%rbp)
leaq -0x80(%rbp), %rdx
callq 0x14e80
jmp 0x11e9b
leaq -0x98(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0xbef0
movq -0xe0(%rbp), %rax
movq -0xf0(%rbp), %rdi
movslq 0x62110(%rax), %rsi
movq $0x0, -0xa0(%rbp)
leaq -0xa0(%rbp), %rdx
callq 0x14e80
jmp 0x11edc
leaq -0xb8(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0xbef0
movq -0xe0(%rbp), %rax
movq -0xf8(%rbp), %rdi
movslq 0x62110(%rax), %rsi
movq $0x0, -0xc0(%rbp)
leaq -0xc0(%rbp), %rdx
callq 0x14e80
jmp 0x11f1d
movq -0xe0(%rbp), %rax
movq %rax, %rdi
addq $0x62140, %rdi          # imm = 0x62140
movslq 0x62110(%rax), %rsi
callq 0x150c0
movsd (%rax), %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd -0xc8(%rbp), %xmm0
movsd 0x269d2(%rip), %xmm1    # 0x38928
ucomisd %xmm1, %xmm0
jb 0x11fd6
movsd 0x269cc(%rip), %xmm0    # 0x38930
ucomisd -0xc8(%rbp), %xmm0
jb 0x11fd6
movq -0xe0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x12d60
jmp 0x11f84
jmp 0x11fee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x12386
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1237d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x12371
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0xc690
jmp 0x12371
movq -0xe0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x136b0
jmp 0x11fec
jmp 0x11fee
movq -0xe0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x14590
jmp 0x1200a
movl $0x1, -0xcc(%rbp)
movq -0xe0(%rbp), %rcx
movl -0xcc(%rbp), %eax
addl 0x62118(%rcx), %eax
subl $0x1, %eax
cmpl 0x62110(%rcx), %eax
jg 0x12183
movq -0xe0(%rbp), %rdi
movl -0xcc(%rbp), %esi
movl 0x62118(%rdi), %edx
callq 0x14960
movsd %xmm0, -0x100(%rbp)
jmp 0x12058
movsd -0x100(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0xcc(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x150c0
movsd (%rax), %xmm1
movsd -0x28(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0xcc(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x150c0
movq -0xe0(%rbp), %rdi
movsd (%rax), %xmm1
movsd -0x28(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0xcc(%rbp), %esi
movl 0x62118(%rdi), %edx
callq 0x14a00
movsd %xmm0, -0x108(%rbp)
jmp 0x120df
movsd -0x108(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x150e0
movss %xmm0, -0x10c(%rbp)
jmp 0x1210d
movss -0x10c(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0xfddda(%rip), %xmm0    # 0x10ff08
movsd 0x2680a(%rip), %xmm1    # 0x38940
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x110(%rbp)
movq -0x18(%rbp), %rdi
movl -0xcc(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x15690
movss -0x110(%rbp), %xmm0
movss %xmm0, (%rax)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0x12014
movl $0x1, -0xd0(%rbp)
movq -0xe0(%rbp), %rcx
movl -0xd0(%rbp), %eax
addl 0x62118(%rcx), %eax
subl $0x1, %eax
cmpl 0x62110(%rcx), %eax
jge 0x1233e
movq -0xe0(%rbp), %rdi
movl -0xd0(%rbp), %esi
movl 0x62118(%rdi), %edx
incl %edx
callq 0x14960
movsd %xmm0, -0x118(%rbp)
jmp 0x121d3
movsd -0x118(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0xd0(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x150c0
movsd (%rax), %xmm1
movsd -0x28(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0xd0(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x78(%rbp), %rdi
callq 0x150c0
movq -0xe0(%rbp), %rdi
movsd (%rax), %xmm1
movsd -0x28(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0xd0(%rbp), %esi
movl 0x62118(%rdi), %edx
incl %edx
callq 0x14a00
movsd %xmm0, -0x120(%rbp)
jmp 0x1225c
movsd -0x120(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x150e0
movss %xmm0, -0x124(%rbp)
jmp 0x1228a
movss -0x124(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0xfdc5d(%rip), %xmm0    # 0x10ff08
movsd 0x2668d(%rip), %xmm1    # 0x38940
divsd %xmm1, %xmm0
movsd %xmm0, -0x130(%rbp)
movq -0x18(%rbp), %rdi
movl -0xd0(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x15690
movsd -0x130(%rbp), %xmm0
movq -0xe0(%rbp), %rcx
movss (%rax), %xmm1
cvtss2sd %xmm1, %xmm1
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x128(%rbp)
movq -0x20(%rbp), %rdi
movl -0xd0(%rbp), %eax
addl 0x62118(%rcx), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x15690
movss -0x128(%rbp), %xmm0
movss %xmm0, (%rax)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x1218d
leaq -0xb8(%rbp), %rdi
callq 0xc690
leaq -0x98(%rbp), %rdi
callq 0xc690
leaq -0x78(%rbp), %rdi
callq 0xc690
leaq -0x48(%rbp), %rdi
callq 0xc690
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0xc690
leaq -0x78(%rbp), %rdi
callq 0xc690
leaq -0x48(%rbp), %rdi
callq 0xc690
movq -0x58(%rbp), %rdi
callq 0x34d0
nopl (%rax,%rax)