// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_write_encseq_varlen
static int gt_reads2twobit_write_encseq_varlen(GtReads2Twobit *r2t,
    GtError *err)
{
  int had_err = 0;
  GtFilelengthvalues *filelengthtab;
  GtStrArray *filenametab;
  uint64_t sizeofrep, minsizeofrep;
  GtUword numofdbfiles = gt_array_size(r2t->collection);
  GtEncseqAccessType sat;
  GtUword idx, lengthofdbfilenames = 0;

  gt_assert(r2t->seppos != NULL);
  gt_reads2twobit_collect_fileinfo(r2t, &filelengthtab, &filenametab);
  for (idx = 0; idx < gt_str_array_size(filenametab); idx++)
  {
    lengthofdbfilenames += gt_str_length(gt_str_array_get_str(
          filenametab, idx)) + 1UL;
  }
  sat = GT_ACCESS_TYPE_UCHARTABLES;
  minsizeofrep = GT_READS2TWOBIT_SIZEOFREP(sat);
  sizeofrep = GT_READS2TWOBIT_SIZEOFREP(GT_ACCESS_TYPE_USHORTTABLES);
  if (sizeofrep < minsizeofrep)
  {
    sat = GT_ACCESS_TYPE_USHORTTABLES;
    minsizeofrep = sizeofrep;
  }
  sizeofrep = GT_READS2TWOBIT_SIZEOFREP(GT_ACCESS_TYPE_UINT32TABLES);
  if (sizeofrep < minsizeofrep)
    sat = GT_ACCESS_TYPE_UINT32TABLES;
  gt_reads2twobit_set_separators_to_less_frequent_char(r2t);
  gt_reads2twobit_zeropad_tbe(r2t);
  had_err = gt_encseq_seppos2ssptab(gt_str_get(r2t->indexname),
      r2t->total_seqlength, r2t->nofseqs, r2t->seppos, err);
  if (!had_err)
    had_err = gt_encseq_generic_write_twobitencoding_to_file(
        gt_str_get(r2t->indexname), r2t->total_seqlength,
        sat, 0, r2t->seqlen_min - 1UL, r2t->seqlen_max - 1UL, 0, 0,
        r2t->seqlen_max - 1UL, r2t->twobitencoding, r2t->nofseqs,
        numofdbfiles, filelengthtab, filenametab, r2t->chardistri, err);
  gt_free(filelengthtab);
  gt_str_array_delete(filenametab);
  return had_err;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rdi, 0xa8(%rsp)
movq %rsi, 0xa0(%rsp)
movl $0x0, 0x9c(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x81370
movq %rax, 0x70(%rsp)
movq $0x0, 0x58(%rsp)
movq 0xa8(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x2a4551
movq 0x397a80(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x271ae9(%rip), %rsi    # 0x516013
leaq 0x2e1958(%rip), %rdx    # 0x585e89
leaq 0x2e1965(%rip), %rcx    # 0x585e9d
leaq 0x2e0a71(%rip), %r8     # 0x584fb0
movl $0x82d, %r9d            # imm = 0x82D
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a4553
movq 0xa8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x2a8760
movq $0x0, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x88(%rsp), %rdi
callq 0x11fcc0
movq %rax, %rcx
movq 0x50(%rsp), %rax
cmpq %rcx, %rax
jae 0x2a45d5
movq 0x88(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0x11f960
movq %rax, %rdi
callq 0x11dfa0
addq $0x1, %rax
addq 0x58(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x60(%rsp)
jmp 0x2a4579
movl $0x4, 0x6c(%rsp)
movl 0x6c(%rsp), %edi
movq 0xa8(%rsp), %rax
movq 0x60(%rax), %rsi
movq 0xa8(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x70(%rsp), %rcx
movq 0x58(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
movl $0x4, (%rsp)
movl $0x2, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0xb29a0
movq %rax, 0x78(%rsp)
movq 0xa8(%rsp), %rax
movq 0x60(%rax), %rsi
movq 0xa8(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x70(%rsp), %rcx
movq 0x58(%rsp), %r8
movl $0x5, %edi
xorl %eax, %eax
movl %eax, %r9d
movl $0x4, (%rsp)
movl $0x2, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0xb29a0
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
cmpq 0x78(%rsp), %rax
jae 0x2a469f
movl $0x5, 0x6c(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0xa8(%rsp), %rax
movq 0x60(%rax), %rsi
movq 0xa8(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x70(%rsp), %rcx
movq 0x58(%rsp), %r8
movl $0x6, %edi
xorl %eax, %eax
movl %eax, %r9d
movl $0x4, (%rsp)
movl $0x2, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
callq 0xb29a0
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
cmpq 0x78(%rsp), %rax
jae 0x2a4707
movl $0x6, 0x6c(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x2a8950
movq 0xa8(%rsp), %rdi
callq 0x2a8b80
movq 0xa8(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0xa8(%rsp), %rax
movq 0x60(%rax), %rsi
movq 0xa8(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0xa8(%rsp), %rax
movq 0x38(%rax), %rcx
movq 0xa0(%rsp), %r8
callq 0xb1110
movl %eax, 0x9c(%rsp)
cmpl $0x0, 0x9c(%rsp)
jne 0x2a4855
movq 0xa8(%rsp), %rax
movq (%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0xa8(%rsp), %rax
movq 0x60(%rax), %rsi
movl 0x6c(%rsp), %edx
movq 0xa8(%rsp), %rax
movq 0x58(%rax), %r8
subq $0x1, %r8
movq 0xa8(%rsp), %rax
movq 0x50(%rax), %r9
subq $0x1, %r9
movq 0xa8(%rsp), %rax
movq 0x50(%rax), %r13
subq $0x1, %r13
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %r12
movq 0xa8(%rsp), %rax
movq 0x40(%rax), %r15
movq 0x70(%rsp), %r14
movq 0x90(%rsp), %rbx
movq 0x88(%rsp), %r11
movq 0xa8(%rsp), %r10
addq $0x18, %r10
movq 0xa0(%rsp), %rax
xorl %ecx, %ecx
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movq %r11, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
callq 0xac810
movl %eax, 0x9c(%rsp)
movq 0x90(%rsp), %rdi
leaq 0x2e074c(%rip), %rsi    # 0x584fb0
movl $0x849, %edx            # imm = 0x849
callq 0xe88c0
movq 0x88(%rsp), %rdi
callq 0x11fd20
movl 0x9c(%rsp), %eax
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopw %cs:(%rax,%rax)