// File: /workspace/github_c_makefile_star2_O0/fukunagatsu[P]RIblast/gapped_extension.cpp
// Function: GappedExtension::Run(std::vector<Hit, std::allocator<Hit>>&, std::vector<unsigned char, std::allocator<unsigned char>>&, std::vector<unsigned char, std::allocator<unsigned char>>&, std::vector<float, std::allocator<float>>&, std::vector<float, std::allocator<float>>&, std::vector<std::vector<float, std::allocator<float>>, std::allocator<std::vector<float, std::allocator<float>>>>&, std::vector<std::vector<float, std::allocator<float>>, std::allocator<std::vector<float, std::allocator<float>>>>&, std::vector<int, std::allocator<int>>&)
void GappedExtension::Run(vector<Hit> &candidate, vector<unsigned char> &query_seq, vector<unsigned char> &db_seq, vector<float> &query_accessibility, vector<float> &query_conditional_accessibility, vector<vector<float> > &db_accessibility,vector<vector<float> > &db_conditional_accessibility, vector<int> &db_seq_length){

  for(int x = 0; x < candidate.size(); x++){
    extension(candidate[x], query_seq, db_seq, query_accessibility, query_conditional_accessibility, db_accessibility, db_conditional_accessibility, 0);
    extension(candidate[x], query_seq, db_seq, query_accessibility, query_conditional_accessibility, db_accessibility, db_conditional_accessibility, 1);
    
    double energy = candidate[x].GetEnergy();
    double h_energy = candidate[x].GetHybridizationEnergy();
    int qlength = candidate[x].GetQLength();
    int dbseq_length = db_seq_length[candidate[x].GetDbSeqId()];

    energy += CalcDangleEnergy(candidate[x].GetQSp(), candidate[x].GetDbSp(), 0 ,query_seq, db_seq, dbseq_length);

    energy += CalcDangleEnergy(candidate[x].GetQSp()+candidate[x].GetQLength()-1, candidate[x].GetDbSp()+candidate[x].GetDbLength()-1, 1 ,query_seq, db_seq, dbseq_length);
    h_energy += CalcDangleEnergy(candidate[x].GetQSp(), candidate[x].GetDbSp(), 0 ,query_seq, db_seq, dbseq_length);
    h_energy += CalcDangleEnergy(candidate[x].GetQSp()+candidate[x].GetQLength()-1, candidate[x].GetDbSp()+candidate[x].GetDbLength()-1, 1 ,query_seq, db_seq, dbseq_length);
    
    candidate[x].SetEnergy(energy);
    candidate[x].SetHybridizationEnergy(h_energy);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x34(%rbp)
movslq -0x34(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20650
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jae 0x2cad3
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq -0x58(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r10
movq 0x18(%rbp), %rax
xorl %r11d, %r11d
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x2cae0
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq -0x58(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
movq 0x10(%rbp), %r10
movq 0x18(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
callq 0x2cae0
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x20800
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x207e0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1fb50
movzwl %ax, %eax
movl %eax, -0x4c(%rbp)
movq 0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x207b0
movq -0x88(%rbp), %rdi
movslq %eax, %rsi
callq 0xbac0
movl (%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1fb10
movl %eax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1faf0
movl -0x80(%rbp), %esi
movq -0x58(%rbp), %rdi
movl %eax, %edx
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
movl -0x50(%rbp), %eax
xorl %ecx, %ecx
movl %eax, (%rsp)
callq 0x2df90
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1fb10
movl %eax, -0x7c(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1fb50
movw %ax, %cx
movl -0x7c(%rbp), %eax
movzwl %cx, %ecx
addl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1faf0
movl %eax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1fb30
movl -0x78(%rbp), %edx
movl -0x74(%rbp), %esi
movq -0x58(%rbp), %rdi
movzwl %ax, %eax
addl %eax, %edx
subl $0x1, %edx
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
movl -0x50(%rbp), %eax
movl $0x1, %ecx
movl %eax, (%rsp)
callq 0x2df90
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1fb10
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1faf0
movl -0x70(%rbp), %esi
movq -0x58(%rbp), %rdi
movl %eax, %edx
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
movl -0x50(%rbp), %eax
xorl %ecx, %ecx
movl %eax, (%rsp)
callq 0x2df90
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1fb10
movl %eax, -0x6c(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1fb50
movw %ax, %cx
movl -0x6c(%rbp), %eax
movzwl %cx, %ecx
addl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1faf0
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
callq 0x1fb30
movl -0x68(%rbp), %edx
movq -0x58(%rbp), %rdi
movl -0x64(%rbp), %esi
movzwl %ax, %eax
addl %eax, %edx
subl $0x1, %edx
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
movl -0x50(%rbp), %eax
movl $0x1, %ecx
movl %eax, (%rsp)
callq 0x2df90
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
movsd -0x40(%rbp), %xmm0
callq 0x29a10
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x20680
movq %rax, %rdi
movsd -0x48(%rbp), %xmm0
callq 0x29a50
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2c77e
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)