#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ LoadMiniBuffer(int *, unsigned char **, unsigned char *,
                                  int *, int *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
uint32_t W4Decompress(unsigned char *dst, size_t dstmax, unsigned char *src,
                      size_t srclen) {
  unsigned char *srcfence = src + srclen;
  unsigned char *dstfence = dst + dstmax;
  unsigned char *dstbase = dst;
  uint32_t minibuffer = 0;
  uint16_t nCount, nDepth;
  uint16_t nBitsUsed = 0;
  uint16_t nBitCount;
  size_t nIndex = 0;
  nDepth = 1;
  nBitCount = 8;
  for (nIndex = 0; nIndex <= 3; nIndex++)
    minibuffer =
        (minibuffer >> (uint32_t)8) + (((uint32_t)(*src++)) << (uint32_t)24);
  while (nDepth != 0) {
    LoadMiniBuffer(&minibuffer, &src, srcfence, &nBitsUsed, &nBitCount);
    if ((minibuffer & 3) == 1 || (minibuffer & 3) == 2) {
      if (dst >= dstfence)
        break;
      *dst++ = (unsigned char)(((minibuffer & 0x1FCU) >> 2U) +
                               ((minibuffer & 1U) << 7U));
      nBitsUsed = 9;
    } else {
      if ((minibuffer & 3U) == 0U) {
        nDepth = (minibuffer & 0xFCU) >> 2U;
        nBitsUsed = 8;
      } else if ((minibuffer & 7U) == 3U) {
        nDepth = ((minibuffer & 0x7F8U) >> 3U) + 0x40U;
        nBitsUsed = 11;
      } else if ((minibuffer & 7U) == 7U) {
        nDepth = ((minibuffer & 0x7FF8U) >> 3U) + 0x140U;
        nBitsUsed = 15;
      } else {
        fprintf(stderr, "Invalid depth data\n");
        break;
      }
      if (nDepth != 0 && nDepth != 0x113FU) {
        LoadMiniBuffer(&minibuffer, &src, srcfence, &nBitsUsed, &nBitCount);
        if ((minibuffer & 1) == 1) {
          nCount = 2;
          nBitsUsed = 1;
        } else if ((minibuffer & 3) == 2) {
          nCount = ((minibuffer & 4U) >> 2U) + 3U;
          nBitsUsed = 3;
        } else if ((minibuffer & 7) == 4) {
          nCount = ((minibuffer & 0x18U) >> 3U) + 5U;
          nBitsUsed = 5;
        } else if ((minibuffer & 0x0FU) == 8) {
          nCount = ((minibuffer & 0x70U) >> 4U) + 9U;
          nBitsUsed = 7;
        } else if ((minibuffer & 0x1FU) == 16) {
          nCount = ((minibuffer & 0x1E0U) >> 5U) + 17U;
          nBitsUsed = 9;
        } else if ((minibuffer & 0x3FU) == 32) {
          nCount = ((minibuffer & 0x7C0U) >> 6U) + 33U;
          nBitsUsed = 11;
        } else if ((minibuffer & 0x7FU) == 64) {
          nCount = ((minibuffer & 0x1F80U) >> 7U) + 65U;
          nBitsUsed = 13;
        } else if ((minibuffer & 0xFFU) == 128) {
          nCount = ((minibuffer & 0x7F00U) >> 8U) + 129U;
          nBitsUsed = 15;
        } else if ((minibuffer & 0x1FFU) == 256) {
          nCount = ((minibuffer & 0x1FE00U) >> 9U) + 257U;
          nBitsUsed = 17;
        } else {
          fprintf(stderr, "Unexpected compressed code=0x%08lx\n",
                  (unsigned long)minibuffer);
          break;
        }
        {
          unsigned char *sp = dst - nDepth;
          if (sp < dstbase) {
            fprintf(stderr,
                    "Unexpected nDepth too large, reaches back too far\n");
            break;
          }
          if ((dst + nCount) > dstfence) {
            fprintf(stderr, "Unexpected nCount too large, reaches too far "
                            "forward into dest\n");
            break;
          }
          assert(nCount != 0);
          do {
            *dst++ = *sp++;
          } while (--nCount != 0);
          assert(sp >= dstbase);
          assert(sp <= dstfence);
          assert(dst <= dstfence);
        }
      } else if (nDepth == 0x113FU && src == srcfence) {
        break;
      }
    }
  }
  if (src < srcfence)
    fprintf(stderr, "Warning: %u bytes left\n", (unsigned int)(srcfence - src));
  return (uint32_t)(dst - dstbase);
}


x86 assembly (clang, -O0):
<W4Decompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x48(%rbp)
movq   $0x0,-0x58(%rbp)
movl   $0x1,-0x44(%rbp)
movl   $0x8,-0x4c(%rbp)
movq   $0x0,-0x58(%rbp)
cmpq   $0x3,-0x58(%rbp)
ja     11d0 <W4Decompress+0xa0>
mov    -0x3c(%rbp),%eax
sar    $0x8,%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movzbl (%rcx),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    1194 <W4Decompress+0x64>
jmp    11d5 <W4Decompress+0xa5>
cmpl   $0x0,-0x44(%rbp)
je     162e <W4Decompress+0x4fe>
mov    -0x28(%rbp),%rdx
lea    -0x3c(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x48(%rbp),%rcx
lea    -0x4c(%rbp),%r8
call   1030 <LoadMiniBuffer@plt>
mov    -0x3c(%rbp),%eax
and    $0x3,%eax
cmp    $0x1,%eax
je     1216 <W4Decompress+0xe6>
mov    -0x3c(%rbp),%eax
and    $0x3,%eax
cmp    $0x2,%eax
jne    125e <W4Decompress+0x12e>
mov    -0x8(%rbp),%rax
cmp    -0x30(%rbp),%rax
jb     1229 <W4Decompress+0xf9>
jmp    162e <W4Decompress+0x4fe>
mov    -0x3c(%rbp),%eax
and    $0x1fc,%eax
shr    $0x2,%eax
mov    -0x3c(%rbp),%ecx
and    $0x1,%ecx
shl    $0x7,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
movl   $0x9,-0x48(%rbp)
jmp    1629 <W4Decompress+0x4f9>
mov    -0x3c(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1287 <W4Decompress+0x157>
mov    -0x3c(%rbp),%eax
and    $0xfc,%eax
shr    $0x2,%eax
mov    %eax,-0x44(%rbp)
movl   $0x8,-0x48(%rbp)
jmp    1307 <W4Decompress+0x1d7>
mov    -0x3c(%rbp),%eax
and    $0x7,%eax
cmp    $0x3,%eax
jne    12b3 <W4Decompress+0x183>
mov    -0x3c(%rbp),%eax
and    $0x7f8,%eax
shr    $0x3,%eax
add    $0x40,%eax
mov    %eax,-0x44(%rbp)
movl   $0xb,-0x48(%rbp)
jmp    1302 <W4Decompress+0x1d2>
mov    -0x3c(%rbp),%eax
and    $0x7,%eax
cmp    $0x7,%eax
jne    12e1 <W4Decompress+0x1b1>
mov    -0x3c(%rbp),%eax
and    $0x7ff8,%eax
shr    $0x3,%eax
add    $0x140,%eax
mov    %eax,-0x44(%rbp)
movl   $0xf,-0x48(%rbp)
jmp    12fd <W4Decompress+0x1cd>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
lea    0xd0f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    162e <W4Decompress+0x4fe>
jmp    1302 <W4Decompress+0x1d2>
jmp    1307 <W4Decompress+0x1d7>
cmpl   $0x0,-0x44(%rbp)
je     15ff <W4Decompress+0x4cf>
cmpl   $0x113f,-0x44(%rbp)
je     15ff <W4Decompress+0x4cf>
mov    -0x28(%rbp),%rdx
lea    -0x3c(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x48(%rbp),%rcx
lea    -0x4c(%rbp),%r8
call   1030 <LoadMiniBuffer@plt>
mov    -0x3c(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1359 <W4Decompress+0x229>
movl   $0x2,-0x40(%rbp)
movl   $0x1,-0x48(%rbp)
jmp    1507 <W4Decompress+0x3d7>
mov    -0x3c(%rbp),%eax
and    $0x3,%eax
cmp    $0x2,%eax
jne    1383 <W4Decompress+0x253>
mov    -0x3c(%rbp),%eax
and    $0x4,%eax
shr    $0x2,%eax
add    $0x3,%eax
mov    %eax,-0x40(%rbp)
movl   $0x3,-0x48(%rbp)
jmp    1502 <W4Decompress+0x3d2>
mov    -0x3c(%rbp),%eax
and    $0x7,%eax
cmp    $0x4,%eax
jne    13ad <W4Decompress+0x27d>
mov    -0x3c(%rbp),%eax
and    $0x18,%eax
shr    $0x3,%eax
add    $0x5,%eax
mov    %eax,-0x40(%rbp)
movl   $0x5,-0x48(%rbp)
jmp    14fd <W4Decompress+0x3cd>
mov    -0x3c(%rbp),%eax
and    $0xf,%eax
cmp    $0x8,%eax
jne    13d7 <W4Decompress+0x2a7>
mov    -0x3c(%rbp),%eax
and    $0x70,%eax
shr    $0x4,%eax
add    $0x9,%eax
mov    %eax,-0x40(%rbp)
movl   $0x7,-0x48(%rbp)
jmp    14f8 <W4Decompress+0x3c8>
mov    -0x3c(%rbp),%eax
and    $0x1f,%eax
cmp    $0x10,%eax
jne    1403 <W4Decompress+0x2d3>
mov    -0x3c(%rbp),%eax
and    $0x1e0,%eax
shr    $0x5,%eax
add    $0x11,%eax
mov    %eax,-0x40(%rbp)
movl   $0x9,-0x48(%rbp)
jmp    14f3 <W4Decompress+0x3c3>
mov    -0x3c(%rbp),%eax
and    $0x3f,%eax
cmp    $0x20,%eax
jne    142f <W4Decompress+0x2ff>
mov    -0x3c(%rbp),%eax
and    $0x7c0,%eax
shr    $0x6,%eax
add    $0x21,%eax
mov    %eax,-0x40(%rbp)
movl   $0xb,-0x48(%rbp)
jmp    14ee <W4Decompress+0x3be>
mov    -0x3c(%rbp),%eax
and    $0x7f,%eax
cmp    $0x40,%eax
jne    145b <W4Decompress+0x32b>
mov    -0x3c(%rbp),%eax
and    $0x1f80,%eax
shr    $0x7,%eax
add    $0x41,%eax
mov    %eax,-0x40(%rbp)
movl   $0xd,-0x48(%rbp)
jmp    14e9 <W4Decompress+0x3b9>
mov    -0x3c(%rbp),%eax
and    $0xff,%eax
cmp    $0x80,%eax
jne    148d <W4Decompress+0x35d>
mov    -0x3c(%rbp),%eax
and    $0x7f00,%eax
shr    $0x8,%eax
add    $0x81,%eax
mov    %eax,-0x40(%rbp)
movl   $0xf,-0x48(%rbp)
jmp    14e4 <W4Decompress+0x3b4>
mov    -0x3c(%rbp),%eax
and    $0x1ff,%eax
cmp    $0x100,%eax
jne    14bf <W4Decompress+0x38f>
mov    -0x3c(%rbp),%eax
and    $0x1fe00,%eax
shr    $0x9,%eax
add    $0x101,%eax
mov    %eax,-0x40(%rbp)
movl   $0x11,-0x48(%rbp)
jmp    14df <W4Decompress+0x3af>
mov    0x2b1a(%rip),%rax
mov    (%rax),%edi
movslq -0x3c(%rbp),%rdx
lea    0xb41(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    162e <W4Decompress+0x4fe>
jmp    14e4 <W4Decompress+0x3b4>
jmp    14e9 <W4Decompress+0x3b9>
jmp    14ee <W4Decompress+0x3be>
jmp    14f3 <W4Decompress+0x3c3>
jmp    14f8 <W4Decompress+0x3c8>
jmp    14fd <W4Decompress+0x3cd>
jmp    1502 <W4Decompress+0x3d2>
jmp    1507 <W4Decompress+0x3d7>
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    1545 <W4Decompress+0x415>
mov    0x2ab0(%rip),%rax
mov    (%rax),%edi
lea    0xaff(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    162e <W4Decompress+0x4fe>
mov    -0x8(%rbp),%rax
movslq -0x40(%rbp),%rcx
add    %rcx,%rax
cmp    -0x30(%rbp),%rax
jbe    1576 <W4Decompress+0x446>
mov    0x2a7f(%rip),%rax
mov    (%rax),%edi
lea    0xb01(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    162e <W4Decompress+0x4fe>
cmpl   $0x0,-0x40(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x60(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x60(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40(%rbp)
cmp    $0x0,%eax
jne    1587 <W4Decompress+0x457>
mov    -0x60(%rbp),%rax
cmp    -0x38(%rbp),%rax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x60(%rbp),%rax
cmp    -0x30(%rbp),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmp    -0x30(%rbp),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
jmp    1624 <W4Decompress+0x4f4>
cmpl   $0x113f,-0x44(%rbp)
jne    161f <W4Decompress+0x4ef>
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    161f <W4Decompress+0x4ef>
jmp    162e <W4Decompress+0x4fe>
jmp    1624 <W4Decompress+0x4f4>
jmp    1629 <W4Decompress+0x4f9>
jmp    11d5 <W4Decompress+0xa5>
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1660 <W4Decompress+0x530>
mov    0x299d(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
lea    0xa52(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    %rcx,%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<W4Decompress>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
add    %rdx,%r15
movl   $0x0,(%rsp)
movl   $0x8,0x14(%rsp)
movsbl (%rdx),%eax
shl    $0x10,%eax
movzbl 0x1(%rdx),%ecx
shl    $0x18,%ecx
add    %eax,%ecx
sar    $0x8,%ecx
movzbl 0x2(%rdx),%eax
shl    $0x18,%eax
add    %ecx,%eax
sar    $0x8,%eax
lea    0x4(%rdx),%rcx
mov    %rcx,0x18(%rsp)
movzbl 0x3(%rdx),%ecx
shl    $0x18,%ecx
add    %eax,%ecx
mov    %ecx,0x4(%rsp)
add    %rdi,%r12
mov    $0x1,%r14d
lea    0x4(%rsp),%r13
lea    0x18(%rsp),%rbp
mov    %rdi,%rax
mov    %rdi,0x20(%rsp)
mov    %r12,0x8(%rsp)
jmp    11ef <W4Decompress+0xbf>
nop
xor    %edi,%edi
cmp    0x20(%rsp),%r13
setae  %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmp    %r12,%r13
setbe  %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmp    %r12,%rbx
setbe  %dil
call   1040 <assert@plt>
lea    0x4(%rsp),%r13
lea    0x18(%rsp),%rbp
test   %r14d,%r14d
je     1643 <W4Decompress+0x513>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %rsp,%rcx
lea    0x14(%rsp),%r8
call   1030 <LoadMiniBuffer@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
and    $0x3,%ecx
lea    -0x1(%rcx),%edx
cmp    $0x2,%edx
jae    1240 <W4Decompress+0x110>
cmp    %r12,%rbx
jae    1643 <W4Decompress+0x513>
mov    %eax,%ecx
shr    $0x2,%ecx
and    $0x7f,%ecx
shl    $0x7,%eax
or     %ecx,%eax
mov    %al,(%rbx)
add    $0x1,%rbx
movl   $0x9,(%rsp)
jmp    11e6 <W4Decompress+0xb6>
nopl   0x0(%rax,%rax,1)
test   %ecx,%ecx
jne    1260 <W4Decompress+0x130>
shr    $0x2,%eax
and    $0x3f,%eax
movl   $0x8,(%rsp)
jmp    12b8 <W4Decompress+0x188>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
and    $0x7,%ecx
cmp    $0x7,%ecx
je     12a4 <W4Decompress+0x174>
cmp    $0x3,%ecx
jne    162c <W4Decompress+0x4fc>
shr    $0x3,%eax
movzbl %al,%r14d
add    $0x40,%r14d
movl   $0xb,(%rsp)
cmp    $0x113f,%r14d
jne    12c4 <W4Decompress+0x194>
mov    $0x113f,%r14d
cmp    %r15,0x18(%rsp)
jne    11e6 <W4Decompress+0xb6>
jmp    1643 <W4Decompress+0x513>
shr    $0x3,%eax
and    $0xfff,%eax
add    $0x140,%eax
movl   $0xf,(%rsp)
mov    %eax,%r14d
cmp    $0x113f,%r14d
je     128e <W4Decompress+0x15e>
test   %r14d,%r14d
je     1643 <W4Decompress+0x513>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %rsp,%rcx
lea    0x14(%rsp),%r8
call   1030 <LoadMiniBuffer@plt>
movslq 0x4(%rsp),%rbp
test   $0x1,%bpl
jne    130e <W4Decompress+0x1de>
mov    %ebp,%eax
and    $0x3,%eax
cmp    $0x2,%eax
jne    1421 <W4Decompress+0x2f1>
shr    $0x2,%ebp
and    $0x1,%ebp
add    $0x3,%ebp
movl   $0x3,(%rsp)
jmp    131a <W4Decompress+0x1ea>
movl   $0x1,(%rsp)
mov    $0x2,%ebp
mov    %r14d,%eax
neg    %eax
movslq %eax,%r12
lea    (%rbx,%r12,1),%r13
cmp    0x20(%rsp),%r13
jb     1608 <W4Decompress+0x4d8>
mov    %ebp,%eax
add    %rbx,%rax
cmp    0x8(%rsp),%rax
ja     161a <W4Decompress+0x4ea>
mov    $0x1,%edi
call   1040 <assert@plt>
lea    -0x1(%rbp),%r10d
cmp    $0x1f,%r10d
jb     137f <W4Decompress+0x24f>
mov    %r14d,%r8d
mov    %r10,%rax
sub    %r8,%rax
add    %rbx,%rax
add    $0x1,%rax
cmp    %rax,%rbx
jae    1440 <W4Decompress+0x310>
lea    (%rbx,%r10,1),%rax
add    $0x1,%rax
cmp    %rax,%r13
jae    1440 <W4Decompress+0x310>
mov    0x8(%rsp),%r12
lea    -0x1(%rbp),%esi
test   $0x7,%bpl
je     13b9 <W4Decompress+0x289>
mov    %ebp,%edx
and    $0x7,%edx
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x0(%r13,%rcx,1),%eax
mov    %al,(%rbx,%rcx,1)
add    $0x1,%rcx
cmp    %ecx,%edx
jne    13a0 <W4Decompress+0x270>
add    %rcx,%rbx
sub    %ecx,%ebp
add    %rcx,%r13
cmp    $0x7,%esi
jb     11b0 <W4Decompress+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x0(%r13),%eax
mov    %al,(%rbx)
movzbl 0x1(%r13),%eax
mov    %al,0x1(%rbx)
movzbl 0x2(%r13),%eax
mov    %al,0x2(%rbx)
movzbl 0x3(%r13),%eax
mov    %al,0x3(%rbx)
movzbl 0x4(%r13),%eax
mov    %al,0x4(%rbx)
movzbl 0x5(%r13),%eax
mov    %al,0x5(%rbx)
movzbl 0x6(%r13),%eax
mov    %al,0x6(%rbx)
movzbl 0x7(%r13),%eax
add    $0x8,%r13
mov    %al,0x7(%rbx)
add    $0x8,%rbx
add    $0xfffffff8,%ebp
jne    13d0 <W4Decompress+0x2a0>
jmp    11b0 <W4Decompress+0x80>
mov    %ebp,%eax
and    $0x7,%eax
cmp    $0x4,%eax
jne    1471 <W4Decompress+0x341>
shr    $0x3,%ebp
and    $0x3,%ebp
add    $0x5,%ebp
movl   $0x5,(%rsp)
jmp    131a <W4Decompress+0x1ea>
add    $0x1,%r10
mov    %r10,%r9
and    $0xffffffffffffffe0,%r9
lea    -0x20(%r9),%rax
mov    %rax,%rdi
shr    $0x5,%rdi
add    $0x1,%rdi
mov    %edi,%esi
and    $0x3,%esi
cmp    $0x60,%rax
jae    1494 <W4Decompress+0x364>
xor    %edx,%edx
mov    0x8(%rsp),%r12
jmp    1508 <W4Decompress+0x3d8>
mov    %ebp,%eax
and    $0xf,%eax
cmp    $0x8,%eax
jne    1562 <W4Decompress+0x432>
shr    $0x4,%ebp
and    $0x7,%ebp
add    $0x9,%ebp
movl   $0x7,(%rsp)
jmp    131a <W4Decompress+0x1ea>
and    $0xfffffffffffffffc,%rdi
lea    0x70(%rbx),%rcx
lea    (%rbx,%r12,1),%rax
add    $0x70,%rax
xor    %edx,%edx
mov    0x8(%rsp),%r12
nopl   0x0(%rax,%rax,1)
movups -0x70(%rax,%rdx,1),%xmm0
movups -0x60(%rax,%rdx,1),%xmm1
movups %xmm0,-0x70(%rcx,%rdx,1)
movups %xmm1,-0x60(%rcx,%rdx,1)
movups -0x50(%rax,%rdx,1),%xmm0
movups -0x40(%rax,%rdx,1),%xmm1
movups %xmm0,-0x50(%rcx,%rdx,1)
movups %xmm1,-0x40(%rcx,%rdx,1)
movups -0x30(%rax,%rdx,1),%xmm0
movups -0x20(%rax,%rdx,1),%xmm1
movups %xmm0,-0x30(%rcx,%rdx,1)
movups %xmm1,-0x20(%rcx,%rdx,1)
movups -0x10(%rax,%rdx,1),%xmm0
movups (%rax,%rdx,1),%xmm1
movups %xmm0,-0x10(%rcx,%rdx,1)
movups %xmm1,(%rcx,%rdx,1)
sub    $0xffffffffffffff80,%rdx
add    $0xfffffffffffffffc,%rdi
jne    14b0 <W4Decompress+0x380>
test   %rsi,%rsi
je     154b <W4Decompress+0x41b>
lea    (%rbx,%rdx,1),%rax
add    $0x10,%rax
sub    %r8,%rdx
lea    (%rbx,%rdx,1),%rcx
add    $0x10,%rcx
shl    $0x5,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
movups -0x10(%rcx,%rdx,1),%xmm0
movups (%rcx,%rdx,1),%xmm1
movups %xmm0,-0x10(%rax,%rdx,1)
movups %xmm1,(%rax,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%rsi
jne    1530 <W4Decompress+0x400>
add    %r9,%rbx
add    %r9,%r13
cmp    %r9,%r10
je     11b0 <W4Decompress+0x80>
sub    %r9d,%ebp
jmp    1384 <W4Decompress+0x254>
mov    %ebp,%eax
and    $0x1f,%eax
cmp    $0x10,%eax
jne    1581 <W4Decompress+0x451>
shr    $0x5,%ebp
and    $0xf,%ebp
add    $0x11,%ebp
movl   $0x9,(%rsp)
jmp    131a <W4Decompress+0x1ea>
mov    %ebp,%eax
and    $0x3f,%eax
cmp    $0x20,%eax
jne    15a0 <W4Decompress+0x470>
shr    $0x6,%ebp
and    $0x1f,%ebp
add    $0x21,%ebp
movl   $0xb,(%rsp)
jmp    131a <W4Decompress+0x1ea>
mov    %ebp,%eax
and    $0x7f,%eax
cmp    $0x40,%eax
jne    15bf <W4Decompress+0x48f>
shr    $0x7,%ebp
and    $0x3f,%ebp
add    $0x41,%ebp
movl   $0xd,(%rsp)
jmp    131a <W4Decompress+0x1ea>
cmp    $0x80,%bpl
jne    15dd <W4Decompress+0x4ad>
shr    $0x8,%ebp
and    $0x7f,%ebp
add    $0x81,%ebp
movl   $0xf,(%rsp)
jmp    131a <W4Decompress+0x1ea>
mov    %ebp,%eax
and    $0x1ff,%eax
cmp    $0x100,%eax
jne    167f <W4Decompress+0x54f>
shr    $0x9,%ebp
movzbl %bpl,%ebp
add    $0x101,%ebp
movl   $0x11,(%rsp)
jmp    131a <W4Decompress+0x1ea>
mov    0x29d1(%rip),%rax
mov    (%rax),%edi
lea    0xa20(%rip),%rsi
jmp    163c <W4Decompress+0x50c>
mov    0x29bf(%rip),%rax
mov    (%rax),%edi
lea    0xa41(%rip),%rsi
jmp    163c <W4Decompress+0x50c>
mov    0x29ad(%rip),%rax
mov    (%rax),%edi
lea    0x9c4(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x18(%rsp),%rax
cmp    %r15,%rax
jae    166a <W4Decompress+0x53a>
mov    0x298c(%rip),%rcx
mov    (%rcx),%edi
sub    %eax,%r15d
lea    0xa4b(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
sub    0x20(%rsp),%ebx
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x295a(%rip),%rax
mov    (%rax),%edi
lea    0x985(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    1643 <W4Decompress+0x513>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Invalid depth data\0A\00"
@.str.1 = [36 x i8] c"Unexpected compressed code=0x%08lx\0A\00"
@.str.2 = [51 x i8] c"Unexpected nDepth too large, reaches back too far\0A\00"
@.str.3 = [64 x i8] c"Unexpected nCount too large, reaches too far forward into dest\0A\00"
@.str.4 = [24 x i8] c"Warning: %u bytes left\0A\00"
define i32 @W4Decompress(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i64
%18 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%19 = load i8*, i8** %7
%20 = load i64, i64* %8
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8* %21, i8** %9
%22 = load i8*, i8** %5
%23 = load i64, i64* %6
%24 = getelementptr inbounds i8, i8* %22, i64 %23
store i8* %24, i8** %10
%25 = load i8*, i8** %5
store i8* %25, i8** %11
store i32 0, i32* %12
store i32 0, i32* %15
store i64 0, i64* %17
store i32 1, i32* %14
store i32 8, i32* %16
store i64 0, i64* %17
br label %26
26: ; preds = %38, %4
%27 = load i64, i64* %17
%28 = icmp ule i64 %27, 3
br i1 %28, label %29, label %41
29: ; preds = %26
%30 = load i32, i32* %12
%31 = ashr i32 %30, 8
%32 = load i8*, i8** %7
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %7
%34 = load i8, i8* %32
%35 = zext i8 %34 to i32
%36 = shl i32 %35, 24
%37 = add nsw i32 %31, %36
store i32 %37, i32* %12
br label %38
38: ; preds = %29
%39 = load i64, i64* %17
%40 = add i64 %39, 1
store i64 %40, i64* %17
br label %26
41: ; preds = %26
br label %42
42: ; preds = %263, %41
%43 = load i32, i32* %14
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %264
45: ; preds = %42
%46 = load i8*, i8** %9
%47 = call i32 @LoadMiniBuffer(i32* %12, i8** %7, i8* %46, i32* %15, i32* %16)
%48 = load i32, i32* %12
%49 = and i32 %48, 3
%50 = icmp eq i32 %49, 1
br i1 %50, label %55, label %51
51: ; preds = %45
%52 = load i32, i32* %12
%53 = and i32 %52, 3
%54 = icmp eq i32 %53, 2
br i1 %54, label %55, label %71
55: ; preds = %51, %45
%56 = load i8*, i8** %5
%57 = load i8*, i8** %10
%58 = icmp uge i8* %56, %57
br i1 %58, label %59, label %60
59: ; preds = %55
br label %264
60: ; preds = %55
%61 = load i32, i32* %12
%62 = and i32 %61, 508
%63 = lshr i32 %62, 2
%64 = load i32, i32* %12
%65 = and i32 %64, 1
%66 = shl i32 %65, 7
%67 = add i32 %63, %66
%68 = trunc i32 %67 to i8
%69 = load i8*, i8** %5
%70 = getelementptr inbounds i8, i8* %69, i32 1
store i8* %70, i8** %5
store i8 %68, i8* %69
store i32 9, i32* %15
br label %263
71: ; preds = %51
%72 = load i32, i32* %12
%73 = and i32 %72, 3
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %71
%76 = load i32, i32* %12
%77 = and i32 %76, 252
%78 = lshr i32 %77, 2
store i32 %78, i32* %14
store i32 8, i32* %15
br label %102
79: ; preds = %71
%80 = load i32, i32* %12
%81 = and i32 %80, 7
%82 = icmp eq i32 %81, 3
br i1 %82, label %83, label %88
83: ; preds = %79
%84 = load i32, i32* %12
%85 = and i32 %84, 2040
%86 = lshr i32 %85, 3
%87 = add i32 %86, 64
store i32 %87, i32* %14
store i32 11, i32* %15
br label %101
88: ; preds = %79
%89 = load i32, i32* %12
%90 = and i32 %89, 7
%91 = icmp eq i32 %90, 7
br i1 %91, label %92, label %97
92: ; preds = %88
%93 = load i32, i32* %12
%94 = and i32 %93, 32760
%95 = lshr i32 %94, 3
%96 = add i32 %95, 320
store i32 %96, i32* %14
store i32 15, i32* %15
br label %100
97: ; preds = %88
%98 = load i32, i32* @stderr
%99 = call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %264
100: ; preds = %92
br label %101
101: ; preds = %100, %83
br label %102
102: ; preds = %101, %75
%103 = load i32, i32* %14
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %253
105: ; preds = %102
%106 = load i32, i32* %14
%107 = icmp ne i32 %106, 4415
br i1 %107, label %108, label %253
108: ; preds = %105
%109 = load i8*, i8** %9
%110 = call i32 @LoadMiniBuffer(i32* %12, i8** %7, i8* %109, i32* %15, i32* %16)
%111 = load i32, i32* %12
%112 = and i32 %111, 1
%113 = icmp eq i32 %112, 1
br i1 %113, label %114, label %115
114: ; preds = %108
store i32 2, i32* %13
store i32 1, i32* %15
br label %200
115: ; preds = %108
%116 = load i32, i32* %12
%117 = and i32 %116, 3
%118 = icmp eq i32 %117, 2
br i1 %118, label %119, label %124
119: ; preds = %115
%120 = load i32, i32* %12
%121 = and i32 %120, 4
%122 = lshr i32 %121, 2
%123 = add i32 %122, 3
store i32 %123, i32* %13
store i32 3, i32* %15
br label %199
124: ; preds = %115
%125 = load i32, i32* %12
%126 = and i32 %125, 7
%127 = icmp eq i32 %126, 4
br i1 %127, label %128, label %133
128: ; preds = %124
%129 = load i32, i32* %12
%130 = and i32 %129, 24
%131 = lshr i32 %130, 3
%132 = add i32 %131, 5
store i32 %132, i32* %13
store i32 5, i32* %15
br label %198
133: ; preds = %124
%134 = load i32, i32* %12
%135 = and i32 %134, 15
%136 = icmp eq i32 %135, 8
br i1 %136, label %137, label %142
137: ; preds = %133
%138 = load i32, i32* %12
%139 = and i32 %138, 112
%140 = lshr i32 %139, 4
%141 = add i32 %140, 9
store i32 %141, i32* %13
store i32 7, i32* %15
br label %197
142: ; preds = %133
%143 = load i32, i32* %12
%144 = and i32 %143, 31
%145 = icmp eq i32 %144, 16
br i1 %145, label %146, label %151
146: ; preds = %142
%147 = load i32, i32* %12
%148 = and i32 %147, 480
%149 = lshr i32 %148, 5
%150 = add i32 %149, 17
store i32 %150, i32* %13
store i32 9, i32* %15
br label %196
151: ; preds = %142
%152 = load i32, i32* %12
%153 = and i32 %152, 63
%154 = icmp eq i32 %153, 32
br i1 %154, label %155, label %160
155: ; preds = %151
%156 = load i32, i32* %12
%157 = and i32 %156, 1984
%158 = lshr i32 %157, 6
%159 = add i32 %158, 33
store i32 %159, i32* %13
store i32 11, i32* %15
br label %195
160: ; preds = %151
%161 = load i32, i32* %12
%162 = and i32 %161, 127
%163 = icmp eq i32 %162, 64
br i1 %163, label %164, label %169
164: ; preds = %160
%165 = load i32, i32* %12
%166 = and i32 %165, 8064
%167 = lshr i32 %166, 7
%168 = add i32 %167, 65
store i32 %168, i32* %13
store i32 13, i32* %15
br label %194
169: ; preds = %160
%170 = load i32, i32* %12
%171 = and i32 %170, 255
%172 = icmp eq i32 %171, 128
br i1 %172, label %173, label %178
173: ; preds = %169
%174 = load i32, i32* %12
%175 = and i32 %174, 32512
%176 = lshr i32 %175, 8
%177 = add i32 %176, 129
store i32 %177, i32* %13
store i32 15, i32* %15
br label %193
178: ; preds = %169
%179 = load i32, i32* %12
%180 = and i32 %179, 511
%181 = icmp eq i32 %180, 256
br i1 %181, label %182, label %187
182: ; preds = %178
%183 = load i32, i32* %12
%184 = and i32 %183, 130560
%185 = lshr i32 %184, 9
%186 = add i32 %185, 257
store i32 %186, i32* %13
store i32 17, i32* %15
br label %192
187: ; preds = %178
%188 = load i32, i32* @stderr
%189 = load i32, i32* %12
%190 = sext i32 %189 to i64
%191 = call i32 (i32, i8*, ...) @fprintf(i32 %188, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i64 %190)
br label %264
192: ; preds = %182
br label %193
193: ; preds = %192, %173
br label %194
194: ; preds = %193, %164
br label %195
195: ; preds = %194, %155
br label %196
196: ; preds = %195, %146
br label %197
197: ; preds = %196, %137
br label %198
198: ; preds = %197, %128
br label %199
199: ; preds = %198, %119
br label %200
200: ; preds = %199, %114
%201 = load i8*, i8** %5
%202 = load i32, i32* %14
%203 = sext i32 %202 to i64
%204 = sub i64 0, %203
%205 = getelementptr inbounds i8, i8* %201, i64 %204
store i8* %205, i8** %18
%206 = load i8*, i8** %18
%207 = load i8*, i8** %11
%208 = icmp ult i8* %206, %207
br i1 %208, label %209, label %212
209: ; preds = %200
%210 = load i32, i32* @stderr
%211 = call i32 (i32, i8*, ...) @fprintf(i32 %210, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
br label %264
212: ; preds = %200
%213 = load i8*, i8** %5
%214 = load i32, i32* %13
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds i8, i8* %213, i64 %215
%217 = load i8*, i8** %10
%218 = icmp ugt i8* %216, %217
br i1 %218, label %219, label %222
219: ; preds = %212
%220 = load i32, i32* @stderr
%221 = call i32 (i32, i8*, ...) @fprintf(i32 %220, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
br label %264
222: ; preds = %212
%223 = load i32, i32* %13
%224 = icmp ne i32 %223, 0
%225 = zext i1 %224 to i32
%226 = call i32 @assert(i32 %225)
br label %227
227: ; preds = %233, %222
%228 = load i8*, i8** %18
%229 = getelementptr inbounds i8, i8* %228, i32 1
store i8* %229, i8** %18
%230 = load i8, i8* %228
%231 = load i8*, i8** %5
%232 = getelementptr inbounds i8, i8* %231, i32 1
store i8* %232, i8** %5
store i8 %230, i8* %231
br label %233
233: ; preds = %227
%234 = load i32, i32* %13
%235 = add nsw i32 %234, -1
store i32 %235, i32* %13
%236 = icmp ne i32 %235, 0
br i1 %236, label %227, label %237
237: ; preds = %233
%238 = load i8*, i8** %18
%239 = load i8*, i8** %11
%240 = icmp uge i8* %238, %239
%241 = zext i1 %240 to i32
%242 = call i32 @assert(i32 %241)
%243 = load i8*, i8** %18
%244 = load i8*, i8** %10
%245 = icmp ule i8* %243, %244
%246 = zext i1 %245 to i32
%247 = call i32 @assert(i32 %246)
%248 = load i8*, i8** %5
%249 = load i8*, i8** %10
%250 = icmp ule i8* %248, %249
%251 = zext i1 %250 to i32
%252 = call i32 @assert(i32 %251)
br label %262
253: ; preds = %105, %102
%254 = load i32, i32* %14
%255 = icmp eq i32 %254, 4415
br i1 %255, label %256, label %261
256: ; preds = %253
%257 = load i8*, i8** %7
%258 = load i8*, i8** %9
%259 = icmp eq i8* %257, %258
br i1 %259, label %260, label %261
260: ; preds = %256
br label %264
261: ; preds = %256, %253
br label %262
262: ; preds = %261, %237
br label %263
263: ; preds = %262, %60
br label %42
264: ; preds = %260, %219, %209, %187, %97, %59, %42
%265 = load i8*, i8** %7
%266 = load i8*, i8** %9
%267 = icmp ult i8* %265, %266
br i1 %267, label %268, label %277
268: ; preds = %264
%269 = load i32, i32* @stderr
%270 = load i8*, i8** %9
%271 = load i8*, i8** %7
%272 = ptrtoint i8* %270 to i64
%273 = ptrtoint i8* %271 to i64
%274 = sub i64 %272, %273
%275 = trunc i64 %274 to i32
%276 = call i32 (i32, i8*, ...) @fprintf(i32 %269, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %275)
br label %277
277: ; preds = %268, %264
%278 = load i8*, i8** %5
%279 = load i8*, i8** %11
%280 = ptrtoint i8* %278 to i64
%281 = ptrtoint i8* %279 to i64
%282 = sub i64 %280, %281
%283 = trunc i64 %282 to i32
ret i32 %283
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Invalid depth data\0A\00"
@.str.1 = [36 x i8] c"Unexpected compressed code=0x%08lx\0A\00"
@.str.2 = [51 x i8] c"Unexpected nDepth too large, reaches back too far\0A\00"
@.str.3 = [64 x i8] c"Unexpected nCount too large, reaches too far forward into dest\0A\00"
@.str.4 = [24 x i8] c"Warning: %u bytes left\0A\00"
define i32 @W4Decompress(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = getelementptr inbounds i8, i8* %2, i64 %3
%10 = bitcast i32* %6 to i8*
%11 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%12 = bitcast i32* %8 to i8*
store i32 8, i32* %8
%13 = getelementptr inbounds i8, i8* %2, i64 1
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = shl nuw i32 %15, 24
%17 = ashr exact i32 %16, 8
%18 = getelementptr inbounds i8, i8* %2, i64 2
%19 = load i8, i8* %13
%20 = zext i8 %19 to i32
%21 = shl nuw i32 %20, 24
%22 = add nsw i32 %21, %17
%23 = ashr exact i32 %22, 8
%24 = getelementptr inbounds i8, i8* %2, i64 3
%25 = load i8, i8* %18
%26 = zext i8 %25 to i32
%27 = shl nuw i32 %26, 24
%28 = add nsw i32 %27, %23
%29 = ashr exact i32 %28, 8
%30 = getelementptr inbounds i8, i8* %2, i64 4
store i8* %30, i8** %5
%31 = load i8, i8* %24
%32 = zext i8 %31 to i32
%33 = shl nuw i32 %32, 24
%34 = add nsw i32 %33, %29
store i32 %34, i32* %6
%35 = getelementptr inbounds i8, i8* %0, i64 %1
br label %36
36: ; preds = %4, %322
%37 = phi i32 [ %324, %322 ], [ 1, %4 ]
%38 = phi i8* [ %323, %322 ], [ %0, %4 ]
%39 = call i32 @LoadMiniBuffer(i32* %6, i8** %5, i8* %9, i32* %7, i32* %8)
%40 = load i32, i32* %6
%41 = and i32 %40, 3
switch i32 %41, label %54 [
i32 1, label %42
i32 2, label %42
i32 0, label %51
]
42: ; preds = %36, %36
%43 = icmp ult i8* %38, %35
br i1 %43, label %44, label %326
44: ; preds = %42
%45 = lshr i32 %40, 2
%46 = and i32 %45, 127
%47 = shl i32 %40, 7
%48 = or i32 %46, %47
%49 = trunc i32 %48 to i8
%50 = getelementptr inbounds i8, i8* %38, i64 1
store i8 %49, i8* %38
store i32 9, i32* %7
br label %322
51: ; preds = %36
%52 = lshr i32 %40, 2
%53 = and i32 %52, 63
store i32 8, i32* %7
br label %67
54: ; preds = %36
%55 = and i32 %40, 7
switch i32 %55, label %64 [
i32 3, label %56
i32 7, label %60
]
56: ; preds = %54
%57 = lshr i32 %40, 3
%58 = and i32 %57, 255
%59 = add nuw nsw i32 %58, 64
store i32 11, i32* %7
br label %67
60: ; preds = %54
%61 = lshr i32 %40, 3
%62 = and i32 %61, 4095
%63 = add nuw nsw i32 %62, 320
store i32 15, i32* %7
br label %67
64: ; preds = %54
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %326
67: ; preds = %56, %60, %51
%68 = phi i32 [ %53, %51 ], [ %59, %56 ], [ %63, %60 ]
switch i32 %68, label %69 [
i32 4415, label %319
i32 0, label %326
]
69: ; preds = %67
%70 = call i32 @LoadMiniBuffer(i32* %6, i8** %5, i8* %9, i32* %7, i32* %8)
%71 = load i32, i32* %6
%72 = and i32 %71, 1
%73 = icmp eq i32 %72, 0
br i1 %73, label %75, label %74
74: ; preds = %69
store i32 1, i32* %7
br label %135
75: ; preds = %69
%76 = and i32 %71, 3
%77 = icmp eq i32 %76, 2
br i1 %77, label %78, label %82
78: ; preds = %75
%79 = lshr i32 %71, 2
%80 = and i32 %79, 1
%81 = add nuw nsw i32 %80, 3
store i32 3, i32* %7
br label %135
82: ; preds = %75
%83 = and i32 %71, 7
%84 = icmp eq i32 %83, 4
br i1 %84, label %85, label %89
85: ; preds = %82
%86 = lshr i32 %71, 3
%87 = and i32 %86, 3
%88 = add nuw nsw i32 %87, 5
store i32 5, i32* %7
br label %135
89: ; preds = %82
%90 = and i32 %71, 15
%91 = icmp eq i32 %90, 8
br i1 %91, label %92, label %96
92: ; preds = %89
%93 = lshr i32 %71, 4
%94 = and i32 %93, 7
%95 = add nuw nsw i32 %94, 9
store i32 7, i32* %7
br label %135
96: ; preds = %89
%97 = and i32 %71, 31
%98 = icmp eq i32 %97, 16
br i1 %98, label %99, label %103
99: ; preds = %96
%100 = lshr i32 %71, 5
%101 = and i32 %100, 15
%102 = add nuw nsw i32 %101, 17
store i32 9, i32* %7
br label %135
103: ; preds = %96
%104 = and i32 %71, 63
%105 = icmp eq i32 %104, 32
br i1 %105, label %106, label %110
106: ; preds = %103
%107 = lshr i32 %71, 6
%108 = and i32 %107, 31
%109 = add nuw nsw i32 %108, 33
store i32 11, i32* %7
br label %135
110: ; preds = %103
%111 = and i32 %71, 127
%112 = icmp eq i32 %111, 64
br i1 %112, label %113, label %117
113: ; preds = %110
%114 = lshr i32 %71, 7
%115 = and i32 %114, 63
%116 = add nuw nsw i32 %115, 65
store i32 13, i32* %7
br label %135
117: ; preds = %110
%118 = and i32 %71, 255
%119 = icmp eq i32 %118, 128
br i1 %119, label %120, label %124
120: ; preds = %117
%121 = lshr i32 %71, 8
%122 = and i32 %121, 127
%123 = add nuw nsw i32 %122, 129
store i32 15, i32* %7
br label %135
124: ; preds = %117
%125 = and i32 %71, 511
%126 = icmp eq i32 %125, 256
br i1 %126, label %127, label %131
127: ; preds = %124
%128 = lshr i32 %71, 9
%129 = and i32 %128, 255
%130 = add nuw nsw i32 %129, 257
store i32 17, i32* %7
br label %135
131: ; preds = %124
%132 = load i32, i32* @stderr
%133 = sext i32 %71 to i64
%134 = call i32 (i32, i8*, ...) @fprintf(i32 %132, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i64 %133)
br label %326
135: ; preds = %78, %92, %106, %120, %127, %113, %99, %85, %74
%136 = phi i32 [ 2, %74 ], [ %81, %78 ], [ %88, %85 ], [ %95, %92 ], [ %102, %99 ], [ %109, %106 ], [ %116, %113 ], [ %123, %120 ], [ %130, %127 ]
%137 = sub nsw i32 0, %68
%138 = sext i32 %137 to i64
%139 = getelementptr i8, i8* %38, i64 %138
%140 = icmp ult i8* %139, %0
br i1 %140, label %141, label %144
141: ; preds = %135
%142 = load i32, i32* @stderr
%143 = call i32 (i32, i8*, ...) @fprintf(i32 %142, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
br label %326
144: ; preds = %135
%145 = zext i32 %136 to i64
%146 = getelementptr inbounds i8, i8* %38, i64 %145
%147 = icmp ugt i8* %146, %35
br i1 %147, label %148, label %151
148: ; preds = %144
%149 = load i32, i32* @stderr
%150 = call i32 (i32, i8*, ...) @fprintf(i32 %149, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
br label %326
151: ; preds = %144
%152 = call i32 @assert(i32 1)
%153 = add nsw i32 %136, -1
%154 = zext i32 %153 to i64
%155 = add nuw nsw i64 %154, 1
%156 = icmp ult i32 %153, 31
br i1 %156, label %252, label %157
157: ; preds = %151
%158 = getelementptr i8, i8* %38, i64 1
%159 = add nsw i32 %136, -1
%160 = zext i32 %159 to i64
%161 = getelementptr i8, i8* %158, i64 %160
%162 = getelementptr i8, i8* %38, i64 1
%163 = zext i32 %68 to i64
%164 = sub nsw i64 %160, %163
%165 = getelementptr i8, i8* %162, i64 %164
%166 = icmp ult i8* %38, %165
%167 = icmp ult i8* %139, %161
%168 = and i1 %166, %167
br i1 %168, label %252, label %169
169: ; preds = %157
%170 = and i64 %155, 8589934560
%171 = getelementptr i8, i8* %38, i64 %170
%172 = trunc i64 %170 to i32
%173 = sub i32 %136, %172
%174 = getelementptr i8, i8* %139, i64 %170
%175 = add nsw i64 %170, -32
%176 = lshr exact i64 %175, 5
%177 = add nuw nsw i64 %176, 1
%178 = and i64 %177, 3
%179 = icmp ult i64 %175, 96
br i1 %179, label %231, label %180
180: ; preds = %169
%181 = and i64 %177, 1152921504606846972
br label %182
182: ; preds = %182, %180
%183 = phi i64 [ 0, %180 ], [ %228, %182 ]
%184 = phi i64 [ 0, %180 ], [ %229, %182 ]
%185 = getelementptr i8, i8* %38, i64 %183
%186 = getelementptr i8, i8* %139, i64 %183
%187 = bitcast i8* %186 to <16 x i8>*
%188 = load <16 x i8>, <16 x i8>* %187
%189 = getelementptr i8, i8* %186, i64 16
%190 = bitcast i8* %189 to <16 x i8>*
%191 = load <16 x i8>, <16 x i8>* %190
%192 = bitcast i8* %185 to <16 x i8>*
store <16 x i8> %188, <16 x i8>* %192
%193 = getelementptr i8, i8* %185, i64 16
%194 = bitcast i8* %193 to <16 x i8>*
store <16 x i8> %191, <16 x i8>* %194
%195 = or i64 %183, 32
%196 = getelementptr i8, i8* %38, i64 %195
%197 = getelementptr i8, i8* %139, i64 %195
%198 = bitcast i8* %197 to <16 x i8>*
%199 = load <16 x i8>, <16 x i8>* %198
%200 = getelementptr i8, i8* %197, i64 16
%201 = bitcast i8* %200 to <16 x i8>*
%202 = load <16 x i8>, <16 x i8>* %201
%203 = bitcast i8* %196 to <16 x i8>*
store <16 x i8> %199, <16 x i8>* %203
%204 = getelementptr i8, i8* %196, i64 16
%205 = bitcast i8* %204 to <16 x i8>*
store <16 x i8> %202, <16 x i8>* %205
%206 = or i64 %183, 64
%207 = getelementptr i8, i8* %38, i64 %206
%208 = getelementptr i8, i8* %139, i64 %206
%209 = bitcast i8* %208 to <16 x i8>*
%210 = load <16 x i8>, <16 x i8>* %209
%211 = getelementptr i8, i8* %208, i64 16
%212 = bitcast i8* %211 to <16 x i8>*
%213 = load <16 x i8>, <16 x i8>* %212
%214 = bitcast i8* %207 to <16 x i8>*
store <16 x i8> %210, <16 x i8>* %214
%215 = getelementptr i8, i8* %207, i64 16
%216 = bitcast i8* %215 to <16 x i8>*
store <16 x i8> %213, <16 x i8>* %216
%217 = or i64 %183, 96
%218 = getelementptr i8, i8* %38, i64 %217
%219 = getelementptr i8, i8* %139, i64 %217
%220 = bitcast i8* %219 to <16 x i8>*
%221 = load <16 x i8>, <16 x i8>* %220
%222 = getelementptr i8, i8* %219, i64 16
%223 = bitcast i8* %222 to <16 x i8>*
%224 = load <16 x i8>, <16 x i8>* %223
%225 = bitcast i8* %218 to <16 x i8>*
store <16 x i8> %221, <16 x i8>* %225
%226 = getelementptr i8, i8* %218, i64 16
%227 = bitcast i8* %226 to <16 x i8>*
store <16 x i8> %224, <16 x i8>* %227
%228 = add nuw i64 %183, 128
%229 = add i64 %184, 4
%230 = icmp eq i64 %229, %181
br i1 %230, label %231, label %182
231: ; preds = %182, %169
%232 = phi i64 [ 0, %169 ], [ %228, %182 ]
%233 = icmp eq i64 %178, 0
br i1 %233, label %250, label %234
234: ; preds = %231, %234
%235 = phi i64 [ %247, %234 ], [ %232, %231 ]
%236 = phi i64 [ %248, %234 ], [ 0, %231 ]
%237 = getelementptr i8, i8* %38, i64 %235
%238 = getelementptr i8, i8* %139, i64 %235
%239 = bitcast i8* %238 to <16 x i8>*
%240 = load <16 x i8>, <16 x i8>* %239
%241 = getelementptr i8, i8* %238, i64 16
%242 = bitcast i8* %241 to <16 x i8>*
%243 = load <16 x i8>, <16 x i8>* %242
%244 = bitcast i8* %237 to <16 x i8>*
store <16 x i8> %240, <16 x i8>* %244
%245 = getelementptr i8, i8* %237, i64 16
%246 = bitcast i8* %245 to <16 x i8>*
store <16 x i8> %243, <16 x i8>* %246
%247 = add nuw i64 %235, 32
%248 = add i64 %236, 1
%249 = icmp eq i64 %248, %178
br i1 %249, label %250, label %234
250: ; preds = %234, %231
%251 = icmp eq i64 %155, %170
br i1 %251, label %307, label %252
252: ; preds = %157, %151, %250
%253 = phi i8* [ %38, %157 ], [ %38, %151 ], [ %171, %250 ]
%254 = phi i32 [ %136, %157 ], [ %136, %151 ], [ %173, %250 ]
%255 = phi i8* [ %139, %157 ], [ %139, %151 ], [ %174, %250 ]
%256 = add nsw i32 %254, -1
%257 = and i32 %254, 7
%258 = icmp eq i32 %257, 0
br i1 %258, label %270, label %259
259: ; preds = %252, %259
%260 = phi i8* [ %266, %259 ], [ %253, %252 ]
%261 = phi i32 [ %267, %259 ], [ %254, %252 ]
%262 = phi i8* [ %264, %259 ], [ %255, %252 ]
%263 = phi i32 [ %268, %259 ], [ 0, %252 ]
%264 = getelementptr inbounds i8, i8* %262, i64 1
%265 = load i8, i8* %262
%266 = getelementptr inbounds i8, i8* %260, i64 1
store i8 %265, i8* %260
%267 = add nsw i32 %261, -1
%268 = add i32 %263, 1
%269 = icmp eq i32 %268, %257
br i1 %269, label %270, label %259
270: ; preds = %259, %252
%271 = phi i8* [ undef, %252 ], [ %264, %259 ]
%272 = phi i8* [ undef, %252 ], [ %266, %259 ]
%273 = phi i8* [ %253, %252 ], [ %266, %259 ]
%274 = phi i32 [ %254, %252 ], [ %267, %259 ]
%275 = phi i8* [ %255, %252 ], [ %264, %259 ]
%276 = icmp ult i32 %256, 7
br i1 %276, label %307, label %277
277: ; preds = %270, %277
%278 = phi i8* [ %304, %277 ], [ %273, %270 ]
%279 = phi i32 [ %305, %277 ], [ %274, %270 ]
%280 = phi i8* [ %302, %277 ], [ %275, %270 ]
%281 = getelementptr inbounds i8, i8* %280, i64 1
%282 = load i8, i8* %280
%283 = getelementptr inbounds i8, i8* %278, i64 1
store i8 %282, i8* %278
%284 = getelementptr inbounds i8, i8* %280, i64 2
%285 = load i8, i8* %281
%286 = getelementptr inbounds i8, i8* %278, i64 2
store i8 %285, i8* %283
%287 = getelementptr inbounds i8, i8* %280, i64 3
%288 = load i8, i8* %284
%289 = getelementptr inbounds i8, i8* %278, i64 3
store i8 %288, i8* %286
%290 = getelementptr inbounds i8, i8* %280, i64 4
%291 = load i8, i8* %287
%292 = getelementptr inbounds i8, i8* %278, i64 4
store i8 %291, i8* %289
%293 = getelementptr inbounds i8, i8* %280, i64 5
%294 = load i8, i8* %290
%295 = getelementptr inbounds i8, i8* %278, i64 5
store i8 %294, i8* %292
%296 = getelementptr inbounds i8, i8* %280, i64 6
%297 = load i8, i8* %293
%298 = getelementptr inbounds i8, i8* %278, i64 6
store i8 %297, i8* %295
%299 = getelementptr inbounds i8, i8* %280, i64 7
%300 = load i8, i8* %296
%301 = getelementptr inbounds i8, i8* %278, i64 7
store i8 %300, i8* %298
%302 = getelementptr inbounds i8, i8* %280, i64 8
%303 = load i8, i8* %299
%304 = getelementptr inbounds i8, i8* %278, i64 8
store i8 %303, i8* %301
%305 = add nsw i32 %279, -8
%306 = icmp eq i32 %305, 0
br i1 %306, label %307, label %277
307: ; preds = %270, %277, %250
%308 = phi i8* [ %174, %250 ], [ %271, %270 ], [ %302, %277 ]
%309 = phi i8* [ %171, %250 ], [ %272, %270 ], [ %304, %277 ]
%310 = icmp uge i8* %308, %0
%311 = zext i1 %310 to i32
%312 = call i32 @assert(i32 %311)
%313 = icmp ule i8* %308, %35
%314 = zext i1 %313 to i32
%315 = call i32 @assert(i32 %314)
%316 = icmp ule i8* %309, %35
%317 = zext i1 %316 to i32
%318 = call i32 @assert(i32 %317)
br label %322
319: ; preds = %67
%320 = load i8*, i8** %5
%321 = icmp eq i8* %320, %9
br i1 %321, label %326, label %322
322: ; preds = %307, %319, %44
%323 = phi i8* [ %50, %44 ], [ %309, %307 ], [ %38, %319 ]
%324 = phi i32 [ %37, %44 ], [ %68, %307 ], [ 4415, %319 ]
%325 = icmp eq i32 %324, 0
br i1 %325, label %326, label %36
326: ; preds = %67, %319, %42, %322, %148, %141, %131, %64
%327 = phi i8* [ %38, %148 ], [ %38, %141 ], [ %38, %131 ], [ %38, %64 ], [ %38, %67 ], [ %323, %322 ], [ %38, %42 ], [ %38, %319 ]
%328 = load i8*, i8** %5
%329 = icmp ult i8* %328, %9
br i1 %329, label %330, label %337
330: ; preds = %326
%331 = load i32, i32* @stderr
%332 = ptrtoint i8* %9 to i64
%333 = ptrtoint i8* %328 to i64
%334 = sub i64 %332, %333
%335 = trunc i64 %334 to i32
%336 = call i32 (i32, i8*, ...) @fprintf(i32 %331, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %335)
br label %337
337: ; preds = %330, %326
%338 = ptrtoint i8* %327 to i64
%339 = ptrtoint i8* %0 to i64
%340 = sub i64 %338, %339
%341 = trunc i64 %340 to i32
ret i32 %341
}