// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movl %r9d, 0x30(%rsp)
movq %rcx, 0x48(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x60(%rsp)
movzbl 0xbf58(%rip), %eax      # 0x159e4
leaq 0xc(%rsp), %rdx
testq %rax, %rax
leaq 0x8(%rsp), %rcx
cmovneq %rcx, %rdx
movq %rdx, 0x18(%rsp)
leaq 0x2(%rax,%rax), %rdx
movq %rdx, 0x28(%rsp)
leaq (%rax,%rax,2), %rdx
addq $0x2, %rdx
movq %rdx, 0x50(%rsp)
xorl %edx, %edx
movq %rdi, 0x58(%rsp)
cmpl $0x2, (%rdi)
setne %dl
addl $0xff, %edx
movl %edx, 0x34(%rsp)
movq $0x0, (%rcx)
cmpl $0x0, 0xbf02(%rip)      # 0x159e0
movl %r8d, 0x14(%rsp)
je 0x9e05
testl %r8d, %r8d
jle 0xa041
xorb $0x1, %al
movzbl %al, %r12d
shll $0x2, %r12d
leaq 0x3(%r12), %rax
movq %rax, 0x40(%rsp)
leaq 0x1(%r12), %rax
movq %rax, 0x38(%rsp)
movq %r12, %rbp
orq $0x2, %rbp
xorl %ebx, %ebx
movl $0x10, %r14d
xorl %r13d, %r13d
movl %r14d, %r15d
movq 0x8(%rsp), %rax
subl %r13d, %r15d
jle 0x9b9c
movl %r13d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa052
movb 0x8(%rsp,%r12), %al
movq 0x40(%rsp), %rdx
movb 0x8(%rsp,%rdx), %cl
movb %cl, 0x8(%rsp,%r12)
movb %al, 0x8(%rsp,%rdx)
movq 0x38(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movb 0x8(%rsp,%rbp), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rbp)
movl %r15d, %ecx
shlq %cl, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0x9baa
movl %r14d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
subl %r14d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %eax
movq 0x60(%rsp), %rcx
movslq 0x804(%rcx,%rax,4), %r15
movl 0x404(%rcx,%r15,4), %r14d
cmpq $0xff, %r15
jne 0x9c6f
movl %r14d, %r15d
movq 0x8(%rsp), %rax
subl %r13d, %r15d
jle 0x9c50
movl %r13d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa052
movb 0x8(%rsp,%r12), %al
movq 0x40(%rsp), %rdx
movb 0x8(%rsp,%rdx), %cl
movb %cl, 0x8(%rsp,%r12)
movb %al, 0x8(%rsp,%rdx)
movq 0x38(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movb 0x8(%rsp,%rbp), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rbp)
movl %r15d, %ecx
shlq %cl, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0x9c5e
movl %r14d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
subl %r14d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %r15d
movl $0x10, %r14d
testl %r15d, %r15d
jle 0x9c90
movslq %ebx, %rbx
movq 0x48(%rsp), %rax
leaq (%rax,%rbx), %rdi
movl %r15d, %edx
movzbl 0x30(%rsp), %esi
callq 0x1130
addl %r15d, %ebx
movl 0x14(%rsp), %edx
cmpl %edx, %ebx
jge 0x9df6
movl %r14d, %r15d
movq 0x8(%rsp), %rax
subl %r13d, %r15d
jle 0x9d16
movl %r13d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa052
movb 0x8(%rsp,%r12), %al
movq 0x40(%rsp), %rdx
movb 0x8(%rsp,%rdx), %cl
movb %cl, 0x8(%rsp,%r12)
movb %al, 0x8(%rsp,%rdx)
movq 0x38(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movb 0x8(%rsp,%rbp), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rbp)
movl %r15d, %ecx
shlq %cl, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0x9d24
movl %r14d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
subl %r14d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %eax
movq 0x58(%rsp), %rcx
movslq 0x804(%rcx,%rax,4), %rax
movl 0x404(%rcx,%rax,4), %r14d
cmpl 0x34(%rsp), %eax
jne 0x9dc3
movl %r14d, %r15d
movq 0x8(%rsp), %rax
subl %r13d, %r15d
jle 0x9dc9
movl %r13d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa052
movb 0x8(%rsp,%r12), %al
movq 0x40(%rsp), %rdx
movb 0x8(%rsp,%rdx), %cl
movb %cl, 0x8(%rsp,%r12)
movb %al, 0x8(%rsp,%rdx)
movq 0x38(%rsp), %rdx
movb 0x8(%rsp,%rdx), %al
movb 0x8(%rsp,%rbp), %cl
movb %cl, 0x8(%rsp,%rdx)
movb %al, 0x8(%rsp,%rbp)
movl %r15d, %ecx
shlq %cl, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0x9dd7
movl 0x14(%rsp), %edx
jmp 0x9deb
movl %r14d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
subl %r14d, %r13d
movl 0x14(%rsp), %edx
movq 0x50(%rsp), %rax
movzbl 0x8(%rsp,%rax), %eax
movl $0x8, %r14d
movslq %ebx, %rcx
movq 0x48(%rsp), %rsi
movb %al, (%rsi,%rcx)
incl %ebx
cmpl %edx, %ebx
jl 0x9b22
jmp 0xa041
testl %r8d, %r8d
jle 0xa041
xorl %ebx, %ebx
movl $0x10, %r14d
movzbl 0x30(%rsp), %ebp
xorl %r13d, %r13d
movl %r14d, %r15d
movq 0x8(%rsp), %rax
subl %r13d, %r15d
jle 0x9e6c
movl %r13d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa052
movl %r15d, %ecx
shlq %cl, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0x9e7a
movl %r14d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
subl %r14d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %eax
movq 0x60(%rsp), %rcx
movslq 0x804(%rcx,%rax,4), %r15
movl 0x404(%rcx,%r15,4), %r14d
cmpq $0xff, %r15
jne 0x9f0f
movl %r14d, %r15d
movq 0x8(%rsp), %rax
subl %r13d, %r15d
jle 0x9ef0
movl %r13d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa052
movl %r15d, %ecx
shlq %cl, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0x9efe
movl %r14d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
subl %r14d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %r15d
movl $0x10, %r14d
testl %r15d, %r15d
jle 0x9f2d
movslq %ebx, %rbx
movq 0x48(%rsp), %rax
leaq (%rax,%rbx), %rdi
movl %r15d, %edx
movl %ebp, %esi
callq 0x1130
addl %r15d, %ebx
movl 0x14(%rsp), %edx
cmpl %edx, %ebx
jge 0xa037
movl %r14d, %r15d
movq 0x8(%rsp), %rax
subl %r13d, %r15d
jle 0x9f87
movl %r13d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa052
movl %r15d, %ecx
shlq %cl, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0x9f95
movl %r14d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
subl %r14d, %r13d
movq 0x28(%rsp), %rax
movzwl 0x8(%rsp,%rax), %eax
movq 0x58(%rsp), %rcx
movslq 0x804(%rcx,%rax,4), %rax
movl 0x404(%rcx,%rax,4), %r14d
cmpl 0x34(%rsp), %eax
jne 0xa004
movl %r14d, %r15d
movq 0x8(%rsp), %rax
subl %r13d, %r15d
jle 0xa00a
movl %r13d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
movl $0x4, %esi
movl $0x1, %edx
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rcx
callq 0x10b0
cmpq $0x1, %rax
jne 0xa052
movl %r15d, %ecx
shlq %cl, 0x8(%rsp)
movl $0x20, %r13d
subl %r15d, %r13d
jmp 0xa018
movl 0x14(%rsp), %edx
jmp 0xa02c
movl %r14d, %ecx
shlq %cl, %rax
movq %rax, 0x8(%rsp)
subl %r14d, %r13d
movl 0x14(%rsp), %edx
movq 0x50(%rsp), %rax
movzbl 0x8(%rsp,%rax), %eax
movl $0x8, %r14d
movslq %ebx, %rcx
movq 0x48(%rsp), %rsi
movb %al, (%rsi,%rcx)
incl %ebx
cmpl %edx, %ebx
jl 0x9e1e
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2253
movl $0x1, %eax
jmp 0xa043