// File: /workspace/github_cpp_makefile_star2_O2/afinit[P]afin/fusion.cpp
// Function: Fusion::run_fusion(bool)
void Fusion::run_fusion( bool first_run ){
  Log::Inst()->log_it( "Fuse contigs" );
  
  // MISMATCH SCORES //
  match_list = get_mismatch_scores( first_run );
  
  // SORT AND CLEAN MATCH LIST //
  sort_matches();
  clean_matches();

  if( verbose ){
    for( int i=0; i<match_list.size(); i++ ){
      Log::Inst()->log_it( "score: " + to_string( match_list[i].get_score() ) );
      Log::Inst()->log_it( "i: " + to_string( match_list[i].get_index_i() ) +  " j: " + to_string( match_list[i].get_index_j() ) );
    }
  }
 
  // FUSE CONTIGS //
  process_fusions();

  // remove fused contigs from the vector
  process_removals();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %esi, %r14d
movq %rdi, -0x30(%rbp)
callq 0x81fe
movq %rax, %r15
leaq 0x85e8(%rip), %rsi      # 0x13198
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x4120
leaq -0x90(%rbp), %rsi
movq %r15, %rdi
callq 0x83ae
leaq -0x90(%rbp), %rdi
callq 0x4160
movzbl %r14b, %edx
leaq -0x70(%rbp), %r15
movq %r15, %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq 0x9c26
leaq 0x10(%rbx), %rdi
movq %rdi, -0x40(%rbp)
movq %r15, %rsi
callq 0xb2ac
movq %r15, %rdi
callq 0x7318
movq %rbx, %rdi
callq 0xa16a
movq %rbx, %rdi
callq 0xa328
leaq 0x10a37(%rip), %rax     # 0x1b658
cmpl $0x0, (%rax)
je 0xad8f
movq $0x0, -0x38(%rbp)
leaq -0xd0(%rbp), %r14
leaq -0x110(%rbp), %rbx
xorl %edx, %edx
movq -0x30(%rbp), %rcx
movq 0x18(%rcx), %rax
subq 0x10(%rcx), %rax
sarq $0x5, %rax
cmpq %rdx, %rax
jbe 0xad8f
movq %rdx, -0x50(%rbp)
callq 0x81fe
movq %rax, %r12
movq -0x40(%rbp), %rax
movq (%rax), %rdi
addq -0x38(%rbp), %rdi
callq 0x81b6
leaq -0x70(%rbp), %r15
movq %r15, %rdi
callq 0x7089
movq %r14, %rdi
leaq 0x84b5(%rip), %rsi      # 0x13142
movq %r15, %rdx
callq 0x6ffb
movq %r12, %rdi
movq %r14, %rsi
callq 0x83ae
movq %r14, %rdi
callq 0x4160
leaq -0x70(%rbp), %r14
movq %r14, %rdi
callq 0x4160
callq 0x81fe
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq %rax, %r13
addq %rax, %rdi
callq 0x81ca
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
movl %eax, %esi
callq 0x7029
movq %rbx, %rdi
leaq 0x8465(%rip), %rsi      # 0x13153
movq %r12, %rdx
callq 0x6ffb
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x84a2(%rip), %rdx      # 0x131a5
callq 0x5a70
movq -0x40(%rbp), %rax
movq (%rax), %rdi
addq %r13, %rdi
callq 0x81d4
leaq -0xf0(%rbp), %r14
movq %r14, %rdi
movl %eax, %esi
callq 0x7029
leaq -0x130(%rbp), %r15
movq %r15, %rdi
leaq -0x70(%rbp), %rsi
movq %r14, %rdx
callq 0x718e
movq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x83ae
movq %r15, %rdi
callq 0x4160
movq %r14, %rdi
callq 0x4160
leaq -0x70(%rbp), %rdi
callq 0x4160
movq %rbx, %rdi
callq 0x4160
leaq -0xb0(%rbp), %rdi
callq 0x4160
movq -0x50(%rbp), %rdx
incq %rdx
addq $0x20, -0x38(%rbp)
leaq -0xd0(%rbp), %r14
jmp 0xac42
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0xa480
movq %rbx, %rdi
callq 0x9bd2
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
jmp 0xae2b
movq %rax, %rbx
jmp 0xae30
movq %rax, %rbx
jmp 0xadda
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
callq 0x4160
leaq -0xf0(%rbp), %rdi
callq 0x4160
jmp 0xae0f
movq %rax, %rbx
jmp 0xadfc
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x4160
leaq -0x70(%rbp), %rdi
jmp 0xae2b
movq %rax, %rbx
jmp 0xae24
movq %rax, %rbx
jmp 0xae18
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x4160
leaq -0x110(%rbp), %rdi
callq 0x4160
leaq -0xb0(%rbp), %rdi
callq 0x4160
movq %rbx, %rdi
callq 0x4590