// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movl %edx, -0x60(%rbp)
movq %rsi, %r15
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq %rdi, -0x58(%rbp)
movq $0x0, 0x10(%rdi)
leaq 0x11aed(%rip), %rax     # 0x1d610
movslq (%rax), %rax
shlq $0x2, %rax
movq %rax, -0xc8(%rbp)
xorl %r14d, %r14d
movq (%r15), %rdi
callq 0x13ddc
cmpl %eax, %r14d
jge 0xc115
leal 0x1(%r14), %r12d
movl %r12d, -0x5c(%rbp)
movq (%r15), %rdi
callq 0x13ddc
cmpl %eax, %r12d
jge 0xc10a
movq (%r15), %rsi
leaq -0x238(%rbp), %r13
movq %r13, %rdi
movl %r14d, %edx
callq 0x13d9c
leaq -0xa0(%rbp), %rdi
movq %r13, %rsi
callq 0x5c92
movq %r13, %rdi
callq 0x59be
movq (%r15), %rsi
movq %r13, %rdi
movl %r12d, %edx
callq 0x13d9c
leaq -0x80(%rbp), %rdi
movq %r13, %rsi
callq 0x5c92
movq %r13, %rdi
callq 0x59be
leaq -0x1d8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1e8(%rbp), %rbx
movq %rbx, %rdi
callq 0x68f6
movq %r13, %rdi
movq %rbx, %rsi
callq 0x94d8
movq -0x1e8(%rbp), %rdi
leaq -0x1d8(%rbp), %rax
cmpq %rax, %rdi
je 0xbbf7
callq 0x42f0
leaq -0x50(%rbp), %rdi
callq 0x95c4
movq -0x98(%rbp), %rdx
cmpb $0x0, -0x60(%rbp)
je 0xbc1a
movq -0x78(%rbp), %r13
cmpq %r13, %rdx
cmovbq %rdx, %r13
jmp 0xbc35
movq -0xc8(%rbp), %rax
cmpq %rax, %rdx
cmovbl %edx, %eax
movslq %eax, %r13
movq -0x78(%rbp), %rax
cmpq %r13, %rax
cmovbl %eax, %r13d
leaq -0x138(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0xa0(%rbp), %rsi
addq %rsi, %rdx
leaq -0x148(%rbp), %rdi
callq 0x68f6
leaq -0x1b8(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1c8(%rbp), %rbx
movq %rbx, %rdi
callq 0x68f6
movl $0x0, (%rsp)
leaq -0xc0(%rbp), %rdi
movq %r15, %rsi
leaq -0x148(%rbp), %rdx
movq %rbx, %rcx
movl %r13d, %r8d
movl $0x1, %r9d
callq 0xad2e
movupd -0xc0(%rbp), %xmm0
movupd -0xb4(%rbp), %xmm1
movupd %xmm1, -0x44(%rbp)
movapd %xmm0, -0x50(%rbp)
movq -0x1c8(%rbp), %rdi
leaq -0x1b8(%rbp), %rax
cmpq %rax, %rdi
je 0xbcdc
callq 0x42f0
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
cmpq %rax, %rdi
je 0xbcf4
callq 0x42f0
leaq -0x50(%rbp), %rdi
callq 0x964a
leaq 0x1194c(%rip), %rax     # 0x1d650
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0xbd51
leaq -0x50(%rbp), %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0x962a
movq -0x58(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xbd48
movapd -0x50(%rbp), %xmm0
movapd -0x40(%rbp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x20, %rsi
movq %rsi, 0x8(%rdi)
jmp 0xbd51
leaq -0x50(%rbp), %rdx
callq 0xd8b2
leaq -0x118(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
addq %rsi, %rdx
leaq -0x128(%rbp), %rdi
callq 0x68f6
leaq -0x198(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x238(%rbp), %rsi
movq -0x230(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1a8(%rbp), %rbx
movq %rbx, %rdi
callq 0x68f6
movl $0x1, (%rsp)
leaq -0xc0(%rbp), %rdi
movq %r15, %rsi
leaq -0x128(%rbp), %rdx
movq %rbx, %rcx
movl %r13d, %r8d
movl $0x1, %r9d
callq 0xad2e
movupd -0xc0(%rbp), %xmm0
movupd -0xb4(%rbp), %xmm1
movupd %xmm1, -0x44(%rbp)
movapd %xmm0, -0x50(%rbp)
movq -0x1a8(%rbp), %rdi
leaq -0x198(%rbp), %rax
cmpq %rax, %rdi
je 0xbe05
callq 0x42f0
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0xbe1d
callq 0x42f0
leaq -0x50(%rbp), %rdi
callq 0x964a
leaq 0x11823(%rip), %rax     # 0x1d650
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0xbe7a
leaq -0x50(%rbp), %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0x962a
movq -0x58(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xbe71
movapd -0x50(%rbp), %xmm0
movapd -0x40(%rbp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x20, %rsi
movq %rsi, 0x8(%rdi)
jmp 0xbe7a
leaq -0x50(%rbp), %rdx
callq 0xd8b2
leaq -0xf8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
addq %rsi, %rdx
leaq -0x108(%rbp), %rdi
callq 0x68f6
leaq -0x178(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
addq %rsi, %rdx
leaq -0x188(%rbp), %rbx
movq %rbx, %rdi
callq 0x68f6
movl $0x1, (%rsp)
leaq -0xc0(%rbp), %rdi
movq %r15, %rsi
leaq -0x108(%rbp), %rdx
movq %rbx, %rcx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0xad2e
movupd -0xc0(%rbp), %xmm0
movupd -0xb4(%rbp), %xmm1
movupd %xmm1, -0x44(%rbp)
movapd %xmm0, -0x50(%rbp)
movq -0x188(%rbp), %rdi
leaq -0x178(%rbp), %rax
cmpq %rax, %rdi
je 0xbf25
callq 0x42f0
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0xbf3d
callq 0x42f0
leaq -0x50(%rbp), %rdi
callq 0x964a
leaq 0x11703(%rip), %rax     # 0x1d650
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0xbf9a
leaq -0x50(%rbp), %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0x962a
movq -0x58(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xbf91
movapd -0x50(%rbp), %xmm0
movapd -0x40(%rbp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x20, %rsi
movq %rsi, 0x8(%rdi)
jmp 0xbf9a
leaq -0x50(%rbp), %rdx
callq 0xd8b2
leaq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x238(%rbp), %rsi
movq -0x230(%rbp), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x68f6
leaq -0x158(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
addq %rsi, %rdx
leaq -0x168(%rbp), %rbx
movq %rbx, %rdi
callq 0x68f6
movl $0x0, (%rsp)
leaq -0xc0(%rbp), %rdi
movq %r15, %rsi
leaq -0xe8(%rbp), %rdx
movq %rbx, %rcx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0xad2e
movupd -0xc0(%rbp), %xmm0
movupd -0xb4(%rbp), %xmm1
movupd %xmm1, -0x44(%rbp)
movapd %xmm0, -0x50(%rbp)
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0xc04b
callq 0x42f0
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0xc063
callq 0x42f0
leaq -0x50(%rbp), %rdi
callq 0x964a
leaq 0x115dd(%rip), %rax     # 0x1d650
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0xc0c0
leaq -0x50(%rbp), %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0x962a
movq -0x58(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0xc0b7
movapd -0x50(%rbp), %xmm0
movapd -0x40(%rbp), %xmm1
movupd %xmm1, 0x10(%rsi)
movupd %xmm0, (%rsi)
addq $0x20, %rsi
movq %rsi, 0x8(%rdi)
jmp 0xc0c0
leaq -0x50(%rbp), %rdx
callq 0xd8b2
movq -0x238(%rbp), %rdi
leaq -0x228(%rbp), %rax
cmpq %rax, %rdi
je 0xc0d8
callq 0x42f0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xc0ea
callq 0x42f0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xc102
callq 0x42f0
incl %r12d
jmp 0xbb4d
movl -0x5c(%rbp), %eax
movl %eax, %r14d
jmp 0xbb34
movq -0x58(%rbp), %rax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc252
jmp 0xc257
movq %rax, %r14
movq -0x188(%rbp), %rdi
leaq -0x178(%rbp), %rax
cmpq %rax, %rdi
je 0xc18d
callq 0x42f0
jmp 0xc18d
jmp 0xc257
movq %rax, %r14
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0xc177
callq 0x42f0
jmp 0xc177
movq %rax, %r14
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
jmp 0xc22e
movq %rax, %r14
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
jmp 0xc22e
movq %rax, %r14
movq -0x1a8(%rbp), %rdi
leaq -0x198(%rbp), %rax
cmpq %rax, %rdi
je 0xc1d4
callq 0x42f0
jmp 0xc1d4
movq %rax, %r14
leaq -0x238(%rbp), %rdi
callq 0x59be
jmp 0xc284
movq %rax, %r14
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
jmp 0xc22e
jmp 0xc257
movq %rax, %r14
jmp 0xc220
movq %rax, %r14
movq -0x1e8(%rbp), %rdi
leaq -0x1d8(%rbp), %rax
jmp 0xc268
jmp 0xc257
movq %rax, %r14
jmp 0xc284
movq %rax, %r14
movq -0x1c8(%rbp), %rdi
leaq -0x1b8(%rbp), %rax
cmpq %rax, %rdi
je 0xc220
callq 0x42f0
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
cmpq %rax, %rdi
je 0xc25a
callq 0x42f0
jmp 0xc25a
movq %rax, %r14
leaq -0x238(%rbp), %rdi
callq 0x59be
jmp 0xc29c
movq %rax, %r14
jmp 0xc272
jmp 0xc252
movq %rax, %r14
jmp 0xc29c
movq %rax, %r14
movq -0x238(%rbp), %rdi
leaq -0x228(%rbp), %rax
cmpq %rax, %rdi
je 0xc272
callq 0x42f0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0xc284
callq 0x42f0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0xc29c
callq 0x42f0
movq -0x58(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xc2ad
callq 0x42f0
movq %r14, %rdi
callq 0x4590
nop