#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 */

/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, ...);
int zax_uncompress(unsigned char *infd, int insz, unsigned char *outfd,
                   int outsz) {
  unsigned char *o = outfd;
  int decode_counter = 0, code_remain = 0;
  int i, code_type, offset, length, length80, repeat_times, code_num = 0;
  unsigned char(*raw_code_p)[3];
  unsigned char *switch_read_buf;
  unsigned char *file_read_buf1 = (unsigned char *)calloc(1, 3 * 1024);
  unsigned char *file_read_buf2 = (unsigned char *)calloc(1, 3 * 1024);
  unsigned char *decode_buf = (unsigned char *)calloc(1, 102400);
  raw_code_p = (void *)file_read_buf1;
  unsigned char *window_back = decode_buf - 1;
  while (insz > 0) {
    code_num = (3) * (1024 - code_remain);
    if (code_num <= 0)
      break;
    if (code_num > insz)
      code_num = insz;
    memcpy(file_read_buf2 + code_remain * 3, infd, code_num);
    infd += code_num;
    insz -= code_num;
    code_num += code_remain;
    if (code_num <= 0)
      break;
    if (code_remain != 0) {
      memcpy(file_read_buf2, raw_code_p, code_remain * 3);
    }
    switch_read_buf = file_read_buf1;
    file_read_buf1 = file_read_buf2;
    file_read_buf2 = switch_read_buf;
    raw_code_p = (void *)file_read_buf1;
    for (decode_counter = 1; decode_counter <= code_num; decode_counter++) {
      if ((*raw_code_p)[0] & 128) {
        code_type = 1;
        i = repeat_times = ((*raw_code_p)[0] & 127) + 1;
      } else {
        if ((length = (*raw_code_p)[1] & 31) ||
            ((*raw_code_p)[0] == 0 && (*raw_code_p)[1] == 0)) {
          code_type = 0;
          offset =
              (((*raw_code_p)[0] & 127) << 3) + (((*raw_code_p)[1] & 224) >> 5);
        } else {
          code_type = 2;
          length80 =
              (((*raw_code_p)[0] & 127) << 3) + (((*raw_code_p)[1] & 224) >> 5);
        }
      }
      switch (code_type) {
      case 0:
        memcpy(window_back + 1, window_back - 1024 + offset + 1, length);
        window_back += length;
        *(++window_back) = (*raw_code_p)[2];
        raw_code_p++;
        break;
      case 1:
        for (; i > 0; i--) {
          *(++window_back) = (*raw_code_p)[1];
          *(++window_back) = (*raw_code_p)[2];
        }
        raw_code_p++;
        break;
      case 2:
        if (length80 == 1) {
          window_back--;
          raw_code_p++;
        } else {
          memcpy(window_back + 1, (char *)(raw_code_p + 1), length80);
          raw_code_p += length80 % 3 ? (length80 / 3 + 2) : (length80 / 3 + 1);
          window_back += length80;
          decode_counter += length80 % 3 ? (length80 / 3 + 1) : (length80 / 3);
        }
        break;
      }
      if ((decode_buf + 102400 - window_back - 1 < 1023 + 1)) {
        i = window_back - 1024 - decode_buf + 1;
        if (i > outsz)
          i = outsz;
        if (i > 0) {
          memcpy(o, decode_buf, i);
          o += i;
          outsz -= i;
        }
        memcpy(decode_buf, window_back - 1024 + 1, 1024);
        window_back = decode_buf + 1024 - 1;
      }
      if ((code_remain = code_num - decode_counter) < 342 && code_num == 1024)
        break;
    }
  }
  i = window_back - decode_buf + 1;
  if (i > outsz)
    i = outsz;
  if (i > 0) {
    memcpy(o, decode_buf, i);
    o += i;
    outsz -= i;
  }
  free(file_read_buf1);
  free(file_read_buf2);
  free(decode_buf);
  return (o - outfd);
}


x86 assembly (clang, -O0):
<zax_uncompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    $0x1,%edi
mov    $0xc00,%esi
call   1040 <calloc@plt>
mov    %rax,-0x68(%rbp)
mov    $0x1,%edi
mov    $0xc00,%esi
call   1040 <calloc@plt>
mov    %rax,-0x70(%rbp)
mov    $0x1,%edi
mov    $0x19000,%esi
call   1040 <calloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x78(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x80(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1642 <zax_uncompress+0x512>
mov    $0x400,%eax
sub    -0x30(%rbp),%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jg     11da <zax_uncompress+0xaa>
jmp    1642 <zax_uncompress+0x512>
mov    -0x4c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11ec <zax_uncompress+0xbc>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x70(%rbp),%rdi
imul   $0x3,-0x30(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x4c(%rbp),%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    -0x4c(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x4c(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x30(%rbp),%eax
add    -0x4c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jg     123b <zax_uncompress+0x10b>
jmp    1642 <zax_uncompress+0x512>
cmpl   $0x0,-0x30(%rbp)
je     1258 <zax_uncompress+0x128>
mov    -0x70(%rbp),%rdi
mov    -0x58(%rbp),%rsi
imul   $0x3,-0x30(%rbp),%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    -0x68(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x58(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jg     163d <zax_uncompress+0x50d>
mov    -0x58(%rbp),%rax
movzbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     12bf <zax_uncompress+0x18f>
movl   $0x1,-0x38(%rbp)
mov    -0x58(%rbp),%rax
movzbl (%rax),%eax
and    $0x7f,%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    %eax,-0x34(%rbp)
jmp    1355 <zax_uncompress+0x225>
mov    -0x58(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x1f,%eax
mov    %eax,-0x40(%rbp)
cmp    $0x0,%eax
jne    12f7 <zax_uncompress+0x1c7>
mov    -0x58(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
jne    1326 <zax_uncompress+0x1f6>
mov    -0x58(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1326 <zax_uncompress+0x1f6>
movl   $0x0,-0x38(%rbp)
mov    -0x58(%rbp),%rax
movzbl (%rax),%eax
and    $0x7f,%eax
shl    $0x3,%eax
mov    -0x58(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xe0,%ecx
sar    $0x5,%ecx
add    %ecx,%eax
mov    %eax,-0x3c(%rbp)
jmp    1350 <zax_uncompress+0x220>
movl   $0x2,-0x38(%rbp)
mov    -0x58(%rbp),%rax
movzbl (%rax),%eax
and    $0x7f,%eax
shl    $0x3,%eax
mov    -0x58(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xe0,%ecx
sar    $0x5,%ecx
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
jmp    1355 <zax_uncompress+0x225>
mov    -0x38(%rbp),%eax
mov    %eax,-0x84(%rbp)
test   %eax,%eax
je     1393 <zax_uncompress+0x263>
jmp    136b <zax_uncompress+0x23b>
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
je     13f6 <zax_uncompress+0x2c6>
jmp    137f <zax_uncompress+0x24f>
mov    -0x84(%rbp),%eax
sub    $0x2,%eax
je     1456 <zax_uncompress+0x326>
jmp    1550 <zax_uncompress+0x420>
mov    -0x80(%rbp),%rdi
add    $0x1,%rdi
mov    -0x80(%rbp),%rsi
add    $0xfffffffffffffc00,%rsi
movslq -0x3c(%rbp),%rax
add    %rax,%rsi
add    $0x1,%rsi
mov    -0x40(%rbp),%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    -0x40(%rbp),%ecx
mov    -0x80(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    -0x58(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x80(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x80(%rbp)
mov    %cl,0x1(%rax)
mov    -0x58(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x58(%rbp)
jmp    1550 <zax_uncompress+0x420>
jmp    13fb <zax_uncompress+0x2cb>
cmpl   $0x0,-0x34(%rbp)
jle    1445 <zax_uncompress+0x315>
mov    -0x58(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x80(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x80(%rbp)
mov    %cl,0x1(%rax)
mov    -0x58(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x80(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x80(%rbp)
mov    %cl,0x1(%rax)
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    13fb <zax_uncompress+0x2cb>
mov    -0x58(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x58(%rbp)
jmp    1550 <zax_uncompress+0x420>
cmpl   $0x1,-0x44(%rbp)
jne    147d <zax_uncompress+0x34d>
mov    -0x80(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x80(%rbp)
mov    -0x58(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x58(%rbp)
jmp    154b <zax_uncompress+0x41b>
mov    -0x80(%rbp),%rdi
add    $0x1,%rdi
mov    -0x58(%rbp),%rsi
add    $0x3,%rsi
mov    -0x44(%rbp),%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    -0x44(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     14c4 <zax_uncompress+0x394>
mov    -0x44(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x2,%eax
mov    %eax,-0x88(%rbp)
jmp    14d8 <zax_uncompress+0x3a8>
mov    -0x44(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
imul   $0x3,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x44(%rbp),%ecx
mov    -0x80(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x80(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     152e <zax_uncompress+0x3fe>
mov    -0x44(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    153f <zax_uncompress+0x40f>
mov    -0x44(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1550 <zax_uncompress+0x420>
mov    -0x78(%rbp),%rax
add    $0x19000,%rax
mov    -0x80(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
cmp    $0x400,%rax
jge    1604 <zax_uncompress+0x4d4>
mov    -0x80(%rbp),%rax
add    $0xfffffffffffffc00,%rax
mov    -0x78(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    159b <zax_uncompress+0x46b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jle    15d3 <zax_uncompress+0x4a3>
mov    -0x28(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x34(%rbp),%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rsi
add    $0xfffffffffffffc00,%rsi
add    $0x1,%rsi
xor    %eax,%eax
mov    $0x400,%edx
call   1050 <memcpy@plt>
mov    -0x78(%rbp),%rax
add    $0x400,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x80(%rbp)
mov    -0x4c(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
cmp    $0x156,%eax
jge    162a <zax_uncompress+0x4fa>
cmpl   $0x400,-0x4c(%rbp)
jne    162a <zax_uncompress+0x4fa>
jmp    163d <zax_uncompress+0x50d>
jmp    162f <zax_uncompress+0x4ff>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    127f <zax_uncompress+0x14f>
jmp    11b3 <zax_uncompress+0x83>
mov    -0x80(%rbp),%rax
mov    -0x78(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1666 <zax_uncompress+0x536>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jle    169e <zax_uncompress+0x56e>
mov    -0x28(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x34(%rbp),%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zax_uncompress>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %ecx,0x14(%rsp)
mov    %rdx,%r15
mov    %esi,%r12d
mov    %rdi,0x40(%rsp)
mov    $0x1,%edi
mov    $0xc00,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    $0xc00,%esi
call   1040 <calloc@plt>
mov    %rax,%rbp
mov    $0x1,%edi
mov    $0x19000,%esi
call   1040 <calloc@plt>
lea    -0x1(%rax),%r14
mov    %r12d,0x10(%rsp)
test   %r12d,%r12d
mov    %rax,0x28(%rsp)
mov    %r15,0x30(%rsp)
jle    14dd <zax_uncompress+0x3ad>
lea    0x19000(%rax),%rcx
mov    %rcx,0x50(%rsp)
add    $0x3ff,%rax
mov    %rax,0x48(%rsp)
mov    %rbp,%rax
mov    %rbx,%r13
mov    %r15,%rbp
mov    %rbx,%r15
xor    %r12d,%r12d
mov    %rbp,0x18(%rsp)
jmp    11eb <zax_uncompress+0xbb>
nopl   0x0(%rax)
mov    0x38(%rsp),%rbp
mov    %rbp,%rax
mov    0x20(%rsp),%r13
mov    %r13,%rbx
cmpl   $0x0,0x10(%rsp)
jle    14f3 <zax_uncompress+0x3c3>
mov    %rax,%rbp
cmp    $0x3ff,%r12d
jg     14e4 <zax_uncompress+0x3b4>
mov    %r13,0x38(%rsp)
mov    $0x400,%eax
sub    %r12d,%eax
lea    (%rax,%rax,2),%ebx
mov    0x10(%rsp),%eax
cmp    %eax,%ebx
cmovg  %eax,%ebx
lea    (%r12,%r12,2),%r13d
movslq %r13d,%rdi
mov    %rbp,0x20(%rsp)
add    %rbp,%rdi
mov    0x40(%rsp),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    %ebx,%ebp
add    %r12d,%ebp
jle    14e9 <zax_uncompress+0x3b9>
test   %r12d,%r12d
mov    0x20(%rsp),%r12
mov    %ebp,0xc(%rsp)
je     125e <zax_uncompress+0x12e>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    0xc(%rsp),%ebp
movslq %ebx,%rax
add    %rax,0x40(%rsp)
sub    %ebx,0x10(%rsp)
mov    $0x1,%r13d
mov    %r12,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r15),%ecx
test   $0x80,%cl
jne    12e0 <zax_uncompress+0x1b0>
movzbl 0x1(%r15),%eax
mov    %eax,%ebx
and    $0x1f,%ebx
test   %rbx,%rbx
jne    12a2 <zax_uncompress+0x172>
mov    %ecx,%edx
or     %al,%dl
jne    146d <zax_uncompress+0x33d>
and    $0x7f,%ecx
shr    $0x5,%rax
lea    (%rax,%rcx,8),%rax
lea    0x1(%r14),%rdi
lea    (%r14,%rax,1),%rsi
add    $0xfffffffffffffc01,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    0xc(%rsp),%ebp
mov    0x2(%r15),%al
mov    %al,0x1(%r14,%rbx,1)
add    %rbx,%r14
add    $0x1,%r14
add    $0x3,%r15
jmp    1353 <zax_uncompress+0x223>
nop
mov    %ecx,%eax
and    $0x7f,%eax
add    $0x1,%eax
mov    %ecx,%edx
and    $0x7f,%edx
cmp    $0xf,%dl
jb     131c <zax_uncompress+0x1ec>
lea    0x1(%r14),%rsi
lea    0x3(%r15),%rdi
cmp    %rdi,%rsi
jae    1406 <zax_uncompress+0x2d6>
add    %cl,%cl
movzbl %cl,%ecx
add    %r14,%rcx
add    $0x3,%rcx
lea    0x1(%r15),%rsi
cmp    %rcx,%rsi
jae    1406 <zax_uncompress+0x2d6>
mov    %r14,%rcx
add    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%r15),%edx
mov    %dl,0x1(%rcx)
movzbl 0x2(%r15),%edx
mov    %dl,0x2(%rcx)
add    $0x2,%rcx
add    $0xffffffff,%eax
cmp    $0x1,%eax
ja     1330 <zax_uncompress+0x200>
add    $0x3,%r15
mov    %rcx,%r14
mov    %r14,%rax
not    %rax
add    0x50(%rsp),%rax
cmp    $0x3ff,%rax
jg     13d0 <zax_uncompress+0x2a0>
mov    %r14d,%ebx
mov    0x28(%rsp),%rsi
sub    %esi,%ebx
add    $0xfffffc01,%ebx
mov    0x14(%rsp),%eax
cmp    %eax,%ebx
cmovg  %eax,%ebx
test   %ebx,%ebx
jle    13ae <zax_uncompress+0x27e>
mov    0x18(%rsp),%rbp
mov    %rbp,%rdi
mov    %ebx,%edx
mov    %eax,%r12d
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    %ebx,%eax
add    %rax,%rbp
mov    %rbp,0x18(%rsp)
mov    0x28(%rsp),%rsi
sub    %ebx,%r12d
mov    %r12d,0x14(%rsp)
add    $0xfffffffffffffc01,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    0x48(%rsp),%r14
mov    0xc(%rsp),%ebp
cmp    $0x400,%ebp
sete   %al
mov    %ebp,%r12d
sub    %r13d,%r12d
cmp    $0x156,%r12d
setl   %cl
test   %cl,%al
jne    11d0 <zax_uncompress+0xa0>
lea    0x1(%r13),%eax
cmp    %r13d,%ebp
mov    %eax,%r13d
jg     1280 <zax_uncompress+0x150>
jmp    11d0 <zax_uncompress+0xa0>
add    $0x1,%rdx
mov    %edx,%esi
and    $0xfffffff0,%esi
lea    (%r14,%rsi,2),%rcx
sub    %esi,%eax
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movzbl 0x2(%r15),%ebx
movd   %ebx,%xmm0
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
movzbl 0x1(%r15),%ebx
movd   %ebx,%xmm1
punpcklbw %xmm1,%xmm1
pshuflw $0x0,%xmm1,%xmm1
punpcklbw %xmm0,%xmm1
movdqu %xmm1,0x1(%r14,%rdi,2)
movdqu %xmm1,0x11(%r14,%rdi,2)
add    $0x10,%rdi
cmp    %rdi,%rsi
jne    1420 <zax_uncompress+0x2f0>
cmp    %rdx,%rsi
je     134c <zax_uncompress+0x21c>
jmp    131f <zax_uncompress+0x1ef>
and    $0x7f,%ecx
shr    $0x5,%rax
lea    (%rax,%rcx,8),%rbx
cmp    $0x1,%ebx
jne    148a <zax_uncompress+0x35a>
add    $0xffffffffffffffff,%r14
add    $0x3,%r15
jmp    1353 <zax_uncompress+0x223>
lea    0x1(%r14),%rdi
lea    0x3(%r15),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    0xc(%rsp),%ebp
mov    %ebx,%eax
mov    $0xaaaaaaab,%ecx
imul   %rcx,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%ecx
xor    %edx,%edx
xor    %esi,%esi
cmp    %ecx,%ebx
setne  %dl
sete   %sil
neg    %esi
lea    (%rax,%rsi,1),%ecx
add    $0x2,%ecx
add    %eax,%edx
lea    (%rcx,%rcx,2),%rax
add    %rax,%r15
add    %rbx,%r14
add    %r13d,%edx
mov    %edx,%r13d
jmp    1353 <zax_uncompress+0x223>
mov    %r15,0x18(%rsp)
jmp    14f3 <zax_uncompress+0x3c3>
mov    %r13,%rbx
jmp    14f3 <zax_uncompress+0x3c3>
mov    0x38(%rsp),%rbx
mov    0x20(%rsp),%rbp
mov    0x28(%rsp),%r15
sub    %r15d,%r14d
add    $0x1,%r14d
mov    0x14(%rsp),%eax
cmp    %eax,%r14d
cmovg  %eax,%r14d
test   %r14d,%r14d
jle    1531 <zax_uncompress+0x401>
mov    0x18(%rsp),%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    %r14d,%eax
add    %rax,%r12
mov    0x30(%rsp),%r14
jmp    153b <zax_uncompress+0x40b>
mov    0x30(%rsp),%r14
mov    0x18(%rsp),%r12
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
sub    %r14d,%r12d
mov    %r12d,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @zax_uncompress(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i64 @calloc(i32 1, i32 3072)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @calloc(i32 1, i32 3072)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i64 @calloc(i32 1, i32 102400)
%10 = inttoptr i64 %9 to i8*
%11 = getelementptr inbounds i8, i8* %10, i64 -1
%12 = icmp sgt i32 %1, 0
br i1 %12, label %13, label %223
13: ; preds = %4
%14 = inttoptr i64 %5 to [3 x i8]*
%15 = getelementptr inbounds i8, i8* %10, i64 102400
%16 = ptrtoint i8* %15 to i64
%17 = getelementptr inbounds i8, i8* %10, i64 1023
br label %18
18: ; preds = %13, %221
%19 = phi i8* [ %11, %13 ], [ %214, %221 ]
%20 = phi i8* [ %0, %13 ], [ %39, %221 ]
%21 = phi i8* [ %8, %13 ], [ %22, %221 ]
%22 = phi i8* [ %6, %13 ], [ %21, %221 ]
%23 = phi i32 [ %1, %13 ], [ %40, %221 ]
%24 = phi [3 x i8]* [ %14, %13 ], [ %186, %221 ]
%25 = phi i32 [ %3, %13 ], [ %213, %221 ]
%26 = phi i32 [ 0, %13 ], [ %215, %221 ]
%27 = phi i8* [ %2, %13 ], [ %212, %221 ]
%28 = sub nsw i32 1024, %26
%29 = mul nsw i32 %28, 3
%30 = icmp sgt i32 %26, 1023
br i1 %30, label %223, label %31
31: ; preds = %18
%32 = icmp sgt i32 %29, %23
%33 = select i1 %32, i32 %23, i32 %29
%34 = mul nsw i32 %26, 3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %21, i64 %35
%37 = tail call i32 (i8*, ...) @memcpy(i8* %36, i8* %20, i32 %33)
%38 = sext i32 %33 to i64
%39 = getelementptr inbounds i8, i8* %20, i64 %38
%40 = sub nsw i32 %23, %33
%41 = add nsw i32 %33, %26
%42 = icmp slt i32 %41, 1
br i1 %42, label %223, label %43
43: ; preds = %31
%44 = icmp eq i32 %26, 0
br i1 %44, label %47, label %45
45: ; preds = %43
%46 = tail call i32 (i8*, ...) @memcpy(i8* %21, [3 x i8]* %24, i32 %34)
br label %47
47: ; preds = %43, %45
%48 = bitcast i8* %21 to [3 x i8]*
%49 = icmp eq i32 %41, 1024
br label %50
50: ; preds = %211, %47
%51 = phi i8* [ %19, %47 ], [ %214, %211 ]
%52 = phi [3 x i8]* [ %48, %47 ], [ %186, %211 ]
%53 = phi i32 [ %25, %47 ], [ %213, %211 ]
%54 = phi i32 [ 1, %47 ], [ %218, %211 ]
%55 = phi i8* [ %27, %47 ], [ %212, %211 ]
%56 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 0, i64 0
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = and i32 %58, 128
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %71
61: ; preds = %50
%62 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 0, i64 1
%63 = load i8, i8* %62
%64 = and i8 %63, 31
%65 = zext i8 %64 to i32
%66 = icmp eq i8 %64, 0
br i1 %66, label %67, label %127
67: ; preds = %61
%68 = icmp eq i8 %57, 0
%69 = icmp eq i8 %63, 0
%70 = select i1 %68, i1 %69, i1 false
br i1 %70, label %127, label %156
71: ; preds = %50
%72 = and i32 %58, 127
%73 = add nuw nsw i32 %72, 1
%74 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 0, i64 1
%75 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 0, i64 2
%76 = and i8 %57, 127
%77 = add nuw i8 %76, 1
%78 = zext i8 %77 to i64
%79 = icmp ult i8 %76, 15
br i1 %79, label %124, label %80
80: ; preds = %71
%81 = getelementptr i8, i8* %51, i64 1
%82 = getelementptr i8, i8* %51, i64 3
%83 = shl i8 %57, 1
%84 = zext i8 %83 to i64
%85 = getelementptr i8, i8* %82, i64 %84
%86 = getelementptr [3 x i8], [3 x i8]* %52, i64 0, i64 1
%87 = getelementptr [3 x i8], [3 x i8]* %52, i64 1, i64 0
%88 = icmp ult i8* %81, %87
%89 = icmp ult i8* %86, %85
%90 = and i1 %88, %89
br i1 %90, label %124, label %91
91: ; preds = %80
%92 = and i64 %78, 240
%93 = shl nuw nsw i64 %92, 1
%94 = getelementptr i8, i8* %51, i64 %93
%95 = trunc i64 %92 to i32
%96 = sub nsw i32 %73, %95
%97 = getelementptr i8, i8* %51, i64 1
%98 = getelementptr i8, i8* %51, i64 1
br label %99
99: ; preds = %99, %91
%100 = phi i64 [ 0, %91 ], [ %120, %99 ]
%101 = shl i64 %100, 1
%102 = shl i64 %100, 1
%103 = or i64 %102, 16
%104 = load i8, i8* %74
%105 = insertelement <8 x i8> poison, i8 %104, i64 0
%106 = shufflevector <8 x i8> %105, <8 x i8> poison, <8 x i32> zeroinitializer
%107 = insertelement <8 x i8> poison, i8 %104, i64 0
%108 = shufflevector <8 x i8> %107, <8 x i8> poison, <8 x i32> zeroinitializer
%109 = load i8, i8* %75
%110 = insertelement <8 x i8> poison, i8 %109, i64 0
%111 = shufflevector <8 x i8> %110, <8 x i8> poison, <8 x i32> zeroinitializer
%112 = insertelement <8 x i8> poison, i8 %109, i64 0
%113 = shufflevector <8 x i8> %112, <8 x i8> poison, <8 x i32> zeroinitializer
%114 = getelementptr inbounds i8, i8* %97, i64 %101
%115 = bitcast i8* %114 to <16 x i8>*
%116 = getelementptr inbounds i8, i8* %98, i64 %103
%117 = bitcast i8* %116 to <16 x i8>*
%118 = shufflevector <8 x i8> %106, <8 x i8> %111, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %118, <16 x i8>* %115
%119 = shufflevector <8 x i8> %108, <8 x i8> %113, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %119, <16 x i8>* %117
%120 = add nuw i64 %100, 16
%121 = icmp eq i64 %120, %92
br i1 %121, label %122, label %99
122: ; preds = %99
%123 = icmp eq i64 %92, %78
br i1 %123, label %153, label %124
124: ; preds = %80, %71, %122
%125 = phi i8* [ %51, %80 ], [ %51, %71 ], [ %94, %122 ]
%126 = phi i32 [ %73, %80 ], [ %73, %71 ], [ %96, %122 ]
br label %144
127: ; preds = %61, %67
%128 = and i8 %57, 127
%129 = zext i8 %128 to i64
%130 = shl nuw nsw i64 %129, 3
%131 = lshr i8 %63, 5
%132 = zext i8 %131 to i64
%133 = or i64 %130, %132
%134 = getelementptr inbounds i8, i8* %51, i64 1
%135 = getelementptr inbounds i8, i8* %51, i64 -1023
%136 = getelementptr inbounds i8, i8* %135, i64 %133
%137 = tail call i32 (i8*, ...) @memcpy(i8* %134, i8* %136, i32 %65)
%138 = zext i8 %64 to i64
%139 = getelementptr inbounds i8, i8* %51, i64 1
%140 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 0, i64 2
%141 = load i8, i8* %140
%142 = getelementptr inbounds i8, i8* %139, i64 %138
store i8 %141, i8* %142
%143 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 1
br label %184
144: ; preds = %124, %144
%145 = phi i8* [ %150, %144 ], [ %125, %124 ]
%146 = phi i32 [ %151, %144 ], [ %126, %124 ]
%147 = load i8, i8* %74
%148 = getelementptr inbounds i8, i8* %145, i64 1
store i8 %147, i8* %148
%149 = load i8, i8* %75
%150 = getelementptr inbounds i8, i8* %145, i64 2
store i8 %149, i8* %150
%151 = add nsw i32 %146, -1
%152 = icmp ugt i32 %146, 1
br i1 %152, label %144, label %153
153: ; preds = %144, %122
%154 = phi i8* [ %94, %122 ], [ %150, %144 ]
%155 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 1
br label %184
156: ; preds = %67
%157 = and i8 %57, 127
%158 = zext i8 %157 to i32
%159 = shl nuw nsw i32 %158, 3
%160 = lshr i8 %63, 5
%161 = zext i8 %160 to i32
%162 = or i32 %159, %161
%163 = icmp eq i32 %162, 1
br i1 %163, label %164, label %167
164: ; preds = %156
%165 = getelementptr inbounds i8, i8* %51, i64 -1
%166 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 1
br label %184
167: ; preds = %156
%168 = getelementptr inbounds i8, i8* %51, i64 1
%169 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 1, i64 0
%170 = tail call i32 (i8*, ...) @memcpy(i8* %168, i8* %169, i32 %162)
%171 = urem i32 %162, 3
%172 = icmp eq i32 %171, 0
%173 = udiv i32 %162, 3
%174 = select i1 %172, i32 1, i32 2
%175 = add nuw nsw i32 %173, %174
%176 = xor i1 %172, true
%177 = zext i1 %176 to i32
%178 = add nuw nsw i32 %173, %177
%179 = zext i32 %162 to i64
%180 = zext i32 %175 to i64
%181 = getelementptr inbounds [3 x i8], [3 x i8]* %52, i64 %180
%182 = getelementptr inbounds i8, i8* %51, i64 %179
%183 = add nsw i32 %178, %54
br label %184
184: ; preds = %164, %167, %153, %127
%185 = phi i32 [ %54, %164 ], [ %183, %167 ], [ %54, %153 ], [ %54, %127 ]
%186 = phi [3 x i8]* [ %166, %164 ], [ %181, %167 ], [ %155, %153 ], [ %143, %127 ]
%187 = phi i8* [ %165, %164 ], [ %182, %167 ], [ %154, %153 ], [ %142, %127 ]
%188 = ptrtoint i8* %187 to i64
%189 = xor i64 %188, -1
%190 = add i64 %189, %16
%191 = icmp slt i64 %190, 1024
br i1 %191, label %192, label %211
192: ; preds = %184
%193 = getelementptr inbounds i8, i8* %187, i64 -1024
%194 = ptrtoint i8* %193 to i64
%195 = sub i64 %194, %9
%196 = trunc i64 %195 to i32
%197 = add i32 %196, 1
%198 = icmp sgt i32 %197, %53
%199 = select i1 %198, i32 %53, i32 %197
%200 = icmp sgt i32 %199, 0
br i1 %200, label %201, label %206
201: ; preds = %192
%202 = tail call i32 (i8*, ...) @memcpy(i8* %55, i8* %10, i32 %199)
%203 = zext i32 %199 to i64
%204 = getelementptr inbounds i8, i8* %55, i64 %203
%205 = sub nsw i32 %53, %199
br label %206
206: ; preds = %201, %192
%207 = phi i8* [ %204, %201 ], [ %55, %192 ]
%208 = phi i32 [ %205, %201 ], [ %53, %192 ]
%209 = getelementptr inbounds i8, i8* %187, i64 -1023
%210 = tail call i32 (i8*, ...) @memcpy(i8* %10, i8* %209, i32 1024)
br label %211
211: ; preds = %206, %184
%212 = phi i8* [ %207, %206 ], [ %55, %184 ]
%213 = phi i32 [ %208, %206 ], [ %53, %184 ]
%214 = phi i8* [ %17, %206 ], [ %187, %184 ]
%215 = sub nsw i32 %41, %185
%216 = icmp slt i32 %215, 342
%217 = and i1 %49, %216
%218 = add nsw i32 %185, 1
%219 = icmp sle i32 %41, %185
%220 = select i1 %217, i1 true, i1 %219
br i1 %220, label %221, label %50
221: ; preds = %211
%222 = icmp sgt i32 %40, 0
br i1 %222, label %18, label %223
223: ; preds = %221, %18, %31, %4
%224 = phi i8* [ %2, %4 ], [ %27, %31 ], [ %27, %18 ], [ %212, %221 ]
%225 = phi i32 [ %3, %4 ], [ %25, %31 ], [ %25, %18 ], [ %213, %221 ]
%226 = phi i8* [ %6, %4 ], [ %22, %31 ], [ %22, %18 ], [ %21, %221 ]
%227 = phi i8* [ %8, %4 ], [ %21, %31 ], [ %21, %18 ], [ %22, %221 ]
%228 = phi i8* [ %11, %4 ], [ %19, %31 ], [ %19, %18 ], [ %214, %221 ]
%229 = ptrtoint i8* %228 to i64
%230 = sub i64 %229, %9
%231 = trunc i64 %230 to i32
%232 = add i32 %231, 1
%233 = icmp sgt i32 %232, %225
%234 = select i1 %233, i32 %225, i32 %232
%235 = icmp sgt i32 %234, 0
br i1 %235, label %236, label %240
236: ; preds = %223
%237 = tail call i32 (i8*, ...) @memcpy(i8* %224, i8* %10, i32 %234)
%238 = zext i32 %234 to i64
%239 = getelementptr inbounds i8, i8* %224, i64 %238
br label %240
240: ; preds = %236, %223
%241 = phi i8* [ %239, %236 ], [ %224, %223 ]
%242 = tail call i32 @free(i8* %226)
%243 = tail call i32 @free(i8* %227)
%244 = tail call i32 @free(i8* %10)
%245 = ptrtoint i8* %241 to i64
%246 = ptrtoint i8* %2 to i64
%247 = sub i64 %245, %246
%248 = trunc i64 %247 to i32
ret i32 %248
}