// File: /workspace/github_c_makefile_star2_O0/thegenemyers[P]DAMASKER/tandem.c
// Function: tuple_thread
static void *tuple_thread(void *arg)
{ Tuple_Arg  *data  = (Tuple_Arg *) arg;
  int         tnum  = data->tnum;
  int64      *kptr  = data->kptr;
  KmerPos    *list  = TA_list;
  int         i, m, n, x, p;
  uint64      c;
  char       *s;

  c  = TA_block->nreads;
  i  = (c * tnum) >> NSHIFT;
  n  = TA_block->reads[i].boff;
  s  = ((char *) (TA_block->bases)) + n;
  n -= Kmer*i;

  for (m = (c * (tnum+1)) >> NSHIFT; i < m; i++)
    { c = p = 0;
      for (x = 1; x < Kmer; x++)
        c = (c << 2) | s[p++];
      while ((x = s[p]) != 4)
        { c = ((c << 2) | x) & Kmask;
          list[n].read = i;
          list[n].rpos = ++p;
          list[n].code = c;
          n += 1;
          kptr[c & BMASK] += 1;
        }
      s += (p+1);
    }

  return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq 0x2849c(%rip), %rax     # 0x2e478
movq %rax, -0x28(%rbp)
movq 0x28489(%rip), %rax     # 0x2e470
movslq 0x30(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq %rcx, %rax
movl 0x2844b(%rip), %ecx     # 0x2e44c
shrq %cl, %rax
movl %eax, -0x2c(%rbp)
movq 0x28462(%rip), %rax     # 0x2e470
movq 0x60(%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movl %eax, -0x34(%rbp)
movq 0x28445(%rip), %rax     # 0x2e470
movq 0x58(%rax), %rax
movslq -0x34(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl 0x283f0(%rip), %ecx     # 0x2e430
imull -0x2c(%rbp), %ecx
movl -0x34(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x34(%rbp)
movq -0x48(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq %rcx, %rax
movl 0x283e9(%rip), %ecx     # 0x2e44c
shrq %cl, %rax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x618c
movl $0x0, -0x3c(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl 0x2839c(%rip), %eax     # 0x2e430
jge 0x60c7
movq -0x48(%rbp), %rax
shlq $0x2, %rax
movq -0x50(%rbp), %rcx
movl -0x3c(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0x3c(%rbp)
movslq %edx, %rdx
movsbq (%rcx,%rdx), %rcx
orq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x608b
jmp 0x60c9
movq -0x50(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x38(%rbp)
cmpl $0x4, %eax
je 0x616a
movq -0x48(%rbp), %rax
shlq $0x2, %rax
movslq -0x38(%rbp), %rcx
orq %rcx, %rax
andq 0x28349(%rip), %rax     # 0x2e440
movq %rax, -0x48(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x48(%rbp), %rcx
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq -0x48(%rbp), %rcx
andq $0xff, %rcx
movq (%rax,%rcx,8), %rdx
addq $0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x60c9
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
movq -0x50(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x6069
xorl %eax, %eax
popq %rbp
retq