#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 */
unsigned char *Load(char *, unsigned int *, int, int);
scalar_t__ Memory(unsigned int, int);
int /*<<< orphan*/ Save(char *, unsigned char *, unsigned int);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ printf(char *, ...);
void LZX_Decode(char *filename) {
  unsigned char *pak_buffer, *raw_buffer, *pak, *raw, *pak_end, *raw_end;
  unsigned int pak_len, raw_len, header, len, pos, threshold, tmp;
  unsigned char flags, mask;
  printf("- decoding '%s'", filename);
  pak_buffer = Load(filename, &pak_len, 0x00000004, 0x01400000);
  header = *pak_buffer;
  if ((header != 0x11) && ((header != 0x40))) {
    free(pak_buffer);
    {
      printf(", WARNING: file is not LZX encoded!\n");
      return;
    };
  }
  raw_len = *(unsigned int *)pak_buffer >> 8;
  raw_buffer = (unsigned char *)Memory(raw_len, sizeof(char));
  pak = pak_buffer + 4;
  raw = raw_buffer;
  pak_end = pak_buffer + pak_len;
  raw_end = raw_buffer + raw_len;
  mask = 0;
  while (raw < raw_end) {
    if (!(mask >>= 1)) {
      if (pak == pak_end)
        break;
      flags = *pak++;
      if (header == 0x40)
        flags = -flags;
      mask = 0x80;
    }
    if (!(flags & mask)) {
      if (pak == pak_end)
        break;
      *raw++ = *pak++;
    } else {
      if (header == 0x11) {
        if (pak + 1 >= pak_end)
          break;
        pos = *pak++;
        pos = (pos << 8) | *pak++;
        tmp = pos >> 12;
        if (tmp < 2) {
          pos &= 0xFFF;
          if (pak == pak_end)
            break;
          pos = (pos << 8) | *pak++;
          threshold = 0x10;
          if (tmp) {
            if (pak == pak_end)
              break;
            pos = (pos << 8) | *pak++;
            threshold = 0x110;
          }
        } else {
          threshold = 0;
        }
        len = (pos >> 12) + threshold + 1;
        pos = (pos & 0xFFF) + 1;
      } else {
        if (pak + 1 == pak_end)
          break;
        pos = *pak++;
        pos |= *pak++ << 8;
        tmp = pos & 0xF;
        if (tmp < 2) {
          if (pak == pak_end)
            break;
          len = *pak++;
          threshold = 0x10;
          if (tmp) {
            if (pak == pak_end)
              break;
            len = (*pak++ << 8) | len;
            threshold = 0x110;
          }
        } else {
          len = tmp;
          threshold = 0;
        }
        len += threshold;
        pos >>= 4;
      }
      if (raw + len > raw_end) {
        printf(", WARNING: wrong decoded length!");
        len = raw_end - raw;
      }
      while (len--)
        *raw++ = *(raw - pos);
    }
  }
  if (header == 0x40)
    pak += *pak == 0x80 ? 3 : 2;
  raw_len = raw - raw_buffer;
  if (raw != raw_end)
    printf(", WARNING: unexpected end of encoded file!");
  Save(filename, raw_buffer, raw_len);
  free(raw_buffer);
  free(pak_buffer);
  printf("\n");
}


x86 assembly (clang, -O0):
<LZX_Decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
mov    $0x4,%edx
mov    $0x1400000,%ecx
call   1040 <Load@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x11,-0x44(%rbp)
je     11c3 <LZX_Decode+0x73>
cmpl   $0x40,-0x44(%rbp)
je     11c3 <LZX_Decode+0x73>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    15ca <LZX_Decode+0x47a>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shr    $0x8,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%edi
mov    $0x1,%esi
call   1070 <Memory@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
movb   $0x0,-0x56(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    153e <LZX_Decode+0x3ee>
movzbl -0x56(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x56(%rbp)
cmp    $0x0,%al
jne    1274 <LZX_Decode+0x124>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    1247 <LZX_Decode+0xf7>
jmp    153e <LZX_Decode+0x3ee>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    %al,-0x55(%rbp)
cmpl   $0x40,-0x44(%rbp)
jne    1270 <LZX_Decode+0x120>
movzbl -0x55(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %al,-0x55(%rbp)
movb   $0x80,-0x56(%rbp)
movzbl -0x55(%rbp),%eax
movzbl -0x56(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    12c1 <LZX_Decode+0x171>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    129a <LZX_Decode+0x14a>
jmp    153e <LZX_Decode+0x3ee>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
jmp    1539 <LZX_Decode+0x3e9>
cmpl   $0x11,-0x44(%rbp)
jne    13d8 <LZX_Decode+0x288>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
cmp    -0x30(%rbp),%rax
jb     12e2 <LZX_Decode+0x192>
jmp    153e <LZX_Decode+0x3ee>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
shl    $0x8,%eax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
shr    $0xc,%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x2,-0x54(%rbp)
jae    13af <LZX_Decode+0x25f>
mov    -0x4c(%rbp),%eax
and    $0xfff,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    1345 <LZX_Decode+0x1f5>
jmp    153e <LZX_Decode+0x3ee>
mov    -0x4c(%rbp),%eax
shl    $0x8,%eax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x4c(%rbp)
movl   $0x10,-0x50(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     13aa <LZX_Decode+0x25a>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    1386 <LZX_Decode+0x236>
jmp    153e <LZX_Decode+0x3ee>
mov    -0x4c(%rbp),%eax
shl    $0x8,%eax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x4c(%rbp)
movl   $0x110,-0x50(%rbp)
jmp    13b6 <LZX_Decode+0x266>
movl   $0x0,-0x50(%rbp)
mov    -0x4c(%rbp),%eax
shr    $0xc,%eax
add    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
and    $0xfff,%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    14c4 <LZX_Decode+0x374>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
cmp    -0x30(%rbp),%rax
jne    13ef <LZX_Decode+0x29f>
jmp    153e <LZX_Decode+0x3ee>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
shl    $0x8,%eax
or     -0x4c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x2,-0x54(%rbp)
jae    14a5 <LZX_Decode+0x355>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    1445 <LZX_Decode+0x2f5>
jmp    153e <LZX_Decode+0x3ee>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x48(%rbp)
movl   $0x10,-0x50(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     14a0 <LZX_Decode+0x350>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    147e <LZX_Decode+0x32e>
jmp    153e <LZX_Decode+0x3ee>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movzbl (%rax),%eax
shl    $0x8,%eax
or     -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
movl   $0x110,-0x50(%rbp)
jmp    14b2 <LZX_Decode+0x362>
mov    -0x54(%rbp),%eax
mov    %eax,-0x48(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
shr    $0x4,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x48(%rbp),%ecx
add    %rcx,%rax
cmp    -0x38(%rbp),%rax
jbe    14f4 <LZX_Decode+0x3a4>
lea    0xb56(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x48(%rbp)
jmp    14f9 <LZX_Decode+0x3a9>
mov    -0x48(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x48(%rbp)
cmp    $0x0,%eax
je     1534 <LZX_Decode+0x3e4>
mov    -0x28(%rbp),%rax
mov    -0x4c(%rbp),%ecx
mov    %ecx,%edx
xor    %ecx,%ecx
sub    %rdx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
jmp    14f9 <LZX_Decode+0x3a9>
jmp    1539 <LZX_Decode+0x3e9>
jmp    1214 <LZX_Decode+0xc4>
cmpl   $0x40,-0x44(%rbp)
jne    1570 <LZX_Decode+0x420>
mov    -0x20(%rbp),%rax
movzbl (%rax),%edx
mov    $0x2,%ecx
mov    $0x3,%eax
cmp    $0x80,%edx
cmove  %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x38(%rbp),%rax
je     159a <LZX_Decode+0x44a>
lea    0xac3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x40(%rbp),%edx
call   1060 <Save@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xa70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZX_Decode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rbx
lea    0xe78(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
mov    $0x1400000,%ecx
call   1060 <Load@plt>
mov    (%rax),%r13b
cmp    $0x11,%r13b
je     11bc <LZX_Decode+0x4c>
cmp    $0x40,%r13b
jne    1242 <LZX_Decode+0xd2>
mov    %rbx,0x30(%rsp)
mov    %rax,0x28(%rsp)
mov    (%rax),%ebp
mov    %rbp,%rbx
shr    $0x8,%rbx
mov    %ebx,%edi
mov    $0x1,%esi
call   1090 <Memory@plt>
mov    %rbx,%r11
mov    %rax,%r12
add    %rax,%r11
mov    %rax,0x20(%rsp)
cmp    $0x100,%rbp
jae    1265 <LZX_Decode+0xf5>
mov    %r11,%rax
mov    %r12d,%ebp
mov    0x20(%rsp),%rbx
sub    %ebx,%ebp
cmp    %r11,%r12
mov    0x30(%rsp),%r14
je     1217 <LZX_Decode+0xa7>
lea    0xe21(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1080 <Save@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1256 <LZX_Decode+0xe6>
mov    %rax,%rdi
call   1030 <free@plt>
lea    0xe0b(%rip),%rdi
call   1050 <puts@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x1c(%rsp),%r8d
mov    0x28(%rsp),%r15
add    %r15,%r8
add    $0x4,%r15
xor    %r14d,%r14d
mov    0x20(%rsp),%r12
mov    %r13b,0x7(%rsp)
mov    %r8,0x10(%rsp)
jmp    129e <LZX_Decode+0x12e>
nopw   0x0(%rax,%rax,1)
mov    0x7(%rsp),%r13b
cmp    %r11,%r12
jae    11f2 <LZX_Decode+0x82>
cmp    $0x1,%r14b
ja     1370 <LZX_Decode+0x200>
cmp    %r8,%r15
je     11f2 <LZX_Decode+0x82>
movzbl (%r15),%eax
add    $0x1,%r15
mov    %eax,%ecx
neg    %cl
cmp    $0x40,%r13b
movzbl %cl,%ebp
cmovne %eax,%ebp
mov    $0x80,%r14b
test   %bpl,%r14b
je     137c <LZX_Decode+0x20c>
lea    0x1(%r15),%rax
cmp    $0x11,%r13b
jne    13a0 <LZX_Decode+0x230>
cmp    %r8,%rax
jae    11f2 <LZX_Decode+0x82>
movzbl (%r15),%eax
mov    %eax,%edx
shl    $0x8,%edx
lea    0x2(%r15),%rcx
movzbl 0x1(%r15),%r13d
or     %edx,%r13d
mov    $0x1,%edx
cmp    $0x1f,%eax
ja     1355 <LZX_Decode+0x1e5>
cmp    %r8,%rcx
je     11f2 <LZX_Decode+0x82>
shl    $0x8,%r13d
mov    %r13d,%edx
and    $0xfff00,%edx
lea    0x3(%r15),%rcx
movzbl 0x2(%r15),%r13d
or     %edx,%r13d
mov    $0x11,%edx
cmp    $0x10,%al
jb     1355 <LZX_Decode+0x1e5>
cmp    %r8,%rcx
je     11f2 <LZX_Decode+0x82>
shl    $0x8,%r13d
movzbl 0x3(%r15),%eax
add    $0x4,%r15
or     %eax,%r13d
mov    $0x111,%edx
mov    %r15,%rcx
mov    %r13d,%eax
shr    $0xc,%eax
add    %edx,%eax
and    $0xfff,%r13d
add    $0x1,%r13d
mov    %rcx,%r15
jmp    140d <LZX_Decode+0x29d>
shr    %r14b
test   %bpl,%r14b
jne    12d3 <LZX_Decode+0x163>
cmp    %r8,%r15
je     11f2 <LZX_Decode+0x82>
mov    (%r15),%al
add    $0x1,%r15
mov    %al,(%r12)
add    $0x1,%r12
jmp    1295 <LZX_Decode+0x125>
nopl   0x0(%rax)
cmp    %r8,%rax
je     11f2 <LZX_Decode+0x82>
movzbl (%r15),%ecx
lea    0x2(%r15),%rdx
movzbl 0x1(%r15),%r13d
mov    %ecx,%edi
and    $0xf,%edi
xor    %esi,%esi
cmp    $0x1,%edi
ja     13fb <LZX_Decode+0x28b>
cmp    %r8,%rdx
je     11f2 <LZX_Decode+0x82>
lea    0x3(%r15),%rdx
movzbl 0x2(%r15),%eax
test   %edi,%edi
je     1569 <LZX_Decode+0x3f9>
cmp    %r8,%rdx
je     11f2 <LZX_Decode+0x82>
movzbl 0x3(%r15),%edi
add    $0x4,%r15
shl    $0x8,%edi
or     %eax,%edi
mov    $0x110,%esi
mov    %r15,%rdx
mov    %edi,%eax
add    %esi,%eax
shl    $0x8,%r13d
or     %ecx,%r13d
shr    $0x4,%r13d
mov    %rdx,%r15
mov    %eax,%ecx
add    %r12,%rcx
cmp    %r11,%rcx
jbe    1447 <LZX_Decode+0x2d7>
lea    0xbf2(%rip),%rdi
xor    %eax,%eax
mov    %r11,%rbx
mov    %r15,0x8(%rsp)
mov    %r14,%r15
mov    %r8,%r14
call   1070 <printf@plt>
mov    %r14,%r8
mov    %r15,%r14
mov    0x8(%rsp),%r15
mov    %rbx,%r11
mov    %r11d,%eax
sub    %r12d,%eax
test   %eax,%eax
je     1290 <LZX_Decode+0x120>
mov    %r13d,%r9d
mov    %r9,%rdx
neg    %rdx
lea    -0x1(%rax),%r10d
cmp    $0x1f,%r10d
jb     148d <LZX_Decode+0x31d>
mov    %r10,%rcx
sub    %r9,%rcx
add    %r12,%rcx
add    $0x1,%rcx
cmp    %rcx,%r12
jae    1534 <LZX_Decode+0x3c4>
lea    (%r12,%r10,1),%rcx
add    $0x1,%rcx
lea    (%r12,%rdx,1),%rsi
cmp    %rcx,%rsi
jae    1534 <LZX_Decode+0x3c4>
mov    0x7(%rsp),%r13b
lea    -0x1(%rax),%ecx
mov    %eax,%esi
and    $0x7,%esi
je     14bb <LZX_Decode+0x34b>
xor    %edi,%edi
xchg   %ax,%ax
movzbl (%r12,%rdx,1),%ebx
mov    %bl,(%r12)
add    $0x1,%r12
add    $0x1,%edi
cmp    %edi,%esi
jne    14a0 <LZX_Decode+0x330>
sub    %edi,%eax
mov    0x10(%rsp),%r8
cmp    $0x7,%ecx
jb     1295 <LZX_Decode+0x125>
mov    $0x7,%ecx
sub    %r9,%rcx
nopl   0x0(%rax)
movzbl -0x7(%r12,%rcx,1),%edx
mov    %dl,(%r12)
movzbl -0x6(%r12,%rcx,1),%edx
mov    %dl,0x1(%r12)
movzbl -0x5(%r12,%rcx,1),%edx
mov    %dl,0x2(%r12)
movzbl -0x4(%r12,%rcx,1),%edx
mov    %dl,0x3(%r12)
movzbl -0x3(%r12,%rcx,1),%edx
mov    %dl,0x4(%r12)
movzbl -0x2(%r12,%rcx,1),%edx
mov    %dl,0x5(%r12)
movzbl -0x1(%r12,%rcx,1),%edx
mov    %dl,0x6(%r12)
movzbl (%r12,%rcx,1),%edx
mov    %dl,0x7(%r12)
add    $0x8,%r12
add    $0xfffffff8,%eax
jne    14d0 <LZX_Decode+0x360>
jmp    1295 <LZX_Decode+0x125>
mov    %ebp,0x8(%rsp)
add    $0x1,%r10
mov    %r10,%r8
and    $0xffffffffffffffe0,%r8
lea    -0x20(%r8),%rsi
mov    %rsi,%rdi
shr    $0x5,%rdi
add    $0x1,%rdi
mov    %edi,%ecx
and    $0x3,%ecx
cmp    $0x60,%rsi
jae    1573 <LZX_Decode+0x403>
xor    %ebx,%ebx
mov    0x7(%rsp),%r13b
jmp    15e9 <LZX_Decode+0x479>
mov    $0x10,%esi
jmp    13fd <LZX_Decode+0x28d>
and    $0xfffffffffffffffc,%rdi
lea    0x70(%r12),%rsi
lea    (%r12,%rdx,1),%rbp
add    $0x70,%rbp
xor    %ebx,%ebx
mov    0x7(%rsp),%r13b
nopl   0x0(%rax,%rax,1)
movups -0x70(%rbp,%rbx,1),%xmm0
movups -0x60(%rbp,%rbx,1),%xmm1
movups %xmm0,-0x70(%rsi,%rbx,1)
movups %xmm1,-0x60(%rsi,%rbx,1)
movups -0x50(%rbp,%rbx,1),%xmm0
movups -0x40(%rbp,%rbx,1),%xmm1
movups %xmm0,-0x50(%rsi,%rbx,1)
movups %xmm1,-0x40(%rsi,%rbx,1)
movups -0x30(%rbp,%rbx,1),%xmm0
movups -0x20(%rbp,%rbx,1),%xmm1
movups %xmm0,-0x30(%rsi,%rbx,1)
movups %xmm1,-0x20(%rsi,%rbx,1)
movups -0x10(%rbp,%rbx,1),%xmm0
movups 0x0(%rbp,%rbx,1),%xmm1
movups %xmm0,-0x10(%rsi,%rbx,1)
movups %xmm1,(%rsi,%rbx,1)
sub    $0xffffffffffffff80,%rbx
add    $0xfffffffffffffffc,%rdi
jne    1590 <LZX_Decode+0x420>
test   %rcx,%rcx
je     161a <LZX_Decode+0x4aa>
lea    (%r12,%rbx,1),%rsi
add    $0x10,%rsi
cs nopw 0x0(%rax,%rax,1)
movups -0x10(%rsi,%rdx,1),%xmm0
movups (%rsi,%rdx,1),%xmm1
movups %xmm0,-0x10(%rsi)
movups %xmm1,(%rsi)
add    $0x20,%rsi
add    $0xffffffffffffffff,%rcx
jne    1600 <LZX_Decode+0x490>
add    %r8,%r12
cmp    %r8,%r10
jne    1630 <LZX_Decode+0x4c0>
mov    0x10(%rsp),%r8
mov    0x8(%rsp),%ebp
jmp    1295 <LZX_Decode+0x125>
sub    %r8d,%eax
mov    0x10(%rsp),%r8
mov    0x8(%rsp),%ebp
jmp    1492 <LZX_Decode+0x322>

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

LLVM IR (-O2):
@.str = [16 x i8] c"- decoding '%s'\00"
@.str.2 = [33 x i8] c", WARNING: wrong decoded length!\00"
@.str.3 = [43 x i8] c", WARNING: unexpected end of encoded file!\00"
@str = [36 x i8] c", WARNING: file is not LZX encoded!\00"
define void @LZX_Decode(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i8* @Load(i8* %0, i32* %2, i32 4, i32 20971520)
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 64, label %10
i8 17, label %10
]
7: ; preds = %1
%8 = call i32 @free(i8* %5)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %308
10: ; preds = %1, %1
%11 = bitcast i8* %5 to i32*
%12 = load i32, i32* %11
%13 = lshr i32 %12, 8
%14 = call i64 @Memory(i32 %13, i32 1)
%15 = inttoptr i64 %14 to i8*
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %5, i64 %17
%19 = zext i32 %13 to i64
%20 = getelementptr inbounds i8, i8* %15, i64 %19
%21 = icmp ult i32 %12, 256
br i1 %21, label %295, label %22
22: ; preds = %10
%23 = getelementptr inbounds i8, i8* %5, i64 4
%24 = icmp eq i8 %6, 64
%25 = icmp eq i8 %6, 17
%26 = ptrtoint i8* %20 to i64
br label %27
27: ; preds = %22, %291
%28 = phi i8 [ 0, %22 ], [ %44, %291 ]
%29 = phi i8 [ undef, %22 ], [ %43, %291 ]
%30 = phi i8* [ %23, %22 ], [ %293, %291 ]
%31 = phi i8* [ %15, %22 ], [ %292, %291 ]
%32 = lshr i8 %28, 1
%33 = icmp ult i8 %28, 2
br i1 %33, label %34, label %41
34: ; preds = %27
%35 = icmp eq i8* %30, %18
br i1 %35, label %295, label %36
36: ; preds = %34
%37 = getelementptr inbounds i8, i8* %30, i64 1
%38 = load i8, i8* %30
%39 = sub i8 0, %38
%40 = select i1 %24, i8 %39, i8 %38
br label %41
41: ; preds = %36, %27
%42 = phi i8* [ %30, %27 ], [ %37, %36 ]
%43 = phi i8 [ %29, %27 ], [ %40, %36 ]
%44 = phi i8 [ %32, %27 ], [ -128, %36 ]
%45 = and i8 %44, %43
%46 = icmp eq i8 %45, 0
br i1 %46, label %47, label %53
47: ; preds = %41
%48 = icmp eq i8* %42, %18
br i1 %48, label %295, label %49
49: ; preds = %47
%50 = getelementptr inbounds i8, i8* %42, i64 1
%51 = load i8, i8* %42
%52 = getelementptr inbounds i8, i8* %31, i64 1
store i8 %51, i8* %31
br label %291
53: ; preds = %41
%54 = getelementptr inbounds i8, i8* %42, i64 1
br i1 %25, label %55, label %92
55: ; preds = %53
%56 = icmp ult i8* %54, %18
br i1 %56, label %57, label %295
57: ; preds = %55
%58 = load i8, i8* %42
%59 = zext i8 %58 to i32
%60 = shl nuw nsw i32 %59, 8
%61 = getelementptr inbounds i8, i8* %42, i64 2
%62 = load i8, i8* %54
%63 = zext i8 %62 to i32
%64 = or i32 %60, %63
%65 = icmp ult i8 %58, 32
br i1 %65, label %66, label %84
66: ; preds = %57
%67 = icmp eq i8* %61, %18
br i1 %67, label %295, label %68
68: ; preds = %66
%69 = shl nuw nsw i32 %64, 8
%70 = and i32 %69, 1048320
%71 = getelementptr inbounds i8, i8* %42, i64 3
%72 = load i8, i8* %61
%73 = zext i8 %72 to i32
%74 = or i32 %70, %73
%75 = icmp ult i8 %58, 16
br i1 %75, label %84, label %76
76: ; preds = %68
%77 = icmp eq i8* %71, %18
br i1 %77, label %295, label %78
78: ; preds = %76
%79 = shl nuw nsw i32 %74, 8
%80 = getelementptr inbounds i8, i8* %42, i64 4
%81 = load i8, i8* %71
%82 = zext i8 %81 to i32
%83 = or i32 %79, %82
br label %84
84: ; preds = %57, %68, %78
%85 = phi i8* [ %80, %78 ], [ %71, %68 ], [ %61, %57 ]
%86 = phi i32 [ %83, %78 ], [ %74, %68 ], [ %64, %57 ]
%87 = phi i32 [ 273, %78 ], [ 17, %68 ], [ 1, %57 ]
%88 = lshr i32 %86, 12
%89 = add nuw nsw i32 %87, %88
%90 = and i32 %86, 4095
%91 = add nuw nsw i32 %90, 1
br label %125
92: ; preds = %53
%93 = icmp eq i8* %54, %18
br i1 %93, label %295, label %94
94: ; preds = %92
%95 = load i8, i8* %42
%96 = zext i8 %95 to i32
%97 = getelementptr inbounds i8, i8* %42, i64 2
%98 = load i8, i8* %54
%99 = zext i8 %98 to i32
%100 = shl nuw nsw i32 %99, 8
%101 = or i32 %100, %96
%102 = and i32 %96, 15
%103 = icmp ult i32 %102, 2
br i1 %103, label %104, label %119
104: ; preds = %94
%105 = icmp eq i8* %97, %18
br i1 %105, label %295, label %106
106: ; preds = %104
%107 = getelementptr inbounds i8, i8* %42, i64 3
%108 = load i8, i8* %97
%109 = zext i8 %108 to i32
%110 = icmp eq i32 %102, 0
br i1 %110, label %119, label %111
111: ; preds = %106
%112 = icmp eq i8* %107, %18
br i1 %112, label %295, label %113
113: ; preds = %111
%114 = getelementptr inbounds i8, i8* %42, i64 4
%115 = load i8, i8* %107
%116 = zext i8 %115 to i32
%117 = shl nuw nsw i32 %116, 8
%118 = or i32 %117, %109
br label %119
119: ; preds = %94, %106, %113
%120 = phi i8* [ %114, %113 ], [ %107, %106 ], [ %97, %94 ]
%121 = phi i32 [ %118, %113 ], [ %109, %106 ], [ %102, %94 ]
%122 = phi i32 [ 272, %113 ], [ 16, %106 ], [ 0, %94 ]
%123 = add nsw i32 %122, %121
%124 = lshr i32 %101, 4
br label %125
125: ; preds = %119, %84
%126 = phi i8* [ %85, %84 ], [ %120, %119 ]
%127 = phi i32 [ %89, %84 ], [ %123, %119 ]
%128 = phi i32 [ %91, %84 ], [ %124, %119 ]
%129 = zext i32 %127 to i64
%130 = getelementptr inbounds i8, i8* %31, i64 %129
%131 = icmp ugt i8* %130, %20
br i1 %131, label %132, label %137
132: ; preds = %125
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%134 = ptrtoint i8* %31 to i64
%135 = sub i64 %26, %134
%136 = trunc i64 %135 to i32
br label %137
137: ; preds = %132, %125
%138 = phi i32 [ %136, %132 ], [ %127, %125 ]
%139 = icmp eq i32 %138, 0
br i1 %139, label %291, label %140
140: ; preds = %137
%141 = zext i32 %128 to i64
%142 = sub nsw i64 0, %141
%143 = add i32 %138, -1
%144 = zext i32 %143 to i64
%145 = add nuw nsw i64 %144, 1
%146 = icmp ult i32 %143, 31
br i1 %146, label %241, label %147
147: ; preds = %140
%148 = getelementptr i8, i8* %31, i64 1
%149 = add i32 %138, -1
%150 = zext i32 %149 to i64
%151 = getelementptr i8, i8* %148, i64 %150
%152 = getelementptr i8, i8* %31, i64 %142
%153 = getelementptr i8, i8* %31, i64 1
%154 = sub nsw i64 %150, %141
%155 = getelementptr i8, i8* %153, i64 %154
%156 = icmp ult i8* %31, %155
%157 = icmp ult i8* %152, %151
%158 = and i1 %156, %157
br i1 %158, label %241, label %159
159: ; preds = %147
%160 = and i64 %145, 8589934560
%161 = trunc i64 %160 to i32
%162 = sub i32 %138, %161
%163 = getelementptr i8, i8* %31, i64 %160
%164 = add nsw i64 %160, -32
%165 = lshr exact i64 %164, 5
%166 = add nuw nsw i64 %165, 1
%167 = and i64 %166, 3
%168 = icmp ult i64 %164, 96
br i1 %168, label %220, label %169
169: ; preds = %159
%170 = and i64 %166, 1152921504606846972
br label %171
171: ; preds = %171, %169
%172 = phi i64 [ 0, %169 ], [ %217, %171 ]
%173 = phi i64 [ 0, %169 ], [ %218, %171 ]
%174 = getelementptr i8, i8* %31, i64 %172
%175 = getelementptr inbounds i8, i8* %174, i64 %142
%176 = bitcast i8* %175 to <16 x i8>*
%177 = load <16 x i8>, <16 x i8>* %176
%178 = getelementptr inbounds i8, i8* %175, i64 16
%179 = bitcast i8* %178 to <16 x i8>*
%180 = load <16 x i8>, <16 x i8>* %179
%181 = bitcast i8* %174 to <16 x i8>*
store <16 x i8> %177, <16 x i8>* %181
%182 = getelementptr i8, i8* %174, i64 16
%183 = bitcast i8* %182 to <16 x i8>*
store <16 x i8> %180, <16 x i8>* %183
%184 = or i64 %172, 32
%185 = getelementptr i8, i8* %31, i64 %184
%186 = getelementptr inbounds i8, i8* %185, i64 %142
%187 = bitcast i8* %186 to <16 x i8>*
%188 = load <16 x i8>, <16 x i8>* %187
%189 = getelementptr inbounds 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 %172, 64
%196 = getelementptr i8, i8* %31, i64 %195
%197 = getelementptr inbounds i8, i8* %196, i64 %142
%198 = bitcast i8* %197 to <16 x i8>*
%199 = load <16 x i8>, <16 x i8>* %198
%200 = getelementptr inbounds 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 %172, 96
%207 = getelementptr i8, i8* %31, i64 %206
%208 = getelementptr inbounds i8, i8* %207, i64 %142
%209 = bitcast i8* %208 to <16 x i8>*
%210 = load <16 x i8>, <16 x i8>* %209
%211 = getelementptr inbounds 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 = add nuw i64 %172, 128
%218 = add i64 %173, 4
%219 = icmp eq i64 %218, %170
br i1 %219, label %220, label %171
220: ; preds = %171, %159
%221 = phi i64 [ 0, %159 ], [ %217, %171 ]
%222 = icmp eq i64 %167, 0
br i1 %222, label %239, label %223
223: ; preds = %220, %223
%224 = phi i64 [ %236, %223 ], [ %221, %220 ]
%225 = phi i64 [ %237, %223 ], [ 0, %220 ]
%226 = getelementptr i8, i8* %31, i64 %224
%227 = getelementptr inbounds i8, i8* %226, i64 %142
%228 = bitcast i8* %227 to <16 x i8>*
%229 = load <16 x i8>, <16 x i8>* %228
%230 = getelementptr inbounds i8, i8* %227, i64 16
%231 = bitcast i8* %230 to <16 x i8>*
%232 = load <16 x i8>, <16 x i8>* %231
%233 = bitcast i8* %226 to <16 x i8>*
store <16 x i8> %229, <16 x i8>* %233
%234 = getelementptr i8, i8* %226, i64 16
%235 = bitcast i8* %234 to <16 x i8>*
store <16 x i8> %232, <16 x i8>* %235
%236 = add nuw i64 %224, 32
%237 = add i64 %225, 1
%238 = icmp eq i64 %237, %167
br i1 %238, label %239, label %223
239: ; preds = %223, %220
%240 = icmp eq i64 %145, %160
br i1 %240, label %291, label %241
241: ; preds = %147, %140, %239
%242 = phi i32 [ %138, %147 ], [ %138, %140 ], [ %162, %239 ]
%243 = phi i8* [ %31, %147 ], [ %31, %140 ], [ %163, %239 ]
%244 = add i32 %242, -1
%245 = and i32 %242, 7
%246 = icmp eq i32 %245, 0
br i1 %246, label %257, label %247
247: ; preds = %241, %247
%248 = phi i32 [ %251, %247 ], [ %242, %241 ]
%249 = phi i8* [ %254, %247 ], [ %243, %241 ]
%250 = phi i32 [ %255, %247 ], [ 0, %241 ]
%251 = add i32 %248, -1
%252 = getelementptr inbounds i8, i8* %249, i64 %142
%253 = load i8, i8* %252
%254 = getelementptr inbounds i8, i8* %249, i64 1
store i8 %253, i8* %249
%255 = add i32 %250, 1
%256 = icmp eq i32 %255, %245
br i1 %256, label %257, label %247
257: ; preds = %247, %241
%258 = phi i8* [ undef, %241 ], [ %254, %247 ]
%259 = phi i32 [ %242, %241 ], [ %251, %247 ]
%260 = phi i8* [ %243, %241 ], [ %254, %247 ]
%261 = icmp ult i32 %244, 7
br i1 %261, label %291, label %262
262: ; preds = %257, %262
%263 = phi i32 [ %286, %262 ], [ %259, %257 ]
%264 = phi i8* [ %289, %262 ], [ %260, %257 ]
%265 = getelementptr inbounds i8, i8* %264, i64 %142
%266 = load i8, i8* %265
%267 = getelementptr inbounds i8, i8* %264, i64 1
store i8 %266, i8* %264
%268 = getelementptr inbounds i8, i8* %267, i64 %142
%269 = load i8, i8* %268
%270 = getelementptr inbounds i8, i8* %264, i64 2
store i8 %269, i8* %267
%271 = getelementptr inbounds i8, i8* %270, i64 %142
%272 = load i8, i8* %271
%273 = getelementptr inbounds i8, i8* %264, i64 3
store i8 %272, i8* %270
%274 = getelementptr inbounds i8, i8* %273, i64 %142
%275 = load i8, i8* %274
%276 = getelementptr inbounds i8, i8* %264, i64 4
store i8 %275, i8* %273
%277 = getelementptr inbounds i8, i8* %276, i64 %142
%278 = load i8, i8* %277
%279 = getelementptr inbounds i8, i8* %264, i64 5
store i8 %278, i8* %276
%280 = getelementptr inbounds i8, i8* %279, i64 %142
%281 = load i8, i8* %280
%282 = getelementptr inbounds i8, i8* %264, i64 6
store i8 %281, i8* %279
%283 = getelementptr inbounds i8, i8* %282, i64 %142
%284 = load i8, i8* %283
%285 = getelementptr inbounds i8, i8* %264, i64 7
store i8 %284, i8* %282
%286 = add i32 %263, -8
%287 = getelementptr inbounds i8, i8* %285, i64 %142
%288 = load i8, i8* %287
%289 = getelementptr inbounds i8, i8* %264, i64 8
store i8 %288, i8* %285
%290 = icmp eq i32 %286, 0
br i1 %290, label %291, label %262
291: ; preds = %257, %262, %239, %137, %49
%292 = phi i8* [ %52, %49 ], [ %31, %137 ], [ %163, %239 ], [ %258, %257 ], [ %289, %262 ]
%293 = phi i8* [ %50, %49 ], [ %126, %137 ], [ %126, %239 ], [ %126, %262 ], [ %126, %257 ]
%294 = icmp ult i8* %292, %20
br i1 %294, label %27, label %295
295: ; preds = %291, %34, %47, %55, %66, %76, %92, %104, %111, %10
%296 = phi i8* [ %15, %10 ], [ %31, %111 ], [ %31, %104 ], [ %31, %92 ], [ %31, %76 ], [ %31, %66 ], [ %31, %55 ], [ %31, %47 ], [ %31, %34 ], [ %292, %291 ]
%297 = ptrtoint i8* %296 to i64
%298 = sub i64 %297, %14
%299 = trunc i64 %298 to i32
%300 = icmp eq i8* %296, %20
br i1 %300, label %303, label %301
301: ; preds = %295
%302 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
br label %303
303: ; preds = %301, %295
%304 = call i32 @Save(i8* %0, i8* %15, i32 %299)
%305 = call i32 @free(i8* %15)
%306 = call i32 @free(i8* %5)
%307 = call i32 @putchar(i32 10)
br label %308
308: ; preds = %303, %7
ret void
}