// File: /workspace/github_c_makefile_star2_O1/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 $0x11a8, %rsp           # imm = 0x11A8
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x4713(%rip), %rdi      # 0x18308
callq 0x30a0
movl $0x10000000, %edi       # imm = 0x10000000
callq 0x3340
movq %rax, %r14
movl 0x4aa1b(%rip), %edx     # 0x5e628
shlq $0x3, %rdx
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3210
cmpb $0x0, (%r12)
leaq 0x46f8(%rip), %rdx      # 0x18324
cmovneq %r12, %rdx
leaq 0x44ed(%rip), %rsi      # 0x18124
leaq 0xa0(%rsp), %r12
movq %r12, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x3430
leaq 0x316b(%rip), %rsi      # 0x16dbe
movq %r12, %rdi
callq 0x3390
testq %rax, %rax
je 0x13ff3
movq %rax, %rbx
movq %rax, %rdi
callq 0x32d0
testl %eax, %eax
jne 0x13faf
xorl %ebp, %ebp
leaq 0x1a0(%rsp), %r12
movq %r14, 0x28(%rsp)
movq %rbx, 0x40(%rsp)
movq %r14, %r13
xorl %r15d, %r15d
movq %r12, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdx
callq 0x3290
testq %rax, %rax
je 0x13cfe
movq %r13, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdx
callq 0x3290
testq %rax, %rax
je 0x13cfe
movq %r12, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdx
callq 0x3290
testq %rax, %rax
je 0x13cfe
movq %r12, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdx
callq 0x3290
testq %rax, %rax
je 0x13cfe
incq %r15
addq $0x1000, %r13           # imm = 0x1000
cmpq $0x10000, %r15          # imm = 0x10000
jne 0x13c91
movl $0x10000, %r15d         # imm = 0x10000
testl %r15d, %r15d
je 0x13f92
movq 0x4a92a(%rip), %r8      # 0x5e638
movl 0x4a91f(%rip), %r11d    # 0x5e634
movl 0x4a924(%rip), %r10d    # 0x5e640
movq 0x4a925(%rip), %rax     # 0x5e648
movq %rax, 0x90(%rsp)
movl 0x4a8ef(%rip), %eax     # 0x5e620
leal (%rax,%rax), %ecx
movq 0x4a91d(%rip), %rdx     # 0x5e658
movq %rdx, 0x80(%rsp)
movl 0x4a917(%rip), %edx     # 0x5e660
movl %edx, 0x20(%rsp)
movq $-0x1, %rdx
movq %rcx, 0x88(%rsp)
shlq %cl, %rdx
movq 0x4a8ea(%rip), %rcx     # 0x5e650
movq %rcx, 0x70(%rsp)
notq %rdx
movq %rdx, 0x78(%rsp)
leal (%r10,%r10), %ecx
shll $0x2, %eax
subl %eax, %ecx
movq %rcx, 0x68(%rsp)
movl 0x4a89d(%rip), %eax     # 0x5e624
shll $0x2, %eax
movq %rax, 0x60(%rsp)
movl 0x4a892(%rip), %r9d     # 0x5e628
leal -0x1(%r9), %eax
movq %rax, 0x50(%rsp)
movl 0x4a887(%rip), %eax     # 0x5e62c
movl %eax, 0x24(%rsp)
movl %r15d, %eax
movq %rax, 0x48(%rsp)
xorl %eax, %eax
leaq 0x3d16(%rip), %rdi      # 0x17ad0
movq %r8, 0x38(%rsp)
movq %r11, 0x30(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x58(%rsp)
shlq $0xc, %rax
movq %rax, 0x98(%rsp)
movb (%r14,%rax), %cl
cmpb $0xa, %cl
je 0x13f7f
movl $0x1, %eax
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %r13d, %r13d
movsbq %cl, %rcx
movslq (%rdi,%rcx,4), %rdx
cmpq $-0x1, %rdx
je 0x13f55
shlq $0x2, %r13
orq %rdx, %r13
andq %r8, %r13
movq %r15, %rsi
shrq $0x2, %rsi
xorq $0x3, %rdx
movl %r11d, %ecx
shlq %cl, %rdx
movq %rdx, %r15
addq %rsi, %r15
leal 0x1(%rax), %edx
cmpl %r10d, %eax
jl 0x13f61
cmpq %r15, %r13
movq %r15, %r10
cmovbq %r13, %r10
movq 0x90(%rsp), %rax
andq %r10, %rax
movq 0x88(%rsp), %rcx
shrq %cl, %rax
movl %eax, %eax
movq 0x80(%rsp), %rcx
movslq (%rcx,%rax,4), %rax
cmpl 0x20(%rsp), %eax
movq 0x18(%rsp), %rsi
jae 0x13f5c
movl %edx, 0xc(%rsp)
movq 0x70(%rsp), %rdx
andq %r10, %rdx
andq 0x78(%rsp), %r10
movq 0x68(%rsp), %rcx
shlq %cl, %r10
addq %rdx, %r10
movq 0x60(%rsp), %rcx
shrq %cl, %r10
testq %r9, %r9
je 0x13f4a
addq %rax, %r10
movq %r10, %rax
xorl %edx, %edx
divq %r9
movq %rdx, %rcx
movq %r10, %rax
xorl %edx, %edx
divq 0x50(%rsp)
movq %rdx, %r11
incq %r11
movq %r10, %r14
shlq $0x10, %r14
incq %r14
movl $0x1, %r8d
xorl %edi, %edi
movq %r11, %rax
imulq %rdi, %rax
addq %rcx, %rax
xorl %edx, %edx
divq %r9
movq (%rsi,%rdx,8), %rbx
testq %rbx, %rbx
je 0x13f08
movq %rbx, %rsi
shrq $0x10, %rsi
movb $0x1, %al
cmpq %r10, %rsi
jne 0x13f1c
cmpw $-0x1, %bx
movq 0x18(%rsp), %rsi
je 0x13f18
incq %rbx
movq %rbx, (%rsi,%rdx,8)
jmp 0x13f18
movq %r14, (%rsi,%rdx,8)
incl %ebp
cmpl 0x24(%rsp), %ebp
ja 0x13fd6
xorl %eax, %eax
jmp 0x13f21
movq 0x18(%rsp), %rsi
testb %al, %al
je 0x13f34
incq %rdi
leaq 0x1(%r8), %rax
cmpq %r9, %r8
movq %rax, %r8
jb 0x13ece
movq 0x28(%rsp), %r14
leaq 0x3b90(%rip), %rdi      # 0x17ad0
movq 0x38(%rsp), %r8
movq 0x30(%rsp), %r11
movq 0x10(%rsp), %r10
movl 0xc(%rsp), %edx
jmp 0x13f61
movl $0x1, %edx
jmp 0x13f61
movq 0x10(%rsp), %r10
movq 0x98(%rsp), %rax
addq %r14, %rax
movb 0x1(%r12,%rax), %cl
incq %r12
movl %edx, %eax
cmpb $0xa, %cl
jne 0x13df5
movq 0x58(%rsp), %rax
incq %rax
cmpq 0x48(%rsp), %rax
jne 0x13dc9
movq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x32d0
testl %eax, %eax
leaq 0x1a0(%rsp), %r12
je 0x13c8b
movq %rbx, %rdi
callq 0x31a0
movq %r14, %rdi
callq 0x3040
movq 0x18(%rsp), %rax
addq $0x11a8, %rsp           # imm = 0x11A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl (%rax), %edi
movl 0x4a635(%rip), %edx     # 0x5e618
incl %edx
leaq 0x4222(%rip), %rsi      # 0x1820e
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0x42f6(%rip), %rsi      # 0x182f7
leaq 0xa0(%rsp), %rdx
xorl %eax, %eax
callq 0x3330