// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x11b0, %rsp           # imm = 0x11B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
leaq 0x4bb8(%rip), %rdi      # 0x1f1b9
movb $0x0, %al
callq 0x3150
movl $0x10000000, %edi       # imm = 0x10000000
callq 0x3310
movq %rax, -0x28(%rbp)
movl $0x0, -0x1038(%rbp)
movq -0x10(%rbp), %rdi
movl 0x49ff2(%rip), %eax     # 0x6461c
movl %eax, %edx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x31f0
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x1a662
leaq -0x1140(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rcx
leaq 0x498d(%rip), %rsi      # 0x1efe6
movb $0x0, %al
callq 0x3400
jmp 0x1a682
leaq -0x1140(%rbp), %rdi
movq -0x8(%rbp), %rcx
leaq 0x4972(%rip), %rsi      # 0x1efe6
leaq 0x4b6c(%rip), %rdx      # 0x1f1e7
movb $0x0, %al
callq 0x3400
leaq -0x1140(%rbp), %rdi
leaq 0x3648(%rip), %rsi      # 0x1dcd8
callq 0x3360
movq %rax, -0x1040(%rbp)
cmpq $0x0, %rax
jne 0x1a6be
callq 0x3050
movl (%rax), %edi
leaq -0x1140(%rbp), %rdx
leaq 0x4b1f(%rip), %rsi      # 0x1f1d6
movb $0x0, %al
callq 0x3300
jmp 0x1a6c0
movq -0x1040(%rbp), %rdi
callq 0x32a0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1a6dd
jmp 0x1ab96
movl $0x0, -0x1034(%rbp)
xorl %eax, %eax
cmpl $0x10000, -0x1034(%rbp) # imm = 0x10000
movb %al, -0x1191(%rbp)
jge 0x1a7ae
leaq -0x1030(%rbp), %rdi
movq -0x1040(%rbp), %rdx
movl $0x1000, %esi           # imm = 0x1000
callq 0x3260
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x1191(%rbp)
je 0x1a7ae
movq -0x28(%rbp), %rdi
movslq -0x1034(%rbp), %rax
shlq $0xc, %rax
addq %rax, %rdi
movq -0x1040(%rbp), %rdx
movl $0x1000, %esi           # imm = 0x1000
callq 0x3260
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x1191(%rbp)
je 0x1a7ae
leaq -0x1030(%rbp), %rdi
movq -0x1040(%rbp), %rdx
movl $0x1000, %esi           # imm = 0x1000
callq 0x3260
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x1191(%rbp)
je 0x1a7ae
leaq -0x1030(%rbp), %rdi
movq -0x1040(%rbp), %rdx
movl $0x1000, %esi           # imm = 0x1000
callq 0x3260
cmpq $0x0, %rax
setne %al
movb %al, -0x1191(%rbp)
movb -0x1191(%rbp), %al
testb $0x1, %al
jne 0x1a7ba
jmp 0x1a7d0
jmp 0x1a7bc
movl -0x1034(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1034(%rbp)
jmp 0x1a6e7
movl $0x0, -0x1144(%rbp)
movl -0x1144(%rbp), %eax
cmpl -0x1034(%rbp), %eax
jge 0x1ab91
movl $0x1, -0x1148(%rbp)
movq $0x0, -0x1158(%rbp)
movq $0x0, -0x1160(%rbp)
movq $0x0, -0x1168(%rbp)
movl $0x0, -0x116c(%rbp)
movq -0x28(%rbp), %rax
movslq -0x1144(%rbp), %rcx
shlq $0xc, %rcx
addq %rcx, %rax
movslq -0x116c(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x1149(%rbp)
movsbl %al, %eax
cmpl $0xa, %eax
je 0x1ab7b
movsbl -0x1149(%rbp), %eax
movslq %eax, %rcx
leaq 0x4130(%rip), %rax      # 0x1e990
movl (%rax,%rcx,4), %eax
movl %eax, -0x1170(%rbp)
cmpl $-0x1, -0x1170(%rbp)
je 0x1a8d2
movq -0x1158(%rbp), %rax
shlq $0x2, %rax
movslq -0x1170(%rbp), %rcx
orq %rcx, %rax
andq 0x49da2(%rip), %rax     # 0x64630
movq %rax, -0x1158(%rbp)
movq -0x1160(%rbp), %rax
shrq $0x2, %rax
movslq -0x1170(%rbp), %rdx
xorq $0x3, %rdx
movl 0x49d7b(%rip), %ecx     # 0x6462c
shlq %cl, %rdx
movq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x1160(%rbp)
movl -0x1148(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1148(%rbp)
jmp 0x1a8e1
movl $0x1, -0x1148(%rbp)
jmp 0x1ab67
movl -0x1148(%rbp), %eax
cmpl 0x49d4b(%rip), %eax     # 0x64638
jle 0x1ab65
movq -0x1158(%rbp), %rax
cmpq -0x1160(%rbp), %rax
jae 0x1a913
movq -0x1158(%rbp), %rax
movq %rax, -0x11a0(%rbp)
jmp 0x1a921
movq -0x1160(%rbp), %rax
movq %rax, -0x11a0(%rbp)
movq -0x11a0(%rbp), %rax
movq %rax, -0x1168(%rbp)
movq -0x1168(%rbp), %rax
andq 0x49d03(%rip), %rax     # 0x64640
movl 0x49cd1(%rip), %ecx     # 0x64614
shll %ecx
movl %ecx, %ecx
shrq %cl, %rax
movl %eax, -0x1174(%rbp)
movq 0x49cf9(%rip), %rax     # 0x64650
movl -0x1174(%rbp), %ecx
movslq (%rax,%rcx,4), %rax
movq %rax, -0x1180(%rbp)
movq -0x1180(%rbp), %rax
movslq 0x49cea(%rip), %rcx     # 0x64660
cmpq %rcx, %rax
jae 0x1a98e
movq -0x1180(%rbp), %rax
movslq 0x49cd3(%rip), %rcx     # 0x6465c
cmpq %rcx, %rax
jae 0x1a993
jmp 0x1ab67
movq -0x1180(%rbp), %rax
movslq 0x49cbb(%rip), %rcx     # 0x6465c
subq %rcx, %rax
movq %rax, -0x1180(%rbp)
movq -0x1168(%rbp), %rax
andq 0x49c8f(%rip), %rax     # 0x64648
movq -0x1168(%rbp), %rdx
movl 0x49c4e(%rip), %ecx     # 0x64614
shll %ecx
movl %ecx, %ecx
movl $0x1, %esi
shlq %cl, %rsi
movq %rsi, %rcx
subq $0x1, %rcx
andq %rcx, %rdx
movl 0x49c56(%rip), %ecx     # 0x64638
shll %ecx
movl 0x49c2a(%rip), %esi     # 0x64614
shll $0x2, %esi
subl %esi, %ecx
movl %ecx, %ecx
shlq %cl, %rdx
movq %rdx, %rcx
addq %rcx, %rax
movl 0x49c18(%rip), %ecx     # 0x64618
shll $0x2, %ecx
movl %ecx, %ecx
shrq %cl, %rax
addq -0x1180(%rbp), %rax
movq %rax, -0x1188(%rbp)
movl $0x0, -0x118c(%rbp)
movl -0x118c(%rbp), %eax
cmpl 0x49bf0(%rip), %eax     # 0x6461c
jae 0x1ab63
movq -0x1188(%rbp), %rax
movl 0x49bdd(%rip), %ecx     # 0x6461c
xorl %edx, %edx
divq %rcx
movq %rdx, -0x11a8(%rbp)
movl -0x118c(%rbp), %eax
movl %eax, %ecx
movq -0x1188(%rbp), %rax
movl 0x49bbc(%rip), %edx     # 0x6461c
subl $0x1, %edx
movl %edx, %edx
movl %edx, %esi
xorl %edx, %edx
divq %rsi
movq -0x11a8(%rbp), %rax
addq $0x1, %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movl 0x49b98(%rip), %ecx     # 0x6461c
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, -0x1190(%rbp)
movq -0x10(%rbp), %rax
movl -0x1190(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jne 0x1aafc
movq -0x1188(%rbp), %rdx
shlq $0x10, %rdx
addq $0x1, %rdx
movq -0x10(%rbp), %rax
movl -0x1190(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x1038(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1038(%rbp)
movl -0x1038(%rbp), %eax
cmpl 0x49b46(%rip), %eax     # 0x64620
jbe 0x1aafa
callq 0x3050
movl (%rax), %edi
movl 0x49b23(%rip), %edx     # 0x6460c
addl $0x1, %edx
leaq 0x45dd(%rip), %rsi      # 0x1f0d0
movb $0x0, %al
callq 0x3300
jmp 0x1ab63
movq -0x10(%rbp), %rax
movl -0x1190(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x10, %rax
cmpq -0x1188(%rbp), %rax
jne 0x1ab4b
movq -0x10(%rbp), %rax
movl -0x1190(%rbp), %ecx
movq (%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpq $0xffff, %rax           # imm = 0xFFFF
jae 0x1ab49
movq -0x10(%rbp), %rax
movl -0x1190(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x1ab63
jmp 0x1ab4d
jmp 0x1ab4f
movl -0x118c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x118c(%rbp)
jmp 0x1aa20
jmp 0x1ab65
jmp 0x1ab67
movl -0x116c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x116c(%rbp)
jmp 0x1a821
jmp 0x1ab7d
movl -0x1144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1144(%rbp)
jmp 0x1a7da
jmp 0x1a6c0
movq -0x1040(%rbp), %rdi
callq 0x3180
movq -0x28(%rbp), %rdi
callq 0x3040
movq -0x10(%rbp), %rax
addq $0x11b0, %rsp           # imm = 0x11B0
popq %rbp
retq
nopl (%rax,%rax)