// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/reads2twobit.c
// Function: gt_reads2twobit_process_fastq_mate_pair
static inline int gt_reads2twobit_process_fastq_mate_pair(
    GtReads2TwobitEncodeState *state, char *line2, FILE *file2, bool *file2new)
{
  int had_err = 0;
  char *fgetsretval = NULL;
  bool was_invalid = state->invalid_mode;
  GtUword prev_seqlen = state->seqlen;
  GtUword qbuf2_next = 0;
  bool qmode = false;
  gt_assert((state->descs == NULL && state->descsfp == NULL) ||
             gt_str_length(state->dbuf) > 0);
  if (*file2new)
  {
    fgetsretval = fgets(line2, (int)GT_READS2TWOBIT_READBUFFER_SIZE, file2);
    gt_assert(fgetsretval == line2);
    *file2new = false;
  }
  /* at this point one line2 is always the (beginnning of the) @ description */
  gt_assert(line2[0] == '@');
  gt_reads2twobit_process_desc_line(state, line2, true, false);
  GT_READS2TWOBIT_HANDLE_LONG_DESCRIPTIONS(line2, file2, fgetsretval, true,
      state, true);
  gt_assert((state->descs == NULL && state->descsfp == NULL) ||
             gt_str_length(state->dbuf2) > 0);
  state->seqlen_mate = state->seqlen;
  state->seqlen = 0;
  state->exp_qlen = 0;
  if (!state->invalid_mode)
    state->current.nofseqs++;
  else
    state->invalid_sequences++;
  while (!had_err)
  {
    fgetsretval = fgets(line2, (int)GT_READS2TWOBIT_READBUFFER_SIZE, file2);
    if (fgetsretval == NULL)
      break;
    if (!qmode)
    {
      if (line2[0] == '@')
        break;
      else if (line2[0] == '+')
      {
        GT_READS2TWOBIT_HANDLE_LONG_DESCRIPTIONS(line2, file2, fgetsretval,
            false, state, true);
        if (state->exp_qlen + 1UL > (GtUword)(state->qbuf2_size))
        {
          state->qbuf2_size = (size_t)state->exp_qlen + 1;
          state->qbuf2 = gt_realloc(state->qbuf2, state->qbuf2_size);
        }
        qmode = true;
      }
      else
      {
        gt_reads2twobit_process_sequence_line(state, line2);
      }
    }
    else
    {
      had_err = gt_reads2twobit_process_qualities_line(state, line2,
          state->qbuf2, &qbuf2_next);
      if (had_err == -1)
        had_err = -2;
      if (!had_err && qbuf2_next == state->exp_qlen)
      {
        if (state->maxlow != GT_UNDEF_UWORD)
          gt_reads2twobit_apply_quality_filter(state, state->qbuf2, qbuf2_next);
        qbuf2_next = 0;
        qmode = false;
      }
    }
  }
  if (!had_err)
    gt_reads2twobit_finalize_descriptions(state);
  if (!had_err && !state->invalid_mode)
    gt_reads2twobit_process_sequence_end(state);
  if (!had_err && !was_invalid && state->invalid_mode)
  {
    state->invalid_sequences++;
    state->invalid_total_length += (prev_seqlen - 1UL);
  }
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movb 0x8f1(%rdi), %r12b
movq 0x808(%rdi), %rbp
cmpq $0x0, 0x990(%rdi)
jne 0x1e86ab
cmpq $0x0, 0x998(%rbx)
je 0x1e86bc
movq 0x948(%rbx), %rdi
callq 0x120d4c
testq %rax, %rax
je 0x1e8716
movb %r12b, 0xf(%rsp)
cmpb $0x1, (%r13)
jne 0x1e86e7
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17c30
cmpq %r15, %rax
jne 0x1e871b
movq %rax, %r12
movb $0x0, (%r13)
jmp 0x1e86ea
xorl %r12d, %r12d
cmpb $0x40, (%r15)
jne 0x1e8711
cmpq $0x0, 0x990(%rbx)
jne 0x1e8704
cmpq $0x0, 0x998(%rbx)
je 0x1e8725
movq 0x950(%rbx), %rdi
leaq 0x1(%r15), %rsi
jmp 0x1e8720
callq 0x75bac
callq 0x75b3a
callq 0x75b73
callq 0x12097f
movq %r15, %rdi
callq 0x172f0
cmpq $0xff, %rax
jne 0x1e877c
testq %r12, %r12
je 0x1e877c
cmpb $0xa, 0xfe(%r15)
je 0x1e877c
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17c30
movq %rax, %r12
testq %rax, %rax
je 0x1e8725
cmpq $0x0, 0x990(%rbx)
jne 0x1e8770
cmpq $0x0, 0x998(%rbx)
je 0x1e8725
movq 0x950(%rbx), %rdi
movq %r15, %rsi
jmp 0x1e8720
movq %rbp, 0x18(%rsp)
cmpq $0x0, 0x990(%rbx)
jne 0x1e8795
cmpq $0x0, 0x998(%rbx)
je 0x1e87aa
movq 0x950(%rbx), %rdi
callq 0x120d4c
testq %rax, %rax
je 0x1e89b9
movq 0x808(%rbx), %rax
movq %rax, 0x810(%rbx)
xorl %eax, %eax
movq %rax, 0x808(%rbx)
movq $0x0, 0x10(%rsp)
movq %rax, 0x818(%rbx)
leaq 0x860(%rbx), %rax
leaq 0x8f8(%rbx), %rcx
cmpb $0x0, 0x8f1(%rbx)
cmovneq %rcx, %rax
incq (%rax)
leaq 0x1(%r15), %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
xorl %r13d, %r13d
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17c30
testq %rax, %rax
je 0x1e8952
testb $0x1, 0x10(%rsp)
je 0x1e8864
movb (%r15), %sil
xorl %ebp, %ebp
movb $0x1, %al
testb %sil, %sil
je 0x1e8904
movq 0x928(%rbx), %rcx
movq 0x20(%rsp), %rdx
subb 0x918(%rbx), %sil
jl 0x1e8854
cmpq 0x818(%rbx), %r13
je 0x1e88fd
movb %sil, (%rcx,%r13)
incq %r13
movb (%rdx), %sil
incq %rdx
testb %sil, %sil
jne 0x1e8837
jmp 0x1e8904
movq %rax, %r12
movzbl (%r15), %eax
cmpl $0x2b, %eax
je 0x1e889c
cmpl $0x40, %eax
je 0x1e8952
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1e811a
jmp 0x1e8948
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17c30
movq %rax, %r12
movq %r15, %rdi
callq 0x172f0
cmpq $0xff, %rax
jne 0x1e88bb
testq %r12, %r12
je 0x1e88bb
cmpb $0xa, 0xfe(%r15)
jne 0x1e8889
movq 0x818(%rbx), %rsi
incq %rsi
movb $0x1, %al
movq %rax, 0x10(%rsp)
cmpq 0x940(%rbx), %rsi
jbe 0x1e8948
movq %rsi, 0x940(%rbx)
movq 0x928(%rbx), %rdi
leaq 0x1d2f0a(%rip), %rdx    # 0x3bb7f4
movl $0x3b6, %ecx            # imm = 0x3B6
callq 0x1094e6
movq %rax, 0x928(%rbx)
jmp 0x1e8948
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %eax, %eax
cmpl $-0x2, %ebp
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmovael %ecx, %ebp
testb %al, %al
je 0x1e8948
xorl %ebp, %ebp
cmpq 0x818(%rbx), %r13
jne 0x1e8948
cmpq $-0x1, 0x958(%rbx)
je 0x1e893a
movq 0x928(%rbx), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x1e841e
xorl %r13d, %r13d
xorl %ebp, %ebp
movq $0x0, 0x10(%rsp)
testl %ebp, %ebp
je 0x1e87fb
jmp 0x1e89a8
movq %rbx, %rdi
callq 0x1e7e65
cmpb $0x0, 0x8f1(%rbx)
jne 0x1e896b
movq %rbx, %rdi
callq 0x1e7aeb
cmpb $0x0, 0xf(%rsp)
jne 0x1e89a8
cmpb $0x1, 0x8f1(%rbx)
jne 0x1e89a8
movq 0x18(%rsp), %rax
decq %rax
movdqu 0x8f8(%rbx), %xmm0
movq %rax, %xmm1
movdqa 0x197a78(%rip), %xmm2   # 0x380410
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
paddq %xmm0, %xmm2
movdqu %xmm2, 0x8f8(%rbx)
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x75be5