// File: /workspace/github_c_makefile_star2_O1/thegenemyers[P]DASCRUBBER/QV.c
// Function: Compress_Next_QVentry
int Compress_Next_QVentry(FILE *input, FILE *output, QVcoding *coding, int lossy)
{ int rlen, clen;

  //  Get all 5 streams, compress each with its scheme, and output

  rlen = Read_Lines(input,5);
  if (rlen < 0)
    { if (rlen == -1)
        EPRINTF(EPLACE,"Line %d: incomplete last entry of .quiv file\n",Nline);
      EXIT (-1);
    }

  if (coding->delChar < 0)
    { Encode(coding->delScheme, output, (uint8 *) Read, rlen);
      clen = rlen;
    }
  else
    { Encode_Run(coding->delScheme, coding->dRunScheme, output,
                 (uint8 *) Read, rlen, coding->delChar);
      clen = Pack_Tag(Read+Rmax,Read,rlen,coding->delChar);
    }
  Number_Read(Read+Rmax);
  Compress_Read(clen,Read+Rmax);
  fwrite(Read+Rmax,1,COMPRESSED_LEN(clen),output);

  if (lossy)
    { uint8 *insert = (uint8 *) (Read+2*Rmax);
      uint8 *merge  = (uint8 *) (Read+3*Rmax);
      int    k;

      for (k = 0; k < rlen; k++)
        { insert[k] = (uint8) ((insert[k] >> 1) << 1);
          merge[k]  = (uint8) (( merge[k] >> 2) << 2);
        }
    }

  Encode(coding->insScheme, output, (uint8 *) (Read+2*Rmax), rlen);
  Encode(coding->mrgScheme, output, (uint8 *) (Read+3*Rmax), rlen);
  if (coding->subChar < 0)
    Encode(coding->subScheme, output, (uint8 *) (Read+4*Rmax), rlen);
  else
    Encode_Run(coding->subScheme, coding->sRunScheme, output,
               (uint8 *) (Read+4*Rmax), rlen, coding->subChar);

  return (rlen);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movl $0x5, %esi
callq 0x78ce
movl %eax, %ebx
testl %eax, %eax
js 0x95af
movl 0x30(%r15), %r9d
movq (%r15), %rdi
testl %r9d, %r9d
js 0x9467
movq 0x20(%r15), %rsi
movq 0x9516(%rip), %rcx      # 0x12930
movq %r14, %rdx
movl %ebx, %r8d
callq 0x9045
movq 0x9504(%rip), %rcx      # 0x12930
movslq 0x6d85(%rip), %rax      # 0x101b8
addq %rcx, %rax
testl %ebx, %ebx
je 0x947d
movl 0x30(%r15), %edx
movl %ebx, %esi
xorl %edi, %edi
xorl %r12d, %r12d
movsbl (%rcx,%rdi), %r8d
cmpl %r8d, %edx
je 0x945d
movb (%rax,%rdi), %r8b
movslq %r12d, %r9
incl %r12d
movb %r8b, (%rax,%r9)
incq %rdi
cmpq %rdi, %rsi
jne 0x9445
jmp 0x9480
movq 0x94c2(%rip), %rdx      # 0x12930
movq %r14, %rsi
movl %ebx, %ecx
callq 0x8e60
movl %ebx, %r12d
jmp 0x9487
xorl %r12d, %r12d
movslq %r12d, %rcx
movb $0x0, (%rax,%rcx)
movslq 0x6d2a(%rip), %rdi      # 0x101b8
addq 0x949b(%rip), %rdi      # 0x12930
callq 0x34e2
movslq 0x6d17(%rip), %rsi      # 0x101b8
addq 0x9488(%rip), %rsi      # 0x12930
movl %r12d, %edi
callq 0x33a0
movslq 0x6d01(%rip), %rdi      # 0x101b8
addq 0x9472(%rip), %rdi      # 0x12930
addl $0x3, %r12d
sarl $0x2, %r12d
movslq %r12d, %rdx
movl $0x1, %esi
movq %r14, %rcx
callq 0x1280
testl %ebp, %ebp
je 0x9519
testl %ebx, %ebx
je 0x9519
movq 0x944b(%rip), %rdx      # 0x12930
movl 0x6ccd(%rip), %ecx      # 0x101b8
leal (%rcx,%rcx), %eax
cltq
addq %rdx, %rax
leal (%rcx,%rcx,2), %ecx
movslq %ecx, %rcx
addq %rdx, %rcx
cmpl $0x2, %ebx
movl $0x1, %edx
cmovgel %ebx, %edx
xorl %esi, %esi
andb $-0x2, (%rax,%rsi)
andb $-0x4, (%rcx,%rsi)
incq %rsi
cmpq %rsi, %rdx
jne 0x9509
movq 0x8(%r15), %rdi
movslq 0x6c94(%rip), %rdx      # 0x101b8
addq %rdx, %rdx
addq 0x9402(%rip), %rdx      # 0x12930
movq %r14, %rsi
movl %ebx, %ecx
callq 0x8e60
movq 0x10(%r15), %rdi
movslq 0x6c75(%rip), %rax      # 0x101b8
leaq (%rax,%rax,2), %rdx
addq 0x93e2(%rip), %rdx      # 0x12930
movq %r14, %rsi
movl %ebx, %ecx
callq 0x8e60
movl 0x34(%r15), %r9d
movq 0x18(%r15), %rdi
testl %r9d, %r9d
js 0x9588
movq 0x28(%r15), %rsi
movslq 0x6c48(%rip), %rcx      # 0x101b8
shlq $0x2, %rcx
addq 0x93b5(%rip), %rcx      # 0x12930
movq %r14, %rdx
movl %ebx, %r8d
callq 0x9045
jmp 0x95a4
movslq 0x6c29(%rip), %rdx      # 0x101b8
shlq $0x2, %rdx
addq 0x9396(%rip), %rdx      # 0x12930
movq %r14, %rsi
movl %ebx, %ecx
callq 0x8e60
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $-0x1, %ebx
jne 0x95b9
callq 0x21cf
movl $0x1, %edi
callq 0x1270