// File: afinit[P]afin/match.cpp
// Function: Match::match_contig_rr()
void Match::match_contig_rr(){
  // loop through possible substrings of sequence to check for matches in readlist
  for( int i=1; i<sequence.length()-min_overlap; i++ ){
    string seq_sub( sequence.substr( i, sequence.length()-1 ));
    tuple<long,long,long,long> range = reads->get_read_range( seq_sub.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.length(), seq_sub ) == 0 ){
            push_match( reads->get_read(j), i );
          }
        }
      }

      // 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.length(), seq_sub ) == 0 ){
            push_match( rc, i, true );
          }
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
movl $0x1, -0xc(%rbp)
movq -0x110(%rbp), %rdi
movslq -0xc(%rbp), %rax
movq %rax, -0x118(%rbp)
addq $0x28, %rdi
callq 0x45e0
movq %rax, %rcx
movq -0x118(%rbp), %rax
leaq 0x2712f(%rip), %rdx     # 0x3e6cc
movslq (%rdx), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jae 0x1792c
movq -0x110(%rbp), %rdi
addq $0x28, %rdi
movq %rdi, -0x138(%rbp)
movslq -0xc(%rbp), %rax
movq %rax, -0x130(%rbp)
callq 0x45e0
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
movq %rax, %rcx
decq %rcx
leaq -0x30(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x43e0
movq -0x110(%rbp), %rax
movq -0x128(%rbp), %rsi
movq (%rax), %rax
movq %rax, -0x120(%rbp)
leaq 0x270b3(%rip), %rax     # 0x3e6c4
movslq (%rax), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x70(%rbp), %rdi
callq 0x43e0
jmp 0x17623
movq -0x120(%rbp), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x1b0b0
jmp 0x17639
leaq -0x70(%rbp), %rdi
callq 0x4270
leaq -0x50(%rbp), %rdi
callq 0x17fa0
cmpq $-0x1, (%rax)
je 0x1790a
leaq -0x50(%rbp), %rdi
callq 0x17fa0
cmpq $0x0, (%rax)
je 0x177c2
leaq -0x50(%rbp), %rdi
callq 0x17fa0
movq (%rax), %rax
subq $0x1, %rax
movl %eax, -0x80(%rbp)
movslq -0x80(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x17fc0
movq %rax, %rcx
movq -0x140(%rbp), %rax
cmpq (%rcx), %rax
jge 0x177c0
movq -0x110(%rbp), %rax
movq (%rax), %rsi
movl -0x80(%rbp), %edx
leaq -0xa0(%rbp), %rdi
callq 0x1b3a0
jmp 0x176bd
leaq -0x30(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x45e0
movq -0x150(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0xa0(%rbp), %rdi
callq 0x44e0
movl %eax, -0x144(%rbp)
jmp 0x176ef
leaq -0xa0(%rbp), %rdi
callq 0x4270
movl -0x144(%rbp), %eax
cmpl $0x0, %eax
jne 0x177b0
movq -0x110(%rbp), %rax
movq (%rax), %rsi
movl -0x80(%rbp), %edx
leaq -0xc0(%rbp), %rdi
callq 0x1b3a0
jmp 0x17725
movq -0x110(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq -0xc0(%rbp), %rsi
callq 0x173a0
jmp 0x1773d
leaq -0xc0(%rbp), %rdi
callq 0x4270
jmp 0x177b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x17921
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x4270
jmp 0x17921
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x4270
jmp 0x17921
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4270
jmp 0x17921
jmp 0x177b2
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x1767b
jmp 0x177c2
leaq -0x50(%rbp), %rdi
callq 0x17fe0
cmpq $0x0, (%rax)
je 0x17908
leaq -0x50(%rbp), %rdi
callq 0x17fe0
movq (%rax), %rax
subq $0x1, %rax
movl %eax, -0xc4(%rbp)
movslq -0xc4(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x18000
movq %rax, %rcx
movq -0x158(%rbp), %rax
cmpq (%rcx), %rax
jge 0x17906
movq -0x110(%rbp), %rax
movq (%rax), %rsi
movl -0xc4(%rbp), %edx
leaq -0xe8(%rbp), %rdi
callq 0x1b3f0
jmp 0x17833
leaq -0x30(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x45e0
movq -0x168(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0xe8(%rbp), %rdi
callq 0x44e0
movl %eax, -0x15c(%rbp)
jmp 0x17865
movl -0x15c(%rbp), %eax
cmpl $0x0, %eax
jne 0x178d8
leaq -0x108(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x41b0
jmp 0x17885
movq -0x110(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq -0x108(%rbp), %rsi
movl $0x1, %ecx
callq 0x17450
jmp 0x178a2
leaq -0x108(%rbp), %rdi
callq 0x4270
jmp 0x178d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x178f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x4270
jmp 0x178f8
leaq -0xe8(%rbp), %rdi
callq 0x4270
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x177eb
leaq -0xe8(%rbp), %rdi
callq 0x4270
jmp 0x17921
jmp 0x17908
jmp 0x1790a
leaq -0x30(%rbp), %rdi
callq 0x4270
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x17571
leaq -0x30(%rbp), %rdi
callq 0x4270
jmp 0x17935
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x46c0
nop