// File: /workspace/github_c_makefile_star2_O0/fukunagatsu[P]RIblast/seed_search.cpp
// Function: SeedSearch::SeedSearchCore(std::vector<unsigned char, std::allocator<unsigned char>>&, std::vector<int, std::allocator<int>>&, std::vector<unsigned char, std::allocator<unsigned char>>&, std::vector<int, std::allocator<int>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, int, int, int, int, double, int)
void SeedSearch::SeedSearchCore(vector<unsigned char> &query_seq, vector<int> &query_suffix_array, vector<unsigned char> &db_seq, vector<int> &db_suffix_array,  vector<vector<int> > &start_hash,  vector<vector<int> > &end_hash, vector<int> &db_seed, vector<int> &q_seed, int sp_q, int ep_q, int sp_db, int ep_db, double score, int length){

  if(length < _max_seed_length){
    vector<int> sp_q_result; sp_q_result.reserve(_pair_size);
    vector<int> ep_q_result; ep_q_result.reserve(_pair_size);
    vector<int> sp_db_result; sp_db_result.reserve(_pair_size);
    vector<int> ep_db_result; ep_db_result.reserve(_pair_size);

    for(int i = 0; i< _pair_size; i++){
      int start = sp_q;
      int end = ep_q;
      int nucleotide_size = 4;
      SeedSearchNextCharacter(query_seq, query_suffix_array, &start, &end, _stem_pair[i][0], length);
      sp_q_result.push_back(start);
      ep_q_result.push_back(end);
      start = sp_db;
      end = ep_db;
      if(length+1 > _hash_size){
	SeedSearchNextCharacter(db_seq, db_suffix_array, &start, &end, _stem_pair[i][1], length);
      }else{
	int temp = _stem_pair[i][1]-2;
	for(int j = 0; j <length;j++){
	  temp += (int)pow(nucleotide_size,length-j) * (db_seed[j] - 2);
	}
	start = start_hash[length][temp];
	end = end_hash[length][temp];
      }
      sp_db_result.push_back(start);
      ep_db_result.push_back(end);
    }
    
    for(int i = 0; i< _pair_size; i++){
      if(sp_q_result[i] <= ep_q_result[i] && sp_db_result[i] <= ep_db_result[i]){
	double temp_score = 0.0;
	
	if(length > 0){
	  int type = BP_pair[q_seed[length-1]-1][db_seed[length-1]-1];
	  int type2 = BP_pair[_stem_pair[i][0]-1][_stem_pair[i][1]-1];
	  type2 = rtype[type2];
	  temp_score = score + ((double)stack37[type][type2])/100;
	}
	
	if(temp_score < _hybrid_energy_threshold && length+1 >= _min_accessible_length){
	  Hit_candidate temp_hit_candidate(sp_q_result[i], ep_q_result[i], sp_db_result[i], ep_db_result[i], length+1, temp_score);
	  _hit_candidate_result.push_back(temp_hit_candidate);
	}else{
	  q_seed.push_back(_stem_pair[i][0]);
	  db_seed.push_back(_stem_pair[i][1]);
	  SeedSearchCore(query_seq, query_suffix_array, db_seq, db_suffix_array, start_hash, end_hash, db_seed, q_seed, sp_q_result[i], ep_q_result[i], sp_db_result[i], ep_db_result[i], temp_score, length+1);
	}
      }
    }
  }
  q_seed.pop_back();
  db_seed.pop_back();
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movl 0x48(%rbp), %eax
movl 0x40(%rbp), %eax
movl 0x38(%rbp), %eax
movl 0x30(%rbp), %eax
movl 0x28(%rbp), %eax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movsd %xmm0, -0x60(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, -0x128(%rbp)
movl 0x48(%rbp), %eax
cmpl 0x1c(%rcx), %eax
jge 0x2a4e5
leaq -0x78(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x4720
movq -0x128(%rbp), %rax
movq -0x130(%rbp), %rdi
movslq 0x18(%rax), %rsi
callq 0xbae0
jmp 0x29cac
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x4720
movq -0x128(%rbp), %rax
movq -0x138(%rbp), %rdi
movslq 0x18(%rax), %rsi
callq 0xbae0
jmp 0x29cd8
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x4720
movq -0x128(%rbp), %rax
movq -0x140(%rbp), %rdi
movslq 0x18(%rax), %rsi
callq 0xbae0
jmp 0x29d04
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x4720
movq -0x128(%rbp), %rax
movq -0x148(%rbp), %rdi
movslq 0x18(%rax), %rsi
callq 0xbae0
jmp 0x29d30
movl $0x0, -0xd4(%rbp)
movq -0x128(%rbp), %rcx
movl -0xd4(%rbp), %eax
cmpl 0x18(%rcx), %eax
jge 0x2a02b
movq -0x128(%rbp), %rdi
movl 0x28(%rbp), %eax
movl %eax, -0xd8(%rbp)
movl 0x30(%rbp), %eax
movl %eax, -0xdc(%rbp)
movl $0x4, -0xe0(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x150(%rbp)
movslq -0xd4(%rbp), %rsi
callq 0xbbe0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbac0
movq -0x128(%rbp), %rdi
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
movzbl (%rax), %r9d
movl 0x48(%rbp), %ecx
movq %rsp, %rax
movl %ecx, (%rax)
leaq -0xd8(%rbp), %rcx
leaq -0xdc(%rbp), %r8
callq 0x2adc0
jmp 0x29dd7
leaq -0x78(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xbc00
jmp 0x29de9
leaq -0xa0(%rbp), %rdi
leaq -0xdc(%rbp), %rsi
callq 0xbc00
jmp 0x29dfe
movq -0x128(%rbp), %rcx
movl 0x38(%rbp), %eax
movl %eax, -0xd8(%rbp)
movl 0x40(%rbp), %eax
movl %eax, -0xdc(%rbp)
movl 0x48(%rbp), %eax
addl $0x1, %eax
cmpl 0x20(%rcx), %eax
jle 0x29ef3
movq -0x128(%rbp), %rdi
movq -0x48(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x160(%rbp)
movslq -0xd4(%rbp), %rsi
callq 0xbbe0
movq %rax, %rdi
movl $0x1, %esi
callq 0xbac0
movq -0x128(%rbp), %rdi
movq -0x168(%rbp), %rsi
movq -0x160(%rbp), %rdx
movzbl (%rax), %r9d
movl 0x48(%rbp), %ecx
movq %rsp, %rax
movl %ecx, (%rax)
leaq -0xd8(%rbp), %rcx
leaq -0xdc(%rbp), %r8
callq 0x2adc0
jmp 0x29e92
jmp 0x29feb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x2a4da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x2a4ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x2a4c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x49d0
jmp 0x2a4c2
movq -0x128(%rbp), %rdi
movslq -0xd4(%rbp), %rsi
callq 0xbbe0
movq %rax, %rdi
movl $0x1, %esi
callq 0xbac0
movl (%rax), %eax
subl $0x2, %eax
movl %eax, -0xe4(%rbp)
movl $0x0, -0xe8(%rbp)
movl -0xe8(%rbp), %eax
cmpl 0x48(%rbp), %eax
jge 0x29fa3
movl -0xe0(%rbp), %edi
movl 0x48(%rbp), %esi
movl -0xe8(%rbp), %eax
subl %eax, %esi
callq 0x4930
movsd %xmm0, -0x170(%rbp)
jmp 0x29f53
movsd -0x170(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x174(%rbp)
movq 0x18(%rbp), %rdi
movslq -0xe8(%rbp), %rsi
callq 0xbac0
movq %rax, %rcx
movl -0x174(%rbp), %eax
movl (%rcx), %ecx
subl $0x2, %ecx
imull %ecx, %eax
addl -0xe4(%rbp), %eax
movl %eax, -0xe4(%rbp)
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe8(%rbp)
jmp 0x29f28
movq -0x58(%rbp), %rdi
movslq 0x48(%rbp), %rsi
callq 0xbbe0
movq %rax, %rdi
movslq -0xe4(%rbp), %rsi
callq 0xbac0
movl (%rax), %eax
movl %eax, -0xd8(%rbp)
movq 0x10(%rbp), %rdi
movslq 0x48(%rbp), %rsi
callq 0xbbe0
movq %rax, %rdi
movslq -0xe4(%rbp), %rsi
callq 0xbac0
movl (%rax), %eax
movl %eax, -0xdc(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xbc00
jmp 0x2a000
leaq -0xd0(%rbp), %rdi
leaq -0xdc(%rbp), %rsi
callq 0xbc00
jmp 0x2a015
jmp 0x2a017
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x29d3a
movl $0x0, -0xec(%rbp)
movq -0x128(%rbp), %rcx
movl -0xec(%rbp), %eax
cmpl 0x18(%rcx), %eax
jge 0x2a493
movslq -0xec(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0xbac0
movl (%rax), %eax
movl %eax, -0x178(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0xbac0
movq %rax, %rcx
movl -0x178(%rbp), %eax
cmpl (%rcx), %eax
jg 0x2a47d
movslq -0xec(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0xbac0
movl (%rax), %eax
movl %eax, -0x17c(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xbac0
movq %rax, %rcx
movl -0x17c(%rbp), %eax
cmpl (%rcx), %eax
jg 0x2a47d
xorps %xmm0, %xmm0
movsd %xmm0, -0xf8(%rbp)
cmpl $0x0, 0x48(%rbp)
jle 0x2a203
movq 0x20(%rbp), %rdi
movl 0x48(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xbac0
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xb4ef4(%rip), %rax     # 0xdeff0
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x190(%rbp)
movq 0x18(%rbp), %rdi
movl 0x48(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xbac0
movq -0x128(%rbp), %rdi
movq %rax, %rcx
movq -0x190(%rbp), %rax
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0xfc(%rbp)
movslq -0xec(%rbp), %rsi
callq 0xbbe0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbac0
movq -0x128(%rbp), %rdi
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xb4e84(%rip), %rax     # 0xdeff0
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x188(%rbp)
movslq -0xec(%rbp), %rsi
callq 0xbbe0
movq %rax, %rdi
movl $0x1, %esi
callq 0xbac0
movq %rax, %rcx
movq -0x188(%rbp), %rax
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x100(%rbp)
movslq -0x100(%rbp), %rcx
leaq 0xb4ea4(%rip), %rax     # 0xdf060
movl (%rax,%rcx,4), %eax
movl %eax, -0x100(%rbp)
movsd -0x60(%rbp), %xmm0
movslq -0xfc(%rbp), %rcx
leaq 0xb4ea8(%rip), %rax     # 0xdf080
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movslq -0x100(%rbp), %rcx
cvtsi2sdl (%rax,%rcx,4), %xmm1
movsd 0xeb05(%rip), %xmm2     # 0x38cf8
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
movq -0x128(%rbp), %rax
movsd -0xf8(%rbp), %xmm1
movsd 0x28(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x2a2e8
movq -0x128(%rbp), %rcx
movl 0x48(%rbp), %eax
addl $0x1, %eax
cmpl 0x24(%rcx), %eax
jl 0x2a2e8
movslq -0xec(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0xbac0
movl (%rax), %eax
movl %eax, -0x19c(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0xbac0
movl (%rax), %eax
movl %eax, -0x198(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0xbac0
movl (%rax), %eax
movl %eax, -0x194(%rbp)
movslq -0xec(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xbac0
movl -0x19c(%rbp), %esi
movl -0x198(%rbp), %edx
movl -0x194(%rbp), %ecx
movl (%rax), %r8d
movl 0x48(%rbp), %r9d
incl %r9d
movsd -0xf8(%rbp), %xmm0
leaq -0x120(%rbp), %rdi
callq 0x2b430
jmp 0x2a2ca
movq -0x128(%rbp), %rdi
addq $0x30, %rdi
leaq -0x120(%rbp), %rsi
callq 0x2b480
jmp 0x2a2e3
jmp 0x2a47b
movq -0x128(%rbp), %rdi
movq 0x20(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movslq -0xec(%rbp), %rsi
callq 0xbbe0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbac0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
callq 0xbc00
jmp 0x2a323
movq -0x128(%rbp), %rdi
movq 0x18(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movslq -0xec(%rbp), %rsi
callq 0xbbe0
movq %rax, %rdi
movl $0x1, %esi
callq 0xbac0
movq -0x1b0(%rbp), %rdi
movq %rax, %rsi
callq 0xbc00
jmp 0x2a35f
movq -0x38(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq 0x18(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq 0x20(%rbp), %rbx
movslq -0xec(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0xbac0
movl (%rax), %r14d
movslq -0xec(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0xbac0
movl (%rax), %r15d
movslq -0xec(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0xbac0
movl (%rax), %r12d
movslq -0xec(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xbac0
movq -0x1f0(%rbp), %r11
movq -0x1e8(%rbp), %r10
movq -0x1e0(%rbp), %rsi
movq -0x1d8(%rbp), %rdx
movq -0x1d0(%rbp), %rcx
movq -0x1c8(%rbp), %r8
movq -0x1c0(%rbp), %r9
movl (%rax), %r13d
movsd -0xf8(%rbp), %xmm0
movl 0x48(%rbp), %edi
incl %edi
movq %rsp, %rax
movq %rax, -0x1b8(%rbp)
movl %edi, 0x38(%rax)
movq -0x128(%rbp), %rdi
movl %r13d, 0x30(%rax)
movl %r12d, 0x28(%rax)
movl %r15d, 0x20(%rax)
movl %r14d, 0x18(%rax)
movq %rbx, 0x10(%rax)
movq %r11, 0x8(%rax)
movq %r10, (%rax)
callq 0x29c20
jmp 0x2a479
jmp 0x2a47b
jmp 0x2a47d
jmp 0x2a47f
movl -0xec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xec(%rbp)
jmp 0x2a035
leaq -0xd0(%rbp), %rdi
callq 0x49d0
leaq -0xb8(%rbp), %rdi
callq 0x49d0
leaq -0xa0(%rbp), %rdi
callq 0x49d0
leaq -0x78(%rbp), %rdi
callq 0x49d0
jmp 0x2a4e5
leaq -0xb8(%rbp), %rdi
callq 0x49d0
leaq -0xa0(%rbp), %rdi
callq 0x49d0
leaq -0x78(%rbp), %rdi
callq 0x49d0
jmp 0x2a509
movq 0x20(%rbp), %rdi
callq 0x2b4f0
movq 0x18(%rbp), %rdi
callq 0x2b4f0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x34d0
nopw %cs:(%rax,%rax)