// File: /workspace/github_c_makefile_star2_O3/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 $0x1198, %rsp           # imm = 0x1198
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x3de8(%rip), %rdi      # 0x18338
callq 0x30a0
movl $0x10000000, %edi       # imm = 0x10000000
callq 0x3340
movq %rax, %r14
movl 0x4a0c0(%rip), %edx     # 0x5e628
shlq $0x3, %rdx
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3210
cmpb $0x0, (%r12)
leaq 0x3dcd(%rip), %rdx      # 0x18354
cmovneq %r12, %rdx
leaq 0x3bc2(%rip), %rsi      # 0x18154
leaq 0x90(%rsp), %r12
movq %r12, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x3430
leaq 0x2860(%rip), %rsi      # 0x16e0e
movq %r12, %rdi
callq 0x3390
testq %rax, %rax
je 0x14951
movq %rax, %r15
movq %rax, %rdi
callq 0x32d0
testl %eax, %eax
jne 0x1490d
movq $0x0, 0x30(%rsp)
leaq 0x190(%rsp), %rbp
movq %r15, 0x38(%rsp)
movq %r14, 0x10(%rsp)
movq %r14, %r13
xorl %r12d, %r12d
movq %rbp, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
callq 0x3290
testq %rax, %rax
je 0x14662
movq %r13, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
callq 0x3290
testq %rax, %rax
je 0x14662
movq %rbp, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
callq 0x3290
testq %rax, %rax
je 0x14662
movq %rbp, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
callq 0x3290
testq %rax, %rax
je 0x14662
incq %r12
addq $0x1000, %r13           # imm = 0x1000
cmpq $0x10000, %r12          # imm = 0x10000
jne 0x145f3
movl $0x10000, %r12d         # imm = 0x10000
jmp 0x1466b
testq %r12, %r12
je 0x148f0
movq 0x49fc6(%rip), %r11     # 0x5e638
movl 0x49fbb(%rip), %r10d    # 0x5e634
movl 0x49fc1(%rip), %ebx     # 0x5e640
movq 0x49fc2(%rip), %rax     # 0x5e648
movq %rax, 0x88(%rsp)
movl 0x49f8c(%rip), %eax     # 0x5e620
leal (%rax,%rax), %ecx
movq 0x49fba(%rip), %rdx     # 0x5e658
movq %rdx, 0x78(%rsp)
movl 0x49fb7(%rip), %edx     # 0x5e660
movl %edx, 0x2c(%rsp)
movq $-0x1, %rdx
movq %rcx, 0x80(%rsp)
shlq %cl, %rdx
movq 0x49f8a(%rip), %rcx     # 0x5e650
movq %rcx, 0x68(%rsp)
notq %rdx
movq %rdx, 0x70(%rsp)
leal (%rbx,%rbx), %ecx
shll $0x2, %eax
subl %eax, %ecx
movq %rcx, 0x60(%rsp)
movl 0x49f3e(%rip), %eax     # 0x5e624
shll $0x2, %eax
movq %rax, 0x58(%rsp)
movl 0x49f33(%rip), %r15d    # 0x5e628
leal -0x1(%r15), %eax
movq %rax, 0x48(%rsp)
movl 0x49f28(%rip), %eax     # 0x5e62c
movl %eax, 0x28(%rsp)
movl %r12d, %eax
movq %rax, 0x40(%rsp)
xorl %r9d, %r9d
leaq 0x33e6(%rip), %r8       # 0x17b00
movq %r11, 0x20(%rsp)
movq %rbx, 0x8(%rsp)
movq %r9, 0x50(%rsp)
shlq $0xc, %r9
movb (%r14,%r9), %cl
cmpb $0xa, %cl
jne 0x1474a
movq 0x50(%rsp), %r9
incq %r9
cmpq 0x40(%rsp), %r9
jne 0x14724
jmp 0x148f0
movl $0x1, %eax
xorl %edi, %edi
xorl %ebp, %ebp
xorl %r12d, %r12d
movsbq %cl, %rcx
movslq (%r8,%rcx,4), %rdx
cmpq $-0x1, %rdx
je 0x14865
shlq $0x2, %r12
orq %rdx, %r12
andq %r11, %r12
movq %rbp, %rsi
shrq $0x2, %rsi
xorq $0x3, %rdx
movl %r10d, %ecx
shlq %cl, %rdx
movq %rdx, %rbp
addq %rsi, %rbp
leal 0x1(%rax), %r13d
cmpl %ebx, %eax
jl 0x1486b
movq %r10, %rbx
cmpq %rbp, %r12
movq %rbp, %r10
cmovbq %r12, %r10
movq 0x88(%rsp), %rax
andq %r10, %rax
movq 0x80(%rsp), %rcx
shrq %cl, %rax
movl %eax, %eax
movq 0x78(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
cmpl 0x2c(%rsp), %eax
jae 0x1485b
movq 0x68(%rsp), %rdx
andq %r10, %rdx
andq 0x70(%rsp), %r10
movq 0x60(%rsp), %rcx
shlq %cl, %r10
addq %rdx, %r10
movq 0x58(%rsp), %rcx
shrq %cl, %r10
testq %r15, %r15
je 0x1485b
addq %rax, %r10
movq %r10, %rax
xorl %edx, %edx
divq %r15
movq %rdx, %rcx
movq %r10, %rax
xorl %edx, %edx
divq 0x48(%rsp)
movq %rdx, %r11
incq %r11
movq %r15, %r8
xorl %esi, %esi
movq %r11, %rax
imulq %rsi, %rax
addq %rcx, %rax
xorl %edx, %edx
divq %r15
movq 0x18(%rsp), %rax
movq (%rax,%rdx,8), %r14
testq %r14, %r14
je 0x14887
movq %r14, %rax
shrq $0x10, %rax
cmpq %r10, %rax
je 0x148c4
incq %rsi
decq %r8
jne 0x14815
movq 0x10(%rsp), %r14
leaq 0x32aa(%rip), %r8       # 0x17b00
movq 0x20(%rsp), %r11
movq %rbx, %r10
movq 0x8(%rsp), %rbx
jmp 0x1486b
movl $0x1, %r13d
leaq (%r14,%r9), %rax
movb 0x1(%rdi,%rax), %cl
incq %rdi
movl %r13d, %eax
cmpb $0xa, %cl
jne 0x14756
jmp 0x14736
shlq $0x10, %r10
incq %r10
movq 0x18(%rsp), %rax
movq %r10, (%rax,%rdx,8)
movq 0x30(%rsp), %rax
incl %eax
movq %rax, 0x30(%rsp)
cmpl 0x28(%rsp), %eax
movq 0x10(%rsp), %r14
leaq 0x324d(%rip), %r8       # 0x17b00
movq 0x20(%rsp), %r11
movq %rbx, %r10
movq 0x8(%rsp), %rbx
jbe 0x1486b
jmp 0x14934
cmpw $-0x1, %r14w
leaq 0x3230(%rip), %r8       # 0x17b00
movq 0x20(%rsp), %r11
movq %rbx, %r10
je 0x148e6
incq %r14
movq 0x18(%rsp), %rax
movq %r14, (%rax,%rdx,8)
movq 0x10(%rsp), %r14
jmp 0x1485e
movq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x32d0
testl %eax, %eax
leaq 0x190(%rsp), %rbp
je 0x145ed
movq %r15, %rdi
callq 0x31a0
movq %r14, %rdi
callq 0x3040
movq 0x18(%rsp), %rax
addq $0x1198, %rsp           # imm = 0x1198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl (%rax), %edi
movl 0x49cd7(%rip), %edx     # 0x5e618
incl %edx
leaq 0x38f4(%rip), %rsi      # 0x1823e
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0x39c8(%rip), %rsi      # 0x18327
leaq 0x90(%rsp), %rdx
xorl %eax, %eax
callq 0x3330