// File: /workspace/github_cpp_makefile_star2_O1/afinit[P]afin/readlist.cpp
// Function: Readlist::create_read_range()
void Readlist::create_read_range(){
  string current( rlist[0].substr( 0, max_sort_char ) );
  long curr_start = 0;
  // cycle through the rlist
  for( long int i=1; i<rlist.size(); i++ ){
    if( rlist[i].compare( 0, max_sort_char, current ) != 0 ){
      // insert values into hash table, the ordered pair reflecting the range is increased by 1 to differentiate between a false search  
      read_range.insert( { current, make_tuple( curr_start+1, i, 0, 0 )});
      curr_start = i;
      current = rlist[i].substr( 0, max_sort_char );
    }
  }
  
  // add the last entry
  read_range.insert( { current, make_tuple( curr_start+1, rlist.size(), 0, 0 )});

  string rc( rlist[0].substr( rlist[0].length() - max_sort_char, max_sort_char ) );
  current = revcomp( rc );
  curr_start = 0;

  // cycle through the rc_reflist to include these ranges in the hash as well
  for( long int i=1; i<rc_reflist.size(); i++ ){
    rc = rlist[i].substr( rlist[i].length() - max_sort_char, max_sort_char );
    rc = revcomp( rc );
    if( rc.compare( current ) != 0 ){
      // check if current already exists in hash
      if( get<0>( get_read_range(current) ) == -1 ){
        read_range.insert( { current, make_tuple( 0, 0, curr_start+1, i )});
      }
      else{
        get<2>( read_range[current] ) = curr_start+1;
        get<3>( read_range[current] ) = i;
      }
      curr_start = i;
      current = rc;
    }
  }
  
  // add the last entry
  if( get<0>( get_read_range(current) ) == -1 ){
    read_range.insert( { current, make_tuple( 0, 0, curr_start+1, rc_reflist.size() )});
  }
  else{
    get<2>( read_range[current] ) = curr_start+1;
    get<3>( read_range[current] ) = rc_reflist.size();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %r12
movq 0xe148(%rip), %rsi      # 0x1d698
leaq 0xe0bd(%rip), %rax      # 0x1d614
movslq (%rax), %rcx
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0x4330
movq 0xe134(%rip), %r14      # 0x1d6a0
movq 0xe125(%rip), %rdi      # 0x1d698
subq %rdi, %r14
sarq $0x5, %r14
movl $0x1, %ebx
cmpq $0x2, %r14
movq %r12, -0x98(%rbp)
jb 0xf685
movl $0x1, %r12d
movl $0x20, %r13d
xorl %ebx, %ebx
leaq -0x88(%rbp), %r15
addq %r13, %rdi
leaq 0xe065(%rip), %rax      # 0x1d614
movslq (%rax), %rdx
xorl %esi, %esi
leaq -0x48(%rbp), %rcx
callq 0x43d0
leaq -0x78(%rbp), %r14
testl %eax, %eax
je 0xf656
movq %r14, -0x88(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x6876
incq %rbx
leaq -0x68(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r12, -0x58(%rbp)
movq %rbx, -0x50(%rbp)
movq -0x98(%rbp), %rdi
movq %r15, %rsi
callq 0x11b50
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0xf618
callq 0x42f0
movq 0xe079(%rip), %rsi      # 0x1d698
addq %r13, %rsi
leaq 0xdfeb(%rip), %rax      # 0x1d614
movslq (%rax), %rcx
movq %r15, %rdi
xorl %edx, %edx
callq 0x4330
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x43b0
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0xf653
callq 0x42f0
movq %r12, %rbx
incq %r12
movq 0xe040(%rip), %r14      # 0x1d6a0
movq 0xe031(%rip), %rdi      # 0x1d698
subq %rdi, %r14
sarq $0x5, %r14
addq $0x20, %r13
cmpq %r14, %r12
jb 0xf5a5
incq %rbx
movq -0x98(%rbp), %r12
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
movq %rax, (%rdi)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x6876
xorps %xmm0, %xmm0
leaq -0x88(%rbp), %rsi
movups %xmm0, 0x20(%rsi)
movq %r14, 0x30(%rsi)
movq %rbx, 0x38(%rsi)
movq %r12, %rdi
callq 0x11b50
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xf6d6
callq 0x42f0
movq 0xdfbb(%rip), %rsi      # 0x1d698
movq 0x8(%rsi), %rdx
leaq 0xdf2c(%rip), %rax      # 0x1d614
movslq (%rax), %rcx
subq %rcx, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x4330
leaq -0x128(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x138(%rbp), %rdi
callq 0x6876
leaq -0x88(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x946c
leaq -0x48(%rbp), %rdi
leaq -0x88(%rbp), %r14
movq %r14, %rsi
callq 0x43b0
movq (%r14), %rdi
leaq -0x78(%rbp), %r14
cmpq %r14, %rdi
je 0xf759
callq 0x42f0
movq -0x138(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf76a
callq 0x42f0
movq 0xdf47(%rip), %rax      # 0x1d6b8
subq 0xdf38(%rip), %rax      # 0x1d6b0
movl $0x1, %r15d
cmpq $0x9, %rax
jb 0xf9db
movl $0x1, %ebx
movl $0x20, %r15d
movq $0x0, -0x90(%rbp)
movq 0xdef3(%rip), %rsi      # 0x1d698
movq 0x8(%rsi,%r15), %rdx
addq %r15, %rsi
leaq 0xde60(%rip), %rax      # 0x1d614
movslq (%rax), %rcx
subq %rcx, %rdx
leaq -0x88(%rbp), %r13
movq %r13, %rdi
callq 0x4330
leaq -0xb8(%rbp), %rdi
movq %r13, %rsi
callq 0x43b0
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
leaq -0x108(%rbp), %r13
leaq -0x118(%rbp), %r12
je 0xf7f7
callq 0x42f0
movq %r13, -0x118(%rbp)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x6876
movq %r12, %rsi
leaq -0x88(%rbp), %r12
movq %r12, %rdi
callq 0x946c
leaq -0xb8(%rbp), %rdi
movq %r12, %rsi
callq 0x43b0
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0xf849
callq 0x42f0
movq -0x118(%rbp), %rdi
cmpq %r13, %rdi
je 0xf85a
callq 0x42f0
movq -0xb0(%rbp), %r14
movq -0x40(%rbp), %r13
cmpq %r14, %r13
movq %r14, %rdx
cmovbq %r13, %rdx
testq %rdx, %rdx
je 0xf88b
movq -0x48(%rbp), %rsi
movq -0xb8(%rbp), %rdi
callq 0x4320
testl %eax, %eax
sete %al
jmp 0xf88d
movb $0x1, %al
cmpq %r13, %r14
sete %cl
testb %cl, %al
je 0xf8a7
movq -0x98(%rbp), %r12
leaq -0x78(%rbp), %r14
jmp 0xf9af
leaq -0xc8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x48(%rbp), %rsi
addq %rsi, %r13
leaq -0xd8(%rbp), %r14
movq %r14, %rdi
movq %r13, %rdx
callq 0x6876
leaq -0x88(%rbp), %rdi
movq -0x98(%rbp), %r12
movq %r12, %rsi
movq %r14, %rdx
callq 0xfe74
movq -0x70(%rbp), %r14
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xf903
callq 0x42f0
cmpq $-0x1, %r14
je 0xf938
movq %r12, %rdi
leaq -0x48(%rbp), %rsi
callq 0x11fb8
leaq -0x78(%rbp), %r14
movq -0x90(%rbp), %rcx
incq %rcx
movq %rcx, 0x8(%rax)
movq %r12, %rdi
leaq -0x48(%rbp), %rsi
callq 0x11fb8
movq %rbx, (%rax)
jmp 0xf995
leaq -0x78(%rbp), %r14
movq %r14, -0x88(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %r13
movq %r13, %rdi
callq 0x6876
movq -0x90(%rbp), %rax
incq %rax
movq %rbx, -0x68(%rbp)
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x11b50
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0xf995
callq 0x42f0
leaq -0x48(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x41c0
movq %rbx, %rax
movq %rbx, -0x90(%rbp)
movq 0xdd02(%rip), %rax      # 0x1d6b8
subq 0xdcf3(%rip), %rax      # 0x1d6b0
incq %rbx
sarq $0x3, %rax
addq $0x20, %r15
cmpq %rax, %rbx
jb 0xf79e
movq -0x90(%rbp), %r15
incq %r15
leaq -0xe8(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %rdi
callq 0x6876
leaq -0x88(%rbp), %rdi
leaq -0xf8(%rbp), %rdx
movq %r12, %rsi
callq 0xfe74
movq -0x70(%rbp), %r14
movq -0xf8(%rbp), %rdi
cmpq %rbx, %rdi
je 0xfa28
callq 0x42f0
cmpq $-0x1, %r14
je 0xfa64
leaq -0x48(%rbp), %rsi
movq %r12, %rdi
callq 0x11fb8
movq %r15, 0x8(%rax)
movq 0xdc73(%rip), %rbx      # 0x1d6b8
movq 0xdc64(%rip), %r14      # 0x1d6b0
leaq -0x48(%rbp), %rsi
movq %r12, %rdi
callq 0x11fb8
subq %r14, %rbx
sarq $0x3, %rbx
movq %rbx, (%rax)
jmp 0xfaca
movq 0xdc4d(%rip), %rbx      # 0x1d6b8
movq 0xdc3e(%rip), %r14      # 0x1d6b0
leaq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
movq %rax, (%rdi)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x6876
subq %r14, %rbx
sarq $0x3, %rbx
leaq -0x88(%rbp), %rsi
movq %rbx, 0x20(%rsi)
movq %r15, 0x28(%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rsi)
movq %r12, %rdi
callq 0x11b50
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xfaca
callq 0x42f0
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfadf
callq 0x42f0
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfaf1
callq 0x42f0
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
jmp 0xfb7c
jmp 0xfbbc
movq %rax, %r14
movq -0xf8(%rbp), %rdi
jmp 0xfb33
jmp 0xfbbc
movq %rax, %r14
movq -0x138(%rbp), %rdi
cmpq %rbx, %rdi
jne 0xfbb0
jmp 0xfbbf
jmp 0xfbbc
jmp 0xfbb7
movq %rax, %r14
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
jmp 0xfbca
jmp 0xfbb7
jmp 0xfbbc
movq %r14, %rcx
movq %rax, %r14
movq -0x88(%rbp), %rdi
cmpq %rcx, %rdi
jne 0xfbb0
jmp 0xfbbf
jmp 0xfbbc
movq %rax, %r14
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
jne 0xfbb0
jmp 0xfbbf
jmp 0xfbbc
jmp 0xfbb7
jmp 0xfbb7
movq %r14, %rcx
movq %rax, %r14
movq -0x88(%rbp), %rdi
cmpq %rcx, %rdi
jne 0xfbcf
jmp 0xfbd4
jmp 0xfbbc
jmp 0xfbbc
movq %rax, %r14
movq -0x118(%rbp), %rdi
cmpq %r13, %rdi
je 0xfbbf
callq 0x42f0
jmp 0xfbbf
movq %rax, %r14
jmp 0xfbd4
movq %rax, %r14
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfbd4
callq 0x42f0
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfbe6
callq 0x42f0
movq %r14, %rdi
callq 0x4590