// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_encode_paired_library
static int gt_reads2twobit_encode_paired_library(
    GtReads2TwobitEncodeState *state, GtReadsLibraryInfo *rli, GtError *err)
{
  int had_err = 0;
  FILE *file1, *file2 = NULL;
  gt_assert(rli->filename1 != NULL);
  file1 = gt_fa_fopen(gt_str_get(rli->filename1), "r", err);
  if (file1 == NULL)
    had_err = -1;
  if (!had_err && rli->filename2 != NULL)
  {
    file2 = gt_fa_fopen(gt_str_get(rli->filename2), "r", err);
    if (file2 == NULL)
      had_err = -1;
  }
  if (!had_err)
  {
    const GtUword invalid_tl_before = state->invalid_total_length,
          invalid_s_before = state->invalid_sequences;
    char line1[GT_READS2TWOBIT_READBUFFER_SIZE],
         *fgetsretval;
    rli->first_seqnum = state->current.nofseqs;
    fgetsretval = fgets(line1, (int)GT_READS2TWOBIT_READBUFFER_SIZE, file1);
    if (fgetsretval == line1)
    {
      if (line1[0] == '>')
      {
        if (file2 == NULL)
        {
          gt_log_log("encode interleaved paired fasta library");
          gt_reads2twobit_encode_interleaved_paired_fasta_library(state, rli,
              file1, line1);
        }
        else
        {
          gt_log_log("encode two-file paired fasta library");
          gt_reads2twobit_encode_twofile_paired_fasta_library(state, rli, file1,
              file2, line1);
        }
      }
      else if (line1[0] == '@')
      {
        if (file2 == NULL)
        {
          gt_log_log("encode interleaved paired fastQ library");
          had_err = gt_reads2twobit_encode_interleaved_paired_fastq_library(
              state, rli, file1, line1);
        }
        else
        {
          gt_log_log("encode two-file paired fastQ library");
          had_err = gt_reads2twobit_encode_twofile_paired_fastq_library(
              state, rli, file1, file2, line1);
        }
        if (had_err != 0)
          gt_error_set(err, "%s: error in FASTQ format", had_err == -1 ?
              gt_str_get(rli->filename1) : gt_str_get(rli->filename2));
      }
      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);
    }
    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(file1, rli->filename1, err);
  else if (file1 != NULL)
    gt_fa_fclose(file1);
  if (!had_err && file2 != NULL)
    had_err = gt_reads2twobit_close_file(file2, rli->filename2, err);
  else if (file2 != NULL)
    gt_fa_fclose(file2);
  return had_err;
}

// Assembly:
subq $0x188, %rsp            # imm = 0x188
movq %rdi, 0x180(%rsp)
movq %rsi, 0x178(%rsp)
movq %rdx, 0x170(%rsp)
movl $0x0, 0x16c(%rsp)
movq $0x0, 0x158(%rsp)
movq 0x178(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x2a1bcd
movq 0x39a404(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x27446d(%rip), %rsi    # 0x516013
leaq 0x2e3f26(%rip), %rdx    # 0x585ad3
leaq 0x2e3f36(%rip), %rcx    # 0x585aea
leaq 0x2e33f5(%rip), %r8     # 0x584fb0
movl $0x4f7, %r9d            # imm = 0x4F7
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a1bcf
movq 0x178(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x170(%rsp), %r8
leaq 0x28a3e8(%rip), %rsi    # 0x52bfda
leaq 0x2e33b7(%rip), %rdx    # 0x584fb0
movl $0x4f8, %ecx            # imm = 0x4F8
callq 0xd8df0
movq %rax, 0x160(%rsp)
cmpq $0x0, 0x160(%rsp)
jne 0x2a1c21
movl $0xffffffff, 0x16c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x16c(%rsp)
jne 0x2a1c8e
movq 0x178(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2a1c8e
movq 0x178(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x170(%rsp), %r8
leaq 0x28a37d(%rip), %rsi    # 0x52bfda
leaq 0x2e334c(%rip), %rdx    # 0x584fb0
movl $0x4fd, %ecx            # imm = 0x4FD
callq 0xd8df0
movq %rax, 0x158(%rsp)
cmpq $0x0, 0x158(%rsp)
jne 0x2a1c8c
movl $0xffffffff, 0x16c(%rsp) # imm = 0xFFFFFFFF
jmp 0x2a1c8e
cmpl $0x0, 0x16c(%rsp)
jne 0x2a20ad
movq 0x180(%rsp), %rax
movq 0x900(%rax), %rax
movq %rax, 0x150(%rsp)
movq 0x180(%rsp), %rax
movq 0x8f8(%rax), %rax
movq %rax, 0x148(%rsp)
movq 0x180(%rsp), %rax
movq 0x860(%rax), %rcx
movq 0x178(%rsp), %rax
movq %rcx, 0x38(%rax)
leaq 0x40(%rsp), %rdi
movq 0x160(%rsp), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x19b60
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
leaq 0x40(%rsp), %rcx
cmpq %rcx, %rax
jne 0x2a1ed5
movsbl 0x40(%rsp), %eax
cmpl $0x3e, %eax
jne 0x2a1d98
cmpq $0x0, 0x158(%rsp)
jne 0x2a1d5b
leaq 0x2e3de0(%rip), %rdi    # 0x585b10
movb $0x0, %al
callq 0xe7740
movq 0x180(%rsp), %rdi
movq 0x178(%rsp), %rsi
movq 0x160(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0x2a7040
jmp 0x2a1d93
leaq 0x2e3dd6(%rip), %rdi    # 0x585b38
movb $0x0, %al
callq 0xe7740
movq 0x180(%rsp), %rdi
movq 0x178(%rsp), %rsi
movq 0x160(%rsp), %rdx
movq 0x158(%rsp), %rcx
leaq 0x40(%rsp), %r8
callq 0x2a7240
jmp 0x2a1ed3
movsbl 0x40(%rsp), %eax
cmpl $0x40, %eax
jne 0x2a1e92
cmpq $0x0, 0x158(%rsp)
jne 0x2a1dea
leaq 0x2e3da5(%rip), %rdi    # 0x585b5d
movb $0x0, %al
callq 0xe7740
movq 0x180(%rsp), %rdi
movq 0x178(%rsp), %rsi
movq 0x160(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0x2a7480
movl %eax, 0x16c(%rsp)
jmp 0x2a1e29
leaq 0x2e3d94(%rip), %rdi    # 0x585b85
movb $0x0, %al
callq 0xe7740
movq 0x180(%rsp), %rdi
movq 0x178(%rsp), %rsi
movq 0x160(%rsp), %rdx
movq 0x158(%rsp), %rcx
leaq 0x40(%rsp), %r8
callq 0x2a7890
movl %eax, 0x16c(%rsp)
cmpl $0x0, 0x16c(%rsp)
je 0x2a1e90
movq 0x170(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpl $-0x1, 0x16c(%rsp)
jne 0x2a1e62
movq 0x178(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq %rax, 0x28(%rsp)
jmp 0x2a1e78
movq 0x178(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x11dee0
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x2e37cf(%rip), %rsi    # 0x585658
movb $0x0, %al
callq 0xd88c0
jmp 0x2a1ed1
movq 0x170(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x178(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x11dee0
movq 0x20(%rsp), %rdi
movq %rax, %rdx
leaq 0x2e37b3(%rip), %rsi    # 0x585672
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x16c(%rsp) # imm = 0xFFFFFFFF
jmp 0x2a1ed3
jmp 0x2a1f1b
jmp 0x2a1ed7
cmpq $0x0, 0x38(%rsp)
je 0x2a1f17
movq 0x39a0ba(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x274123(%rip), %rsi    # 0x516013
leaq 0x2e378e(%rip), %rdx    # 0x585685
leaq 0x2e3bec(%rip), %rcx    # 0x585aea
leaq 0x2e30ab(%rip), %r8     # 0x584fb0
movl $0x535, %r9d            # imm = 0x535
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a1f19
jmp 0x2a1f1b
jmp 0x2a1f1d
movq 0x180(%rsp), %rax
movq 0x860(%rax), %rax
movq 0x178(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jae 0x2a1f72
movq 0x39a05f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2740c8(%rip), %rsi    # 0x516013
leaq 0x2e376f(%rip), %rdx    # 0x5856c1
leaq 0x2e3b91(%rip), %rcx    # 0x585aea
leaq 0x2e3050(%rip), %r8     # 0x584fb0
movl $0x537, %r9d            # imm = 0x537
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a1f74
movq 0x180(%rsp), %rax
movq 0x860(%rax), %rcx
movq 0x178(%rsp), %rax
subq 0x38(%rax), %rcx
movq 0x178(%rsp), %rax
movq %rcx, 0x40(%rax)
movq 0x180(%rsp), %rax
testb $0x1, 0x8f0(%rax)
je 0x2a2033
movq 0x180(%rsp), %rax
movq 0x908(%rax), %rax
movq 0x180(%rsp), %rcx
movq 0x860(%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x178(%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x2a1ff7
xorl %eax, %eax
movq %rax, 0x10(%rsp)
jmp 0x2a201f
movq 0x180(%rsp), %rax
movq 0x908(%rax), %rax
movq 0x178(%rsp), %rcx
movq 0x38(%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rsp), %rcx
subq %rcx, %rax
movq %rax, 0x8(%rsp)
jmp 0x2a2054
movq 0x180(%rsp), %rax
movq 0x880(%rax), %rax
movq 0x178(%rsp), %rcx
imulq 0x40(%rcx), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rcx
movq 0x178(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x180(%rsp), %rax
movq 0x900(%rax), %rdx
subq 0x150(%rsp), %rdx
movq 0x180(%rsp), %rax
movq 0x8f8(%rax), %rax
subq 0x148(%rsp), %rax
imulq $0x3, %rax, %rax
addq %rax, %rdx
movq 0x178(%rsp), %rax
movq 0x28(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x28(%rax)
cmpl $0x0, 0x16c(%rsp)
jne 0x2a20e1
movq 0x160(%rsp), %rdi
movq 0x178(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x170(%rsp), %rdx
callq 0x2a5a80
movl %eax, 0x16c(%rsp)
jmp 0x2a20fb
cmpq $0x0, 0x160(%rsp)
je 0x2a20f9
movq 0x160(%rsp), %rdi
callq 0xd9390
jmp 0x2a20fb
cmpl $0x0, 0x16c(%rsp)
jne 0x2a213a
cmpq $0x0, 0x158(%rsp)
je 0x2a213a
movq 0x158(%rsp), %rdi
movq 0x178(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x170(%rsp), %rdx
callq 0x2a5a80
movl %eax, 0x16c(%rsp)
jmp 0x2a2154
cmpq $0x0, 0x158(%rsp)
je 0x2a2152
movq 0x158(%rsp), %rdi
callq 0xd9390
jmp 0x2a2154
movl 0x16c(%rsp), %eax
addq $0x188, %rsp            # imm = 0x188
retq
nopw %cs:(%rax,%rax)