// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_encode_unpaired_library
static int gt_reads2twobit_encode_unpaired_library(
    GtReads2TwobitEncodeState *state, GtReadsLibraryInfo *rli, GtError *err)
{
  int had_err = 0;
  FILE *file;
  file = gt_fa_fopen(gt_str_get(rli->filename1), "r", err);
  if (file == NULL)
    had_err = -1;
  if (!had_err)
  {
    const GtUword invalid_tl_before = state->invalid_total_length,
          invalid_s_before = state->invalid_sequences;
    char line[GT_READS2TWOBIT_READBUFFER_SIZE], *fgetsretval;
    rli->first_seqnum = state->current.nofseqs;
    fgetsretval = fgets(line, (int)GT_READS2TWOBIT_READBUFFER_SIZE, file);
    if (fgetsretval == line)
    {
      if (line[0] == '>')
      {
        gt_reads2twobit_encode_unpaired_fasta_library(state, rli, file, line);
      }
      else if (line[0] == '@')
      {
        had_err = gt_reads2twobit_encode_unpaired_fastq_library(state, rli,
            file, line);
        if (had_err != 0)
          gt_error_set(err, "%s: error in FASTQ format",
              gt_str_get(rli->filename1));
      }
      else
      {
        gt_error_set(err, "%s: unknown format", gt_str_get(rli->filename1));
        had_err = -1;
      }
    }
    else
    {
      /* empty file or error */
      gt_assert(fgetsretval == NULL);
    }
    if (!state->invalid_mode)
      gt_reads2twobit_process_sequence_end(state);
    gt_assert(state->current.nofseqs >= rli->first_seqnum);
    rli->nofseqs = state->current.nofseqs - rli->first_seqnum;
    rli->total_seqlength = state->varlen_mode
      ?  state->seppos[state->current.nofseqs - 1UL] + 1UL -
         ((rli->first_seqnum == 0) ? 0 : state->seppos[rli->first_seqnum - 1UL])
      : state->current.seqlen_first * rli->nofseqs;
    /* the following is not necessary, but is useful for the tests */
    rli->total_filelength -= (state->invalid_total_length - invalid_tl_before +
        3UL * (state->invalid_sequences - invalid_s_before));
    if (!had_err)
      had_err = gt_reads2twobit_close_file(file, rli->filename1, err);
    else
      gt_fa_fclose(file);
  }
  return had_err;
}

// Assembly:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x160(%rsp)
movq %rsi, 0x158(%rsp)
movq %rdx, 0x150(%rsp)
movl $0x0, 0x14c(%rsp)
movq 0x158(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x150(%rsp), %r8
leaq 0x28a86d(%rip), %rsi    # 0x52bfda
leaq 0x2e383c(%rip), %rdx    # 0x584fb0
movl $0x351, %ecx            # imm = 0x351
callq 0xd8df0
movq %rax, 0x140(%rsp)
cmpq $0x0, 0x140(%rsp)
jne 0x2a179c
movl $0xffffffff, 0x14c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x14c(%rsp)
jne 0x2a1b3f
movq 0x160(%rsp), %rax
movq 0x900(%rax), %rax
movq %rax, 0x138(%rsp)
movq 0x160(%rsp), %rax
movq 0x8f8(%rax), %rax
movq %rax, 0x130(%rsp)
movq 0x160(%rsp), %rax
movq 0x860(%rax), %rcx
movq 0x158(%rsp), %rax
movq %rcx, 0x38(%rax)
leaq 0x30(%rsp), %rdi
movq 0x140(%rsp), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x19b60
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
leaq 0x30(%rsp), %rcx
cmpq %rcx, %rax
jne 0x2a1909
movsbl 0x30(%rsp), %eax
cmpl $0x3e, %eax
jne 0x2a1853
movq 0x160(%rsp), %rdi
movq 0x158(%rsp), %rsi
movq 0x140(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x2a5310
jmp 0x2a1907
movsbl 0x30(%rsp), %eax
cmpl $0x40, %eax
jne 0x2a18c6
movq 0x160(%rsp), %rdi
movq 0x158(%rsp), %rsi
movq 0x140(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x2a5480
movl %eax, 0x14c(%rsp)
cmpl $0x0, 0x14c(%rsp)
je 0x2a18c4
movq 0x150(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x158(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq 0x20(%rsp), %rdi
movq %rax, %rdx
leaq 0x2e3d9b(%rip), %rsi    # 0x585658
movb $0x0, %al
callq 0xd88c0
jmp 0x2a1905
movq 0x150(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x158(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq 0x18(%rsp), %rdi
movq %rax, %rdx
leaq 0x2e3d7f(%rip), %rsi    # 0x585672
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x14c(%rsp) # imm = 0xFFFFFFFF
jmp 0x2a1907
jmp 0x2a194f
jmp 0x2a190b
cmpq $0x0, 0x28(%rsp)
je 0x2a194b
movq 0x39a686(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2746ef(%rip), %rsi    # 0x516013
leaq 0x2e3d5a(%rip), %rdx    # 0x585685
leaq 0x2e3d67(%rip), %rcx    # 0x585699
leaq 0x2e3677(%rip), %r8     # 0x584fb0
movl $0x372, %r9d            # imm = 0x372
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a194d
jmp 0x2a194f
movq 0x160(%rsp), %rax
testb $0x1, 0x8f1(%rax)
jne 0x2a196d
movq 0x160(%rsp), %rdi
callq 0x2a57b0
jmp 0x2a196f
movq 0x160(%rsp), %rax
movq 0x860(%rax), %rax
movq 0x158(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x2a19c4
movq 0x39a60d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x274676(%rip), %rsi    # 0x516013
leaq 0x2e3d1d(%rip), %rdx    # 0x5856c1
leaq 0x2e3cee(%rip), %rcx    # 0x585699
leaq 0x2e35fe(%rip), %r8     # 0x584fb0
movl $0x376, %r9d            # imm = 0x376
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a19c6
movq 0x160(%rsp), %rax
movq 0x860(%rax), %rcx
movq 0x158(%rsp), %rax
subq 0x38(%rax), %rcx
movq 0x158(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x160(%rsp), %rax
testb $0x1, 0x8f0(%rax)
je 0x2a1a84
movq 0x160(%rsp), %rax
movq 0x908(%rax), %rax
movq 0x160(%rsp), %rcx
movq 0x860(%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x158(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x2a1a49
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x2a1a71
movq 0x160(%rsp), %rax
movq 0x908(%rax), %rax
movq 0x158(%rsp), %rcx
movq 0x38(%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
subq %rcx, %rax
movq %rax, (%rsp)
jmp 0x2a1aa4
movq 0x160(%rsp), %rax
movq 0x880(%rax), %rax
movq 0x158(%rsp), %rcx
imulq 0x40(%rcx), %rax
movq %rax, (%rsp)
movq (%rsp), %rcx
movq 0x158(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x160(%rsp), %rax
movq 0x900(%rax), %rdx
subq 0x138(%rsp), %rdx
movq 0x160(%rsp), %rax
movq 0x8f8(%rax), %rax
subq 0x130(%rsp), %rax
imulq $0x3, %rax, %rax
addq %rax, %rdx
movq 0x158(%rsp), %rax
movq 0x28(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x28(%rax)
cmpl $0x0, 0x14c(%rsp)
jne 0x2a1b30
movq 0x140(%rsp), %rdi
movq 0x158(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x150(%rsp), %rdx
callq 0x2a5a80
movl %eax, 0x14c(%rsp)
jmp 0x2a1b3d
movq 0x140(%rsp), %rdi
callq 0xd9390
jmp 0x2a1b3f
movl 0x14c(%rsp), %eax
addq $0x168, %rsp            # imm = 0x168
retq
nop