// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %rbx
movb 0x8f1(%rdi), %bpl
movq 0x808(%rdi), %r13
andq $0x0, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, %r15
cmpq $0x0, 0x990(%rdi)
jne 0x18ce5e
cmpq $0x0, 0x998(%rbx)
je 0x18ce73
movq 0x948(%rbx), %rdi
callq 0xad289
testq %rax, %rax
je 0x18d155
cmpb $0x1, (%r12)
jne 0x18cea1
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17bc0
cmpq %r15, %rax
jne 0x18d1b1
movb $0x0, (%r12)
testq %r15, %r15
setne %r12b
jmp 0x18cea4
xorl %r12d, %r12d
movb %bpl, 0x7(%rsp)
cmpb $0x40, (%r15)
jne 0x18d124
pushq $0x1
popq %rbp
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x18c7d7
movq %r15, %rdi
callq 0x172d0
cmpq $0xff, %rax
jne 0x18cf11
cmpb $0xa, 0xfe(%r15)
sete %al
notb %r12b
orb %al, %r12b
testb $0x1, %r12b
jne 0x18cf11
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17bc0
testq %rax, %rax
setne %r12b
je 0x18cec5
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %ebp, %ecx
jmp 0x18cec0
movq %r13, 0x10(%rsp)
cmpq $0x0, 0x990(%rbx)
jne 0x18cf2a
cmpq $0x0, 0x998(%rbx)
je 0x18cf3f
movq 0x950(%rbx), %rdi
callq 0xad289
testq %rax, %rax
je 0x18d183
movq 0x808(%rbx), %rax
movq %rax, 0x810(%rbx)
andq $0x0, 0x808(%rbx)
andq $0x0, 0x818(%rbx)
leaq 0x860(%rbx), %rax
leaq 0x8f8(%rbx), %rcx
cmpb $0x0, 0x8f1(%rbx)
cmovneq %rcx, %rax
incq (%rax)
xorl %ebp, %ebp
movb $0x1, %r13b
xorl %r12d, %r12d
testb $0x1, %r13b
je 0x18d113
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17bc0
testq %rax, %rax
je 0x18d0bd
testb $0x1, %r12b
je 0x18cfec
movq 0x928(%rbx), %rdx
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x8(%rsp), %rcx
callq 0x18cb32
movb $0x1, %r12b
xorl %r13d, %r13d
pushq $-0x2
popq %rbp
testl %eax, %eax
jne 0x18cf81
movq 0x8(%rsp), %rdx
movb $0x1, %r13b
movl $0x0, %ebp
movb $0x1, %r12b
cmpq 0x818(%rbx), %rdx
jne 0x18cf81
jmp 0x18d082
movq %rax, %r13
movzbl (%r15), %eax
cmpl $0x2b, %eax
jne 0x18d0a8
jmp 0x18d011
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x17bc0
movq %rax, %r13
movq %r15, %rdi
callq 0x172d0
cmpq $0xff, %rax
jne 0x18d030
testq %r13, %r13
je 0x18d030
cmpb $0xa, 0xfe(%r15)
jne 0x18cffe
movq 0x818(%rbx), %rsi
incq %rsi
movb $0x1, %r13b
movl $0x0, %ebp
movb $0x1, %r12b
cmpq 0x940(%rbx), %rsi
jbe 0x18cf81
movq %rsi, 0x940(%rbx)
movq 0x928(%rbx), %rdi
leaq 0x1c55ef(%rip), %rdx    # 0x352656
movl $0x3b6, %ecx            # imm = 0x3B6
callq 0x93472
movq %rax, 0x928(%rbx)
xorl %ebp, %ebp
movb $0x1, %r12b
jmp 0x18cf81
cmpq $-0x1, 0x958(%rbx)
je 0x18d09b
movq 0x928(%rbx), %rsi
movq %rbx, %rdi
callq 0x18cb61
andq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
jmp 0x18cf7e
cmpl $0x40, %eax
je 0x18d0bd
movq %rbx, %rdi
movq %r15, %rsi
callq 0x18c805
jmp 0x18cf79
movq %rbx, %rdi
callq 0x18c4cd
cmpb $0x0, 0x8f1(%rbx)
jne 0x18d0d6
movq %rbx, %rdi
callq 0x18bfb0
cmpb $0x0, 0x7(%rsp)
jne 0x18d113
cmpb $0x1, 0x8f1(%rbx)
jne 0x18d113
movq 0x10(%rsp), %rax
decq %rax
movdqu 0x8f8(%rbx), %xmm0
movq %rax, %xmm1
movdqa 0x18a38d(%rip), %xmm2   # 0x317490
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
paddq %xmm0, %xmm2
movdqu %xmm2, 0x8f8(%rbx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2aae3d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x157ede(%rip), %rsi    # 0x2e5013
leaq 0x1c6196(%rip), %rdx    # 0x3532d2
leaq 0x1c6167(%rip), %rcx    # 0x3532aa
leaq 0x1c550c(%rip), %r8     # 0x352656
movl $0x399, %r9d            # imm = 0x399
jmp 0x18d1dd
movq 0x2aae0c(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x157ead(%rip), %rsi    # 0x2e5013
leaq 0x1c60b6(%rip), %rdx    # 0x353223
leaq 0x1c6136(%rip), %rcx    # 0x3532aa
leaq 0x1c54db(%rip), %r8     # 0x352656
movl $0x391, %r9d            # imm = 0x391
jmp 0x18d1dd
movq 0x2aadde(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x157e7f(%rip), %rsi    # 0x2e5013
leaq 0x1c6147(%rip), %rdx    # 0x3532e2
leaq 0x1c6108(%rip), %rcx    # 0x3532aa
leaq 0x1c54ad(%rip), %r8     # 0x352656
movl $0x39e, %r9d            # imm = 0x39E
jmp 0x18d1dd
movq 0x2aadb0(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x157e51(%rip), %rsi    # 0x2e5013
leaq 0x1c600d(%rip), %rdx    # 0x3531d6
leaq 0x1c60da(%rip), %rcx    # 0x3532aa
leaq 0x1c547f(%rip), %r8     # 0x352656
movl $0x395, %r9d            # imm = 0x395
xorl %eax, %eax
callq 0x17a50
callq 0x17390