// File: /workspace/github_c_makefile_star2_O3/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 $0x18, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movb 0x8f1(%rdi), %bpl
movq 0x808(%rdi), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x990(%rdi)
jne 0x1dee87
cmpq $0x0, 0x998(%rbx)
je 0x1dee98
movq 0x948(%rbx), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0x1deeed
cmpb $0x1, (%r12)
jne 0x1deebe
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17c30
cmpq %r15, %rax
jne 0x1deef2
movb $0x0, (%r12)
movq %r15, %r12
jmp 0x1deec1
xorl %r12d, %r12d
cmpb $0x40, (%r15)
jne 0x1deee8
cmpq $0x0, 0x990(%rbx)
jne 0x1deedb
cmpq $0x0, 0x998(%rbx)
je 0x1deefc
movq 0x950(%rbx), %rdi
leaq 0x1(%r15), %rsi
jmp 0x1deef7
callq 0x73f1f
callq 0x73ead
callq 0x73ee6
callq 0x11acf3
movq %r15, %rdi
callq 0x172f0
cmpq $0xff, %rax
jne 0x1def53
testq %r12, %r12
je 0x1def53
cmpb $0xa, 0xfe(%r15)
je 0x1def53
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17c30
movq %rax, %r12
testq %rax, %rax
je 0x1deefc
cmpq $0x0, 0x990(%rbx)
jne 0x1def47
cmpq $0x0, 0x998(%rbx)
je 0x1deefc
movq 0x950(%rbx), %rdi
movq %r15, %rsi
jmp 0x1deef7
movb %bpl, 0x7(%rsp)
cmpq $0x0, 0x990(%rbx)
jne 0x1def6c
cmpq $0x0, 0x998(%rbx)
je 0x1def81
movq 0x950(%rbx), %rdi
callq 0x11b0ca
testq %rax, %rax
je 0x1df16f
movq 0x808(%rbx), %rax
movq %rax, 0x810(%rbx)
xorl %eax, %eax
movq %rax, 0x808(%rbx)
movq %rax, 0x818(%rbx)
leaq 0x860(%rbx), %rax
leaq 0x8f8(%rbx), %rcx
cmpb $0x0, 0x8f1(%rbx)
cmovneq %rcx, %rax
incq (%rax)
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17c30
testq %rax, %rax
je 0x1df101
movq %rax, %rbp
leaq 0x1(%r15), %rax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
testb $0x1, %r12b
je 0x1df055
movb (%r15), %dl
testb %dl, %dl
je 0x1df024
movq 0x928(%rbx), %rax
movq 0x10(%rsp), %rcx
subb 0x918(%rbx), %dl
jl 0x1df01b
cmpq 0x818(%rbx), %r13
je 0x1df15b
movb %dl, (%rax,%r13)
incq %r13
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x1defff
movb $0x1, %r12b
cmpq 0x818(%rbx), %r13
jne 0x1df0e5
cmpq $-0x1, 0x958(%rbx)
je 0x1df050
movq 0x928(%rbx), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x1debfd
xorl %r13d, %r13d
jmp 0x1df072
movzbl (%r15), %eax
cmpl $0x2b, %eax
je 0x1df08a
cmpl $0x40, %eax
je 0x1df101
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1de8e8
xorl %r12d, %r12d
jmp 0x1df0e5
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17c30
movq %rax, %rbp
movq %r15, %rdi
callq 0x172f0
cmpq $0xff, %rax
jne 0x1df0a9
testq %rbp, %rbp
je 0x1df0a9
cmpb $0xa, 0xfe(%r15)
jne 0x1df077
movq 0x818(%rbx), %rsi
incq %rsi
movb $0x1, %r12b
cmpq 0x940(%rbx), %rsi
jbe 0x1df0e5
movq %rsi, 0x940(%rbx)
movq 0x928(%rbx), %rdi
leaq 0x1d3120(%rip), %rdx    # 0x3b21f4
movl $0x3b6, %ecx            # imm = 0x3B6
callq 0x104461
movq %rax, 0x928(%rbx)
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17c30
movq %rax, %rbp
testq %rax, %rax
jne 0x1defe6
movq %rbx, %rdi
callq 0x1de639
cmpb $0x0, 0x8f1(%rbx)
jne 0x1df11a
movq %rbx, %rdi
callq 0x1de2bf
xorl %eax, %eax
cmpb $0x0, 0x7(%rsp)
jne 0x1df160
cmpb $0x1, 0x8f1(%rbx)
jne 0x1df160
movq 0x8(%rsp), %rcx
decq %rcx
movdqu 0x8f8(%rbx), %xmm0
movq %rcx, %xmm1
movdqa 0x198037(%rip), %xmm2   # 0x377180
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
paddq %xmm0, %xmm2
movdqu %xmm2, 0x8f8(%rbx)
jmp 0x1df160
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x73f58