// File: /workspace/github_cpp_makefile_star2_O3/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, %r15
movq 0xdfe8(%rip), %rsi      # 0x1d698
leaq 0xdf5d(%rip), %rax      # 0x1d614
movslq (%rax), %rcx
leaq -0x90(%rbp), %rdi
xorl %edx, %edx
callq 0x4330
movq 0xdfd1(%rip), %r14      # 0x1d6a0
movq 0xdfc2(%rip), %rdi      # 0x1d698
subq %rdi, %r14
sarq $0x5, %r14
movl $0x1, %ebx
cmpq $0x2, %r14
movq %r15, -0x70(%rbp)
jb 0xf7e7
movl $0x1, %r12d
movl $0x20, %r13d
xorl %ebx, %ebx
leaq -0x68(%rbp), %r15
addq %r13, %rdi
leaq 0xdf08(%rip), %rax      # 0x1d614
movslq (%rax), %rdx
xorl %esi, %esi
leaq -0x90(%rbp), %rcx
callq 0x43d0
testl %eax, %eax
je 0xf7bb
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x68f6
incq %rbx
leaq -0x48(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r12, -0x38(%rbp)
movq %rbx, -0x30(%rbp)
movq -0x70(%rbp), %rdi
movq %r15, %rsi
callq 0x11d22
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf779
callq 0x42f0
movq 0xdf18(%rip), %rsi      # 0x1d698
addq %r13, %rsi
leaq 0xde8a(%rip), %rax      # 0x1d614
movslq (%rax), %rcx
movq %r15, %rdi
xorl %edx, %edx
callq 0x4330
leaq -0x90(%rbp), %rdi
movq %r15, %rsi
callq 0x43b0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf7b8
callq 0x42f0
movq %r12, %rbx
incq %r12
movq 0xdedb(%rip), %r14      # 0x1d6a0
movq 0xdecc(%rip), %rdi      # 0x1d698
subq %rdi, %r14
sarq $0x5, %r14
addq $0x20, %r13
cmpq %r14, %r12
jb 0xf702
incq %rbx
movq -0x70(%rbp), %r15
leaq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
movq %rax, (%rdi)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
callq 0x68f6
xorps %xmm0, %xmm0
leaq -0x68(%rbp), %rsi
movups %xmm0, 0x20(%rsi)
movq %r14, 0x30(%rsi)
movq %rbx, 0x38(%rsi)
movq %r15, %rdi
callq 0x11d22
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf835
callq 0x42f0
movq 0xde5c(%rip), %rsi      # 0x1d698
movq 0x8(%rsi), %rdx
leaq 0xddcd(%rip), %rax      # 0x1d614
movslq (%rax), %rcx
subq %rcx, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x4330
leaq -0x130(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x68f6
leaq -0x68(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x94d8
leaq -0x90(%rbp), %rdi
leaq -0x68(%rbp), %rbx
movq %rbx, %rsi
callq 0x43b0
movq (%rbx), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf8b5
callq 0x42f0
movq -0x140(%rbp), %rdi
cmpq %r14, %rdi
je 0xf8c6
callq 0x42f0
movq 0xddeb(%rip), %rax      # 0x1d6b8
subq 0xdddc(%rip), %rax      # 0x1d6b0
movl $0x1, %r12d
cmpq $0x9, %rax
jb 0xfb5b
leaq -0xd0(%rbp), %rbx
movl $0x20, %eax
movq $0x0, -0x98(%rbp)
leaq -0x68(%rbp), %r13
movq 0xdd92(%rip), %rsi      # 0x1d698
movq 0x8(%rsi,%rax), %rdx
movq %rax, -0xc0(%rbp)
addq %rax, %rsi
leaq 0xdcf8(%rip), %rax      # 0x1d614
movslq (%rax), %rcx
subq %rcx, %rdx
movq %r13, %rdi
callq 0x4330
leaq -0xb8(%rbp), %rdi
movq %r13, %rsi
callq 0x43b0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
leaq -0xe0(%rbp), %r15
je 0xf952
callq 0x42f0
movq %rbx, -0xe0(%rbp)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x68f6
movq %r13, %rdi
movq %r15, %rsi
callq 0x94d8
leaq -0xb8(%rbp), %rdi
movq %r13, %rsi
callq 0x43b0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf99e
callq 0x42f0
movq -0xe0(%rbp), %rdi
cmpq %rbx, %rdi
je 0xf9af
callq 0x42f0
movq -0xb0(%rbp), %r15
movq -0x88(%rbp), %r13
cmpq %r15, %r13
movq %r15, %rdx
cmovbq %r13, %rdx
testq %rdx, %rdx
je 0xf9f8
movq -0x90(%rbp), %rbx
movq -0xb8(%rbp), %rdi
movq %rbx, %rsi
callq 0x4320
cmpq %r13, %r15
jne 0xfa11
testl %eax, %eax
jne 0xfa11
movq -0x70(%rbp), %r15
leaq -0xd0(%rbp), %rbx
jmp 0xfa01
cmpq %r13, %r15
jne 0xfa0a
movq -0x70(%rbp), %r15
leaq -0x68(%rbp), %r13
jmp 0xfb25
movq -0x90(%rbp), %rbx
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
addq %rbx, %r13
leaq -0x100(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x68f6
leaq -0x68(%rbp), %r13
movq %r13, %rdi
movq -0x70(%rbp), %rsi
movq %rsi, %r15
movq %r14, %rdx
callq 0xffe0
movq -0x50(%rbp), %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0xfa69
callq 0x42f0
cmpq $-0x1, %rbx
je 0xfaa7
movq %r15, %rdi
leaq -0x90(%rbp), %rsi
callq 0x1218a
leaq -0xd0(%rbp), %rbx
movq -0x98(%rbp), %rcx
incq %rcx
movq %rcx, 0x8(%rax)
movq %r15, %rdi
leaq -0x90(%rbp), %rsi
callq 0x1218a
movq %r12, (%rax)
jmp 0xfb08
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x68f6
leaq -0xd0(%rbp), %rbx
movq -0x98(%rbp), %rax
incq %rax
movq %r12, -0x48(%rbp)
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r15, %rdi
movq %r13, %rsi
callq 0x11d22
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xfb08
callq 0x42f0
leaq -0x90(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x41c0
movq %r12, %rax
movq %r12, -0x98(%rbp)
movq 0xdb8c(%rip), %rax      # 0x1d6b8
subq 0xdb7d(%rip), %rax      # 0x1d6b0
incq %r12
sarq $0x3, %rax
movq -0xc0(%rbp), %rcx
addq $0x20, %rcx
cmpq %rax, %r12
movq %rcx, %rax
jb 0xf8ff
movq -0x98(%rbp), %r12
incq %r12
leaq -0x110(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x68f6
leaq -0x68(%rbp), %rdi
leaq -0x120(%rbp), %rdx
movq %r15, %rsi
callq 0xffe0
movq -0x50(%rbp), %rbx
movq -0x120(%rbp), %rdi
cmpq %r14, %rdi
je 0xfbab
callq 0x42f0
cmpq $-0x1, %rbx
je 0xfbed
leaq -0x90(%rbp), %rsi
movq %r15, %rdi
callq 0x1218a
movq %r12, 0x8(%rax)
movq 0xdaed(%rip), %rbx      # 0x1d6b8
movq 0xdade(%rip), %r14      # 0x1d6b0
leaq -0x90(%rbp), %rsi
movq %r15, %rdi
callq 0x1218a
subq %r14, %rbx
sarq $0x3, %rbx
movq %rbx, (%rax)
jmp 0xfc50
movq 0xdac4(%rip), %rbx      # 0x1d6b8
movq 0xdab5(%rip), %r14      # 0x1d6b0
leaq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
movq %rax, (%rdi)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
callq 0x68f6
subq %r14, %rbx
sarq $0x3, %rbx
leaq -0x68(%rbp), %rsi
movq %rbx, 0x20(%rsi)
movq %r12, 0x28(%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rsi)
movq %r15, %rdi
callq 0x11d22
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xfc50
callq 0x42f0
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfc65
callq 0x42f0
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfc77
callq 0x42f0
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xfcb9
jmp 0xfd15
movq %rax, %rbx
movq -0x120(%rbp), %rdi
jmp 0xfca8
jmp 0xfd15
movq %rax, %rbx
movq -0x140(%rbp), %rdi
cmpq %r14, %rdi
jne 0xfd09
jmp 0xfd18
jmp 0xfd15
jmp 0xfd10
jmp 0xfce6
jmp 0xfd10
jmp 0xfd15
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
jmp 0xfcd9
jmp 0xfd15
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
jne 0xfd09
jmp 0xfd18
jmp 0xfd15
jmp 0xfd10
jmp 0xfd10
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
jmp 0xfd23
jmp 0xfd15
jmp 0xfd15
movq %rbx, %rcx
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
cmpq %rcx, %rdi
je 0xfd18
callq 0x42f0
jmp 0xfd18
movq %rax, %rbx
jmp 0xfd2d
movq %rax, %rbx
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfd2d
callq 0x42f0
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfd3f
callq 0x42f0
movq %rbx, %rdi
callq 0x4590
nop