// File: 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
subq $0x190, %rsp            # imm = 0x190
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x160(%rbp)
callq 0x100d0
movq %rax, -0x158(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x46e0
movq -0x150(%rbp), %rdx
leaq 0x1750c(%rip), %rsi     # 0x2c408
leaq -0x30(%rbp), %rdi
callq 0x4530
jmp 0x14f07
movq -0x158(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x10460
jmp 0x14f19
leaq -0x30(%rbp), %rdi
callq 0x4270
leaq -0x31(%rbp), %rdi
callq 0x4420
movq -0x160(%rbp), %rsi
movb -0x9(%rbp), %al
leaq -0x60(%rbp), %rdi
andb $0x1, %al
movzbl %al, %edx
callq 0x13310
movq -0x160(%rbp), %rdi
addq $0x10, %rdi
leaq -0x60(%rbp), %rsi
callq 0x15780
leaq -0x60(%rbp), %rdi
callq 0xba20
movq -0x160(%rbp), %rdi
callq 0x13b40
movq -0x160(%rbp), %rdi
callq 0x13e30
leaq 0x29779(%rip), %rax     # 0x3e6f8
cmpl $0x0, (%rax)
je 0x15255
movl $0x0, -0x64(%rbp)
movq -0x160(%rbp), %rdi
movslq -0x64(%rbp), %rax
movq %rax, -0x168(%rbp)
addq $0x10, %rdi
callq 0x15530
movq %rax, %rcx
movq -0x168(%rbp), %rax
cmpq %rcx, %rax
jae 0x15253
callq 0x100d0
movq -0x160(%rbp), %rdi
movq %rax, -0x178(%rbp)
addq $0x10, %rdi
movslq -0x64(%rbp), %rsi
callq 0x15550
movq %rax, %rdi
callq 0xfff0
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0xb420
movq -0x170(%rbp), %rdx
leaq 0x173ac(%rip), %rsi     # 0x2c3b2
leaq -0x88(%rbp), %rdi
callq 0xb2b0
jmp 0x15014
movq -0x178(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x10460
jmp 0x15029
leaq -0x88(%rbp), %rdi
callq 0x4270
leaq -0xa8(%rbp), %rdi
callq 0x4270
callq 0x100d0
movq -0x160(%rbp), %rdi
movq %rax, -0x188(%rbp)
addq $0x10, %rdi
movslq -0x64(%rbp), %rsi
callq 0x15550
movq %rax, %rdi
callq 0x10030
movl %eax, %esi
leaq -0x128(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0xb300
movq -0x180(%rbp), %rdx
leaq 0x17337(%rip), %rsi     # 0x2c3c3
leaq -0x108(%rbp), %rdi
callq 0xb2b0
jmp 0x1509a
leaq 0x17374(%rip), %rdx     # 0x2c415
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x6a60
jmp 0x150b6
movq -0x160(%rbp), %rdi
addq $0x10, %rdi
movslq -0x64(%rbp), %rsi
callq 0x15550
movq %rax, %rdi
callq 0x10050
movl %eax, -0x18c(%rbp)
jmp 0x150da
movl -0x18c(%rbp), %esi
leaq -0x148(%rbp), %rdi
callq 0xb300
jmp 0x150ee
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0xb630
jmp 0x1510a
movq -0x188(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x10460
jmp 0x1511f
leaq -0xc8(%rbp), %rdi
callq 0x4270
leaq -0x148(%rbp), %rdi
callq 0x4270
leaq -0xe8(%rbp), %rdi
callq 0x4270
leaq -0x108(%rbp), %rdi
callq 0x4270
leaq -0x128(%rbp), %rdi
callq 0x4270
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x14f8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1518c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4270
leaq -0x31(%rbp), %rdi
callq 0x4420
jmp 0x15276
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x151c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x4270
leaq -0xa8(%rbp), %rdi
callq 0x4270
jmp 0x15276
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x15245
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x15239
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1522d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x15221
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x4270
leaq -0x148(%rbp), %rdi
callq 0x4270
leaq -0xe8(%rbp), %rdi
callq 0x4270
leaq -0x108(%rbp), %rdi
callq 0x4270
leaq -0x128(%rbp), %rdi
callq 0x4270
jmp 0x15276
jmp 0x15255
movq -0x160(%rbp), %rdi
callq 0x14210
movq -0x160(%rbp), %rdi
callq 0x13290
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x46c0
nop