// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_decode_range
void gt_reads2twobit_decode_range(const GtReads2Twobit *r2t,
    GtFile *outfp, GtUword seqnum_from, GtUword nofseqs,
    const GtBitsequence *skip)
{
  GtTwobitencoding code;
  unsigned short charsincode;
  const char code2char[] = "acgt";
  GtUword seqnum, pos, nextsep, nextdecoded, seqnum_to;
  const GtTwobitencoding *nextencoded;
  char *decoded;

  gt_assert(r2t->seqlen_max > 0);
  if (nofseqs == 0)
    return;
  seqnum_to = seqnum_from + nofseqs - 1UL;
  decoded = gt_malloc(sizeof (*decoded) * (r2t->seqlen_max + 3UL));
  decoded[0] = '>';
  decoded[1] = '\n';
  nextdecoded = 2UL;

  seqnum = seqnum_from;
  if (skip != NULL)
    while (GT_ISIBITSET(skip, seqnum))
      seqnum++;

  if (r2t->seqlen_eqlen > 0)
  {
    nextsep = r2t->seqlen_eqlen * (seqnum + 1UL) - 1UL;
    pos = seqnum * r2t->seqlen_eqlen;
  }
  else
  {
    nextsep = r2t->seppos[seqnum];
    pos = (seqnum == 0) ? 0 : r2t->seppos[seqnum - 1UL] + 1UL;
  }

  nextencoded = r2t->twobitencoding + GT_DIVBYUNITSIN2BITENC(pos);
  code = *(nextencoded++);
  charsincode = (unsigned short)GT_UNITSIN2BITENC -
    (unsigned short)GT_MODBYUNITSIN2BITENC(pos);

  while (true)
  {
    if (charsincode == 0)
    {
      code = *(nextencoded++);
      charsincode = (unsigned short)GT_UNITSIN2BITENC;
    }
    if (pos++ < nextsep)
    {
      gt_assert(nextsep - pos <= r2t->seqlen_max);
      decoded[nextdecoded++] = code2char[code >> ((--charsincode) << 1) & 3];
    }
    else
    {
      /* output sequence */
      charsincode--;
      decoded[nextdecoded++] = '\n';
      decoded[nextdecoded] = '\0';
      gt_file_xfputs(decoded, outfp);
      nextdecoded = 2UL;

      seqnum++;
      if (seqnum > seqnum_to)
        break;
      if (skip != NULL && GT_ISIBITSET(skip, seqnum))
      {
        /* jump to next non-contained sequence */
        while (seqnum <= seqnum_to && GT_ISIBITSET(skip, seqnum))
          seqnum++;
        if (seqnum > seqnum_to)
          break;
        pos = r2t->seqlen_eqlen > 0 ? seqnum * r2t->seqlen_eqlen :
          r2t->seppos[seqnum - 1UL] + 1UL;
        nextencoded = r2t->twobitencoding + GT_DIVBYUNITSIN2BITENC(pos);
        code = *(nextencoded++);
        charsincode = (unsigned short)GT_UNITSIN2BITENC -
          (unsigned short)GT_MODBYUNITSIN2BITENC(pos);
      }
      nextsep = (r2t->seqlen_eqlen > 0)
        ? r2t->seqlen_eqlen * (seqnum + 1UL) - 1UL
        : r2t->seppos[seqnum];
    }
  }
  gt_free(decoded);
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movq %rcx, 0x78(%rsp)
movq %r8, 0x70(%rsp)
movl 0x28ccad(%rip), %eax    # 0x52f43c
movl %eax, 0x61(%rsp)
movb 0x28cca7(%rip), %al     # 0x52f440
movb %al, 0x65(%rsp)
movq 0x90(%rsp), %rax
cmpq $0x0, 0x50(%rax)
ja 0x2a27e4
movq 0x3997ed(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x273856(%rip), %rsi    # 0x516013
leaq 0x2e29f2(%rip), %rdx    # 0x5851b6
leaq 0x2e29ff(%rip), %rcx    # 0x5851ca
leaq 0x2e27de(%rip), %r8     # 0x584fb0
movl $0x661, %r9d            # imm = 0x661
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a27e6
cmpq $0x0, 0x78(%rsp)
jne 0x2a27f3
jmp 0x2a2cbe
movq 0x80(%rsp), %rax
addq 0x78(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x90(%rsp), %rax
movq 0x50(%rax), %rdi
addq $0x3, %rdi
shlq $0x0, %rdi
leaq 0x2e278c(%rip), %rsi    # 0x584fb0
movl $0x665, %edx            # imm = 0x665
callq 0xe80f0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movb $0x3e, (%rax)
movq 0x28(%rsp), %rax
movb $0xa, 0x1(%rax)
movq $0x2, 0x40(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0x2a28aa
jmp 0x2a2864
movq 0x70(%rsp), %rax
movq 0x58(%rsp), %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq 0x58(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2a28a8
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x2a2864
jmp 0x2a28aa
movq 0x90(%rsp), %rax
cmpq $0x0, 0x48(%rax)
jbe 0x2a28f4
movq 0x90(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x58(%rsp), %rcx
addq $0x1, %rcx
imulq %rcx, %rax
subq $0x1, %rax
movq %rax, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq 0x90(%rsp), %rcx
imulq 0x48(%rcx), %rax
movq %rax, 0x50(%rsp)
jmp 0x2a294b
movq 0x90(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x58(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0x2a291f
xorl %eax, %eax
movq %rax, 0x20(%rsp)
jmp 0x2a2941
movq 0x90(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x50(%rsp), %rcx
shrq $0x5, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x30(%rsp)
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x50(%rsp), %rax
andq $0x1f, %rax
movzwl %ax, %ecx
movl $0x20, %eax
subl %ecx, %eax
movw %ax, 0x66(%rsp)
movzwl 0x66(%rsp), %eax
cmpl $0x0, %eax
jne 0x2a29c7
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x30(%rsp)
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movw $0x20, 0x66(%rsp)
movq 0x50(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x50(%rsp)
cmpq 0x48(%rsp), %rax
jae 0x2a2a7a
jmp 0x2a29e5
movq 0x48(%rsp), %rax
subq 0x50(%rsp), %rax
movq 0x90(%rsp), %rcx
cmpq 0x50(%rcx), %rax
jbe 0x2a2a35
movq 0x39959c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x273605(%rip), %rsi    # 0x516013
leaq 0x2e27d2(%rip), %rdx    # 0x5851e7
leaq 0x2e27ae(%rip), %rcx    # 0x5851ca
leaq 0x2e258d(%rip), %r8     # 0x584fb0
movl $0x688, %r9d            # imm = 0x688
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a2a37
movq 0x68(%rsp), %rax
movw 0x66(%rsp), %cx
addw $-0x1, %cx
movw %cx, 0x66(%rsp)
movzwl %cx, %ecx
shll %ecx
movl %ecx, %ecx
shrq %cl, %rax
andq $0x3, %rax
movb 0x61(%rsp,%rax), %dl
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x40(%rsp)
movb %dl, (%rax,%rcx)
jmp 0x2a2ca3
movw 0x66(%rsp), %ax
addw $-0x1, %ax
movw %ax, 0x66(%rsp)
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, 0x40(%rsp)
movb $0xa, (%rax,%rcx)
movq 0x28(%rsp), %rax
movq 0x40(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x28(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0xde030
movq $0x2, 0x40(%rsp)
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x38(%rsp), %rax
jbe 0x2a2aea
jmp 0x2a2ca8
cmpq $0x0, 0x70(%rsp)
je 0x2a2c4c
movq 0x70(%rsp), %rax
movq 0x58(%rsp), %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq 0x58(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x2a2c4c
jmp 0x2a2b30
movq 0x58(%rsp), %rcx
xorl %eax, %eax
cmpq 0x38(%rsp), %rcx
movb %al, 0x1f(%rsp)
ja 0x2a2b7b
movq 0x70(%rsp), %rax
movq 0x58(%rsp), %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rax
movq 0x58(%rsp), %rcx
andq $0x3f, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
setne %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x2a2b85
jmp 0x2a2b95
movq 0x58(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x58(%rsp)
jmp 0x2a2b30
movq 0x58(%rsp), %rax
cmpq 0x38(%rsp), %rax
jbe 0x2a2ba6
jmp 0x2a2ca8
movq 0x90(%rsp), %rax
cmpq $0x0, 0x48(%rax)
jbe 0x2a2bce
movq 0x58(%rsp), %rax
movq 0x90(%rsp), %rcx
imulq 0x48(%rcx), %rax
movq %rax, 0x10(%rsp)
jmp 0x2a2bf0
movq 0x90(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x58(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x90(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x50(%rsp), %rcx
shrq $0x5, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x30(%rsp)
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x50(%rsp), %rax
andq $0x1f, %rax
movzwl %ax, %ecx
movl $0x20, %eax
subl %ecx, %eax
movw %ax, 0x66(%rsp)
movq 0x90(%rsp), %rax
cmpq $0x0, 0x48(%rax)
jbe 0x2a2c7f
movq 0x90(%rsp), %rax
movq 0x48(%rax), %rax
movq 0x58(%rsp), %rcx
addq $0x1, %rcx
imulq %rcx, %rax
subq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0x2a2c99
movq 0x90(%rsp), %rax
movq 0x38(%rax), %rax
movq 0x58(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x2a299d
movq 0x28(%rsp), %rdi
leaq 0x2e22fc(%rip), %rsi    # 0x584fb0
movl $0x6aa, %edx            # imm = 0x6AA
callq 0xe88c0
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)