int LZRDecompress(void *out, unsigned int out_capacity, void *in,
                  void *in_end) {
  unsigned char **next_in, *tmp, *next_out, *out_end, *next_seq, *seq_end,
      *buf_ptr1, *buf_ptr2;
  unsigned char last_char = 0;
  int seq_len, seq_off, n_bits, buf_off = 0, i, j;
  unsigned int mask = 0xFFFFFFFF, test_mask;
  char flag;
  signed char type = *(signed char *)in;
  unsigned int buffer = ((unsigned int)*(unsigned char *)(in + 1) << 24) +
                        ((unsigned int)*(unsigned char *)(in + 2) << 16) +
                        ((unsigned int)*(unsigned char *)(in + 3) << 8) +
                        ((unsigned int)*(unsigned char *)(in + 4));
  next_in = (in_end) ? in_end : &tmp;
  *next_in = in + 5;
  next_out = out;
  out_end = out + out_capacity;
  if (type < 0) {
    seq_end = next_out + buffer;
    if (seq_end > out_end)
      return 0x80000104;
    while (next_out < seq_end) {
      *next_out++ = *(*next_in)++;
    }
    (*next_in)++;
    return next_out - (unsigned char *)out;
  }
  unsigned char *buf = (unsigned char *)malloc(2800);
  if (!buf)
    return 0x800200D9;
  for (i = 0; i < 2800; i++)
    buf[i] = 0x80;
  while (1) {
    buf_ptr1 = buf + buf_off + 2488;
    if (!LZRNextBit(buf_ptr1, 0, &mask, &mask, &buffer, next_in)) {
      if (buf_off > 0)
        buf_off--;
      if (next_out == out_end)
        return 0x80000104;
      buf_ptr1 = buf +
                 (((((((int)(next_out - (unsigned char *)out)) & 0x07) << 8) +
                    last_char) >>
                   type) &
                  0x07) *
                     0xFF -
                 0x01;
      for (j = 1; j <= 0xFF;) {
        LZRNextBit(buf_ptr1 + j, &j, &mask, &mask, &buffer, next_in);
      }
      *next_out++ = j;
    } else {
      test_mask = mask;
      n_bits = -1;
      do {
        buf_ptr1 += 8;
        flag = LZRNextBit(buf_ptr1, 0, &test_mask, &mask, &buffer, next_in);
        n_bits += flag;
      } while ((flag != 0) && (n_bits < 6));
      buf_ptr2 = buf + n_bits + 2033;
      j = 64;
      if ((flag != 0) || (n_bits >= 0)) {
        buf_ptr1 =
            buf + (n_bits << 5) +
            (((((int)(next_out - (unsigned char *)out)) << n_bits) & 0x03)
             << 3) +
            buf_off + 2552;
        seq_len =
            LZRGetNumber(n_bits, buf_ptr1, 8, &flag, &mask, &buffer, next_in);
        if (seq_len == 0xFF)
          return next_out - (unsigned char *)out;
        if ((flag != 0) || (n_bits > 0)) {
          buf_ptr2 += 56;
          j = 352;
        }
      } else {
        seq_len = 1;
      }
      i = 1;
      do {
        n_bits = (i << 4) - j;
        flag =
            LZRNextBit(buf_ptr2 + (i << 3), &i, &mask, &mask, &buffer, next_in);
      } while (n_bits < 0);
      if (flag || (n_bits > 0)) {
        if (!flag)
          n_bits -= 8;
        seq_off = LZRGetNumber(n_bits / 8, buf + n_bits + 2344, 1, &flag, &mask,
                               &buffer, next_in);
      } else {
        seq_off = 1;
      }
      next_seq = next_out - seq_off;
      if (next_seq < (unsigned char *)out)
        return 0x80000108;
      seq_end = next_out + seq_len + 1;
      if (seq_end > out_end)
        return 0x80000104;
      buf_off = ((((int)(seq_end - (unsigned char *)out)) + 1) & 0x01) + 0x06;
      do {
        *next_out++ = *next_seq++;
      } while (next_out < seq_end);
    }
    last_char = *(next_out - 1);
  }
}


x86 assembly (clang, -O0):
<LZRDecompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movb   $0x0,-0x69(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0xffffffff,-0x88(%rbp)
ff ff ff
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x8e(%rbp)
mov    -0x20(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x18,%eax
mov    -0x20(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x20(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x20(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x94(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11bb <LZRDecompress+0x8b>
mov    -0x28(%rbp),%rax
mov    %rax,-0xa8(%rbp)
jmp    11c6 <LZRDecompress+0x96>
lea    -0x38(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rcx
add    $0x5,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movsbl -0x8e(%rbp),%eax
cmp    $0x0,%eax
jge    128e <LZRDecompress+0x15e>
mov    -0x40(%rbp),%rax
mov    -0x94(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
cmp    -0x48(%rbp),%rax
jbe    1231 <LZRDecompress+0x101>
movl   $0x80000104,-0x4(%rbp)
jmp    173e <LZRDecompress+0x60e>
jmp    1236 <LZRDecompress+0x106>
mov    -0x40(%rbp),%rax
cmp    -0x58(%rbp),%rax
jae    126d <LZRDecompress+0x13d>
mov    -0x30(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%cl
mov    -0x40(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x40(%rbp)
mov    %cl,(%rax)
jmp    1236 <LZRDecompress+0x106>
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    173e <LZRDecompress+0x60e>
mov    $0xaf0,%edi
call   1030 <malloc@plt>
mov    %rax,-0xa0(%rbp)
cmpq   $0x0,-0xa0(%rbp)
jne    12b9 <LZRDecompress+0x189>
movl   $0x800200d9,-0x4(%rbp)
jmp    173e <LZRDecompress+0x60e>
movl   $0x0,-0x80(%rbp)
cmpl   $0xaf0,-0x80(%rbp)
jge    12ea <LZRDecompress+0x1ba>
mov    -0xa0(%rbp),%rax
movslq -0x80(%rbp),%rcx
movb   $0x80,(%rax,%rcx,1)
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    12c0 <LZRDecompress+0x190>
jmp    12ef <LZRDecompress+0x1bf>
mov    -0xa0(%rbp),%rax
movslq -0x7c(%rbp),%rcx
add    %rcx,%rax
add    $0x9b8,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%r9
xor    %esi,%esi
lea    -0x88(%rbp),%rcx
lea    -0x94(%rbp),%r8
mov    %rcx,%rdx
mov    $0x0,%al
call   1040 <LZRNextBit@plt>
cmp    $0x0,%eax
jne    140f <LZRDecompress+0x2df>
cmpl   $0x0,-0x7c(%rbp)
jle    1345 <LZRDecompress+0x215>
mov    -0x7c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x48(%rbp),%rax
jne    135f <LZRDecompress+0x22f>
movl   $0x80000104,-0x4(%rbp)
jmp    173e <LZRDecompress+0x60e>
mov    -0xa0(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    %rdx,%rcx
mov    %ecx,%edx
and    $0x7,%edx
shl    $0x8,%edx
movzbl -0x69(%rbp),%ecx
add    %ecx,%edx
movsbl -0x8e(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0x7,%ecx
imul   $0xff,%ecx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x60(%rbp)
movl   $0x1,-0x84(%rbp)
cmpl   $0xff,-0x84(%rbp)
jg     13f1 <LZRDecompress+0x2c1>
mov    -0x60(%rbp),%rdi
movslq -0x84(%rbp),%rax
add    %rax,%rdi
mov    -0x30(%rbp),%r9
lea    -0x84(%rbp),%rsi
lea    -0x88(%rbp),%rcx
lea    -0x94(%rbp),%r8
mov    %rcx,%rdx
mov    $0x0,%al
call   1040 <LZRNextBit@plt>
jmp    13ab <LZRDecompress+0x27b>
mov    -0x84(%rbp),%eax
mov    %al,%cl
mov    -0x40(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x40(%rbp)
mov    %cl,(%rax)
jmp    172f <LZRDecompress+0x5ff>
mov    -0x88(%rbp),%eax
mov    %eax,-0x8c(%rbp)
movl   $0xffffffff,-0x78(%rbp)
mov    -0x60(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x30(%rbp),%r9
xor    %esi,%esi
lea    -0x8c(%rbp),%rdx
lea    -0x88(%rbp),%rcx
lea    -0x94(%rbp),%r8
mov    $0x0,%al
call   1040 <LZRNextBit@plt>
mov    %al,-0x8d(%rbp)
movsbl -0x8d(%rbp),%eax
add    -0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
movsbl -0x8d(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa9(%rbp)
je     148c <LZRDecompress+0x35c>
cmpl   $0x6,-0x78(%rbp)
setl   %al
mov    %al,-0xa9(%rbp)
mov    -0xa9(%rbp),%al
test   $0x1,%al
jne    1422 <LZRDecompress+0x2f2>
mov    -0xa0(%rbp),%rax
movslq -0x78(%rbp),%rcx
add    %rcx,%rax
add    $0x7f1,%rax
mov    %rax,-0x68(%rbp)
movl   $0x40,-0x84(%rbp)
movsbl -0x8d(%rbp),%eax
cmp    $0x0,%eax
jne    14d6 <LZRDecompress+0x3a6>
cmpl   $0x0,-0x78(%rbp)
jl     15a2 <LZRDecompress+0x472>
mov    -0xa0(%rbp),%rax
mov    -0x78(%rbp),%ecx
shl    $0x5,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    -0x40(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    %rdx,%rcx
mov    %ecx,%edx
mov    -0x78(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
and    $0x3,%ecx
shl    $0x3,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0x7c(%rbp),%rcx
add    %rcx,%rax
add    $0x9f8,%rax
mov    %rax,-0x60(%rbp)
mov    -0x78(%rbp),%edi
mov    -0x60(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    $0x8,%edx
lea    -0x8d(%rbp),%rcx
lea    -0x88(%rbp),%r8
lea    -0x94(%rbp),%r9
mov    %rax,(%rsp)
mov    $0x0,%al
call   1050 <LZRGetNumber@plt>
mov    %eax,-0x70(%rbp)
cmpl   $0xff,-0x70(%rbp)
jne    156d <LZRDecompress+0x43d>
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    173e <LZRDecompress+0x60e>
movsbl -0x8d(%rbp),%eax
cmp    $0x0,%eax
jne    1587 <LZRDecompress+0x457>
cmpl   $0x0,-0x78(%rbp)
jle    159d <LZRDecompress+0x46d>
mov    -0x68(%rbp),%rax
add    $0x38,%rax
mov    %rax,-0x68(%rbp)
movl   $0x160,-0x84(%rbp)
jmp    15a9 <LZRDecompress+0x479>
movl   $0x1,-0x70(%rbp)
movl   $0x1,-0x80(%rbp)
mov    -0x80(%rbp),%eax
shl    $0x4,%eax
sub    -0x84(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x68(%rbp),%rdi
mov    -0x80(%rbp),%eax
shl    $0x3,%eax
cltq
add    %rax,%rdi
mov    -0x30(%rbp),%r9
lea    -0x80(%rbp),%rsi
lea    -0x88(%rbp),%rcx
lea    -0x94(%rbp),%r8
mov    %rcx,%rdx
mov    $0x0,%al
call   1040 <LZRNextBit@plt>
mov    %al,-0x8d(%rbp)
cmpl   $0x0,-0x78(%rbp)
jl     15b0 <LZRDecompress+0x480>
movsbl -0x8d(%rbp),%eax
cmp    $0x0,%eax
jne    1618 <LZRDecompress+0x4e8>
cmpl   $0x0,-0x78(%rbp)
jle    1681 <LZRDecompress+0x551>
cmpb   $0x0,-0x8d(%rbp)
jne    162e <LZRDecompress+0x4fe>
mov    -0x78(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0xa0(%rbp),%rsi
movslq -0x78(%rbp),%rax
add    %rax,%rsi
add    $0x928,%rsi
mov    -0x30(%rbp),%rax
mov    $0x1,%edx
lea    -0x8d(%rbp),%rcx
lea    -0x88(%rbp),%r8
lea    -0x94(%rbp),%r9
mov    %rax,(%rsp)
mov    $0x0,%al
call   1050 <LZRGetNumber@plt>
mov    %eax,-0x74(%rbp)
jmp    1688 <LZRDecompress+0x558>
movl   $0x1,-0x74(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x74(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    16b6 <LZRDecompress+0x586>
movl   $0x80000108,-0x4(%rbp)
jmp    173e <LZRDecompress+0x60e>
mov    -0x40(%rbp),%rax
movslq -0x70(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
cmp    -0x48(%rbp),%rax
jbe    16e3 <LZRDecompress+0x5b3>
movl   $0x80000104,-0x4(%rbp)
jmp    173e <LZRDecompress+0x60e>
mov    -0x58(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%eax
and    $0x1,%eax
add    $0x6,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x50(%rbp)
mov    (%rax),%cl
mov    -0x40(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x40(%rbp)
mov    %cl,(%rax)
mov    -0x40(%rbp),%rax
cmp    -0x58(%rbp),%rax
jb     16fa <LZRDecompress+0x5ca>
jmp    172f <LZRDecompress+0x5ff>
mov    -0x40(%rbp),%rax
mov    -0x1(%rax),%al
mov    %al,-0x69(%rbp)
jmp    12ef <LZRDecompress+0x1bf>
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZRDecompress>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdi,%r14
movl   $0xffffffff,0x20(%rsp)
ff
movzbl (%rdx),%ebp
mov    0x1(%rdx),%eax
shl    $0x20,%rax
bswap  %rax
mov    %eax,0x18(%rsp)
test   %rcx,%rcx
lea    0x90(%rsp),%rbx
cmovne %rcx,%rbx
lea    0x5(%rdx),%rcx
mov    %rbx,%r12
mov    %rcx,(%rbx)
mov    %esi,%ebx
add    %rdi,%rbx
mov    %rbp,0x70(%rsp)
test   %bpl,%bpl
js     16da <LZRDecompress+0x59a>
mov    $0xaf0,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     173c <LZRDecompress+0x5fc>
mov    %rax,%rbp
mov    %rbx,0x38(%rsp)
mov    $0xaf0,%edx
mov    %rax,%rdi
mov    $0x80,%esi
call   1030 <memset@plt>
movl   $0xaf0,0x24(%rsp)
lea    0x9b8(%rbp),%rax
mov    %rax,0x88(%rsp)
lea    0x7f1(%rbp),%rax
mov    %rax,0x78(%rsp)
lea    0x9f8(%rbp),%rax
mov    %rax,0x60(%rsp)
lea    0x928(%rbp),%rax
mov    %rax,0x58(%rsp)
lea    -0x1(%rbp),%rax
mov    %rax,0x68(%rsp)
add    $0x9c0,%rbp
mov    %rbp,0x80(%rsp)
lea    0x20(%rsp),%r13
mov    %r14,%rax
xor    %r14d,%r14d
xor    %ebp,%ebp
mov    %rax,%r15
mov    %rax,%rcx
mov    %rax,0x30(%rsp)
mov    %r12,%rbx
mov    %r12,0x50(%rsp)
jmp    1251 <LZRDecompress+0x111>
mov    %rbx,%rbp
xchg   %ax,%ax
xor    $0x7,%ebp
mov    -0x1(%r15),%r14b
lea    0x20(%rsp),%r13
mov    0x50(%rsp),%rbx
movslq %ebp,%r12
mov    0x88(%rsp),%rax
lea    (%rax,%r12,1),%rdi
xor    %esi,%esi
mov    %r13,%rdx
mov    %r13,%rcx
lea    0x18(%rsp),%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1050 <LZRNextBit@plt>
test   %eax,%eax
je     1320 <LZRDecompress+0x1e0>
mov    0x20(%rsp),%eax
mov    %eax,0x44(%rsp)
mov    0x80(%rsp),%rax
mov    %r12,0x28(%rsp)
lea    (%rax,%r12,1),%rbp
mov    $0xffffffff,%r14d
lea    0x18(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
xor    %esi,%esi
lea    0x44(%rsp),%rdx
mov    %r13,%rcx
mov    %r12,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1050 <LZRNextBit@plt>
mov    %al,0x17(%rsp)
movsbl %al,%ecx
add    %ecx,%r14d
test   $0xff,%cl
je     12e3 <LZRDecompress+0x1a3>
add    $0x8,%rbp
cmp    $0x6,%r14d
jl     12b0 <LZRDecompress+0x170>
movslq %r14d,%rbp
add    0x78(%rsp),%rbp
movl   $0x40,0x1c(%rsp)
test   %al,%al
jne    13d0 <LZRDecompress+0x290>
mov    $0x1,%r12d
test   %r14d,%r14d
jns    13d0 <LZRDecompress+0x290>
lea    0x24(%rsp),%rsi
jmp    1456 <LZRDecompress+0x316>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %ebp,%ebp
lea    -0x1(%rbp),%eax
mov    %eax,%ecx
mov    $0x0,%eax
cmovle %eax,%ecx
cmp    0x38(%rsp),%r15
je     1743 <LZRDecompress+0x603>
mov    %rcx,0x28(%rsp)
mov    %r15d,%eax
sub    0x30(%rsp),%eax
and    $0x7,%eax
shl    $0x8,%rax
movzbl %r14b,%edx
or     %rax,%rdx
mov    0x70(%rsp),%rcx
shr    %cl,%rdx
and    $0x7,%edx
mov    %rbx,%r12
lea    0x1c(%rsp),%rbx
mov    %rdx,%rbp
shl    $0x8,%rbp
sub    %rdx,%rbp
add    0x68(%rsp),%rbp
movl   $0x1,0x1c(%rsp)
mov    $0x1,%eax
lea    0x18(%rsp),%r14
nopl   0x0(%rax,%rax,1)
movslq %eax,%rdi
add    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r13,%rcx
mov    %r14,%r8
mov    %r12,%r9
xor    %eax,%eax
call   1050 <LZRNextBit@plt>
mov    0x1c(%rsp),%eax
cmp    $0x100,%eax
jl     1390 <LZRDecompress+0x250>
mov    %al,(%r15)
add    $0x1,%r15
mov    -0x1(%r15),%r14b
mov    0x28(%rsp),%rbp
mov    %r12,%rbx
jmp    1251 <LZRDecompress+0x111>
nop
mov    %rbp,0x48(%rsp)
mov    %r14d,%eax
shl    $0x5,%eax
cltq
add    0x60(%rsp),%rax
mov    %r15,%rbp
sub    0x30(%rsp),%rbp
mov    %ebp,%esi
mov    %r14d,%ecx
shl    %cl,%esi
shl    $0x3,%esi
and    $0x18,%esi
add    %rax,%rsi
add    0x28(%rsp),%rsi
mov    %rbx,(%rsp)
mov    %r14d,%edi
mov    $0x8,%edx
lea    0x17(%rsp),%rcx
mov    %r13,%r8
lea    0x18(%rsp),%r9
xor    %eax,%eax
call   1060 <LZRGetNumber@plt>
cmp    $0xff,%eax
je     174f <LZRDecompress+0x60f>
mov    %eax,%r12d
cmpb   $0x0,0x17(%rsp)
lea    0x24(%rsp),%rsi
jne    1445 <LZRDecompress+0x305>
test   %r14d,%r14d
jg     1445 <LZRDecompress+0x305>
mov    0x48(%rsp),%rbp
jmp    1456 <LZRDecompress+0x316>
mov    0x48(%rsp),%rbp
add    $0x38,%rbp
movl   $0x160,0x1c(%rsp)
movl   $0x1,0x24(%rsp)
mov    0x1c(%rsp),%r14d
lea    0x8(%rbp),%rdi
mov    %r13,%rdx
mov    %r13,%rcx
lea    0x18(%rsp),%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1050 <LZRNextBit@plt>
mov    %al,0x17(%rsp)
cmp    $0x11,%r14d
jl     14f0 <LZRDecompress+0x3b0>
mov    %r12d,0x28(%rsp)
lea    0x20(%rsp),%r14
mov    %rbx,%r12
mov    %rbp,%r13
cs nopw 0x0(%rax,%rax,1)
mov    0x24(%rsp),%eax
mov    %eax,%ebp
shl    $0x4,%ebp
shl    $0x3,%eax
movslq %eax,%rdi
add    %r13,%rdi
mov    0x1c(%rsp),%ebx
lea    0x24(%rsp),%rsi
mov    %r14,%rdx
mov    %r14,%rcx
lea    0x18(%rsp),%r8
mov    %r12,%r9
xor    %eax,%eax
call   1050 <LZRNextBit@plt>
sub    %ebx,%ebp
mov    %al,0x17(%rsp)
js     14a0 <LZRDecompress+0x360>
mov    0x30(%rsp),%rbx
mov    0x38(%rsp),%r14
mov    0x28(%rsp),%r12d
jmp    1502 <LZRDecompress+0x3c2>
nopl   0x0(%rax)
mov    $0x10,%ebp
sub    %r14d,%ebp
mov    0x38(%rsp),%r14
mov    0x30(%rsp),%rbx
movzbl %al,%edx
mov    $0x1,%ecx
or     %ebp,%edx
lea    0x18(%rsp),%r9
je     154f <LZRDecompress+0x40f>
lea    -0x8(%rbp),%ecx
test   %al,%al
cmovne %ebp,%ecx
lea    0x7(%rcx),%edi
test   %ecx,%ecx
cmovns %ecx,%edi
sar    $0x3,%edi
movslq %ecx,%rsi
add    0x58(%rsp),%rsi
mov    0x50(%rsp),%rax
mov    %rax,(%rsp)
mov    $0x1,%edx
lea    0x17(%rsp),%rcx
lea    0x20(%rsp),%r8
xor    %eax,%eax
call   1060 <LZRGetNumber@plt>
mov    %eax,%ecx
movslq %ecx,%r10
mov    %r15,%rax
sub    %r10,%rax
cmp    %rbx,%rax
jb     174a <LZRDecompress+0x60a>
movslq %r12d,%rcx
lea    (%r15,%rcx,1),%rbp
add    $0x1,%rbp
cmp    %r14,%rbp
ja     1743 <LZRDecompress+0x603>
add    %r15,%rcx
sub    %ebx,%ebp
and    $0x1,%ebp
mov    %rcx,%rdx
sub    %r15,%rdx
mov    $0x0,%r9d
cmovae %rdx,%r9
add    $0x1,%r9
cmp    $0x20,%r9
jb     16b0 <LZRDecompress+0x570>
mov    %rcx,%rsi
sub    %r15,%rsi
mov    $0x0,%edx
cmovae %rsi,%rdx
mov    %rdx,%rsi
sub    %r10,%rsi
add    %r15,%rsi
add    $0x1,%rsi
cmp    %rsi,%r15
jae    15cc <LZRDecompress+0x48c>
add    %r15,%rdx
add    $0x1,%rdx
cmp    %rdx,%rax
jb     16b0 <LZRDecompress+0x570>
neg    %r10
mov    %r9,%r8
and    $0xffffffffffffffe0,%r8
lea    -0x20(%r8),%rdx
mov    %rdx,%rdi
shr    $0x5,%rdi
add    $0x1,%rdi
mov    %edi,%esi
and    $0x3,%esi
mov    %rbp,%rbx
cmp    $0x60,%rdx
jae    15f7 <LZRDecompress+0x4b7>
xor    %ebp,%ebp
jmp    1670 <LZRDecompress+0x530>
and    $0xfffffffffffffffc,%rdi
lea    (%r15,%r10,1),%rdx
add    $0x70,%rdx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movups -0x70(%rdx,%rbp,1),%xmm0
movups -0x60(%rdx,%rbp,1),%xmm1
movups %xmm0,(%r15,%rbp,1)
movups %xmm1,0x10(%r15,%rbp,1)
movups -0x50(%rdx,%rbp,1),%xmm0
movups -0x40(%rdx,%rbp,1),%xmm1
movups %xmm0,0x20(%r15,%rbp,1)
movups %xmm1,0x30(%r15,%rbp,1)
movups -0x30(%rdx,%rbp,1),%xmm0
movups -0x20(%rdx,%rbp,1),%xmm1
movups %xmm0,0x40(%r15,%rbp,1)
movups %xmm1,0x50(%r15,%rbp,1)
movups -0x10(%rdx,%rbp,1),%xmm0
movups (%rdx,%rbp,1),%xmm1
movups %xmm0,0x60(%r15,%rbp,1)
movups %xmm1,0x70(%r15,%rbp,1)
sub    $0xffffffffffffff80,%rbp
add    $0xfffffffffffffffc,%rdi
jne    1610 <LZRDecompress+0x4d0>
test   %rsi,%rsi
je     169c <LZRDecompress+0x55c>
lea    (%r15,%rbp,1),%rdx
add    $0x10,%rdx
nopl   (%rax)
movups -0x10(%rdx,%r10,1),%xmm0
movups (%rdx,%r10,1),%xmm1
movups %xmm0,-0x10(%rdx)
movups %xmm1,(%rdx)
add    $0x20,%rdx
add    $0xffffffffffffffff,%rsi
jne    1680 <LZRDecompress+0x540>
add    %r8,%r15
cmp    %r8,%r9
je     123b <LZRDecompress+0xfb>
add    %r8,%rax
mov    %rbx,%rbp
xchg   %ax,%ax
mov    %r15,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ebx
add    $0x1,%rax
lea    0x1(%rdx),%r15
mov    %bl,(%rdx)
cmp    %rcx,%rdx
mov    %r15,%rdx
jb     16c0 <LZRDecompress+0x580>
jmp    1240 <LZRDecompress+0x100>
mov    %eax,%edi
add    %r14,%rax
mov    $0x80000104,%ebp
cmp    %rbx,%rax
ja     174f <LZRDecompress+0x60f>
mov    %r14,%rbp
test   %edi,%edi
je     172f <LZRDecompress+0x5ef>
lea    0x6(%rdx),%rcx
mov    %rcx,(%r12)
mov    0x5(%rdx),%cl
lea    0x1(%r14),%rbp
mov    %cl,(%r14)
cmp    $0x1,%edi
je     172b <LZRDecompress+0x5eb>
nopw   0x0(%rax,%rax,1)
mov    (%r12),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%r12)
movzbl (%rcx),%ecx
mov    %cl,0x0(%rbp)
add    $0x1,%rbp
cmp    %rax,%rbp
jb     1710 <LZRDecompress+0x5d0>
mov    (%r12),%rcx
add    $0x1,%rcx
mov    %rcx,(%r12)
sub    %r14d,%ebp
jmp    174f <LZRDecompress+0x60f>
mov    $0x800200d9,%ebp
jmp    174f <LZRDecompress+0x60f>
mov    $0x80000104,%ebp
jmp    174f <LZRDecompress+0x60f>
mov    $0x80000108,%ebp
mov    %ebp,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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