// File: /workspace/github_cpp_makefile_star2_O3/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 0x9692
movq %rax, %r15
leaq -0x118(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x8fdf(%rip), %rsi      # 0x16198
leaq 0x8fe4(%rip), %rdx      # 0x161a4
leaq -0x128(%rbp), %r12
movq %r12, %rdi
callq 0x6be0
movq %r15, %rdi
movq %r12, %rsi
callq 0x98ba
movq -0x128(%rbp), %rdi
cmpq %r13, %rdi
je 0xd1eb
callq 0x42f0
movzbl %r14b, %edx
leaq -0x50(%rbp), %r14
movq %r14, %rdi
movq -0x58(%rbp), %r13
movq %r13, %rsi
callq 0xbaee
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 0xd244
callq 0x42f0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xd244
callq 0x42f0
movq %r13, %rdi
callq 0xc2b6
movq %r13, %rdi
callq 0xc48c
leaq 0x103ed(%rip), %rax     # 0x1d648
cmpl $0x0, (%rax)
je 0xd6b6
movq 0x18(%r13), %rax
cmpq 0x10(%r13), %rax
je 0xd6b6
leaq -0x40(%rbp), %r12
xorl %r14d, %r14d
movq %r13, %rbx
movq %r12, %r13
callq 0x9692
movq %rax, %r15
movq %r14, -0xe8(%rbp)
shlq $0x5, %r14
movq 0x10(%rbx), %rdi
addq %r14, %rdi
callq 0x964a
movl $0x148, %edx            # imm = 0x148
leaq -0x50(%rbp), %r12
movq %r12, %rdi
movq 0xfcef(%rip), %rsi      # 0x1cfa0
leaq 0x8a82(%rip), %rcx      # 0x15d3a
movb $0x1, %al
callq 0x8be1
movl $0x7, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x8e6f(%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 0xd308
movq %rdx, -0xd8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc8(%rbp)
jmp 0xd30e
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 0x98ba
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xd354
callq 0x42f0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xd362
callq 0x42f0
callq 0x9692
movq %rax, -0xe0(%rbp)
movq -0x58(%rbp), %rax
movq 0x10(%rax), %rdi
addq %r14, %rdi
callq 0x965e
movl %eax, %r12d
movl %eax, %r15d
negl %r15d
cmovsl %eax, %r15d
movl $0x1, %r13d
cmpl $0xa, %r15d
jb 0xd3d9
movl $0x4, %r13d
movl %r15d, %eax
cmpl $0x63, %eax
jbe 0xd3d0
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xd3d6
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xd3d9
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xd3a0
addl $-0x3, %r13d
jmp 0xd3d9
addl $-0x2, %r13d
jmp 0xd3d9
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 0x8b6f
movl $0x3, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x8d27(%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 0xd469
movq %rdx, -0xb8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa8(%rbp)
jmp 0xd46f
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 0x8d09(%rip), %rsi      # 0x161a5
callq 0x45f0
movq %r15, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xd4c1
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0xd4c8
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 0x9668
movl %eax, %r15d
movl %eax, %r14d
negl %r14d
cmovsl %eax, %r14d
movl $0x1, %r12d
cmpl $0xa, %r14d
jb 0xd546
movl $0x4, %r12d
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0xd53d
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0xd543
cmpl $0x2710, %eax           # imm = 0x2710
jb 0xd546
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r12d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0xd50d
addl $-0x3, %r12d
jmp 0xd546
addl $-0x2, %r12d
jmp 0xd546
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 0x8b6f
movq -0x50(%rbp), %rcx
movl $0xf, %edi
leaq -0x40(%rbp), %r12
cmpq %r12, %rcx
je 0xd58c
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %r8
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq (%rdx,%r8), %rax
cmpq %rdi, %rax
leaq -0x88(%rbp), %r14
jbe 0xd5bf
movl $0xf, %edi
leaq -0x68(%rbp), %r9
cmpq %r9, %rsi
je 0xd5ba
movq -0x68(%rbp), %rdi
cmpq %rdi, %rax
jbe 0xd5ca
leaq -0x50(%rbp), %rdi
callq 0x40f0
jmp 0xd5d7
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 0xd5fd
movq %rdx, -0x98(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x88(%rbp)
jmp 0xd604
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 0x98ba
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0xd647
callq 0x42f0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
movq -0xe8(%rbp), %r14
je 0xd660
callq 0x42f0
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0xd66e
callq 0x42f0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xd686
callq 0x42f0
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xd69e
callq 0x42f0
incq %r14
movq 0x18(%r13), %rax
subq 0x10(%r13), %rax
sarq $0x5, %rax
cmpq %r14, %rax
ja 0xd279
movq %r13, %rdi
callq 0xc638
movq %r13, %rdi
callq 0xba86
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 0xd791
jmp 0xd796
movq %rax, %rbx
jmp 0xd710
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xd710
callq 0x42f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
jmp 0xd78c
movq %rax, %rbx
jmp 0xd77e
movq %rax, %rbx
jmp 0xd766
movq %rax, %rbx
jmp 0xd73d
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0xd73d
callq 0x42f0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xd754
callq 0x42f0
jmp 0xd754
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xd766
callq 0x42f0
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xd77e
callq 0x42f0
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xd796
callq 0x42f0
movq %rbx, %rdi
callq 0x4590