// File: /workspace/github_cpp_makefile_star2_O2/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 $0x228, %rsp            # imm = 0x228
movl %edx, -0x68(%rbp)
movq %rsi, %r15
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq %rdi, -0x38(%rbp)
andq $0x0, 0x10(%rdi)
leaq 0x119c8(%rip), %rax     # 0x1b620
movslq (%rax), %rax
shlq $0x2, %rax
movq %rax, -0x90(%rbp)
xorl %ebx, %ebx
leaq -0x240(%rbp), %r14
leaq -0xd0(%rbp), %r12
movq (%r15), %rdi
callq 0x107dc
cmpl %eax, %ebx
jge 0xa048
leal 0x1(%rbx), %r13d
movl %r13d, -0x64(%rbp)
movq %rbx, -0x40(%rbp)
movq (%r15), %rdi
callq 0x107dc
cmpl %eax, %r13d
jge 0xa03e
movq (%r15), %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x107a4
leaq -0xb0(%rbp), %rdi
movq %r14, %rsi
callq 0x5534
movq %r14, %rdi
callq 0x5328
movq (%r15), %rsi
movq %r14, %rdi
movl %r13d, %edx
callq 0x107a4
movq %r12, %rdi
movq %r14, %rsi
callq 0x5534
movl %r13d, -0x2c(%rbp)
movq %r14, %rdi
callq 0x5328
leaq -0x1f0(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x4410
movq %r14, %rdi
movq %r13, %rsi
callq 0x802c
movq %r13, %rdi
callq 0x4160
leaq -0x60(%rbp), %rdi
callq 0x8134
movq -0xa8(%rbp), %rax
cmpb $0x0, -0x68(%rbp)
je 0x9d37
movq -0xc8(%rbp), %r13
cmpq %r13, %rax
cmovbq %rax, %r13
jmp 0x9d55
movq -0x90(%rbp), %rcx
cmpq %rcx, %rax
cmovael %ecx, %eax
movslq %eax, %r13
movq -0xc8(%rbp), %rax
cmpq %r13, %rax
cmovbl %eax, %r13d
leaq -0xf0(%rbp), %rdi
leaq -0x150(%rbp), %rbx
leaq -0xb0(%rbp), %rsi
callq 0x4410
movq %rbx, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4410
andl $0x0, (%rsp)
leaq -0x88(%rbp), %rdi
movq %r15, %r12
movq %r15, %rsi
leaq -0xf0(%rbp), %r15
movq %r15, %rdx
movq %rbx, %rcx
movl %r13d, %r8d
pushq $0x1
popq %r9
callq 0x9266
movupd -0x88(%rbp), %xmm0
movupd -0x7c(%rbp), %xmm1
movupd %xmm1, -0x54(%rbp)
movapd %xmm0, -0x60(%rbp)
movq %rbx, %rdi
callq 0x4160
movq %r15, %rdi
callq 0x4160
leaq -0x60(%rbp), %rdi
callq 0x81b6
leaq -0x1d0(%rbp), %rbx
movq %r12, %r15
leaq 0x11877(%rip), %rax     # 0x1b660
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0x9e10
leaq -0x60(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x8196
movq -0x38(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xaee8
movq %rbx, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4410
leaq -0x1b0(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x4410
movl $0x1, (%rsp)
leaq -0x88(%rbp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movl %r13d, %r8d
pushq $0x1
popq %r9
callq 0x9266
movupd -0x88(%rbp), %xmm0
movupd -0x7c(%rbp), %xmm1
movupd %xmm1, -0x54(%rbp)
movapd %xmm0, -0x60(%rbp)
movq %r12, %rdi
callq 0x4160
movq %rbx, %rdi
callq 0x4160
leaq -0x60(%rbp), %rdi
callq 0x81b6
leaq 0x117d5(%rip), %rax     # 0x1b660
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0x9eb2
leaq -0x60(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x8196
movq -0x38(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xaee8
leaq -0x130(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4410
leaq -0x190(%rbp), %r12
movq %r12, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4410
movl $0x1, (%rsp)
leaq -0x88(%rbp), %rdi
movq %r15, %rsi
leaq -0x130(%rbp), %rbx
movq %rbx, %rdx
movq %r12, %rcx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x9266
movupd -0x88(%rbp), %xmm0
movupd -0x7c(%rbp), %xmm1
movupd %xmm1, -0x54(%rbp)
movapd %xmm0, -0x60(%rbp)
movq %r12, %rdi
callq 0x4160
movq %rbx, %rdi
callq 0x4160
leaq -0x60(%rbp), %rdi
callq 0x81b6
leaq 0x11725(%rip), %rax     # 0x1b660
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0x9f62
leaq -0x60(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x8196
movq -0x38(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xaee8
leaq -0x110(%rbp), %rdi
movq %r14, %rsi
callq 0x4410
leaq -0x170(%rbp), %r12
movq %r12, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4410
andl $0x0, (%rsp)
leaq -0x88(%rbp), %rdi
movq %r15, %rsi
leaq -0x110(%rbp), %rbx
movq %rbx, %rdx
movq %r12, %rcx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x9266
movupd -0x88(%rbp), %xmm0
movupd -0x7c(%rbp), %xmm1
movupd %xmm1, -0x54(%rbp)
movapd %xmm0, -0x60(%rbp)
movq %r12, %rdi
callq 0x4160
movq %rbx, %rdi
callq 0x4160
leaq -0x60(%rbp), %rdi
callq 0x81b6
leaq 0x1167c(%rip), %rax     # 0x1b660
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jb 0xa00b
leaq -0x60(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x8196
movq -0x38(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xaee8
movq %r14, %rdi
callq 0x4160
leaq -0xd0(%rbp), %r12
movq %r12, %rdi
callq 0x4160
leaq -0xb0(%rbp), %rdi
callq 0x4160
movl -0x2c(%rbp), %r13d
incl %r13d
movq -0x40(%rbp), %rbx
jmp 0x9c92
movl -0x64(%rbp), %eax
movl %eax, %ebx
jmp 0x9c76
movq -0x38(%rbp), %rax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa12d
movq %rax, %rbx
jmp 0xa088
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
callq 0x4160
jmp 0xa09c
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
callq 0x4160
leaq -0x130(%rbp), %rdi
jmp 0xa124
jmp 0xa132
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
jmp 0xa124
jmp 0xa132
movq %rax, %rbx
leaq -0x1f0(%rbp), %rdi
jmp 0xa13c
movq %rax, %rbx
jmp 0xa141
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x4160
jmp 0xa11d
movq %rax, %rbx
leaq -0x240(%rbp), %rdi
callq 0x5328
jmp 0xa14d
movq %rax, %rbx
jmp 0xa10f
movq %rax, %rbx
jmp 0xa14d
jmp 0xa12d
movq %rax, %rbx
leaq -0x240(%rbp), %rdi
callq 0x5328
jmp 0xa159
movq %rax, %rbx
leaq -0x1b0(%rbp), %rdi
callq 0x4160
leaq -0x1d0(%rbp), %rdi
jmp 0xa124
jmp 0xa132
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x4160
jmp 0xa135
jmp 0xa132
movq %rax, %rbx
jmp 0xa159
movq %rax, %rbx
leaq -0x240(%rbp), %rdi
callq 0x4160
leaq -0xd0(%rbp), %rdi
callq 0x4160
leaq -0xb0(%rbp), %rdi
callq 0x4160
movq -0x38(%rbp), %rdi
callq 0x7318
movq %rbx, %rdi
callq 0x4590