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

/* Forward declarations */

/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int usage();
int main(int argc, char **argv) {
  FILE *f;
  FILE *fo;
  unsigned char buffer[4096];
  char *filename, *filename2;
  int i, j, size;
  int argfail = 0;
  int argidx = 1;
  if (argc <= argidx) {
    return usage();
  }
  int headerStrip = 0;
  int nibbleShift = 0;
  if (strcmp(argv[argidx], "-h") == 0) {
    headerStrip = 1;
    argidx++;
  } else if (strcmp(argv[argidx], "-n") == 0) {
    headerStrip = 1;
    nibbleShift = 1;
    argidx++;
  }
  if (nibbleShift)
    printf("NibbleShift Enabled\n");
  if (headerStrip)
    printf("HeaderStrip Enabled\n");
  if (argc <= argidx) {
    return usage();
  }
  filename = argv[argidx++];
  if (argc <= argidx) {
    return usage();
  }
  filename2 = argv[argidx++];
  int truncate = 0x7FFFFFFF;
  if (argc > argidx) {
    truncate = (int)strtol(argv[argidx++], NULL, 16);
  }
  f = fopen(filename, "rb");
  if (!f) {
    printf("Can't open file %s.\n", filename);
    return 1;
  }
  fo = fopen(filename2, "wb");
  if (!fo) {
    printf("Can't open file %s.\n", filename2);
    fclose(f);
    return 1;
  }
  uint8_t swapped_bytes[256];
  for (i = 0; i < 256; i++) {
    uint8_t temp = (uint8_t)i;
    uint8_t swapped = 0;
    for (j = 0; j < 8; j++) {
      swapped <<= 1;
      swapped |= (temp & 1);
      temp >>= 1;
    }
    swapped_bytes[i] = swapped;
  }
  uint8_t nibble = 0x0F;
  uint8_t nibbleTemp;
  while (!feof(f) && (truncate)) {
    int now = (truncate > 4096) ? 4096 : truncate;
    truncate -= now;
    int read = fread((char *)buffer, 1, now, f);
    int start = 0;
    if (headerStrip) {
      for (i = 0; i < read; i++) {
        if (buffer[i] == 0xFF) {
          start = i;
          headerStrip = 0;
          truncate += start;
          break;
        }
      }
    }
    if (nibbleShift) {
      for (i = 0; i < read; i++) {
        nibbleTemp = buffer[i] >> 4;
        buffer[i] = (buffer[i] << 4) | nibble;
        nibble = nibbleTemp;
      }
    }
    for (i = 0; i < read; i++) {
      buffer[i] = swapped_bytes[buffer[i]];
    }
    fwrite(&buffer[start], 1, read - start, fo);
  }
  fclose(f);
  fclose(fo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1480,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1040(%rbp)
movl   $0x1,-0x1044(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1044(%rbp),%eax
jg     11db <main+0x4b>
mov    $0x0,%al
call   1090 <usage@plt>
mov    %eax,-0x4(%rbp)
jmp    1740 <main+0x5b0>
movl   $0x0,-0x1048(%rbp)
movl   $0x0,-0x104c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdfb(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1232 <main+0xa2>
movl   $0x1,-0x1048(%rbp)
mov    -0x1044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1044(%rbp)
jmp    127f <main+0xef>
mov    -0x10(%rbp),%rax
movslq -0x1044(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdbb(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    127a <main+0xea>
movl   $0x1,-0x1048(%rbp)
movl   $0x1,-0x104c(%rbp)
mov    -0x1044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1044(%rbp)
jmp    127f <main+0xef>
cmpl   $0x0,-0x104c(%rbp)
je     129a <main+0x10a>
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x1048(%rbp)
je     12b5 <main+0x125>
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x1044(%rbp),%eax
jg     12d3 <main+0x143>
mov    $0x0,%al
call   1090 <usage@plt>
mov    %eax,-0x4(%rbp)
jmp    1740 <main+0x5b0>
mov    -0x10(%rbp),%rax
mov    -0x1044(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1044(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x1028(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1044(%rbp),%eax
jg     1314 <main+0x184>
mov    $0x0,%al
call   1090 <usage@plt>
mov    %eax,-0x4(%rbp)
jmp    1740 <main+0x5b0>
mov    -0x10(%rbp),%rax
mov    -0x1044(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1044(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x1030(%rbp)
movl   $0x7fffffff,-0x1050(%rbp)
ff ff 7f
mov    -0x8(%rbp),%eax
cmp    -0x1044(%rbp),%eax
jle    1380 <main+0x1f0>
mov    -0x10(%rbp),%rax
mov    -0x1044(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1044(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1080 <strtol@plt>
mov    %eax,-0x1050(%rbp)
mov    -0x1028(%rbp),%rdi
lea    0xca2(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13c3 <main+0x233>
mov    -0x1028(%rbp),%rsi
lea    0xc83(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1740 <main+0x5b0>
mov    -0x1030(%rbp),%rdi
lea    0xc77(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    140f <main+0x27f>
mov    -0x1030(%rbp),%rsi
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1740 <main+0x5b0>
movl   $0x0,-0x1034(%rbp)
cmpl   $0x100,-0x1034(%rbp)
jge    14c5 <main+0x335>
mov    -0x1034(%rbp),%eax
mov    %eax,-0x1454(%rbp)
movl   $0x0,-0x1458(%rbp)
movl   $0x0,-0x1038(%rbp)
cmpl   $0x8,-0x1038(%rbp)
jge    149d <main+0x30d>
mov    -0x1458(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1458(%rbp)
mov    -0x1454(%rbp),%eax
and    $0x1,%eax
or     -0x1458(%rbp),%eax
mov    %eax,-0x1458(%rbp)
mov    -0x1454(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1454(%rbp)
mov    -0x1038(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1038(%rbp)
jmp    1449 <main+0x2b9>
mov    -0x1458(%rbp),%ecx
movslq -0x1034(%rbp),%rax
mov    %ecx,-0x1450(%rbp,%rax,4)
mov    -0x1034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1034(%rbp)
jmp    1419 <main+0x289>
movl   $0xf,-0x145c(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x146d(%rbp)
jne    14fb <main+0x36b>
cmpl   $0x0,-0x1050(%rbp)
setne  %al
mov    %al,-0x146d(%rbp)
mov    -0x146d(%rbp),%al
test   $0x1,%al
jne    150e <main+0x37e>
jmp    1727 <main+0x597>
cmpl   $0x1000,-0x1050(%rbp)
jle    152e <main+0x39e>
mov    $0x1000,%eax
mov    %eax,-0x1474(%rbp)
jmp    153a <main+0x3aa>
mov    -0x1050(%rbp),%eax
mov    %eax,-0x1474(%rbp)
mov    -0x1474(%rbp),%eax
mov    %eax,-0x1464(%rbp)
mov    -0x1464(%rbp),%ecx
mov    -0x1050(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1050(%rbp)
lea    -0x1020(%rbp),%rdi
mov    -0x1464(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    %eax,-0x1468(%rbp)
movl   $0x0,-0x146c(%rbp)
cmpl   $0x0,-0x1048(%rbp)
je     1613 <main+0x483>
movl   $0x0,-0x1034(%rbp)
mov    -0x1034(%rbp),%eax
cmp    -0x1468(%rbp),%eax
jge    160e <main+0x47e>
movslq -0x1034(%rbp),%rax
movzbl -0x1020(%rbp,%rax,1),%eax
ff
cmp    $0xff,%eax
jne    15f5 <main+0x465>
mov    -0x1034(%rbp),%eax
mov    %eax,-0x146c(%rbp)
movl   $0x0,-0x1048(%rbp)
mov    -0x146c(%rbp),%eax
add    -0x1050(%rbp),%eax
mov    %eax,-0x1050(%rbp)
jmp    160e <main+0x47e>
jmp    15fa <main+0x46a>
mov    -0x1034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1034(%rbp)
jmp    159c <main+0x40c>
jmp    1613 <main+0x483>
cmpl   $0x0,-0x104c(%rbp)
je     16a1 <main+0x511>
movl   $0x0,-0x1034(%rbp)
mov    -0x1034(%rbp),%eax
cmp    -0x1468(%rbp),%eax
jge    169c <main+0x50c>
movslq -0x1034(%rbp),%rax
movzbl -0x1020(%rbp,%rax,1),%eax
ff
sar    $0x4,%eax
mov    %eax,-0x1460(%rbp)
movslq -0x1034(%rbp),%rax
movzbl -0x1020(%rbp,%rax,1),%eax
ff
shl    $0x4,%eax
or     -0x145c(%rbp),%eax
mov    %al,%cl
movslq -0x1034(%rbp),%rax
mov    %cl,-0x1020(%rbp,%rax,1)
mov    -0x1460(%rbp),%eax
mov    %eax,-0x145c(%rbp)
mov    -0x1034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1034(%rbp)
jmp    162a <main+0x49a>
jmp    16a1 <main+0x511>
movl   $0x0,-0x1034(%rbp)
mov    -0x1034(%rbp),%eax
cmp    -0x1468(%rbp),%eax
jge    16f7 <main+0x567>
movslq -0x1034(%rbp),%rax
movzbl -0x1020(%rbp,%rax,1),%eax
ff
mov    -0x1450(%rbp,%rax,4),%eax
mov    %al,%cl
movslq -0x1034(%rbp),%rax
mov    %cl,-0x1020(%rbp,%rax,1)
mov    -0x1034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1034(%rbp)
jmp    16ab <main+0x51b>
movslq -0x146c(%rbp),%rax
lea    -0x1020(%rbp),%rdi
add    %rax,%rdi
mov    -0x1468(%rbp),%edx
sub    -0x146c(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   10b0 <fwrite@plt>
jmp    14cf <main+0x33f>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1428,%rsp
cmp    $0x1,%edi
jle    1672 <main+0x4d2>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe96(%rip),%rsi
call   1070 <strcmp@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1211 <main+0x71>
mov    0x8(%r14),%rdi
lea    0xe81(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1205 <main+0x65>
xor    %r15d,%r15d
mov    $0x1,%eax
movl   $0x0,0xc(%rsp)
cmp    %ebp,%eax
jb     123a <main+0x9a>
jmp    1672 <main+0x4d2>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
test   %rbx,%rbx
setne  %al
mov    %eax,0xc(%rsp)
lea    0xe5f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%r15d
mov    $0x2,%eax
cmp    %ebp,%eax
jae    1672 <main+0x4d2>
lea    0x1(%rax),%ecx
cmp    %ebp,%ecx
jae    1672 <main+0x4d2>
mov    %eax,%edx
mov    (%r14,%rdx,8),%r13
add    $0x2,%eax
mov    %ecx,%ecx
mov    (%r14,%rcx,8),%rcx
mov    %rcx,0x18(%rsp)
mov    $0x7fffffff,%ebx
cmp    %ebp,%eax
jae    1277 <main+0xd7>
mov    %eax,%eax
mov    (%r14,%rax,8),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1090 <strtol@plt>
mov    %rax,%rbx
lea    0xde8(%rip),%rsi
mov    %r13,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     168a <main+0x4ea>
mov    %rax,%r12
lea    0xde5(%rip),%rsi
mov    0x18(%rsp),%rbp
mov    %rbp,%rdi
call   10b0 <fopen@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     169d <main+0x4fd>
movdqa 0xd44(%rip),%xmm0
xor    %eax,%eax
movdqa 0xd4a(%rip),%xmm1
movdqa 0xd52(%rip),%xmm2
movdqa 0xd5a(%rip),%xmm3
pxor   %xmm4,%xmm4
movdqa 0xd5e(%rip),%xmm5
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqa %xmm0,%xmm6
psrlw  $0x4,%xmm6
pand   %xmm1,%xmm6
movdqa %xmm0,%xmm7
pand   %xmm1,%xmm7
psllw  $0x4,%xmm7
por    %xmm6,%xmm7
movdqa %xmm7,%xmm6
psrlw  $0x2,%xmm6
pand   %xmm2,%xmm6
pand   %xmm2,%xmm7
psllw  $0x2,%xmm7
por    %xmm6,%xmm7
movdqa %xmm7,%xmm6
psrlw  $0x1,%xmm6
pand   %xmm3,%xmm6
pand   %xmm3,%xmm7
paddb  %xmm7,%xmm7
por    %xmm6,%xmm7
punpcklbw %xmm4,%xmm7
punpcklwd %xmm4,%xmm7
movdqa %xmm7,0x20(%rsp,%rax,4)
add    $0x4,%rax
paddb  %xmm5,%xmm0
cmp    $0x100,%rax
jne    12f0 <main+0x150>
mov    %r12,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    165c <main+0x4bc>
test   %ebx,%ebx
je     165c <main+0x4bc>
mov    $0xf,%r14d
mov    0xc(%rsp),%eax
xor    $0x1,%al
mov    %eax,0xc(%rsp)
nopw   0x0(%rax,%rax,1)
cmp    $0x1000,%ebx
mov    $0x1000,%ebp
cmovl  %ebx,%ebp
mov    %ebx,%r13d
sub    %ebp,%r13d
lea    0x420(%rsp),%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %r12,%rcx
call   1040 <fread@plt>
test   %r15d,%r15d
je     1400 <main+0x260>
test   %eax,%eax
jle    1415 <main+0x275>
mov    %eax,%edx
xor    %ecx,%ecx
pxor   %xmm8,%xmm8
movdqa 0xc7a(%rip),%xmm9
cs nopw 0x0(%rax,%rax,1)
cmpb   $0xff,0x420(%rsp,%rcx,1)
ff
je     1422 <main+0x282>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    13e0 <main+0x240>
xor    %ecx,%ecx
mov    $0x1,%r15d
jmp    142c <main+0x28c>
nopl   (%rax)
xor    %r15d,%r15d
xor    %ecx,%ecx
pxor   %xmm8,%xmm8
movdqa 0xc3d(%rip),%xmm9
jmp    142c <main+0x28c>
xor    %ecx,%ecx
mov    $0x1,%r15d
jmp    1625 <main+0x485>
sub    %ebp,%ebx
add    %ecx,%ebx
xor    %r15d,%r15d
mov    %ebx,%r13d
test   %eax,%eax
setle  %dl
or     0xc(%rsp),%dl
jne    1578 <main+0x3d8>
mov    %eax,%edx
cmp    $0x10,%eax
jae    1449 <main+0x2a9>
xor    %esi,%esi
jmp    1540 <main+0x3a0>
mov    %edx,%esi
and    $0xfffffff0,%esi
movd   %r14d,%xmm0
pshufd $0x0,%xmm0,%xmm4
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movdqa 0x420(%rsp,%rdi,1),%xmm0
movdqa %xmm0,%xmm2
punpckhbw %xmm8,%xmm2
movdqa %xmm2,%xmm1
punpcklwd %xmm8,%xmm1
punpckhwd %xmm8,%xmm2
punpcklbw %xmm8,%xmm0
movdqa %xmm0,%xmm3
punpckhwd %xmm8,%xmm3
punpcklwd %xmm8,%xmm0
movdqa %xmm0,%xmm5
psrld  $0x4,%xmm5
movdqa %xmm3,%xmm6
psrld  $0x4,%xmm6
shufps $0x3,%xmm5,%xmm4
shufps $0x98,%xmm5,%xmm4
pslld  $0x4,%xmm0
por    %xmm4,%xmm0
movdqa %xmm2,%xmm4
psrld  $0x4,%xmm4
movdqa %xmm1,%xmm7
psrld  $0x4,%xmm7
shufps $0x3,%xmm6,%xmm5
shufps $0x98,%xmm6,%xmm5
shufps $0x3,%xmm7,%xmm6
shufps $0x98,%xmm7,%xmm6
shufps $0x3,%xmm4,%xmm7
shufps $0x98,%xmm4,%xmm7
pslld  $0x4,%xmm2
por    %xmm7,%xmm2
pslld  $0x4,%xmm1
por    %xmm6,%xmm1
pslld  $0x4,%xmm3
por    %xmm5,%xmm3
pand   %xmm9,%xmm2
pand   %xmm9,%xmm1
packuswb %xmm2,%xmm1
pand   %xmm9,%xmm3
pand   %xmm9,%xmm0
packuswb %xmm3,%xmm0
packuswb %xmm1,%xmm0
movdqa %xmm0,0x420(%rsp,%rdi,1)
add    $0x10,%rdi
cmp    %rdi,%rsi
jne    1460 <main+0x2c0>
pshufd $0xff,%xmm4,%xmm0
movd   %xmm0,%r14d
cmp    %rdx,%rsi
je     1578 <main+0x3d8>
mov    %r14d,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x420(%rsp,%rsi,1),%ebp
mov    %ebp,%r14d
shr    $0x4,%r14d
shl    $0x4,%ebp
or     %edi,%ebp
mov    %bpl,0x420(%rsp,%rsi,1)
add    $0x1,%rsi
mov    %r14d,%edi
cmp    %rsi,%rdx
jne    1550 <main+0x3b0>
test   %eax,%eax
jle    1625 <main+0x485>
mov    %eax,%esi
lea    -0x1(%rsi),%rdi
mov    %esi,%edx
and    $0x3,%edx
cmp    $0x3,%rdi
jae    1595 <main+0x3f5>
xor    %edi,%edi
jmp    15f9 <main+0x459>
and    $0xfffffffc,%esi
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movzbl 0x420(%rsp,%rdi,1),%ebp
movzbl 0x20(%rsp,%rbp,4),%ebx
mov    %bl,0x420(%rsp,%rdi,1)
movzbl 0x421(%rsp,%rdi,1),%ebp
movzbl 0x20(%rsp,%rbp,4),%ebx
mov    %bl,0x421(%rsp,%rdi,1)
movzbl 0x422(%rsp,%rdi,1),%ebp
movzbl 0x20(%rsp,%rbp,4),%ebx
mov    %bl,0x422(%rsp,%rdi,1)
movzbl 0x423(%rsp,%rdi,1),%ebp
movzbl 0x20(%rsp,%rbp,4),%ebx
mov    %bl,0x423(%rsp,%rdi,1)
add    $0x4,%rdi
cmp    %rdi,%rsi
jne    15a0 <main+0x400>
test   %rdx,%rdx
je     1625 <main+0x485>
lea    (%rsp,%rdi,1),%rsi
add    $0x420,%rsi
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdi,1),%ebp
movzbl 0x20(%rsp,%rbp,4),%ebx
mov    %bl,(%rsi,%rdi,1)
add    $0x1,%rdi
cmp    %rdi,%rdx
jne    1610 <main+0x470>
mov    %r13d,%ebx
mov    %ecx,%edx
lea    (%rsp,%rdx,1),%rdi
add    $0x420,%rdi
sub    %ecx,%eax
mov    $0x1,%esi
mov    %eax,%edx
mov    0x10(%rsp),%rcx
call   10c0 <fwrite@plt>
mov    %r12,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    165c <main+0x4bc>
test   %ebx,%ebx
jne    1390 <main+0x1f0>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
jmp    16bb <main+0x51b>
xor    %eax,%eax
add    $0x1428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <usage@plt>
lea    0x9d8(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    16b6 <main+0x516>
lea    0x9c5(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    $0x1,%eax
add    $0x1428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [3 x i8] c"-n\00"
@.str.2 = [21 x i8] c"NibbleShift Enabled\0A\00"
@.str.3 = [21 x i8] c"HeaderStrip Enabled\0A\00"
@.str.4 = [3 x i8] c"rb\00"
@.str.5 = [21 x i8] c"Can't open file %s.\0A\00"
@.str.6 = [3 x i8] c"wb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [4096 x i8]
%9 = alloca i8*
%10 = alloca i8*
%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 [256 x i32]
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %14
store i32 1, i32* %15
%27 = load i32, i32* %4
%28 = load i32, i32* %15
%29 = icmp sle i32 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %2
%31 = call i32 (...) @usage()
store i32 %31, i32* %3
br label %264
32: ; preds = %2
store i32 0, i32* %16
store i32 0, i32* %17
%33 = load i8**, i8*** %5
%34 = load i32, i32* %15
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %32
store i32 1, i32* %16
%41 = load i32, i32* %15
%42 = add nsw i32 %41, 1
store i32 %42, i32* %15
br label %55
43: ; preds = %32
%44 = load i8**, i8*** %5
%45 = load i32, i32* %15
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8*, i8** %44, i64 %46
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %43
store i32 1, i32* %16
store i32 1, i32* %17
%52 = load i32, i32* %15
%53 = add nsw i32 %52, 1
store i32 %53, i32* %15
br label %54
54: ; preds = %51, %43
br label %55
55: ; preds = %54, %40
%56 = load i32, i32* %17
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %60
60: ; preds = %58, %55
%61 = load i32, i32* %16
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %65
65: ; preds = %63, %60
%66 = load i32, i32* %4
%67 = load i32, i32* %15
%68 = icmp sle i32 %66, %67
br i1 %68, label %69, label %71
69: ; preds = %65
%70 = call i32 (...) @usage()
store i32 %70, i32* %3
br label %264
71: ; preds = %65
%72 = load i8**, i8*** %5
%73 = load i32, i32* %15
%74 = add nsw i32 %73, 1
store i32 %74, i32* %15
%75 = sext i32 %73 to i64
%76 = getelementptr inbounds i8*, i8** %72, i64 %75
%77 = load i8*, i8** %76
store i8* %77, i8** %9
%78 = load i32, i32* %4
%79 = load i32, i32* %15
%80 = icmp sle i32 %78, %79
br i1 %80, label %81, label %83
81: ; preds = %71
%82 = call i32 (...) @usage()
store i32 %82, i32* %3
br label %264
83: ; preds = %71
%84 = load i8**, i8*** %5
%85 = load i32, i32* %15
%86 = add nsw i32 %85, 1
store i32 %86, i32* %15
%87 = sext i32 %85 to i64
%88 = getelementptr inbounds i8*, i8** %84, i64 %87
%89 = load i8*, i8** %88
store i8* %89, i8** %10
store i32 2147483647, i32* %18
%90 = load i32, i32* %4
%91 = load i32, i32* %15
%92 = icmp sgt i32 %90, %91
br i1 %92, label %93, label %102
93: ; preds = %83
%94 = load i8**, i8*** %5
%95 = load i32, i32* %15
%96 = add nsw i32 %95, 1
store i32 %96, i32* %15
%97 = sext i32 %95 to i64
%98 = getelementptr inbounds i8*, i8** %94, i64 %97
%99 = load i8*, i8** %98
%100 = call i64 @strtol(i8* %99, i32* null, i32 16)
%101 = trunc i64 %100 to i32
store i32 %101, i32* %18
br label %102
102: ; preds = %93, %83
%103 = load i8*, i8** %9
%104 = call i32* @fopen(i8* %103, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %104, i32** %6
%105 = load i32*, i32** %6
%106 = icmp ne i32* %105, null
br i1 %106, label %110, label %107
107: ; preds = %102
%108 = load i8*, i8** %9
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %108)
store i32 1, i32* %3
br label %264
110: ; preds = %102
%111 = load i8*, i8** %10
%112 = call i32* @fopen(i8* %111, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %112, i32** %7
%113 = load i32*, i32** %7
%114 = icmp ne i32* %113, null
br i1 %114, label %120, label %115
115: ; preds = %110
%116 = load i8*, i8** %10
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %116)
%118 = load i32*, i32** %6
%119 = call i32 @fclose(i32* %118)
store i32 1, i32* %3
br label %264
120: ; preds = %110
store i32 0, i32* %11
br label %121
121: ; preds = %146, %120
%122 = load i32, i32* %11
%123 = icmp slt i32 %122, 256
br i1 %123, label %124, label %149
124: ; preds = %121
%125 = load i32, i32* %11
store i32 %125, i32* %20
store i32 0, i32* %21
store i32 0, i32* %12
br label %126
126: ; preds = %138, %124
%127 = load i32, i32* %12
%128 = icmp slt i32 %127, 8
br i1 %128, label %129, label %141
129: ; preds = %126
%130 = load i32, i32* %21
%131 = shl i32 %130, 1
store i32 %131, i32* %21
%132 = load i32, i32* %20
%133 = and i32 %132, 1
%134 = load i32, i32* %21
%135 = or i32 %134, %133
store i32 %135, i32* %21
%136 = load i32, i32* %20
%137 = ashr i32 %136, 1
store i32 %137, i32* %20
br label %138
138: ; preds = %129
%139 = load i32, i32* %12
%140 = add nsw i32 %139, 1
store i32 %140, i32* %12
br label %126
141: ; preds = %126
%142 = load i32, i32* %21
%143 = load i32, i32* %11
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds [256 x i32], [256 x i32]* %19, i64 0, i64 %144
store i32 %142, i32* %145
br label %146
146: ; preds = %141
%147 = load i32, i32* %11
%148 = add nsw i32 %147, 1
store i32 %148, i32* %11
br label %121
149: ; preds = %121
store i32 15, i32* %22
br label %150
150: ; preds = %250, %149
%151 = load i32*, i32** %6
%152 = call i32 @feof(i32* %151)
%153 = icmp ne i32 %152, 0
br i1 %153, label %157, label %154
154: ; preds = %150
%155 = load i32, i32* %18
%156 = icmp ne i32 %155, 0
br label %157
157: ; preds = %154, %150
%158 = phi i1 [ false, %150 ], [ %156, %154 ]
br i1 %158, label %159, label %259
159: ; preds = %157
%160 = load i32, i32* %18
%161 = icmp sgt i32 %160, 4096
br i1 %161, label %162, label %163
162: ; preds = %159
br label %165
163: ; preds = %159
%164 = load i32, i32* %18
br label %165
165: ; preds = %163, %162
%166 = phi i32 [ 4096, %162 ], [ %164, %163 ]
store i32 %166, i32* %24
%167 = load i32, i32* %24
%168 = load i32, i32* %18
%169 = sub nsw i32 %168, %167
store i32 %169, i32* %18
%170 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 0
%171 = load i32, i32* %24
%172 = load i32*, i32** %6
%173 = call i32 @fread(i8* %170, i32 1, i32 %171, i32* %172)
store i32 %173, i32* %25
store i32 0, i32* %26
%174 = load i32, i32* %16
%175 = icmp ne i32 %174, 0
br i1 %175, label %176, label %198
176: ; preds = %165
store i32 0, i32* %11
br label %177
177: ; preds = %194, %176
%178 = load i32, i32* %11
%179 = load i32, i32* %25
%180 = icmp slt i32 %178, %179
br i1 %180, label %181, label %197
181: ; preds = %177
%182 = load i32, i32* %11
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %183
%185 = load i8, i8* %184
%186 = zext i8 %185 to i32
%187 = icmp eq i32 %186, 255
br i1 %187, label %188, label %193
188: ; preds = %181
%189 = load i32, i32* %11
store i32 %189, i32* %26
store i32 0, i32* %16
%190 = load i32, i32* %26
%191 = load i32, i32* %18
%192 = add nsw i32 %191, %190
store i32 %192, i32* %18
br label %197
193: ; preds = %181
br label %194
194: ; preds = %193
%195 = load i32, i32* %11
%196 = add nsw i32 %195, 1
store i32 %196, i32* %11
br label %177
197: ; preds = %188, %177
br label %198
198: ; preds = %197, %165
%199 = load i32, i32* %17
%200 = icmp ne i32 %199, 0
br i1 %200, label %201, label %230
201: ; preds = %198
store i32 0, i32* %11
br label %202
202: ; preds = %226, %201
%203 = load i32, i32* %11
%204 = load i32, i32* %25
%205 = icmp slt i32 %203, %204
br i1 %205, label %206, label %229
206: ; preds = %202
%207 = load i32, i32* %11
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %208
%210 = load i8, i8* %209
%211 = zext i8 %210 to i32
%212 = ashr i32 %211, 4
store i32 %212, i32* %23
%213 = load i32, i32* %11
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %214
%216 = load i8, i8* %215
%217 = zext i8 %216 to i32
%218 = shl i32 %217, 4
%219 = load i32, i32* %22
%220 = or i32 %218, %219
%221 = trunc i32 %220 to i8
%222 = load i32, i32* %11
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %223
store i8 %221, i8* %224
%225 = load i32, i32* %23
store i32 %225, i32* %22
br label %226
226: ; preds = %206
%227 = load i32, i32* %11
%228 = add nsw i32 %227, 1
store i32 %228, i32* %11
br label %202
229: ; preds = %202
br label %230
230: ; preds = %229, %198
store i32 0, i32* %11
br label %231
231: ; preds = %247, %230
%232 = load i32, i32* %11
%233 = load i32, i32* %25
%234 = icmp slt i32 %232, %233
br i1 %234, label %235, label %250
235: ; preds = %231
%236 = load i32, i32* %11
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %237
%239 = load i8, i8* %238
%240 = zext i8 %239 to i64
%241 = getelementptr inbounds [256 x i32], [256 x i32]* %19, i64 0, i64 %240
%242 = load i32, i32* %241
%243 = trunc i32 %242 to i8
%244 = load i32, i32* %11
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %245
store i8 %243, i8* %246
br label %247
247: ; preds = %235
%248 = load i32, i32* %11
%249 = add nsw i32 %248, 1
store i32 %249, i32* %11
br label %231
250: ; preds = %231
%251 = load i32, i32* %26
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds [4096 x i8], [4096 x i8]* %8, i64 0, i64 %252
%254 = load i32, i32* %25
%255 = load i32, i32* %26
%256 = sub nsw i32 %254, %255
%257 = load i32*, i32** %7
%258 = call i32 @fwrite(i8* %253, i32 1, i32 %256, i32* %257)
br label %150
259: ; preds = %157
%260 = load i32*, i32** %6
%261 = call i32 @fclose(i32* %260)
%262 = load i32*, i32** %7
%263 = call i32 @fclose(i32* %262)
store i32 0, i32* %3
br label %264
264: ; preds = %259, %115, %107, %81, %69, %30
%265 = load i32, i32* %3
ret i32 %265
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [3 x i8] c"-n\00"
@.str.4 = [3 x i8] c"rb\00"
@.str.5 = [21 x i8] c"Can't open file %s.\0A\00"
@.str.6 = [3 x i8] c"wb\00"
@str = [20 x i8] c"HeaderStrip Enabled\00"
@str.7 = [20 x i8] c"NibbleShift Enabled\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = alloca [256 x i32]
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%6 = icmp slt i32 %0, 2
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @usage()
br label %222
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %9
%15 = load i8*, i8** %10
%16 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
br label %20
20: ; preds = %9, %18
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%22 = xor i1 %13, true
br label %23
23: ; preds = %14, %20
%24 = phi i32 [ 2, %20 ], [ 1, %14 ]
%25 = phi i32 [ 1, %20 ], [ 0, %14 ]
%26 = phi i1 [ %22, %20 ], [ false, %14 ]
%27 = icmp ult i32 %24, %0
br i1 %27, label %30, label %28
28: ; preds = %23
%29 = tail call i32 (...) @usage()
br label %222
30: ; preds = %23
%31 = add nuw nsw i32 %24, 1
%32 = zext i32 %24 to i64
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
%35 = icmp ult i32 %31, %0
br i1 %35, label %38, label %36
36: ; preds = %30
%37 = tail call i32 (...) @usage()
br label %222
38: ; preds = %30
%39 = add nuw nsw i32 %24, 2
%40 = zext i32 %31 to i64
%41 = getelementptr inbounds i8*, i8** %1, i64 %40
%42 = load i8*, i8** %41
%43 = icmp ult i32 %39, %0
br i1 %43, label %44, label %50
44: ; preds = %38
%45 = zext i32 %39 to i64
%46 = getelementptr inbounds i8*, i8** %1, i64 %45
%47 = load i8*, i8** %46
%48 = tail call i64 @strtol(i8* nocapture %47, i32* null, i32 16)
%49 = trunc i64 %48 to i32
br label %50
50: ; preds = %44, %38
%51 = phi i32 [ %49, %44 ], [ 2147483647, %38 ]
%52 = tail call i32* @fopen(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%53 = icmp eq i32* %52, null
br i1 %53, label %54, label %56
54: ; preds = %50
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %34)
br label %222
56: ; preds = %50
%57 = tail call i32* @fopen(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%58 = icmp eq i32* %57, null
br i1 %58, label %59, label %62
59: ; preds = %56
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %42)
%61 = tail call i32 @fclose(i32* %52)
br label %222
62: ; preds = %56
%63 = bitcast [256 x i32]* %4 to i8*
br label %64
64: ; preds = %64, %62
%65 = phi i64 [ 0, %62 ], [ %71, %64 ]
%66 = phi <4 x i8> [ <i8 0, i8 1, i8 2, i8 3>, %62 ], [ %72, %64 ]
%67 = call <4 x i8> @llvm.bitreverse.v4i8(<4 x i8> %66)
%68 = zext <4 x i8> %67 to <4 x i32>
%69 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %65
%70 = bitcast i32* %69 to <4 x i32>*
store <4 x i32> %68, <4 x i32>* %70
%71 = add nuw i64 %65, 4
%72 = add <4 x i8> %66, <i8 4, i8 4, i8 4, i8 4>
%73 = icmp eq i64 %71, 256
br i1 %73, label %74, label %64
74: ; preds = %64
%75 = tail call i32 @feof(i32* %52)
%76 = icmp eq i32 %75, 0
%77 = icmp ne i32 %51, 0
%78 = select i1 %76, i1 %77, i1 false
br i1 %78, label %79, label %219
79: ; preds = %74, %206
%80 = phi i32 [ %207, %206 ], [ 15, %74 ]
%81 = phi i32 [ %209, %206 ], [ %51, %74 ]
%82 = phi i32 [ %208, %206 ], [ %25, %74 ]
%83 = icmp slt i32 %81, 4096
%84 = select i1 %83, i32 %81, i32 4096
%85 = sub nsw i32 %81, %84
%86 = call i32 @fread(i8* %5, i32 1, i32 %84, i32* %52)
%87 = icmp eq i32 %82, 0
br i1 %87, label %103, label %88
88: ; preds = %79
%89 = icmp sgt i32 %86, 0
br i1 %89, label %90, label %206
90: ; preds = %88
%91 = zext i32 %86 to i64
br label %92
92: ; preds = %90, %100
%93 = phi i64 [ 0, %90 ], [ %101, %100 ]
%94 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %93
%95 = load i8, i8* %94
%96 = icmp eq i8 %95, -1
br i1 %96, label %97, label %100
97: ; preds = %92
%98 = trunc i64 %93 to i32
%99 = add nsw i32 %85, %98
br label %103
100: ; preds = %92
%101 = add nuw nsw i64 %93, 1
%102 = icmp eq i64 %101, %91
br i1 %102, label %103, label %92
103: ; preds = %100, %97, %79
%104 = phi i32 [ 0, %97 ], [ 0, %79 ], [ 1, %100 ]
%105 = phi i32 [ %99, %97 ], [ %85, %79 ], [ %85, %100 ]
%106 = phi i32 [ %98, %97 ], [ 0, %79 ], [ 0, %100 ]
%107 = icmp sgt i32 %86, 0
%108 = and i1 %26, %107
br i1 %108, label %109, label %149
109: ; preds = %103
%110 = zext i32 %86 to i64
%111 = icmp ult i32 %86, 16
br i1 %111, label %134, label %112
112: ; preds = %109
%113 = and i64 %110, 4294967280
%114 = insertelement <16 x i32> poison, i32 %80, i64 15
br label %115
115: ; preds = %115, %112
%116 = phi i64 [ 0, %112 ], [ %128, %115 ]
%117 = phi <16 x i32> [ %114, %112 ], [ %122, %115 ]
%118 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %116
%119 = bitcast i8* %118 to <16 x i8>*
%120 = load <16 x i8>, <16 x i8>* %119
%121 = zext <16 x i8> %120 to <16 x i32>
%122 = lshr <16 x i32> %121, <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4>
%123 = shufflevector <16 x i32> %117, <16 x i32> %122, <16 x i32> <i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30>
%124 = shl nuw nsw <16 x i32> %121, <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4>
%125 = or <16 x i32> %124, %123
%126 = trunc <16 x i32> %125 to <16 x i8>
%127 = bitcast i8* %118 to <16 x i8>*
store <16 x i8> %126, <16 x i8>* %127
%128 = add nuw i64 %116, 16
%129 = icmp eq i64 %128, %113
br i1 %129, label %130, label %115
130: ; preds = %115
%131 = icmp eq i64 %113, %110
%132 = extractelement <16 x i32> %122, i64 15
%133 = extractelement <16 x i32> %122, i64 15
br i1 %131, label %149, label %134
134: ; preds = %109, %130
%135 = phi i64 [ %113, %130 ], [ 0, %109 ]
%136 = phi i32 [ %132, %130 ], [ %80, %109 ]
br label %137
137: ; preds = %134, %137
%138 = phi i64 [ %147, %137 ], [ %135, %134 ]
%139 = phi i32 [ %143, %137 ], [ %136, %134 ]
%140 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %138
%141 = load i8, i8* %140
%142 = zext i8 %141 to i32
%143 = lshr i32 %142, 4
%144 = shl nuw nsw i32 %142, 4
%145 = or i32 %144, %139
%146 = trunc i32 %145 to i8
store i8 %146, i8* %140
%147 = add nuw nsw i64 %138, 1
%148 = icmp eq i64 %147, %110
br i1 %148, label %149, label %137
149: ; preds = %137, %130, %103
%150 = phi i32 [ %80, %103 ], [ %133, %130 ], [ %143, %137 ]
br i1 %107, label %151, label %206
151: ; preds = %149
%152 = zext i32 %86 to i64
%153 = add nsw i64 %152, -1
%154 = and i64 %152, 3
%155 = icmp ult i64 %153, 3
br i1 %155, label %191, label %156
156: ; preds = %151
%157 = and i64 %152, 4294967292
br label %158
158: ; preds = %158, %156
%159 = phi i64 [ 0, %156 ], [ %188, %158 ]
%160 = phi i64 [ 0, %156 ], [ %189, %158 ]
%161 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %159
%162 = load i8, i8* %161
%163 = zext i8 %162 to i64
%164 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %163
%165 = load i32, i32* %164
%166 = trunc i32 %165 to i8
store i8 %166, i8* %161
%167 = or i64 %159, 1
%168 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %167
%169 = load i8, i8* %168
%170 = zext i8 %169 to i64
%171 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %170
%172 = load i32, i32* %171
%173 = trunc i32 %172 to i8
store i8 %173, i8* %168
%174 = or i64 %159, 2
%175 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %174
%176 = load i8, i8* %175
%177 = zext i8 %176 to i64
%178 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %177
%179 = load i32, i32* %178
%180 = trunc i32 %179 to i8
store i8 %180, i8* %175
%181 = or i64 %159, 3
%182 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %181
%183 = load i8, i8* %182
%184 = zext i8 %183 to i64
%185 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %184
%186 = load i32, i32* %185
%187 = trunc i32 %186 to i8
store i8 %187, i8* %182
%188 = add nuw nsw i64 %159, 4
%189 = add i64 %160, 4
%190 = icmp eq i64 %189, %157
br i1 %190, label %191, label %158
191: ; preds = %158, %151
%192 = phi i64 [ 0, %151 ], [ %188, %158 ]
%193 = icmp eq i64 %154, 0
br i1 %193, label %206, label %194
194: ; preds = %191, %194
%195 = phi i64 [ %203, %194 ], [ %192, %191 ]
%196 = phi i64 [ %204, %194 ], [ 0, %191 ]
%197 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %195
%198 = load i8, i8* %197
%199 = zext i8 %198 to i64
%200 = getelementptr inbounds [256 x i32], [256 x i32]* %4, i64 0, i64 %199
%201 = load i32, i32* %200
%202 = trunc i32 %201 to i8
store i8 %202, i8* %197
%203 = add nuw nsw i64 %195, 1
%204 = add i64 %196, 1
%205 = icmp eq i64 %204, %154
br i1 %205, label %206, label %194
206: ; preds = %191, %194, %88, %149
%207 = phi i32 [ %150, %149 ], [ %80, %88 ], [ %150, %194 ], [ %150, %191 ]
%208 = phi i32 [ %104, %149 ], [ 1, %88 ], [ %104, %194 ], [ %104, %191 ]
%209 = phi i32 [ %105, %149 ], [ %85, %88 ], [ %105, %194 ], [ %105, %191 ]
%210 = phi i32 [ %106, %149 ], [ 0, %88 ], [ %106, %194 ], [ %106, %191 ]
%211 = zext i32 %210 to i64
%212 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %211
%213 = sub nsw i32 %86, %210
%214 = call i32 @fwrite(i8* %212, i32 1, i32 %213, i32* %57)
%215 = tail call i32 @feof(i32* %52)
%216 = icmp eq i32 %215, 0
%217 = icmp ne i32 %209, 0
%218 = select i1 %216, i1 %217, i1 false
br i1 %218, label %79, label %219
219: ; preds = %206, %74
%220 = tail call i32 @fclose(i32* %52)
%221 = tail call i32 @fclose(i32* %57)
br label %222
222: ; preds = %28, %36, %219, %59, %54, %7
%223 = phi i32 [ %8, %7 ], [ %29, %28 ], [ %37, %36 ], [ 0, %219 ], [ 1, %59 ], [ 1, %54 ]
ret i32 %223
}