// File: /workspace/github_c_makefile_star2_O3/thegenemyers[P]DASCRUBBER/QV.c
// Function: Decode_Run
static int Decode_Run(HScheme *neme, HScheme *reme, FILE *in, char *read,
                      int rlen, int rchar)
{ int    *nlook, *nlens;
  int    *rlook, *rlens;
  int     nsignal, ilen;
  uint64  icode;
  uint32 *ipart;
  uint16 *xpart;
  uint8  *cpart;
  int     j, n, c, k;

  if (LittleEndian)
    { ipart = ((uint32 *) (&icode));
      xpart = ((uint16 *) (&icode)) + 2;
      cpart = ((uint8  *) (&icode)) + 5;
    }
  else
    { ipart = ((uint32 *) (&icode)) + 1;
      xpart = ((uint16 *) (&icode)) + 1;
      cpart = ((uint8  *) (&icode)) + 2;
    }

  if (neme->type == 2)
    nsignal = 255;
  else
    nsignal = 256;
  nlens = neme->codelens;
  nlook = neme->lookup;

  rlens = reme->codelens;
  rlook = reme->lookup;

  n     = 16;
  ilen  = 0;
  icode = 0;
  if (Flip)
    for (j = 0; j < rlen; j++)
      { GETFLIP
        c = rlook[*xpart];
        n = rlens[c];
        if (c == 255)
          { GETFLIP
            c = *xpart;
            n = 16;
          }
        for (k = 0; k < c; k++)
          read[j++] = (char) rchar;

        if (j < rlen)
          { GETFLIP
            c = nlook[*xpart];
            n = nlens[c];
            if (c == nsignal)
              { GETFLIP
                c = *cpart;
                n = 8;
              }
            read[j] = (char) c;
          }
      }
  else
    for (j = 0; j < rlen; j++)
      { GET
        c = rlook[*xpart];
        n = rlens[c];
        if (c == 255)
          { GET
            c = *xpart;
            n = 16;
          }
        for (k = 0; k < c; k++)
          read[j++] = (char) rchar;

        if (j < rlen)
          { GET
            c = nlook[*xpart];
            n = nlens[c];
            if (c == nsignal)
              { GET
                c = *cpart;
                n = 8;
              }
            read[j] = (char) c;
          }
      }

  return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r9d, 0x34(%rsp)
movq %rcx, 0x58(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x70(%rsp)
movzbl 0xbb04(%rip), %eax      # 0x159e4
leaq 0xc(%rsp), %rcx
testq %rax, %rax
leaq 0x8(%rsp), %rdx
cmoveq %rcx, %rdx
movq %rdx, 0x18(%rsp)
leaq 0x2(%rax,%rax), %rcx
movq %rcx, 0x28(%rsp)
leaq (%rax,%rax,2), %rcx
addq $0x2, %rcx
movq %rcx, 0x60(%rsp)
xorl %ecx, %ecx
movq %rdi, 0x68(%rsp)
cmpl $0x2, (%rdi)
setne %cl
addl $0xff, %ecx
movl %ecx, 0x30(%rsp)
cmpl $0x0, 0xbab5(%rip)      # 0x159e0
movl %r8d, 0x14(%rsp)
je 0xa295
testl %r8d, %r8d
jle 0xa4df
xorb $0x1, %al
movzbl %al, %eax
shll $0x2, %eax
leaq 0x3(%rax), %rcx
movq %rcx, 0x48(%rsp)
leaq 0x1(%rax), %rcx
movq %rcx, 0x40(%rsp)
movq %rax, 0x50(%rsp)
orq $0x2, %rax
movq %rax, 0x38(%rsp)
xorl %r12d, %r12d
movl $0x10, %r14d
xorl %ebp, %ebp
xorl %r13d, %r13d
movl %r14d, %r15d
subl %r13d, %r15d
jle 0x9ffa
movl %r13d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa4f0
movq 0x50(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movq 0x48(%rsp), %rsi
movb 0x8(%rsp,%rsi), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rsi)
movq 0x40(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movq 0x38(%rsp), %rsi
movb 0x8(%rsp,%rsi), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rsi)
movq 0x8(%rsp), %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0xa003
movl %r14d, %ecx
shlq %cl, %r12
subl %r14d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %ebx
movq 0x70(%rsp), %rax
movslq 0x804(%rax,%rbx,4), %r15
movl 0x404(%rax,%r15,4), %r14d
cmpq $0xff, %r15
jne 0xa0da
movl %r14d, %r15d
subl %r13d, %r15d
jle 0xa0c2
movl %r13d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa4f0
movq 0x50(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movq 0x48(%rsp), %rsi
movb 0x8(%rsp,%rsi), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rsi)
movq 0x40(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movq 0x38(%rsp), %rsi
movb 0x8(%rsp,%rsi), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rsi)
movq 0x8(%rsp), %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %ebx
jmp 0xa0d0
movl %r14d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
subl %r14d, %r13d
movzwl %bx, %r15d
movl $0x10, %r14d
testl %r15d, %r15d
jle 0xa0fb
movslq %ebp, %rbp
movq 0x58(%rsp), %rax
leaq (%rax,%rbp), %rdi
movl %r15d, %edx
movzbl 0x34(%rsp), %esi
callq 0x1130
addl %r15d, %ebp
movl 0x14(%rsp), %edx
cmpl %edx, %ebp
jge 0xa286
movl %r14d, %r15d
subl %r13d, %r15d
jle 0xa19a
movl %r13d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa4f0
movq 0x50(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movq 0x48(%rsp), %rsi
movb 0x8(%rsp,%rsi), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rsi)
movq 0x40(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movq 0x38(%rsp), %rsi
movb 0x8(%rsp,%rsi), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rsi)
movq 0x8(%rsp), %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %ebx
jmp 0xa1a8
movl %r14d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
subl %r14d, %r13d
movzwl %bx, %eax
movq 0x68(%rsp), %rcx
movslq 0x804(%rcx,%rax,4), %rax
movl 0x404(%rcx,%rax,4), %r14d
cmpl 0x30(%rsp), %eax
jne 0xa253
movl %r14d, %r15d
subl %r13d, %r15d
jle 0xa259
movl %r13d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa4f0
movq 0x50(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movq 0x48(%rsp), %rsi
movb 0x8(%rsp,%rsi), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rsi)
movq 0x40(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movq 0x38(%rsp), %rsi
movb 0x8(%rsp,%rsi), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rsi)
movq 0x8(%rsp), %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0xa267
movl 0x14(%rsp), %edx
jmp 0xa27b
movl %r14d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
subl %r14d, %r13d
movl 0x14(%rsp), %edx
movq 0x60(%rsp), %rax
movzbl 0x8(%rsp,%rax), %eax
movl $0x8, %r14d
movslq %ebp, %rcx
movq 0x58(%rsp), %rsi
movb %al, (%rsi,%rcx)
incl %ebp
cmpl %edx, %ebp
jl 0x9f75
jmp 0xa4df
testl %r8d, %r8d
jle 0xa4df
xorl %r12d, %r12d
movl $0x10, %r14d
xorl %ebx, %ebx
xorl %r13d, %r13d
movl %r14d, %r15d
subl %r13d, %r15d
jle 0xa2fd
movl %r13d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa4f0
movq 0x8(%rsp), %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0xa306
movl %r14d, %ecx
shlq %cl, %r12
subl %r14d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %ebp
movq 0x70(%rsp), %rax
movslq 0x804(%rax,%rbp,4), %r15
movl 0x404(%rax,%r15,4), %r14d
cmpq $0xff, %r15
jne 0xa3a1
movl %r14d, %r15d
subl %r13d, %r15d
jle 0xa389
movl %r13d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa4f0
movq 0x8(%rsp), %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %ebp
jmp 0xa397
movl %r14d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
subl %r14d, %r13d
movzwl %bp, %r15d
movl $0x10, %r14d
testl %r15d, %r15d
jle 0xa3c2
movslq %ebx, %rbx
movq 0x58(%rsp), %rax
leaq (%rax,%rbx), %rdi
movl %r15d, %edx
movzbl 0x34(%rsp), %esi
callq 0x1130
addl %r15d, %ebx
movl 0x14(%rsp), %edx
cmpl %edx, %ebx
jge 0xa4d5
movl %r14d, %r15d
subl %r13d, %r15d
jle 0xa429
movl %r13d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa4f0
movq 0x8(%rsp), %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %ebp
jmp 0xa437
movl %r14d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
subl %r14d, %r13d
movzwl %bp, %eax
movq 0x68(%rsp), %rcx
movslq 0x804(%rcx,%rax,4), %rax
movl 0x404(%rcx,%rax,4), %r14d
cmpl 0x30(%rsp), %eax
jne 0xa4a2
movl %r14d, %r15d
subl %r13d, %r15d
jle 0xa4a8
movl %r13d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa4f0
movq 0x8(%rsp), %r12
movl %r15d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0xa4b6
movl 0x14(%rsp), %edx
jmp 0xa4ca
movl %r14d, %ecx
shlq %cl, %r12
movq %r12, 0x8(%rsp)
subl %r14d, %r13d
movl 0x14(%rsp), %edx
movq 0x60(%rsp), %rax
movzbl 0x8(%rsp,%rax), %eax
movl $0x8, %r14d
movslq %ebx, %rcx
movq 0x58(%rsp), %rsi
movb %al, (%rsi,%rcx)
incl %ebx
cmpl %edx, %ebx
jl 0xa2ac
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x21db
movl $0x1, %eax
jmp 0xa4e1