// File: /workspace/github_c_makefile_star2_O2/yhg926[P]public_kssd/iseq2comem.c
// Function: mt_shortreads2koc
llong * mt_shortreads2koc (char* seqfname, llong *co, char *pipecmd,int p){
printf("running mt_shortreads2koc()\n");
char (*fq_buff)[FQ_LEN] = malloc( THREAD_MAX * FQ_LEN );
char tmp[FQ_LEN];
int l;
unsigned int keycount =0 ;
  memset(co,0LLU,hashsize*sizeof(llong));
 FILE *infp;
  char fq_fname[PATHLEN];
  if(pipecmd[0] != '\0') sprintf(fq_fname,"%s %s",pipecmd,seqfname);
 else sprintf(fq_fname,"%s %s",gzpipe_cmd,seqfname);
  if( (infp=popen(fq_fname,"r")) == NULL ) err(errno,"mtfastq2koc():%s",fq_fname);
 while (!feof(infp)){
  for (l = 0; l < THREAD_MAX && fgets(tmp,FQ_LEN,infp) && fgets(fq_buff[l],FQ_LEN,infp) && fgets(tmp,FQ_LEN,infp) && fgets(tmp,FQ_LEN,infp); l++) ;
#pragma omp parallel for num_threads(p) schedule(guided)
  for (int t = 0 ; t < l ; t++ ){
   int base = 1; char ch;
      llong tuple = 0LLU;
      llong crvstuple = 0LLU;
      llong unituple = 0LLU;
   for(int pos = 0; (ch = fq_buff[t][pos]) != '\n'; pos++){
    int basenum = Basemap[(int)ch];
    if(basenum != DEFAULT ){
     tuple = ( ( tuple<< 2 ) | (llong)basenum ) & tupmask ;
     crvstuple = ( crvstuple >> 2 ) + (((llong)basenum^3LLU) << crvsaddmove);
     base++;
    }else{ base = 1;continue;}
    if( base > TL ){
         unituple = tuple < crvstuple ? tuple:crvstuple;
        unsigned int dim_tup = ((unituple & domask) >> ( (half_outctx_len)*2 ) ) ;
     llong pfilter = dim_shuf_arr[dim_tup];
     if( ( pfilter >= dim_end) || (pfilter < dim_start ) ) continue;
     pfilter = pfilter - dim_start;
     llong drtuple = ( ( (unituple & undomask)
      + ( ( unituple & ( ( 1LLU<< ( half_outctx_len*2) ) - 1)) << (TL*2 - half_outctx_len*4) ) )
      >> ( drlevel*4 ) )
      + pfilter ;
     for(unsigned int i=0;i<hashsize;i++){
      unsigned int n = HASH(drtuple, i, hashsize);
      if (co[n] == 0LLU){
#pragma omp atomic write
      co[n] = (drtuple << OCCRC_BIT) + 1LLU ;
#pragma omp atomic
       keycount++;
       if( keycount > hashlimit )
         err(errno,"the context space is too crowd, try rerun the program using -k%d", half_ctx_len + 1);
       break;
      }else if ( ( co[n] >> OCCRC_BIT ) == drtuple ) {
       if( (co[n] & OCCRC_MAX) < OCCRC_MAX )
#pragma omp atomic
         co[n]+=1LLU;
        break ;
      }
     }
    }
   }
  }
 }
 pclose(infp);
 free(fq_buff);
 return co;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1188, %rsp           # imm = 0x1188
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x455a(%rip), %rdi      # 0x172e8
callq 0x30a0
movl $0x10000000, %edi       # imm = 0x10000000
callq 0x3340
movq %rax, %r14
movl 0x4a882(%rip), %edx     # 0x5d628
shlq $0x3, %rdx
movq $0x0, 0x10(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3210
cmpb $0x0, (%r12)
leaq 0x453b(%rip), %rdx      # 0x17304
cmovneq %r12, %rdx
leaq 0x4330(%rip), %rsi      # 0x17104
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x3430
leaq 0x2fce(%rip), %rsi      # 0x15dbe
movq %r12, %rdi
callq 0x3390
testq %rax, %rax
je 0x1310c
movq %rax, %r15
leaq 0x180(%rsp), %r12
movq %rax, 0x18(%rsp)
movq %r15, %rdi
callq 0x32d0
testl %eax, %eax
jne 0x130ca
movq %r14, %r13
xorl %ebp, %ebp
cmpq $0x10000, %rbp          # imm = 0x10000
je 0x12e8f
movq %r12, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
callq 0x3290
testq %rax, %rax
je 0x12e8f
movq %r13, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
callq 0x3290
testq %rax, %rax
je 0x12e8f
movq %r12, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
callq 0x3290
testq %rax, %rax
je 0x12e8f
movq %r12, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
callq 0x3290
testq %rax, %rax
je 0x12e8f
incq %rbp
addq $0x1000, %r13           # imm = 0x1000
jmp 0x12e26
movq %rbp, 0x20(%rsp)
movq 0x4a79d(%rip), %rax     # 0x5d638
movq %rax, 0x78(%rsp)
movl 0x4a78e(%rip), %eax     # 0x5d634
movq %rax, 0x70(%rsp)
movl 0x4a78f(%rip), %edx     # 0x5d640
movq 0x4a790(%rip), %rax     # 0x5d648
movq %rax, 0x60(%rsp)
movl 0x4a75d(%rip), %eax     # 0x5d620
leal (%rax,%rax), %esi
movq 0x4a78b(%rip), %rcx     # 0x5d658
movq %rcx, 0x50(%rsp)
movl 0x4a788(%rip), %ecx     # 0x5d660
movl %ecx, 0xc(%rsp)
pushq $-0x1
popq %rdi
movq %rsi, 0x58(%rsp)
movl %esi, %ecx
shlq %cl, %rdi
movq 0x4a760(%rip), %rcx     # 0x5d650
movq %rcx, 0x40(%rsp)
notq %rdi
movq %rdi, 0x48(%rsp)
movq %rdx, 0x68(%rsp)
leal (%rdx,%rdx), %ecx
shll $0x2, %eax
subl %eax, %ecx
movq %rcx, 0x38(%rsp)
movl 0x4a70f(%rip), %eax     # 0x5d624
shll $0x2, %eax
movq %rax, 0x30(%rsp)
movl 0x4a705(%rip), %ebp     # 0x5d628
leal -0x1(%rbp), %r12d
movl 0x4a6ff(%rip), %eax     # 0x5d62c
movl %eax, 0x8(%rsp)
leaq 0x1(%rbp), %rax
movq %rax, 0x28(%rsp)
xorl %r8d, %r8d
pushq $0x1
popq %r13
leaq 0x3b68(%rip), %r10      # 0x16ab0
cmpq %r8, 0x20(%rsp)
je 0x130b8
xorl %r9d, %r9d
movl %r13d, %eax
xorl %edi, %edi
xorl %r15d, %r15d
movq %r8, %rcx
shlq $0xc, %rcx
addq %r14, %rcx
movsbq (%r9,%rcx), %rcx
cmpq $0xa, %rcx
je 0x130b0
movslq (%r10,%rcx,4), %rdx
cmpq $-0x1, %rdx
je 0x1306b
shlq $0x2, %rdi
orq %rdx, %rdi
andq 0x78(%rsp), %rdi
movq %r15, %rsi
shrq $0x2, %rsi
xorq $0x3, %rdx
movq 0x70(%rsp), %rcx
shlq %cl, %rdx
movq %rdx, %r15
addq %rsi, %r15
leal 0x1(%rax), %r11d
cmpl 0x68(%rsp), %eax
jl 0x1307b
cmpq %r15, %rdi
movq %r15, %r10
cmovbq %rdi, %r10
movq 0x60(%rsp), %rax
andq %r10, %rax
movq 0x58(%rsp), %rcx
shrq %cl, %rax
movl %eax, %eax
movq 0x50(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
cmpl 0xc(%rsp), %eax
jae 0x13074
movq 0x40(%rsp), %rdx
andq %r10, %rdx
andq 0x48(%rsp), %r10
movq 0x38(%rsp), %rcx
shlq %cl, %r10
addq %rdx, %r10
movq 0x30(%rsp), %rcx
shrq %cl, %r10
addq %rax, %r10
movq 0x28(%rsp), %r13
xorl %esi, %esi
decq %r13
je 0x13070
movq %r10, %rax
xorl %edx, %edx
divq %rbp
movq %rdx, %rcx
movq %r10, %rax
xorl %edx, %edx
divq %r12
leaq 0x1(%rdx), %rax
imulq %rsi, %rax
addq %rcx, %rax
xorl %edx, %edx
divq %rbp
movq (%rbx,%rdx,8), %rax
testq %rax, %rax
je 0x13086
incq %rsi
movq %rax, %rcx
shrq $0x10, %rcx
cmpq %r10, %rcx
jne 0x13011
cmpw $-0x1, %ax
pushq $0x1
popq %r13
leaq 0x3a50(%rip), %r10      # 0x16ab0
je 0x1307b
incq %rax
movq %rax, (%rbx,%rdx,8)
jmp 0x1307b
movl %r13d, %r11d
jmp 0x1307b
pushq $0x1
popq %r13
leaq 0x3a35(%rip), %r10      # 0x16ab0
incq %r9
movl %r11d, %eax
jmp 0x12f5e
shlq $0x10, %r10
incq %r10
movq %r10, (%rbx,%rdx,8)
movq 0x10(%rsp), %rax
incl %eax
movq %rax, 0x10(%rsp)
cmpl 0x8(%rsp), %eax
pushq $0x1
popq %r13
leaq 0x3a04(%rip), %r10      # 0x16ab0
jbe 0x1307b
jmp 0x130ef
incq %r8
jmp 0x12f48
movq 0x18(%rsp), %r15
leaq 0x180(%rsp), %r12
jmp 0x12e11
movq %r15, %rdi
callq 0x31a0
movq %r14, %rdi
callq 0x3040
movq %rbx, %rax
addq $0x1188, %rsp           # imm = 0x1188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl (%rax), %edi
movl 0x4a51c(%rip), %edx     # 0x5d618
incl %edx
leaq 0x40e9(%rip), %rsi      # 0x171ee
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0x41bd(%rip), %rsi      # 0x172d7
leaq 0x80(%rsp), %rdx
xorl %eax, %eax
callq 0x3330