// File: /workspace/github_cpp_makefile_star2_O2/afinit[P]afin/readlist.cpp
// Function: Readlist::add_reads(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Readlist::add_reads( string readsfiles ){
  stringstream ss;
  ss.str( readsfiles );
  string filename;
  string buffer("");
  string line("");
  char log_buff[1000];
  int line_count = 0;
  FileIO* read = NULL; 

  while( getline( ss, filename, ',' )){
    Log::Inst()->log_it( "readfile: " + filename );

    if( filename.rfind( ".gz" ) == filename.length() - 3 ){
      read = new Gzip( filename );
    }
    else{
      read = new IO_Wrapper( filename );
    }

    // check what type of file it is
    if( (line = read->getline()) != "" ){
      if( line[0] == '@' ){
        // read in fastq reads
        do{
          line_count++;
          if( line[0] == '@' ){
            if( (line = read->getline()) != "" ){
              line_count++;
              if( !homopolymer_check( line ) ){
                if( line.length() > max_sort_char ){
                  rlist.push_back( line );
                }
              }
              if( ( line = read->getline()) != "" ){
                line_count++;
                if( line[0] == '+'){
                  if( ( line = read->getline()) != "" ){
                    line_count++;
                    continue;
                  }
                  else{
                    sprintf( log_buff, "Error reading fastq file. Scoring line missing. Line_num: %d Line: %s", line_count, line.c_str() );
                    Log::Inst()->log_it( log_buff );
                    fprintf( stderr, "Error reading fastq file. Scoring line missing. Line_num: %d Line: %s\n", line_count, line.c_str() );
                    break;
                  }   
                }   
                else{
                  sprintf( log_buff, "Error reading fastq file. '+' expected at this line. Line_num: %d Line: %s", line_count, line.c_str() );
                  Log::Inst()->log_it( log_buff );
                  fprintf( stderr, "Error reading fastq file. '+' expected at this line. Line_num: %d Line: %s\n", line_count, line.c_str() );
                  break;
                }   
              }   
              else{
                sprintf( log_buff, "Error reading fastq file. Line missing. Should start with '+'. Line_num: %d Line: %s", line_count, line.c_str() );
                Log::Inst()->log_it( log_buff );
                fprintf( stderr, "Error reading fastq file. Line missing. Should start with '+'. Line_num: %d Line: %s\n", line_count, line.c_str() );
                break;
              }   
            }   
            else{
              sprintf( log_buff, "Error reading fastq file. Sequence line missing. Line_num: %d Line: %s", line_count, line.c_str() );
              Log::Inst()->log_it( log_buff );
              fprintf( stderr, "Error reading fastq file. Sequence line missing. Line_num: %d Line: %s\n", line_count, line.c_str() );
              break;
            }   
          }   
          else{  
            sprintf( log_buff, "Error reading fastq file. '@' expected at the beginning of this line. Line_num: %d Line: %s", line_count, line.c_str() );
            Log::Inst()->log_it( log_buff );
            fprintf( stderr, "Error reading fastq file. '@' expected at the beginning of this line. Line_num: %d Line: %s\n", line_count, line.c_str() );
            break;
          }
        } while( ( line = read->getline()) != "" );
      }
      else if( line[0] == '>' ){
        // read in reads to vector from fasta file
        do{
          if( line[0] == '>' && buffer.length() != 0 ){
            if( !homopolymer_check( buffer ) ){
              if( buffer.length() > max_sort_char ){
                rlist.push_back( buffer );
              }
            }
            buffer = "";
          }
          else if ( line[0] == '>' ) {
          }
          else{
            buffer += line;
          }
        } while( ( line = read->getline()) != "" );
      }
      else {
        Log::Inst()->log_it( "Error: Unexpected file type. Needs to be fasta or fastq file for input." );
        fprintf( stderr, "Error: Unexpected file type. Needs to be fasta or fastq file for input.\n" );
        break;
      }
    }
  }

  // insert last line into rlist
  if( buffer.length() != 0 ){
    if( !homopolymer_check( buffer ) ){
      if( buffer.length() > max_sort_char ){
        rlist.push_back( buffer );
      }
    }
  }

  if( rlist.size() == 0 ){
    Log::Inst()->log_it( "Error: No reads found in files supplied" );
    fprintf( stderr, "Error: No reads found in files supplied\n" );
    exit(1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x798, %rsp            # imm = 0x798
movq %rsi, %rbx
leaq -0x3d8(%rbp), %rdi
callq 0x4220
leaq -0x3c0(%rbp), %rdi
movq %rbx, %rsi
callq 0x44b0
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x6fb4(%rip), %rsi      # 0x12f4c
leaq -0x70(%rbp), %rdi
leaq -0x7c0(%rbp), %rdx
callq 0x4120
leaq 0x6f9d(%rip), %rsi      # 0x12f4c
leaq -0x50(%rbp), %rdi
leaq -0x7c0(%rbp), %rdx
callq 0x4120
leaq -0xb0(%rbp), %r12
leaq -0x90(%rbp), %rbx
leaq -0x1f0(%rbp), %r14
movl $0x0, -0x2c(%rbp)
leaq -0x3d8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
pushq $0x2c
popq %rdx
callq 0x45d0
leaq -0x250(%rbp), %r15
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xc5e4
callq 0x81fe
movq %rax, %r13
movq %r12, %rdi
leaq 0x7224(%rip), %rsi      # 0x13240
leaq -0xd0(%rbp), %rdx
callq 0xae38
movq %r13, %rdi
movq %r12, %rsi
callq 0x83ae
movq %r12, %rdi
callq 0x4160
leaq -0xd0(%rbp), %rdi
leaq 0x7202(%rip), %rsi      # 0x1324b
pushq $-0x1
popq %rdx
callq 0x4550
movq -0xc8(%rbp), %rcx
addq $-0x3, %rcx
cmpq %rcx, %rax
jne 0xc08a
movl $0xc8, %edi
callq 0x4320
movq %rax, %r13
movq %r15, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4410
movq %r13, %rdi
movq %r15, %rsi
callq 0x852c
jmp 0xc0b6
pushq $0x10
popq %rdi
callq 0x4320
movq %rax, %r13
leaq -0x230(%rbp), %r15
movq %r15, %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4410
movq %r13, %rdi
movq %r15, %rsi
callq 0x8488
movq %r15, %rdi
callq 0x4160
movq (%r13), %rax
movq %rbx, %rdi
movq %r13, %rsi
callq *(%rax)
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x4390
movq %rax, %rdi
leaq 0x6e6c(%rip), %rsi      # 0x12f4c
callq 0x51f1
movl %eax, %r12d
movq %rbx, %rdi
callq 0x4160
testb %r12b, %r12b
leaq -0xb0(%rbp), %r12
je 0xbfdb
movq -0x50(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x40, %eax
je 0xc1de
cmpl $0x3e, %eax
jne 0xc58b
movq -0x50(%rbp), %rax
cmpb $0x3e, (%rax)
jne 0xc18a
cmpq $0x0, -0x68(%rbp)
je 0xc197
leaq -0x150(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4410
leaq -0x150(%rbp), %r15
movq %r15, %rsi
callq 0xcf72
movl %eax, %r12d
movq %r15, %rdi
callq 0x4160
testb %r12b, %r12b
jne 0xc178
leaq 0xf4c5(%rip), %rax      # 0x1b624
movslq (%rax), %rax
cmpq %rax, -0x68(%rbp)
jbe 0xc178
leaq 0xf539(%rip), %rdi      # 0x1b6a8
leaq -0x70(%rbp), %rsi
callq 0xd302
leaq -0x70(%rbp), %rdi
leaq 0x6dc9(%rip), %rsi      # 0x12f4c
callq 0x4600
jmp 0xc197
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4630
movq (%r13), %rax
movq %rbx, %rdi
movq %r13, %rsi
callq *(%rax)
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x4390
movq %rax, %rdi
leaq 0x6d93(%rip), %rsi      # 0x12f4c
callq 0x51f1
movl %eax, %r12d
movq %rbx, %rdi
callq 0x4160
testb %r12b, %r12b
leaq -0xb0(%rbp), %r12
jne 0xc119
jmp 0xbfdb
movq -0x50(%rbp), %rcx
cmpb $0x40, (%rcx)
jne 0xc350
movq (%r13), %rax
movq %rbx, %rdi
movq %r13, %rsi
callq *(%rax)
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x4390
movq %rax, %rdi
leaq 0x6d3f(%rip), %rsi      # 0x12f4c
callq 0x51f1
movl %eax, %r12d
movq %rbx, %rdi
callq 0x4160
testb %r12b, %r12b
je 0xc3bb
leaq -0x210(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4410
movq %r14, %r15
leaq -0x210(%rbp), %r14
movq %r14, %rsi
callq 0xcf72
movl %eax, %r12d
movq %r14, %rdi
movq %r15, %r14
callq 0x4160
testb %r12b, %r12b
jne 0xc27b
leaq 0xf3c2(%rip), %rax      # 0x1b624
movslq (%rax), %rax
cmpq %rax, -0x48(%rbp)
jbe 0xc27b
leaq 0xf436(%rip), %rdi      # 0x1b6a8
leaq -0x50(%rbp), %rsi
callq 0xd302
movq (%r13), %rax
movq %rbx, %rdi
movq %r13, %rsi
callq *(%rax)
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x4390
movq %rax, %rdi
leaq 0x6caf(%rip), %rsi      # 0x12f4c
callq 0x51f1
movl %eax, %r12d
movq %rbx, %rdi
callq 0x4160
testb %r12b, %r12b
je 0xc431
movq -0x50(%rbp), %rcx
cmpb $0x2b, (%rcx)
leaq -0xb0(%rbp), %r12
jne 0xc4a8
movq (%r13), %rax
movq %rbx, %rdi
movq %r13, %rsi
callq *(%rax)
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x4390
movq %rax, %rdi
leaq 0x6c60(%rip), %rsi      # 0x12f4c
callq 0x51f1
movl %eax, %r12d
movq %rbx, %rdi
callq 0x4160
testb %r12b, %r12b
je 0xc511
movq (%r13), %rax
movq %rbx, %rdi
movq %r13, %rsi
callq *(%rax)
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x4390
movq %rax, %rdi
leaq 0x6c25(%rip), %rsi      # 0x12f4c
callq 0x51f1
movl %eax, %r12d
movq %rbx, %rdi
callq 0x4160
addl $0x4, -0x2c(%rbp)
testb %r12b, %r12b
leaq -0xb0(%rbp), %r12
jne 0xc1de
jmp 0xbfdb
movl -0x2c(%rbp), %edx
incl %edx
leaq -0x7c0(%rbp), %rdi
leaq 0x714a(%rip), %rsi      # 0x134ad
movl %edx, -0x2c(%rbp)
xorl %eax, %eax
callq 0x4070
callq 0x81fe
movq %rax, %r13
leaq -0x170(%rbp), %r15
movq %r15, %rdi
leaq -0x7c0(%rbp), %rsi
movq %rbx, %rdx
callq 0x4120
movq %r13, %rdi
movq %r15, %rsi
callq 0x83ae
movq %r15, %rdi
callq 0x4160
movq 0xec20(%rip), %rax      # 0x1afc8
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
leaq 0x7153(%rip), %rsi      # 0x13509
jmp 0xc57c
movl -0x2c(%rbp), %edx
incl %edx
movq -0x50(%rbp), %rcx
leaq -0x7c0(%rbp), %rdi
leaq 0x704c(%rip), %rsi      # 0x1341e
movl %edx, -0x2c(%rbp)
xorl %eax, %eax
callq 0x4070
callq 0x81fe
leaq -0xb0(%rbp), %r12
movq %rax, %r13
leaq -0x190(%rbp), %r15
movq %r15, %rdi
leaq -0x7c0(%rbp), %rsi
movq %rbx, %rdx
callq 0x4120
movq %r13, %rdi
movq %r15, %rsi
callq 0x83ae
movq %r15, %rdi
callq 0x4160
movq 0xebaa(%rip), %rax      # 0x1afc8
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
leaq 0x7039(%rip), %rsi      # 0x13465
jmp 0xc57c
movl -0x2c(%rbp), %edx
addl $0x2, %edx
movq -0x50(%rbp), %rcx
leaq -0x7c0(%rbp), %rdi
leaq 0x6f2a(%rip), %rsi      # 0x13373
movl %edx, -0x2c(%rbp)
xorl %eax, %eax
callq 0x4070
callq 0x81fe
leaq -0xb0(%rbp), %r12
movq %rax, %r13
leaq -0x1b0(%rbp), %r15
movq %r15, %rdi
leaq -0x7c0(%rbp), %rsi
movq %rbx, %rdx
callq 0x4120
movq %r13, %rdi
movq %r15, %rsi
callq 0x83ae
movq %r15, %rdi
callq 0x4160
movq 0xeb33(%rip), %rax      # 0x1afc8
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
leaq 0x6f25(%rip), %rsi      # 0x133c8
jmp 0xc57c
movl -0x2c(%rbp), %edx
addl $0x3, %edx
leaq -0x7c0(%rbp), %rdi
leaq 0x6e20(%rip), %rsi      # 0x132dc
movl %edx, -0x2c(%rbp)
xorl %eax, %eax
callq 0x4070
callq 0x81fe
movq %rax, %r13
leaq -0x1d0(%rbp), %r15
movq %r15, %rdi
leaq -0x7c0(%rbp), %rsi
movq %rbx, %rdx
callq 0x4120
movq %r13, %rdi
movq %r15, %rsi
callq 0x83ae
movq %r15, %rdi
callq 0x4160
movq 0xeac7(%rip), %rax      # 0x1afc8
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
leaq 0x6e18(%rip), %rsi      # 0x13327
jmp 0xc57c
movl -0x2c(%rbp), %edx
addl $0x3, %edx
movq -0x50(%rbp), %rcx
leaq -0x7c0(%rbp), %rdi
leaq 0x6d26(%rip), %rsi      # 0x1324f
movl %edx, -0x2c(%rbp)
xorl %eax, %eax
callq 0x4070
callq 0x81fe
leaq -0xb0(%rbp), %r12
movq %rax, %r13
movq %r14, %rdi
leaq -0x7c0(%rbp), %rsi
movq %rbx, %rdx
callq 0x4120
movq %r13, %rdi
movq %r14, %rsi
callq 0x83ae
movq %r14, %rdi
callq 0x4160
movq 0xea5a(%rip), %rax      # 0x1afc8
movq (%rax), %rdi
movq -0x50(%rbp), %rcx
leaq 0x6d19(%rip), %rsi      # 0x13295
movl -0x2c(%rbp), %edx
xorl %eax, %eax
callq 0x4450
jmp 0xbfdb
callq 0x81fe
movq %rax, %rbx
leaq 0x6fcc(%rip), %rsi      # 0x13566
leaq -0x110(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x4120
leaq -0x110(%rbp), %rsi
movq %rbx, %rdi
callq 0x83ae
leaq -0x110(%rbp), %rdi
callq 0x4160
movq 0xe9f9(%rip), %rax      # 0x1afc8
movq (%rax), %rcx
leaq 0x6fd5(%rip), %rdi      # 0x135ae
pushq $0x48
popq %rsi
pushq $0x1
popq %rdx
callq 0x4620
cmpq $0x0, -0x68(%rbp)
je 0xc63a
leaq -0x130(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x4410
leaq -0x130(%rbp), %rbx
movq %rbx, %rsi
callq 0xcf72
movl %eax, %r14d
movq %rbx, %rdi
callq 0x4160
testb %r14b, %r14b
jne 0xc63a
leaq 0xf003(%rip), %rax      # 0x1b624
movslq (%rax), %rax
cmpq %rax, -0x68(%rbp)
jbe 0xc63a
leaq 0xf077(%rip), %rdi      # 0x1b6a8
leaq -0x70(%rbp), %rsi
callq 0xd302
movq 0xf06f(%rip), %rax      # 0x1b6b0
cmpq 0xf060(%rip), %rax      # 0x1b6a8
je 0xc686
leaq -0x50(%rbp), %rdi
callq 0x4160
leaq -0x70(%rbp), %rdi
callq 0x4160
leaq -0xd0(%rbp), %rdi
callq 0x4160
leaq -0x3d8(%rbp), %rdi
callq 0x4250
addq $0x798, %rsp            # imm = 0x798
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x81fe
movq %rax, %rbx
leaq 0x6f62(%rip), %rsi      # 0x135f7
leaq -0xf0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x4120
leaq -0xf0(%rbp), %rsi
movq %rbx, %rdi
callq 0x83ae
leaq -0xf0(%rbp), %rdi
callq 0x4160
movq 0xe8fe(%rip), %rax      # 0x1afc8
movq (%rax), %rcx
leaq 0x6f4b(%rip), %rdi      # 0x1361f
pushq $0x28
popq %rsi
pushq $0x1
popq %rdx
callq 0x4620
pushq $0x1
popq %rdi
callq 0x4380
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
jmp 0xc7d8
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
jmp 0xc7d8
jmp 0xc7e1
jmp 0xc7e1
movq %rax, %rbx
jmp 0xc7ed
movq %rax, %rbx
jmp 0xc7f6
movq %rax, %rbx
jmp 0xc802
jmp 0xc7e1
movq %rax, %rbx
leaq -0x1f0(%rbp), %rdi
jmp 0xc7d8
jmp 0xc7e1
jmp 0xc7e1
movq %rax, %rbx
leaq -0x1d0(%rbp), %rdi
jmp 0xc7d8
movq %rax, %rbx
leaq -0x1b0(%rbp), %rdi
jmp 0xc7d8
jmp 0xc7e1
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
jmp 0xc7d8
jmp 0xc7e1
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
jmp 0xc7d8
jmp 0xc7e1
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
jmp 0xc79b
jmp 0xc78c
movq %rax, %rbx
jmp 0xc7a0
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x4160
movq %r13, %rdi
callq 0x42f0
jmp 0xc7e4
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
jmp 0xc7d8
jmp 0xc7e1
jmp 0xc7ce
jmp 0xc7e1
jmp 0xc7ce
jmp 0xc7e1
jmp 0xc7e1
jmp 0xc7ce
jmp 0xc7ce
jmp 0xc7e1
jmp 0xc7ce
jmp 0xc7e1
jmp 0xc7e1
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x4160
jmp 0xc7e4
jmp 0xc7e1
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x4160
leaq -0x70(%rbp), %rdi
callq 0x4160
leaq -0xd0(%rbp), %rdi
callq 0x4160
leaq -0x3d8(%rbp), %rdi
callq 0x4250
movq %rbx, %rdi
callq 0x4590