// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_write_encseq
int gt_reads2twobit_write_encseq(GtReads2Twobit *r2t, GtError *err)
{
  int had_err = 0;
  gt_error_check(err);
  gt_assert(r2t != NULL);
  if (r2t->nofseqs == 0)
  {
    gt_log_log("read set is empty, no encseq was written");
    return had_err;
  }
  gt_assert(r2t->twobitencoding != NULL);
  gt_log_log("write encseq %s", gt_str_get(r2t->indexname));
  gt_log_log("seqlen_eqlen = "GT_WU"", r2t->seqlen_eqlen);
  if (r2t->seqlen_eqlen > 0)
  {
    had_err = gt_reads2twobit_write_encseq_eqlen(r2t, err);
  }
  else
  {
    had_err = gt_reads2twobit_write_encseq_varlen(r2t, err);
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
je 0x18b4ff
movq %r14, %rdi
callq 0x89eb7
testb %al, %al
jne 0x18b829
testq %rbx, %rbx
je 0x18b7f8
cmpq $0x0, 0x40(%rbx)
je 0x18b5f6
cmpq $0x0, 0x10(%rbx)
je 0x18b857
movq (%rbx), %rdi
callq 0xad1fa
leaq 0x1c75b7(%rip), %rdi    # 0x352ae4
movq %rax, %rsi
xorl %eax, %eax
callq 0x92a82
movq 0x48(%rbx), %rsi
leaq 0x1c75b2(%rip), %rdi    # 0x352af4
xorl %eax, %eax
callq 0x92a82
cmpq $0x0, 0x48(%rbx)
movq %r14, 0x10(%rsp)
je 0x18b60b
movq %rsp, %rsi
leaq 0x20(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x18d1e9
movq %rbx, %rdi
callq 0x18d335
movq %rbx, %rdi
callq 0x18d457
movq (%rbx), %rdi
callq 0xad1fa
movq %rax, 0x8(%rsp)
movq 0x60(%rbx), %rbp
movq 0x48(%rbx), %r15
decq %r15
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %r14
movq 0x40(%rbx), %r13
callq 0x586a4
movq (%r12), %r12
addq $0x18, %rbx
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %r13, %r8
movq %rax, %r9
pushq 0x10(%rsp)
pushq %rbx
pushq %r12
leaq 0x18(%rsp), %rbx
pushq (%rbx)
callq 0x73a9c
addq $0x20, %rsp
movl %eax, %ebp
movq (%rbx), %rdi
leaq 0x1c7072(%rip), %rsi    # 0x352656
movl $0x819, %edx            # imm = 0x819
callq 0x936f9
movq %r12, %rdi
jmp 0x18b7e2
leaq 0x1c74a2(%rip), %rdi    # 0x352a9f
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x92a82
jmp 0x18b7e7
movq 0x8(%rbx), %rdi
callq 0x586a4
cmpq $0x0, 0x38(%rbx)
je 0x18b885
movq %rax, %r13
movq %rsp, %rsi
leaq 0x20(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x18d1e9
xorl %r12d, %r12d
movq (%r14), %r15
xorl %ebp, %ebp
movq %r15, %rdi
callq 0xae61c
cmpq %rax, %r12
jae 0x18b668
movq %r15, %rdi
movq %r12, %rsi
callq 0xae3f2
movq %rax, %rdi
callq 0xad289
addq %rax, %rbp
incq %rbp
incq %r12
jmp 0x18b63d
movq 0x40(%rbx), %rdx
movq 0x60(%rbx), %rsi
subq $0x20, %rsp
pushq $0x2
popq %r14
movl %r14d, 0x8(%rsp)
pushq $0x4
popq %r12
andq $0x0, 0x10(%rsp)
movl %r12d, (%rsp)
movl %r12d, %edi
movq %r13, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
callq 0x762d6
addq $0x20, %rsp
movq %rax, 0x8(%rsp)
movq 0x40(%rbx), %rdx
movq 0x60(%rbx), %rsi
subq $0x8, %rsp
pushq $0x5
popq %rdi
movq %r13, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
pushq $0x0
pushq %r14
pushq %r12
callq 0x762d6
addq $0x20, %rsp
movq %rax, 0x18(%rsp)
movq 0x40(%rbx), %rdx
movq 0x60(%rbx), %rsi
subq $0x8, %rsp
pushq $0x6
popq %rdi
movq %r13, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
pushq $0x0
pushq %r14
pushq %r12
callq 0x762d6
addq $0x20, %rsp
movq %rax, %r12
movq %rbx, %rdi
callq 0x18d335
movq %rbx, %rdi
callq 0x18d457
movq (%rbx), %rdi
callq 0xad1fa
movq 0x60(%rbx), %rsi
movq 0x38(%rbx), %rcx
movq 0x40(%rbx), %rdx
movq %rax, %rdi
movq 0x10(%rsp), %r14
movq %r14, %r8
callq 0x7560b
movl %eax, %ebp
testl %eax, %eax
jne 0x18b7ca
movq 0x8(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq %rax, %rcx
cmovbq %rcx, %rax
movl $0x0, %ebp
adcl $0x4, %ebp
cmpq %rax, %r12
pushq $0x6
popq %rax
cmovbl %eax, %ebp
movq (%rbx), %rdi
callq 0xad1fa
movq 0x60(%rbx), %rsi
movq 0x58(%rbx), %r8
decq %r8
movq 0x50(%rbx), %r9
decq %r9
movq 0x10(%rbx), %rcx
movq 0x40(%rbx), %rdx
movq (%rsp), %rdi
addq $0x18, %rbx
subq $0x50, %rsp
movq %r14, 0x48(%rsp)
movq %rbx, 0x40(%rsp)
movq %r15, 0x38(%rsp)
movq %rdi, 0x30(%rsp)
movq %r13, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %r9, 0x10(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x7251a
addq $0x50, %rsp
movl %eax, %ebp
movq (%rsp), %rdi
leaq 0x1c6e81(%rip), %rsi    # 0x352656
movl $0x849, %edx            # imm = 0x849
callq 0x936f9
movq %r15, %rdi
callq 0xae662
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2ac769(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x15980a(%rip), %rsi    # 0x2e5013
leaq 0x1c6e5f(%rip), %rdx    # 0x35266f
leaq 0x1c726b(%rip), %rcx    # 0x352a82
leaq 0x1c6e38(%rip), %r8     # 0x352656
movl $0x852, %r9d            # imm = 0x852
jmp 0x18b8b1
movq 0x2ac738(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1597d9(%rip), %rsi    # 0x2e5013
leaq 0x15997e(%rip), %rdx    # 0x2e51bf
leaq 0x1c723a(%rip), %rcx    # 0x352a82
leaq 0x1c6e07(%rip), %r8     # 0x352656
movl $0x851, %r9d            # imm = 0x851
jmp 0x18b8b1
movq 0x2ac70a(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1597ab(%rip), %rsi    # 0x2e5013
leaq 0x1c7259(%rip), %rdx    # 0x352ac8
leaq 0x1c720c(%rip), %rcx    # 0x352a82
leaq 0x1c6dd9(%rip), %r8     # 0x352656
movl $0x858, %r9d            # imm = 0x858
jmp 0x18b8b1
movq 0x2ac6dc(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x15977d(%rip), %rsi    # 0x2e5013
leaq 0x1c7bdf(%rip), %rdx    # 0x35347c
leaq 0x1c7bec(%rip), %rcx    # 0x353490
leaq 0x1c6dab(%rip), %r8     # 0x352656
movl $0x82d, %r9d            # imm = 0x82D
xorl %eax, %eax
callq 0x17a50
callq 0x17390