// File: /workspace/github_cpp_makefile_star2_O3/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, -0x30(%rbp)
movl 0x30(%rdi), %eax
addl $-0x2, %eax
leaq 0xf52f(%rip), %rcx      # 0x1d61c
cmpl (%rcx), %eax
jge 0xe103
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rcx
addq $0x28, %rcx
movq %rcx, -0x98(%rbp)
leaq -0xe8(%rbp), %r14
movslq %eax, %r15
leaq -0x90(%rbp), %r12
movq %r12, %rdi
movq -0x98(%rbp), %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x4330
movq %r14, -0xf8(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %rbx
movq %rbx, %rdi
callq 0x68f6
leaq -0x70(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x94d8
movq %r12, %rdi
movq %r13, %rsi
callq 0x43b0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xe18a
callq 0x42f0
movq -0xf8(%rbp), %rdi
cmpq %r14, %rdi
je 0xe19b
callq 0x42f0
movq -0x30(%rbp), %rax
movq (%rax), %r14
leaq 0xf46b(%rip), %rax      # 0x1d614
movslq (%rax), %rcx
leaq -0x138(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x4330
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xffe0
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xe1e7
callq 0x42f0
movq -0x58(%rbp), %r14
cmpq $-0x1, %r14
je 0xe2c2
testq %r14, %r14
jne 0xe2fd
movq -0x68(%rbp), %r14
testq %r14, %r14
je 0xe2c2
shlq $0x20, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r14
sarq $0x20, %r14
cmpq %r14, -0x70(%rbp)
jle 0xe2c2
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq -0x50(%rbp), %r13
movq %r13, %rdi
movl %r14d, %edx
callq 0x10116
movq -0x88(%rbp), %rdx
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0x43d0
testl %eax, %eax
jne 0xe2a8
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x68f6
movq -0x30(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movl %r15d, %edx
callq 0xdc56
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xe2a8
callq 0x42f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe2ba
callq 0x42f0
incq %r14
jmp 0xe220
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xe2d7
callq 0x42f0
leaq -0x1(%r15), %rax
leaq 0xf33a(%rip), %rcx      # 0x1d61c
movslq (%rcx), %rcx
cmpq %rcx, %r15
movq %rax, %r15
leaq -0xe8(%rbp), %r14
jg 0xe123
jmp 0xe0f1
shlq $0x20, %r14
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r14
sarq $0x20, %r14
cmpq %r14, -0x60(%rbp)
jle 0xe1fe
movq %r15, %r13
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq -0x50(%rbp), %r15
movq %r15, %rdi
movl %r14d, %edx
callq 0x100dc
movq -0x88(%rbp), %rdx
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %r15
movq %r12, %rcx
callq 0x43d0
movl %eax, %r12d
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe361
callq 0x42f0
testl %r12d, %r12d
movq %r15, %r12
movq %r13, %r15
jne 0xe413
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq -0x118(%rbp), %r13
movq %r13, %rdi
movl %r14d, %edx
callq 0x100dc
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x94d8
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xe3ad
callq 0x42f0
leaq -0xc8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %r13
movq %r13, %rdi
callq 0x68f6
movq -0x30(%rbp), %rdi
movq %r13, %rsi
movl %r15d, %edx
movl $0x1, %ecx
callq 0xdd0a
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xe401
callq 0x42f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe413
callq 0x42f0
incq %r14
jmp 0xe312
jmp 0xe48e
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
cmpq %r14, %rdi
jne 0xe4a3
jmp 0xe4a8
jmp 0xe48e
movq %rax, %rbx
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
jmp 0xe49e
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
jmp 0xe47e
jmp 0xe48e
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
jmp 0xe49e
jmp 0xe493
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xe496
callq 0x42f0
jmp 0xe496
jmp 0xe48e
jmp 0xe493
movq %rax, %rbx
jmp 0xe4a8
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe4a8
callq 0x42f0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xe4bd
callq 0x42f0
movq %rbx, %rdi
callq 0x4590
nop