// File: /workspace/github_c_makefile_star2_O3/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 0x1ddb02
movq %r14, %rdi
callq 0xfcc32
testb %al, %al
jne 0x1dde80
testq %rbx, %rbx
je 0x1dde7b
cmpq $0x0, 0x40(%rbx)
je 0x1ddb96
cmpq $0x0, 0x10(%rbx)
je 0x1dde85
movq (%rbx), %rdi
callq 0x11b0a1
leaq 0x1d4b52(%rip), %rdi    # 0x3b2682
movq %rax, %rsi
xorl %eax, %eax
callq 0x103d72
movq 0x48(%rbx), %rsi
leaq 0x1d4b4d(%rip), %rdi    # 0x3b2692
xorl %eax, %eax
callq 0x103d72
cmpq $0x0, 0x48(%rbx)
movq %r14, 0x18(%rsp)
je 0x1ddbac
leaq 0x8(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x1df174
movq %rbx, %rdi
callq 0x1df2cc
movq 0x60(%rbx), %rcx
decq %rcx
movq %rcx, %rax
shrq $0x5, %rax
andl $0x1f, %ecx
cmpq $0x1f, %rcx
jne 0x1ddcf7
movq 0x10(%rbx), %rdx
jmp 0x1ddd0e
leaq 0x1d4aa0(%rip), %rdi    # 0x3b263d
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x103d72
jmp 0x1dde69
movq 0x8(%rbx), %rdi
callq 0xd24e0
cmpq $0x0, 0x38(%rbx)
je 0x1dde8a
movq %rax, %rbp
leaq 0x8(%rsp), %rsi
leaq 0x20(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1df174
movq (%r14), %r15
movq %r15, %rdi
callq 0x11c131
xorl %r13d, %r13d
testq %rax, %rax
je 0x1ddc17
xorl %r12d, %r12d
movq %r15, %rdi
movq %r12, %rsi
callq 0x11bfee
movq %rax, %rdi
callq 0x11b0ca
addq %rax, %r13
incq %r13
incq %r12
movq %r15, %rdi
callq 0x11c131
cmpq %rax, %r12
jb 0x1ddbee
movq 0x40(%rbx), %rdx
movq 0x60(%rbx), %rsi
subq $0x8, %rsp
movl $0x2, %eax
movl $0x4, %r14d
movl $0x4, %edi
movq %rbp, %rcx
movq %r13, %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
pushq %r10
pushq %rax
pushq %r14
callq 0xec6d9
addq $0x20, %rsp
movq %rax, %r12
movq 0x40(%rbx), %rdx
movq 0x60(%rbx), %rsi
subq $0x8, %rsp
movl $0x5, %edi
movq %rbp, %rcx
movq %r13, %r8
xorl %r9d, %r9d
xorl %eax, %eax
pushq %rax
movl $0x2, %eax
pushq %rax
pushq %r14
callq 0xec6d9
addq $0x20, %rsp
cmpq %r12, %rax
cmovbq %rax, %r12
movq %rbp, %rcx
movl $0x0, %ebp
adcl %r14d, %ebp
movq 0x40(%rbx), %rdx
movq 0x60(%rbx), %rsi
subq $0x8, %rsp
movl $0x6, %edi
movq %rcx, 0x18(%rsp)
movq %r13, %r8
xorl %r9d, %r9d
xorl %eax, %eax
pushq %rax
movl $0x2, %eax
pushq %rax
pushq %r14
callq 0xec6d9
addq $0x20, %rsp
cmpq %r12, %rax
movl $0x6, %eax
cmovbl %eax, %ebp
movq %rbx, %rdi
callq 0x1df2cc
movq 0x60(%rbx), %rcx
decq %rcx
movq %rcx, %rax
shrq $0x5, %rax
andl $0x1f, %ecx
cmpq $0x1f, %rcx
jne 0x1ddd8a
movq 0x10(%rbx), %rdx
jmp 0x1ddda1
addl %ecx, %ecx
movq 0x10(%rbx), %rdx
movq (%rdx,%rax,8), %rsi
xorb $0x3e, %cl
shrq %cl, %rsi
shlq %cl, %rsi
movq %rsi, (%rdx,%rax,8)
movq $0x0, 0x8(%rdx,%rax,8)
movq (%rbx), %rdi
callq 0x11b0a1
movq %rax, 0x10(%rsp)
movq 0x60(%rbx), %r13
movq 0x48(%rbx), %rbp
decq %rbp
movq 0x8(%rbx), %rdi
movq 0x10(%rbx), %r14
movq 0x40(%rbx), %r12
callq 0xd24e0
movq 0x20(%rsp), %r15
addq $0x18, %rbx
movq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq %r12, %r8
movq %rax, %r9
pushq 0x18(%rsp)
pushq %rbx
pushq %r15
pushq 0x20(%rsp)
callq 0xea882
addq $0x20, %rsp
movl %eax, %r13d
movq 0x8(%rsp), %rdi
leaq 0x1d4474(%rip), %rsi    # 0x3b21f4
movl $0x819, %edx            # imm = 0x819
jmp 0x1dde5c
addl %ecx, %ecx
movq 0x10(%rbx), %rdx
movq (%rdx,%rax,8), %rsi
xorb $0x3e, %cl
shrq %cl, %rsi
shlq %cl, %rsi
movq %rsi, (%rdx,%rax,8)
movq 0x18(%rsp), %r14
movq $0x0, 0x8(%rdx,%rax,8)
movq (%rbx), %rdi
callq 0x11b0a1
movq 0x60(%rbx), %rsi
movq 0x38(%rbx), %rcx
movq 0x40(%rbx), %rdx
movq %rax, %rdi
movq %r14, %r8
callq 0xebd70
movl %eax, %r13d
testl %eax, %eax
jne 0x1dde4b
movq (%rbx), %rdi
callq 0x11b0a1
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 0x8(%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 0x60(%rsp), %rdi
movq %rdi, 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 0xe9397
addq $0x50, %rsp
movl %eax, %r13d
movq 0x8(%rsp), %rdi
leaq 0x1d439d(%rip), %rsi    # 0x3b21f4
movl $0x849, %edx            # imm = 0x849
callq 0x1045eb
movq %r15, %rdi
callq 0x11c144
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x73754
callq 0x736a9
callq 0x7371b
callq 0x736e2