// File: afinit[P]afin/fusion.cpp
// Function: Fusion::get_mismatch_scores(bool)
vector<Mismatch> Fusion::get_mismatch_scores( bool first_run ){
  vector<Mismatch> match_list;
  int overlap_len = extend_len * 4;

  // loop through each contig to get the end of the contig
  for( int i=0; i<contigs->get_list_size(); i++ ){
    for( int j=i+1; j<contigs->get_list_size(); j++ ){
      string contig_i( contigs->get_contig(i).get_sequence() );
      string contig_j( contigs->get_contig(j).get_sequence() );
      string contig_j_rev( revcomp( contig_j ) );
      int overlap = overlap_len;
      Mismatch mim;

      if( first_run ){
        overlap = (contig_i.length() < contig_j.length()) ? contig_i.length() : contig_j.length();
      }
      else{
        if( overlap > contig_i.length() ){
          overlap = contig_i.length();
        }
        if( overlap > contig_j.length() ){
          overlap = contig_j.length();
        }
      }

      //// Processing of rear end of the contig
      // orientation: i to j
      mim = overlap_check( contig_i, contig_j, overlap, 1, 0 );

      if( mim.get_score() <= mismatch_threshold ){
        mim.set_indices( i, j );
        match_list.push_back( mim );
      }

      // orientation: i to j_rev
      mim = overlap_check( contig_i, contig_j_rev, overlap, 1, 1 );

      if( mim.get_score() <= mismatch_threshold ){
        mim.set_indices( i, j );
        match_list.push_back( mim );
      }

      //// Processing of front end of the contig
      // orientation: j to i
      mim = overlap_check( contig_j, contig_i, overlap, 0, 1);

      if( mim.get_score() <= mismatch_threshold ){
        mim.set_indices( i, j );
        match_list.push_back( mim );
      }

      // orientation: j_rev to i
      mim = overlap_check( contig_j_rev, contig_i, overlap, 0, 0 );

      if( mim.get_score() <= mismatch_threshold ){
        mim.set_indices( i, j );
        match_list.push_back( mim );
      }
    }
  }

  return match_list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x318(%rbp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, -0x310(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x308(%rbp)
movb $0x0, -0x12(%rbp)
callq 0x15280
leaq 0x2b36a(%rip), %rax     # 0x3e6c0
movl (%rax), %eax
shll $0x2, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x308(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, -0x320(%rbp)
movq (%rax), %rdi
callq 0x281d0
movl %eax, -0x31c(%rbp)
jmp 0x13385
movl -0x320(%rbp), %eax
movl -0x31c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x13afe
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x308(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, -0x328(%rbp)
movq (%rax), %rdi
callq 0x281d0
movl %eax, -0x324(%rbp)
jmp 0x133c2
movl -0x328(%rbp), %eax
movl -0x324(%rbp), %ecx
cmpl %ecx, %eax
jge 0x13aee
movq -0x308(%rbp), %rax
movq (%rax), %rsi
movl -0x1c(%rbp), %edx
leaq -0xa0(%rbp), %rdi
callq 0x28150
jmp 0x133f1
leaq -0x50(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5e50
jmp 0x13403
leaq -0xa0(%rbp), %rdi
callq 0x5b00
movq -0x308(%rbp), %rax
movq (%rax), %rsi
movl -0x30(%rbp), %edx
leaq -0x110(%rbp), %rdi
callq 0x28150
jmp 0x1342a
leaq -0xc0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x5e50
jmp 0x1343f
leaq -0x110(%rbp), %rdi
callq 0x5b00
leaq -0x150(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x41b0
jmp 0x13460
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0xfc10
jmp 0x13475
leaq -0x150(%rbp), %rdi
callq 0x4270
movl -0x18(%rbp), %eax
movl %eax, -0x154(%rbp)
leaq -0x180(%rbp), %rdi
callq 0xfe80
jmp 0x13498
testb $0x1, -0x11(%rbp)
je 0x1359f
leaq -0x50(%rbp), %rdi
callq 0x45e0
movq %rax, -0x330(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x45e0
movq %rax, %rcx
movq -0x330(%rbp), %rax
cmpq %rcx, %rax
jae 0x134df
leaq -0x50(%rbp), %rdi
callq 0x45e0
movq %rax, -0x338(%rbp)
jmp 0x134f2
leaq -0xc0(%rbp), %rdi
callq 0x45e0
movq %rax, -0x338(%rbp)
movq -0x338(%rbp), %rax
movl %eax, -0x154(%rbp)
jmp 0x13611
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x13b24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x5b00
jmp 0x13b24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x13ae3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x5b00
jmp 0x13ae3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x13ad7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x4270
jmp 0x13ad7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x13acb
movslq -0x154(%rbp), %rax
movq %rax, -0x340(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x45e0
movq %rax, %rcx
movq -0x340(%rbp), %rax
cmpq %rcx, %rax
jbe 0x135d4
leaq -0x50(%rbp), %rdi
callq 0x45e0
movl %eax, -0x154(%rbp)
movslq -0x154(%rbp), %rax
movq %rax, -0x348(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x45e0
movq %rax, %rcx
movq -0x348(%rbp), %rax
cmpq %rcx, %rax
jbe 0x1360f
leaq -0xc0(%rbp), %rdi
callq 0x45e0
movl %eax, -0x154(%rbp)
jmp 0x13611
leaq -0x1c0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x41b0
jmp 0x13623
leaq -0x1e0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x41b0
jmp 0x13638
movq -0x308(%rbp), %rsi
movl -0x154(%rbp), %r8d
movq %rsp, %rax
movl $0x0, (%rax)
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rdx
leaq -0x1e0(%rbp), %rcx
movl $0x1, %r9d
callq 0x11ed0
jmp 0x13671
movups -0x1a0(%rbp), %xmm0
movups -0x194(%rbp), %xmm1
movups %xmm1, -0x174(%rbp)
movaps %xmm0, -0x180(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x4270
leaq -0x1c0(%rbp), %rdi
callq 0x4270
leaq -0x180(%rbp), %rdi
callq 0xfff0
movsd %xmm0, -0x350(%rbp)
jmp 0x136bb
movsd -0x350(%rbp), %xmm1
leaq 0x2b036(%rip), %rax     # 0x3e700
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x13736
movl -0x1c(%rbp), %esi
movl -0x30(%rbp), %edx
leaq -0x180(%rbp), %rdi
callq 0xff90
jmp 0x136e8
movq -0x318(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x154c0
jmp 0x136fd
jmp 0x13736
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x13725
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x4270
leaq -0x1c0(%rbp), %rdi
callq 0x4270
jmp 0x13acb
leaq -0x220(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x41b0
jmp 0x13748
leaq -0x240(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x41b0
jmp 0x1375d
movq -0x308(%rbp), %rsi
movl -0x154(%rbp), %r8d
movq %rsp, %rax
movl $0x1, (%rax)
leaq -0x200(%rbp), %rdi
leaq -0x220(%rbp), %rdx
leaq -0x240(%rbp), %rcx
movl $0x1, %r9d
callq 0x11ed0
jmp 0x13796
movups -0x200(%rbp), %xmm0
movups -0x1f4(%rbp), %xmm1
movups %xmm1, -0x174(%rbp)
movaps %xmm0, -0x180(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x4270
leaq -0x220(%rbp), %rdi
callq 0x4270
leaq -0x180(%rbp), %rdi
callq 0xfff0
movsd %xmm0, -0x358(%rbp)
jmp 0x137e0
movsd -0x358(%rbp), %xmm1
leaq 0x2af11(%rip), %rax     # 0x3e700
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x1385b
movl -0x1c(%rbp), %esi
movl -0x30(%rbp), %edx
leaq -0x180(%rbp), %rdi
callq 0xff90
jmp 0x1380d
movq -0x318(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x154c0
jmp 0x13822
jmp 0x1385b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1384a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x4270
leaq -0x220(%rbp), %rdi
callq 0x4270
jmp 0x13acb
leaq -0x280(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x41b0
jmp 0x13870
leaq -0x2a0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x41b0
jmp 0x13882
movq -0x308(%rbp), %rsi
movl -0x154(%rbp), %r8d
movq %rsp, %rax
movl $0x1, (%rax)
leaq -0x260(%rbp), %rdi
leaq -0x280(%rbp), %rdx
leaq -0x2a0(%rbp), %rcx
xorl %r9d, %r9d
callq 0x11ed0
jmp 0x138b8
movups -0x260(%rbp), %xmm0
movups -0x254(%rbp), %xmm1
movups %xmm1, -0x174(%rbp)
movaps %xmm0, -0x180(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x4270
leaq -0x280(%rbp), %rdi
callq 0x4270
leaq -0x180(%rbp), %rdi
callq 0xfff0
movsd %xmm0, -0x360(%rbp)
jmp 0x13902
movsd -0x360(%rbp), %xmm1
leaq 0x2adef(%rip), %rax     # 0x3e700
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x1397d
movl -0x1c(%rbp), %esi
movl -0x30(%rbp), %edx
leaq -0x180(%rbp), %rdi
callq 0xff90
jmp 0x1392f
movq -0x318(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x154c0
jmp 0x13944
jmp 0x1397d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x1396c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x4270
leaq -0x280(%rbp), %rdi
callq 0x4270
jmp 0x13acb
leaq -0x2e0(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x41b0
jmp 0x13992
leaq -0x300(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x41b0
jmp 0x139a4
movq -0x308(%rbp), %rsi
movl -0x154(%rbp), %r8d
movq %rsp, %rax
movl $0x0, (%rax)
leaq -0x2c0(%rbp), %rdi
leaq -0x2e0(%rbp), %rdx
leaq -0x300(%rbp), %rcx
xorl %r9d, %r9d
callq 0x11ed0
jmp 0x139da
movups -0x2c0(%rbp), %xmm0
movups -0x2b4(%rbp), %xmm1
movups %xmm1, -0x174(%rbp)
movaps %xmm0, -0x180(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x4270
leaq -0x2e0(%rbp), %rdi
callq 0x4270
leaq -0x180(%rbp), %rdi
callq 0xfff0
movsd %xmm0, -0x368(%rbp)
jmp 0x13a24
movsd -0x368(%rbp), %xmm1
leaq 0x2accd(%rip), %rax     # 0x3e700
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x13a9c
movl -0x1c(%rbp), %esi
movl -0x30(%rbp), %edx
leaq -0x180(%rbp), %rdi
callq 0xff90
jmp 0x13a51
movq -0x318(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x154c0
jmp 0x13a66
jmp 0x13a9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x13a8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x4270
leaq -0x2e0(%rbp), %rdi
callq 0x4270
jmp 0x13acb
leaq -0x130(%rbp), %rdi
callq 0x4270
leaq -0xc0(%rbp), %rdi
callq 0x4270
leaq -0x50(%rbp), %rdi
callq 0x4270
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x133a2
leaq -0x130(%rbp), %rdi
callq 0x4270
leaq -0xc0(%rbp), %rdi
callq 0x4270
leaq -0x50(%rbp), %rdi
callq 0x4270
jmp 0x13b24
jmp 0x13af0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x13365
movb $0x1, -0x12(%rbp)
testb $0x1, -0x12(%rbp)
jne 0x13b14
movq -0x318(%rbp), %rdi
callq 0xba20
movq -0x310(%rbp), %rax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
movq -0x318(%rbp), %rdi
callq 0xba20
movq -0x28(%rbp), %rdi
callq 0x46c0
nopl (%rax)