// File: /workspace/github_cpp_makefile_star2_O1/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, -0x58(%rbp)
callq 0x9626
movq %rax, %r15
leaq -0x118(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x90ff(%rip), %rsi      # 0x16198
leaq 0x9104(%rip), %rdx      # 0x161a4
leaq -0x128(%rbp), %r12
movq %r12, %rdi
callq 0x6b5c
movq %r15, %rdi
movq %r12, %rsi
callq 0x9846
movq -0x128(%rbp), %rdi
cmpq %r13, %rdi
je 0xd0cb
callq 0x42f0
movzbl %r14b, %edx
leaq -0x50(%rbp), %r14
movq %r14, %rdi
movq -0x58(%rbp), %r13
movq %r13, %rsi
callq 0xb9b6
movq 0x10(%r13), %rdi
movq (%r14), %rax
movq %rax, 0x10(%r13)
movq 0x8(%r14), %rax
movq %rax, 0x18(%r13)
movq 0x10(%r14), %rax
movq %rax, 0x20(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
testq %rdi, %rdi
je 0xd116
callq 0x42f0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xd124
callq 0x42f0
movq %r13, %rdi
callq 0xc188
movq %r13, %rdi
callq 0xc37c
leaq 0x1050d(%rip), %rax     # 0x1d648
cmpl $0x0, (%rax)
je 0xd597
movq 0x18(%r13), %rax
cmpq 0x10(%r13), %rax
je 0xd597
leaq -0x40(%rbp), %r12
xorl %r14d, %r14d
movq %r13, %rbx
movq %r12, %r13
callq 0x9626
movq %rax, %r15
movq %r14, -0xe8(%rbp)
shlq $0x5, %r14
movq 0x10(%rbx), %rdi
addq %r14, %rdi
callq 0x95de
movl $0x148, %edx            # imm = 0x148
leaq -0x50(%rbp), %r12
movq %r12, %rdi
movq 0xfe0f(%rip), %rsi      # 0x1cfa0
leaq 0x8ba2(%rip), %rcx      # 0x15d3a
movb $0x1, %al
callq 0x8b67
movl $0x7, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x8f8f(%rip), %rcx      # 0x16142
callq 0x4350
leaq -0xc8(%rbp), %rsi
movq %rsi, -0xd8(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xd1e8
movq %rdx, -0xd8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc8(%rbp)
jmp 0xd1ee
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movl $0xd1b71759, %ebx       # imm = 0xD1B71759
movq 0x8(%rax), %rdx
movq %rdx, -0xd0(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r15, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x9846
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xd234
callq 0x42f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xd242
callq 0x42f0
callq 0x9626
movq %rax, -0xe0(%rbp)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
addq %r14, %rdi
callq 0x95f2
movl %eax, %r12d
movl %eax, %r15d
negl %r15d
cmovsl %eax, %r15d
movl $0x1, %r13d
cmpl $0xa, %r15d
jb 0xd2b9
movl $0x4, %r13d
movl %r15d, %eax
cmpl $0x63, %eax
jbe 0xd2b0
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xd2b6
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xd2b9
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xd280
addl $-0x3, %r13d
jmp 0xd2b9
addl $-0x2, %r13d
jmp 0xd2b9
decl %r13d
shrl $0x1f, %r12d
leal (%r12,%r13), %esi
leaq -0xf8(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x108(%rbp), %rbx
movq %rbx, %rdi
movl $0x2d, %edx
callq 0x4370
addq -0x108(%rbp), %r12
movq %r12, %rdi
movl %r13d, %esi
movl %r15d, %edx
callq 0x8af5
movl $0x3, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x8e47(%rip), %rcx      # 0x16153
callq 0x4350
leaq -0xa8(%rbp), %rsi
movq %rsi, -0xb8(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq -0x58(%rbp), %r13
leaq -0x40(%rbp), %r15
je 0xd349
movq %rdx, -0xb8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa8(%rbp)
jmp 0xd34f
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movl $0xd1b71759, %ebx       # imm = 0xD1B71759
movq 0x8(%rax), %rdx
movq %rdx, -0xb0(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0xb8(%rbp), %rdi
leaq 0x8e29(%rip), %rsi      # 0x161a5
callq 0x45f0
movq %r15, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xd3a1
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0xd3a8
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
addq 0x10(%r13), %r14
movq %r14, %rdi
callq 0x95fc
movl %eax, %r15d
movl %eax, %r14d
negl %r14d
cmovsl %eax, %r14d
movl $0x1, %r12d
cmpl $0xa, %r14d
jb 0xd426
movl $0x4, %r12d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0xd41d
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xd423
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xd426
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xd3ed
addl $-0x3, %r12d
jmp 0xd426
addl $-0x2, %r12d
jmp 0xd426
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x78(%rbp), %rdi
movl $0x2d, %edx
callq 0x4370
movl %r15d, %edi
addq -0x78(%rbp), %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0x8af5
movq -0x50(%rbp), %rcx
movl $0xf, %esi
leaq -0x40(%rbp), %r12
cmpq %r12, %rcx
je 0xd46c
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %r8
movq -0x70(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rsi, %rax
leaq -0x88(%rbp), %r14
jbe 0xd49c
movl $0xf, %esi
leaq -0x68(%rbp), %rdi
cmpq %rdi, -0x78(%rbp)
je 0xd497
movq -0x68(%rbp), %rsi
cmpq %rsi, %rax
jbe 0xd4ab
movq -0x78(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x40f0
jmp 0xd4b8
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4350
movq %r14, -0x98(%rbp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0xd4de
movq %rdx, -0x98(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x88(%rbp)
jmp 0xd4e5
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x90(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq -0xe0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x9846
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0xd528
callq 0x42f0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
movq -0xe8(%rbp), %r14
je 0xd541
callq 0x42f0
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0xd54f
callq 0x42f0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xd567
callq 0x42f0
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xd57f
callq 0x42f0
incq %r14
movq 0x18(%r13), %rax
subq 0x10(%r13), %rax
sarq $0x5, %rax
cmpq %r14, %rax
ja 0xd159
movq %r13, %rdi
callq 0xc51e
movq %r13, %rdi
callq 0xb956
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x128(%rbp), %rdi
cmpq %r13, %rdi
jne 0xd672
jmp 0xd677
movq %rax, %rbx
jmp 0xd5f1
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xd5f1
callq 0x42f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0xd66d
movq %rax, %rbx
jmp 0xd65f
movq %rax, %rbx
jmp 0xd647
movq %rax, %rbx
jmp 0xd61e
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0xd61e
callq 0x42f0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xd635
callq 0x42f0
jmp 0xd635
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xd647
callq 0x42f0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xd65f
callq 0x42f0
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xd677
callq 0x42f0
movq %rbx, %rdi
callq 0x4590