// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_encode_twofile_paired_fastq_library
static int gt_reads2twobit_encode_twofile_paired_fastq_library(
    GtReads2TwobitEncodeState *state, GtReadsLibraryInfo *rli, FILE *file1,
    FILE *file2, char *line1)
{
  int had_err = 0;
  GtUword qbuf_next = 0;
  bool qmode = false;
  bool file2new = true;
  char *fgetsretval = NULL,
       line2[GT_READS2TWOBIT_READBUFFER_SIZE];
  line2[0] = '\0';
  state->seqlen = 0;
  state->exp_qlen = 0;
  do {
    if (!qmode)
    {
      if (line1[0] == '@')
      {
        if (state->current.nofseqs > rli->first_seqnum)
        {
          if (!state->invalid_mode)
            gt_reads2twobit_process_sequence_end(state);
          had_err = gt_reads2twobit_process_fastq_mate_pair(state, line2,
              file2, &file2new);
        }
        else
        {
          if (state->invalid_mode)
            had_err = gt_reads2twobit_process_fastq_mate_pair(state, line2,
                file2, &file2new);
        }
        gt_reads2twobit_process_desc_line(state, line1, false, false);
        GT_READS2TWOBIT_HANDLE_LONG_DESCRIPTIONS(line1, file1, fgetsretval,
            true, state, false);
        gt_assert((state->descs == NULL && state->descsfp == NULL) ||
                   gt_str_length(state->dbuf) > 0);
        gt_reads2twobit_prepare_for_new_sequence(state);
      }
      else if (line1[0] == '+')
      {
        GT_READS2TWOBIT_HANDLE_LONG_DESCRIPTIONS(line1, file1, fgetsretval,
            false, state, false);
        if (state->exp_qlen + 1UL > (GtUword)(state->qbuf_size))
        {
          state->qbuf_size = (size_t)state->exp_qlen + 1;
          state->qbuf = gt_realloc(state->qbuf, state->qbuf_size);
        }
        qmode = true;
      }
      else
      {
        gt_reads2twobit_process_sequence_line(state, line1);
      }
    }
    else
    {
      had_err = gt_reads2twobit_process_qualities_line(state, line1,
          state->qbuf, &qbuf_next);
      if (qbuf_next == state->exp_qlen)
      {
        if (state->maxlow != GT_UNDEF_UWORD)
          gt_reads2twobit_apply_quality_filter(state, state->qbuf, qbuf_next);
        qbuf_next = 0;
        qmode = false;
      }
    }
  } while ((fgetsretval = fgets(line1, (int)GT_READS2TWOBIT_READBUFFER_SIZE,
            file1)) == line1 && !had_err);
  if (!had_err && !state->invalid_mode)
    gt_reads2twobit_process_sequence_end(state);
  if (!had_err)
  {
    had_err = gt_reads2twobit_process_fastq_mate_pair(state, line2, file2,
        &file2new);
  }
  return had_err;
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x150(%rsp)
movq %rsi, 0x148(%rsp)
movq %rdx, 0x140(%rsp)
movq %rcx, 0x138(%rsp)
movq %r8, 0x130(%rsp)
movl $0x0, 0x12c(%rsp)
movq $0x0, 0x120(%rsp)
movb $0x0, 0x11f(%rsp)
movb $0x1, 0x11e(%rsp)
movq $0x0, 0x110(%rsp)
movb $0x0, 0x10(%rsp)
movq 0x150(%rsp), %rax
movq $0x0, 0x808(%rax)
movq 0x150(%rsp), %rax
movq $0x0, 0x818(%rax)
testb $0x1, 0x11f(%rsp)
jne 0x2a7c61
movq 0x130(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x2a7b27
movq 0x150(%rsp), %rax
movq 0x860(%rax), %rax
movq 0x148(%rsp), %rcx
cmpq 0x38(%rcx), %rax
jbe 0x2a79a5
movq 0x150(%rsp), %rax
testb $0x1, 0x8f1(%rax)
jne 0x2a797a
movq 0x150(%rsp), %rdi
callq 0x2a57b0
movq 0x150(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq 0x138(%rsp), %rdx
leaq 0x11e(%rsp), %rcx
callq 0x2a8080
movl %eax, 0x12c(%rsp)
jmp 0x2a79e1
movq 0x150(%rsp), %rax
testb $0x1, 0x8f1(%rax)
je 0x2a79df
movq 0x150(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq 0x138(%rsp), %rdx
leaq 0x11e(%rsp), %rcx
callq 0x2a8080
movl %eax, 0x12c(%rsp)
jmp 0x2a79e1
movq 0x150(%rsp), %rdi
movq 0x130(%rsp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x2a5c70
movq 0x130(%rsp), %rdi
callq 0x192b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0xff, %rcx
movb %al, 0xf(%rsp)
jne 0x2a7a43
movq 0x130(%rsp), %rax
movsbl 0xfe(%rax), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, 0xf(%rsp)
je 0x2a7a43
cmpq $0x0, 0x110(%rsp)
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x2a7a4d
jmp 0x2a7a9b
movq 0x130(%rsp), %rdi
movq 0x140(%rsp), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x19b60
movq %rax, 0x110(%rsp)
cmpq $0x0, 0x110(%rsp)
je 0x2a7a96
movq 0x150(%rsp), %rdi
movq 0x130(%rsp), %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x2a5c70
jmp 0x2a79fa
jmp 0x2a7a9d
movq 0x150(%rsp), %rax
cmpq $0x0, 0x990(%rax)
jne 0x2a7ac1
movq 0x150(%rsp), %rax
cmpq $0x0, 0x998(%rax)
je 0x2a7b13
movq 0x150(%rsp), %rax
movq 0x948(%rax), %rdi
callq 0x11dfa0
cmpq $0x0, %rax
ja 0x2a7b13
movq 0x3944be(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x26e527(%rip), %rsi    # 0x516013
leaq 0x2de104(%rip), %rdx    # 0x585bf7
leaq 0x2de150(%rip), %rcx    # 0x585c4a
leaq 0x2dd4af(%rip), %r8     # 0x584fb0
movl $0x44e, %r9d            # imm = 0x44E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2a7b15
movq 0x150(%rsp), %rdi
callq 0x2a5d20
jmp 0x2a7c5c
movq 0x130(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x2a7c45
jmp 0x2a7b3d
movq 0x130(%rsp), %rdi
callq 0x192b0
movq %rax, %rcx
xorl %eax, %eax
cmpq $0xff, %rcx
movb %al, 0xe(%rsp)
jne 0x2a7b86
movq 0x130(%rsp), %rax
movsbl 0xfe(%rax), %ecx
xorl %eax, %eax
cmpl $0xa, %ecx
movb %al, 0xe(%rsp)
je 0x2a7b86
cmpq $0x0, 0x110(%rsp)
setne %al
movb %al, 0xe(%rsp)
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x2a7b90
jmp 0x2a7bb4
movq 0x130(%rsp), %rdi
movq 0x140(%rsp), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x19b60
movq %rax, 0x110(%rsp)
jmp 0x2a7b3d
movq 0x150(%rsp), %rax
movq 0x818(%rax), %rax
addq $0x1, %rax
movq 0x150(%rsp), %rcx
cmpq 0x938(%rcx), %rax
jbe 0x2a7c3b
movq 0x150(%rsp), %rax
movq 0x818(%rax), %rcx
addq $0x1, %rcx
movq 0x150(%rsp), %rax
movq %rcx, 0x938(%rax)
movq 0x150(%rsp), %rax
movq 0x920(%rax), %rdi
movq 0x150(%rsp), %rax
movq 0x938(%rax), %rsi
leaq 0x2dd391(%rip), %rdx    # 0x584fb0
movl $0x458, %ecx            # imm = 0x458
callq 0xe8540
movq %rax, %rcx
movq 0x150(%rsp), %rax
movq %rcx, 0x920(%rax)
movb $0x1, 0x11f(%rsp)
jmp 0x2a7c5a
movq 0x150(%rsp), %rdi
movq 0x130(%rsp), %rsi
callq 0x2a5db0
jmp 0x2a7c5c
jmp 0x2a7cf9
movq 0x150(%rsp), %rdi
movq 0x130(%rsp), %rsi
movq 0x150(%rsp), %rax
movq 0x920(%rax), %rdx
leaq 0x120(%rsp), %rcx
callq 0x2a68c0
movl %eax, 0x12c(%rsp)
movq 0x120(%rsp), %rax
movq 0x150(%rsp), %rcx
cmpq 0x818(%rcx), %rax
jne 0x2a7cf7
movq 0x150(%rsp), %rax
cmpq $-0x1, 0x958(%rax)
je 0x2a7ce3
movq 0x150(%rsp), %rdi
movq 0x150(%rsp), %rax
movq 0x920(%rax), %rsi
movq 0x120(%rsp), %rdx
callq 0x2a6980
movq $0x0, 0x120(%rsp)
movb $0x0, 0x11f(%rsp)
jmp 0x2a7cf9
jmp 0x2a7cfb
movq 0x130(%rsp), %rdi
movq 0x140(%rsp), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x19b60
movq %rax, %rcx
movq %rcx, 0x110(%rsp)
xorl %eax, %eax
cmpq 0x130(%rsp), %rcx
movb %al, 0xd(%rsp)
jne 0x2a7d41
cmpl $0x0, 0x12c(%rsp)
setne %al
xorb $-0x1, %al
movb %al, 0xd(%rsp)
movb 0xd(%rsp), %al
testb $0x1, %al
jne 0x2a791d
cmpl $0x0, 0x12c(%rsp)
jne 0x2a7d75
movq 0x150(%rsp), %rax
testb $0x1, 0x8f1(%rax)
jne 0x2a7d75
movq 0x150(%rsp), %rdi
callq 0x2a57b0
cmpl $0x0, 0x12c(%rsp)
jne 0x2a7da8
movq 0x150(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq 0x138(%rsp), %rdx
leaq 0x11e(%rsp), %rcx
callq 0x2a8080
movl %eax, 0x12c(%rsp)
movl 0x12c(%rsp), %eax
addq $0x158, %rsp            # imm = 0x158
retq
nopw (%rax,%rax)