// File: /workspace/github_cpp_makefile_star2_O2/afinit[P]afin/match.cpp
// Function: Match::match_contig_fr()
void Match::match_contig_fr(){
  // loop through possible substrings of sequence to check for matches in readlist
  for( int i=sequence.length()-2; i>=min_overlap; i-- ){
    string seq_sub_rc( sequence.substr( 0, i ));
    seq_sub_rc = revcomp( seq_sub_rc );
    tuple<long,long,long,long> range = reads->get_read_range( seq_sub_rc.substr( 0, max_sort_char ) );

    if( get<0>(range) != -1 ){
      // check reads in range against sequence 
      if( get<0>(range) != 0 ){
        for( int j=get<0>(range)-1; j<get<1>(range); j++ ){
          // check if the current read matches the sequence from this point
          if( reads->get_read(j).compare( 0, seq_sub_rc.length(), seq_sub_rc ) == 0 ){
            string read_rc = revcomp( reads->get_read(j) );
            push_match( read_rc, i, true );
          }
        }
      }

      // check if there are revcomp reads to be checked
      if( get<2>(range) != 0 ){
        // check reverse complements
        for( int j=get<2>(range)-1; j<get<3>(range); j++ ){
          // check if the current read matches the sequence from this point
          string rc = reads->get_rc_read(j);

          if( rc.compare( 0, seq_sub_rc.length(), seq_sub_rc ) == 0 ){
            push_match( rc, i );
          }
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %rbx
leaq 0x28(%rdi), %rax
movq %rax, -0x38(%rbp)
movl 0x30(%rdi), %eax
addl $-0x2, %eax
movslq %eax, %r12
leaq -0x98(%rbp), %r15
leaq -0xf8(%rbp), %r14
leaq -0x78(%rbp), %r13
leaq 0xfe7d(%rip), %rax      # 0x1b62c
movslq (%rax), %rax
cmpq %rax, %r12
jl 0xb9b1
movq %r15, %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x4330
movq %r14, %rdi
movq %r15, %rsi
callq 0x4410
movq %r12, -0x30(%rbp)
leaq -0x58(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x802c
movq %r15, %rdi
movq %r12, %rsi
callq 0x4390
movq %r12, %rdi
callq 0x4160
movq %r14, %rdi
callq 0x4160
movq (%rbx), %r14
leaq 0xfe15(%rip), %rax      # 0x1b624
movslq (%rax), %rcx
leaq -0xd8(%rbp), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x4330
movq %r12, %rdi
movq %r14, %rsi
leaq -0xd8(%rbp), %r14
movq %r14, %rdx
callq 0xcf28
movq %r14, %rdi
callq 0x4160
movq -0x40(%rbp), %r14
cmpq $-0x1, %r14
je 0xb8db
testq %r14, %r14
jne 0xb8f6
movq -0x50(%rbp), %r14
testq %r14, %r14
je 0xb8db
shlq $0x20, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r14
sarq $0x20, %r14
cmpq %r14, -0x58(%rbp)
jle 0xb8db
movq (%rbx), %rsi
movq %r13, %rdi
movl %r14d, %edx
callq 0xd06c
movq -0x90(%rbp), %rdx
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x43c0
testl %eax, %eax
jne 0xb8ce
leaq -0xb8(%rbp), %rdi
movq %r13, %rsi
callq 0x4410
movq %rbx, %rdi
leaq -0xb8(%rbp), %r12
movq %r12, %rsi
movq -0x30(%rbp), %rdx
callq 0xb41a
movq %r12, %rdi
callq 0x4160
movq %r13, %rdi
callq 0x4160
incq %r14
jmp 0xb875
movq %r15, %rdi
callq 0x4160
movq -0x30(%rbp), %r12
decq %r12
leaq -0xf8(%rbp), %r14
jmp 0xb7a8
shlq $0x20, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r14
sarq $0x20, %r14
cmpq %r14, -0x48(%rbp)
jle 0xb857
movq (%rbx), %rsi
movq %r13, %rdi
movl %r14d, %edx
callq 0xd046
movq -0x90(%rbp), %rdx
movq %r13, %rdi
xorl %esi, %esi
movq %r15, %r12
movq %r15, %rcx
callq 0x43c0
movl %eax, %r15d
movq %r13, %rdi
callq 0x4160
testl %r15d, %r15d
movq %r12, %r15
jne 0xb9a9
movq (%rbx), %rsi
leaq -0x138(%rbp), %r12
movq %r12, %rdi
movl %r14d, %edx
callq 0xd046
movq %r13, %rdi
movq %r12, %rsi
callq 0x802c
movq %r12, %rdi
callq 0x4160
leaq -0x118(%rbp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x4410
movq %rbx, %rdi
movq %r12, %rsi
movq -0x30(%rbp), %rdx
pushq $0x1
popq %rcx
callq 0xb498
movq %r12, %rdi
callq 0x4160
movq %r13, %rdi
callq 0x4160
incq %r14
jmp 0xb90b
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xba10
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
jmp 0xba1c
jmp 0xba10
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
jmp 0xba1c
jmp 0xba15
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
jmp 0xba1c
jmp 0xba10
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
jmp 0xba05
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x4160
jmp 0xba18
jmp 0xba10
jmp 0xba15
movq %rax, %rbx
jmp 0xba21
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x4160
leaq -0x98(%rbp), %rdi
callq 0x4160
movq %rbx, %rdi
callq 0x4590
nop