// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_init_encode
static void gt_reads2twobit_init_encode(GtReads2Twobit *r2t,
    GtReads2TwobitEncodeState *state)
{
  const GtUword noflibraries = gt_array_size(r2t->collection);
  GtUword i;
  state->inputfiles_totallength = 0;
  gt_array_sort(r2t->collection, gt_reads2twobit_rli_cmp);
  for (i = 0; i < noflibraries; i++)
  {
    const GtReadsLibraryInfo *rli = gt_array_get(r2t->collection, i);
    state->inputfiles_totallength += rli->total_filelength;
  }
  r2t->twobitencoding = gt_malloc(sizeof (*r2t->twobitencoding) *
    GT_DIVBYUNITSIN2BITENC(state->inputfiles_totallength) + 2UL);
  GT_READS2TWOBIT_INIT_ENCODE_INFO(state->current, r2t->twobitencoding);
  GT_READS2TWOBIT_COPY_ENCODE_INFO(state->current, state->backup);
  for (i = 0; i < (GtUword)(UCHAR_MAX) + 1UL; i++)
    state->char2code[i] = GT_READS2TWOBIT_CODE_UNDEF;
  state->char2code[(unsigned char)'A'] = (GtTwobitencoding)0;
  state->char2code[(unsigned char)'a'] = (GtTwobitencoding)0;
  state->char2code[(unsigned char)'C'] = (GtTwobitencoding)1;
  state->char2code[(unsigned char)'c'] = (GtTwobitencoding)1;
  state->char2code[(unsigned char)'G'] = (GtTwobitencoding)2;
  state->char2code[(unsigned char)'g'] = (GtTwobitencoding)2;
  state->char2code[(unsigned char)'T'] = (GtTwobitencoding)3;
  state->char2code[(unsigned char)'t'] = (GtTwobitencoding)3;
  state->seqlen = 0;
  state->seqlen_mate = 0;
  state->exp_qlen = 0;
  state->varlen_mode = false;
  state->invalid_mode = false;
  state->invalid_sequences = 0;
  state->invalid_total_length = 0;
  gt_assert(r2t->seppos == NULL);
  state->seppos = NULL;
  state->qbuf = NULL;
  state->qbuf_size = 0;
  state->qbuf2 = NULL;
  state->qbuf2_size = 0;
  state->phredbase = r2t->phredbase;
  state->lowqual = r2t->lowqual;
  state->maxlow = r2t->maxlow;
  state->prevcode = GT_READS2TWOBIT_CODE_UNDEF;
  state->hplength = 0;
  state->use_rle = r2t->use_rle;
  state->hplengths = r2t->use_rle ? gt_hplstore_new(
      state->inputfiles_totallength + 2UL) : NULL;
  state->nofh = 0;
  state->hsum = 0;
  state->descs = r2t->descs;
  state->descsfp = r2t->descsfp;
  state->clipdes = r2t->clipdes;
  state->longestdesc = &(r2t->longestdesc);
  state->n_descs = &(r2t->n_descs);
  state->dbuf = gt_str_new();
  state->dbuf2 = gt_str_new();
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x81370
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq $0x0, 0x800(%rax)
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x3fcf(%rip), %rsi      # 0x2a52d0
callq 0x81500
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x20(%rsp), %rax
jae 0x2a135f
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x18(%rsp), %rsi
callq 0x80b60
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rcx
movq 0x28(%rsp), %rax
addq 0x800(%rax), %rcx
movq %rcx, 0x800(%rax)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x2a130f
movq 0x28(%rsp), %rax
movq 0x800(%rax), %rdi
shrq $0x5, %rdi
shlq $0x3, %rdi
addq $0x2, %rdi
leaq 0x2e3c32(%rip), %rsi    # 0x584fb0
movl $0x14c, %edx            # imm = 0x14C
callq 0xe80f0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x28(%rsp), %rdi
addq $0x820, %rdi            # imm = 0x820
xorl %esi, %esi
movl $0x68, %edx
callq 0x19360
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x820(%rax)
movq 0x28(%rsp), %rdi
addq $0x888, %rdi            # imm = 0x888
movq 0x28(%rsp), %rsi
addq $0x820, %rsi            # imm = 0x820
movl $0x68, %edx
callq 0x19610
movq $0x0, 0x18(%rsp)
cmpq $0x100, 0x18(%rsp)      # imm = 0x100
jae 0x2a1419
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rcx
movq $-0x1, (%rax,%rcx,8)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x2a13ec
movq 0x28(%rsp), %rax
movq $0x0, 0x208(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x308(%rax)
movq 0x28(%rsp), %rax
movq $0x1, 0x218(%rax)
movq 0x28(%rsp), %rax
movq $0x1, 0x318(%rax)
movq 0x28(%rsp), %rax
movq $0x2, 0x238(%rax)
movq 0x28(%rsp), %rax
movq $0x2, 0x338(%rax)
movq 0x28(%rsp), %rax
movq $0x3, 0x2a0(%rax)
movq 0x28(%rsp), %rax
movq $0x3, 0x3a0(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x808(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x810(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x818(%rax)
movq 0x28(%rsp), %rax
movb $0x0, 0x8f0(%rax)
movq 0x28(%rsp), %rax
movb $0x0, 0x8f1(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x8f8(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x900(%rax)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x2a1545
movq 0x39aa8c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x274af5(%rip), %rsi    # 0x516013
leaq 0x2e4103(%rip), %rdx    # 0x585628
leaq 0x2e4110(%rip), %rcx    # 0x58563c
leaq 0x2e3a7d(%rip), %r8     # 0x584fb0
movl $0x160, %r9d            # imm = 0x160
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a1547
movq 0x28(%rsp), %rax
movq $0x0, 0x908(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x920(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x938(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x928(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x940(%rax)
movq 0x30(%rsp), %rax
movb 0x80(%rax), %cl
movq 0x28(%rsp), %rax
movb %cl, 0x918(%rax)
movq 0x30(%rsp), %rax
movb 0x81(%rax), %cl
movq 0x28(%rsp), %rax
movb %cl, 0x930(%rax)
movq 0x30(%rsp), %rax
movq 0x88(%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x958(%rax)
movq 0x28(%rsp), %rax
movq $-0x1, 0x968(%rax)
movq 0x28(%rsp), %rax
movb $0x0, 0x978(%rax)
movq 0x30(%rsp), %rax
movb 0x91(%rax), %cl
movq 0x28(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x960(%rax)
movq 0x30(%rsp), %rax
testb $0x1, 0x91(%rax)
je 0x2a163a
movq 0x28(%rsp), %rax
movq 0x800(%rax), %rdi
addq $0x2, %rdi
callq 0x4d11d0
movq %rax, 0x8(%rsp)
jmp 0x2a1643
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x2a1643
movq 0x8(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x970(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x988(%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x980(%rax)
movq 0x30(%rsp), %rax
movq 0x98(%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x990(%rax)
movq 0x30(%rsp), %rax
movq 0xa0(%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x998(%rax)
movq 0x30(%rsp), %rax
movb 0xa8(%rax), %cl
movq 0x28(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x9a0(%rax)
movq 0x30(%rsp), %rcx
addq $0xb0, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x9a8(%rax)
movq 0x30(%rsp), %rcx
addq $0xb8, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x9b0(%rax)
callq 0x11d4a0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x948(%rax)
callq 0x11d4a0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x950(%rax)
addq $0x38, %rsp
retq
nopw (%rax,%rax)