// File: /workspace/github_cpp_makefile_star2_O1/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 0xf66f(%rip), %rcx      # 0x1d61c
cmpl (%rcx), %eax
jge 0xdfc3
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 0x6876
leaq -0x70(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x946c
movq %r12, %rdi
movq %r13, %rsi
callq 0x43b0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xe04a
callq 0x42f0
movq -0xf8(%rbp), %rdi
cmpq %r14, %rdi
je 0xe05b
callq 0x42f0
movq -0x30(%rbp), %rax
movq (%rax), %r14
leaq 0xf5ab(%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 0xfe74
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xe0a7
callq 0x42f0
movq -0x58(%rbp), %rax
cmpq $-0x1, %rax
je 0xe172
testq %rax, %rax
jne 0xe1ad
movq -0x68(%rbp), %rax
testq %rax, %rax
je 0xe172
decl %eax
movslq %eax, %r14
cmpq %r14, -0x70(%rbp)
jle 0xe172
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq -0x50(%rbp), %r13
movq %r13, %rdi
movl %r14d, %edx
callq 0xffbc
movq -0x88(%rbp), %rdx
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0x43d0
testl %eax, %eax
jne 0xe158
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x6876
movq -0x30(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movl %r15d, %edx
callq 0xdb36
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xe158
callq 0x42f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe16a
callq 0x42f0
incq %r14
jmp 0xe0d0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xe187
callq 0x42f0
leaq -0x1(%r15), %rax
leaq 0xf48a(%rip), %rcx      # 0x1d61c
movslq (%rcx), %rcx
cmpq %rcx, %r15
movq %rax, %r15
leaq -0xe8(%rbp), %r14
jg 0xdfe3
jmp 0xdfb1
decl %eax
movslq %eax, %r14
cmpq %r14, -0x60(%rbp)
jle 0xe0be
movq %r15, %r13
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq -0x50(%rbp), %r15
movq %r15, %rdi
movl %r14d, %edx
callq 0xff82
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 0xe201
callq 0x42f0
testl %r12d, %r12d
movq %r15, %r12
movq %r13, %r15
jne 0xe2b3
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq -0x118(%rbp), %r13
movq %r13, %rdi
movl %r14d, %edx
callq 0xff82
leaq -0x50(%rbp), %rdi
movq %r13, %rsi
callq 0x946c
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xe24d
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 0x6876
movq -0x30(%rbp), %rdi
movq %r13, %rsi
movl %r15d, %edx
movl $0x1, %ecx
callq 0xdbea
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xe2a1
callq 0x42f0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe2b3
callq 0x42f0
incq %r14
jmp 0xe1b2
jmp 0xe32e
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
cmpq %r14, %rdi
jne 0xe343
jmp 0xe348
jmp 0xe32e
movq %rax, %rbx
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
jmp 0xe33e
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
jmp 0xe31e
jmp 0xe32e
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
jmp 0xe33e
jmp 0xe333
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xe336
callq 0x42f0
jmp 0xe336
jmp 0xe32e
jmp 0xe333
movq %rax, %rbx
jmp 0xe348
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xe348
callq 0x42f0
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xe35d
callq 0x42f0
movq %rbx, %rdi
callq 0x4590
nop