#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 */
struct stat {
  int st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ERANGE;
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ R_OK;
int /*<<< orphan*/ abort();
scalar_t__ access(char *, int /*<<< orphan*/);
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
size_t fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, size_t, int, int /*<<< orphan*/);
size_t getopt(int, char **, char *);
void *malloc(int);
int /*<<< orphan*/ optarg;
size_t optind;
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
long strtol(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  long int count;
  size_t i, s, bytes_read, xor_max;
  size_t f_sizes[2];
  unsigned char p, q;
  unsigned char c = 0, z = 0;
  char *filename, *res;
  char **bufs = malloc(sizeof(char *) * 2);
  FILE *f;
  struct stat attr;
  if (argc < 3) {
    fprintf(stderr, "Usage: %s file1 file2 [-c] [-z]\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  while ((s = getopt(argc, argv, "c:hz")) != -1) {
    switch (s) {
    case 'c':
      errno = 0;
      count = strtol(optarg, NULL, 10);
      if (errno == ERANGE) {
        fprintf(stderr, "-c argument out of range; aborting\n");
        exit(EXIT_FAILURE);
      }
      c = 1;
      break;
    case 'z':
      z = 1;
      break;
    case '?':
      fprintf(stderr, "Usage: %s file1 file2 [-c] [-z]\n", argv[0]);
      exit(EXIT_FAILURE);
    default:
      abort();
    }
  }
  for (i = 0; i < 3 - 1; i++) {
    filename = argv[i + optind];
    if (stat(filename, &attr) == -1) {
      fprintf(stderr, "Could not stat file \"%s\", exiting;\n", filename);
    }
    errno = 0;
    if (access(filename, R_OK) || errno) {
      fprintf(stderr, "File %s not found; exiting\n", argv[i]);
      exit(EXIT_FAILURE);
    }
    bufs[i] = malloc(sizeof(char) * attr.st_size);
    if (!bufs[i]) {
      fprintf(stderr, "Could not allocate %li bytes of memory for file %s",
              attr.st_size, filename);
      exit(EXIT_FAILURE);
    }
    f = fopen(filename, "r");
    if (!(bytes_read = fread(bufs[i], attr.st_size, 1, f))) {
      fprintf(stderr,
              "Could not read %lu bytes from file %s "
              "only read %lu bytes; exiting\n",
              attr.st_size, filename, bytes_read);
      exit(EXIT_FAILURE);
    }
    f_sizes[i] = attr.st_size;
  }
  if (c) {
    if ((count <= f_sizes[0]) && (count <= f_sizes[1])) {
      xor_max = count;
    } else if (z) {
      xor_max = (f_sizes[0] > f_sizes[1]) ? f_sizes[0] : f_sizes[1];
    } else
      xor_max = (f_sizes[0] < f_sizes[1]) ? f_sizes[0] : f_sizes[1];
  } else {
    xor_max = (f_sizes[0] < f_sizes[1]) ? f_sizes[0] : f_sizes[1];
  }
  res = malloc(sizeof(char) * xor_max);
  for (i = 0; i < xor_max; i++) {
    if (z) {
      p = (i > f_sizes[0]) ? bufs[0][i] : '\0';
      q = (i > f_sizes[1]) ? bufs[1][i] : '\0';
    } else {
      p = bufs[0][i];
      q = bufs[1][i];
    }
    res[i] = p ^ q;
  }
  fwrite(res, xor_max, 1, stdout);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x53(%rbp)
movb   $0x0,-0x54(%rbp)
mov    $0x10,%edi
call   1080 <malloc@plt>
mov    %rax,-0x70(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1215 <main+0x65>
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe00(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2daa(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
jmp    121a <main+0x6a>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdf9(%rip),%rdx
call   10b0 <getopt@plt>
mov    %rax,-0x28(%rbp)
cmp    $0xffffffffffffffff,%rax
je     1333 <main+0x183>
mov    -0x28(%rbp),%rax
mov    %rax,-0x88(%rbp)
sub    $0x3f,%rax
je     12fb <main+0x14b>
jmp    1255 <main+0xa5>
mov    -0x88(%rbp),%rax
sub    $0x63,%rax
je     1281 <main+0xd1>
jmp    126b <main+0xbb>
mov    -0x88(%rbp),%rax
sub    $0x7a,%rax
je     12f2 <main+0x142>
jmp    1327 <main+0x177>
mov    0x2d38(%rip),%rax
movq   $0x0,(%rax)
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    0x2d0f(%rip),%rax
mov    (%rax),%rax
mov    0x2d1d(%rip),%rcx
cmp    (%rcx),%rax
jne    12e9 <main+0x139>
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
lea    0xd52(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
movb   $0x1,-0x53(%rbp)
jmp    132e <main+0x17e>
movb   $0x1,-0x54(%rbp)
jmp    132e <main+0x17e>
mov    0x2cc6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xcee(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c98(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    121a <main+0x6a>
movq   $0x0,-0x20(%rbp)
cmpq   $0x2,-0x20(%rbp)
jae    14e7 <main+0x337>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    0x2c8b(%rip),%rdx
add    (%rdx),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1060 <stat@plt>
cmp    $0xffffffff,%eax
jne    1391 <main+0x1e1>
mov    0x2c4b(%rip),%rax
mov    (%rax),%edi
mov    -0x60(%rbp),%rdx
lea    0xcc0(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2c28(%rip),%rax
movq   $0x0,(%rax)
mov    -0x60(%rbp),%rdi
mov    0x2bfe(%rip),%rax
mov    (%rax),%esi
call   1090 <access@plt>
cmp    $0x0,%rax
jne    13cc <main+0x21c>
mov    0x2bfe(%rip),%rax
cmpq   $0x0,(%rax)
je     13fd <main+0x24d>
mov    0x2bf5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc86(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2bc2(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
movslq -0x80(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x70(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x70(%rbp),%rax
mov    -0x20(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
jne    145a <main+0x2aa>
mov    0x2b93(%rip),%rax
mov    (%rax),%edi
mov    -0x80(%rbp),%edx
mov    -0x60(%rbp),%rcx
lea    0xc45(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2b65(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x60(%rbp),%rdi
lea    0xc58(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x80(%rbp),%esi
mov    -0x78(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fread@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    14c9 <main+0x319>
mov    0x2b28(%rip),%rax
mov    (%rax),%edi
mov    -0x80(%rbp),%edx
mov    -0x60(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xc0b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2af6(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
movslq -0x80(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,-0x50(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    133b <main+0x18b>
cmpb   $0x0,-0x53(%rbp)
je     159b <main+0x3eb>
mov    -0x18(%rbp),%rax
cmp    -0x50(%rbp),%rax
ja     151a <main+0x36a>
mov    -0x18(%rbp),%rax
cmp    -0x48(%rbp),%rax
ja     151a <main+0x36a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1596 <main+0x3e6>
cmpb   $0x0,-0x54(%rbp)
je     155d <main+0x3ad>
mov    -0x50(%rbp),%rax
cmp    -0x48(%rbp),%rax
jbe    1542 <main+0x392>
mov    -0x50(%rbp),%rax
mov    %rax,-0x90(%rbp)
jmp    154d <main+0x39d>
mov    -0x48(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1591 <main+0x3e1>
mov    -0x50(%rbp),%rax
cmp    -0x48(%rbp),%rax
jae    157b <main+0x3cb>
mov    -0x50(%rbp),%rax
mov    %rax,-0x98(%rbp)
jmp    1586 <main+0x3d6>
mov    -0x48(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1596 <main+0x3e6>
jmp    15cf <main+0x41f>
mov    -0x50(%rbp),%rax
cmp    -0x48(%rbp),%rax
jae    15b9 <main+0x409>
mov    -0x50(%rbp),%rax
mov    %rax,-0xa0(%rbp)
jmp    15c4 <main+0x414>
mov    -0x48(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x68(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    16cf <main+0x51f>
cmpb   $0x0,-0x54(%rbp)
je     1684 <main+0x4d4>
mov    -0x20(%rbp),%rax
cmp    -0x50(%rbp),%rax
jbe    162a <main+0x47a>
mov    -0x70(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0xa4(%rbp)
jmp    1637 <main+0x487>
xor    %eax,%eax
mov    %eax,-0xa4(%rbp)
jmp    1637 <main+0x487>
mov    -0xa4(%rbp),%eax
mov    %al,-0x51(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x48(%rbp),%rax
jbe    1669 <main+0x4b9>
mov    -0x70(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0xa8(%rbp)
jmp    1676 <main+0x4c6>
xor    %eax,%eax
mov    %eax,-0xa8(%rbp)
jmp    1676 <main+0x4c6>
mov    -0xa8(%rbp),%eax
mov    %al,-0x52(%rbp)
jmp    16a7 <main+0x4f7>
mov    -0x70(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x51(%rbp)
mov    -0x70(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x52(%rbp)
movzbl -0x51(%rbp),%eax
movzbl -0x52(%rbp),%ecx
xor    %ecx,%eax
mov    %al,%dl
mov    -0x68(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    15ea <main+0x43a>
mov    -0x68(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    0x28d2(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    0x28af(%rip),%rax
mov    (%rax),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r13
cmp    $0x3,%edi
jl     1472 <main+0x2c2>
mov    %edi,%ebp
mov    $0x1,%al
mov    %rax,0x10(%rsp)
xor    %r12d,%r12d
lea    0xe44(%rip),%rbx
mov    0x2df4(%rip),%r15
mov    %r12d,%ecx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%r12d
mov    %ebp,%edi
mov    %r13,%rsi
mov    %rbx,%rdx
call   10b0 <getopt@plt>
mov    $0x1,%cl
cmp    $0x7a,%rax
je     11f0 <main+0x40>
cmp    $0xffffffffffffffff,%rax
je     125d <main+0xad>
cmp    $0x63,%rax
jne    146c <main+0x2bc>
mov    0x2da1(%rip),%rax
movq   $0x0,(%rax)
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtol@plt>
mov    %rax,%r14
mov    0x2d74(%rip),%rax
mov    (%rax),%rax
cmp    (%r15),%rax
je     14c0 <main+0x310>
mov    %r12d,%ecx
jmp    11f0 <main+0x40>
mov    0x2d7c(%rip),%rax
mov    (%rax),%rax
mov    0x0(%r13,%rax,8),%rbp
lea    0x8(%rsp),%rsi
mov    %rbp,%rdi
call   1060 <stat@plt>
cmp    $0xffffffff,%eax
jne    1298 <main+0xe8>
mov    0x2d43(%rip),%rax
mov    (%rax),%edi
lea    0xdbc(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2d21(%rip),%rbx
movq   $0x0,(%rbx)
mov    %rbp,%rdi
mov    0x2cf8(%rip),%rax
mov    (%rax),%esi
call   1090 <access@plt>
or     (%rbx),%rax
jne    14d9 <main+0x329>
mov    0x8(%rsp),%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     14a2 <main+0x2f2>
mov    %rax,%r15
lea    0xddf(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <fopen@plt>
mov    %r15,%rdi
mov    %ebx,0xc(%rsp)
mov    %ebx,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1040 <fread@plt>
test   %rax,%rax
je     14fd <main+0x34d>
mov    0x2cd4(%rip),%rax
mov    (%rax),%rax
mov    0x8(%r13,%rax,8),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <stat@plt>
cmp    $0xffffffff,%eax
jne    1340 <main+0x190>
mov    0x2c9b(%rip),%rax
mov    (%rax),%edi
lea    0xd14(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2c79(%rip),%rbp
movq   $0x0,0x0(%rbp)
mov    0x2c52(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1090 <access@plt>
or     0x0(%rbp),%rax
jne    14dd <main+0x32d>
mov    %rbx,%rbp
mov    0x8(%rsp),%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     14a2 <main+0x2f2>
mov    %rax,%r13
lea    0xd32(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <fopen@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1040 <fread@plt>
test   %rax,%rax
je     14f9 <main+0x349>
movslq 0xc(%rsp),%rbp
movslq %ebx,%rbx
testb  $0x1,0x10(%rsp)
je     13c9 <main+0x219>
cmp    %rbx,%rbp
mov    %rbx,%r14
cmovb  %rbp,%r14
jmp    13e2 <main+0x232>
cmp    %rbp,%r14
ja     13d3 <main+0x223>
cmp    %rbx,%r14
jbe    13e2 <main+0x232>
test   %r12b,%r12b
je     13bd <main+0x20d>
cmp    %rbx,%rbp
mov    %rbx,%r14
cmova  %rbp,%r14
mov    %r14d,%edi
call   1080 <malloc@plt>
test   %r14,%r14
je     143b <main+0x28b>
xor    %ecx,%ecx
jmp    141a <main+0x26a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r15,%rcx,1),%edx
movzbl 0x0(%r13,%rcx,1),%esi
xor    %sil,%dl
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
cmp    %rcx,%r14
je     143b <main+0x28b>
test   %r12b,%r12b
je     1400 <main+0x250>
cmp    %rbp,%rcx
jbe    1430 <main+0x280>
movzbl (%r15,%rcx,1),%edx
cmp    %rbx,%rcx
ja     1405 <main+0x255>
jmp    1437 <main+0x287>
xor    %edx,%edx
cmp    %rbx,%rcx
ja     1405 <main+0x255>
xor    %esi,%esi
jmp    140b <main+0x25b>
mov    0x2b6e(%rip),%rcx
mov    (%rcx),%ecx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   10d0 <fwrite@plt>
mov    0x2b45(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x3f,%rax
jne    149b <main+0x2eb>
mov    0x2b4f(%rip),%rax
mov    (%rax),%edi
mov    0x0(%r13),%rdx
lea    0xb7a(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2b24(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>
mov    0x2b1f(%rip),%rax
mov    (%rax),%edi
lea    0xbd8(%rip),%rsi
mov    %ebx,%edx
mov    %rbp,%rcx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    148d <main+0x2dd>
mov    0x2b01(%rip),%rax
mov    (%rax),%edi
lea    0xb56(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    148d <main+0x2dd>
xor    %eax,%eax
jmp    14e2 <main+0x332>
mov    $0x1,%eax
mov    0x2adf(%rip),%rcx
mov    (%rcx),%edi
mov    0x0(%r13,%rax,8),%rdx
lea    0xb77(%rip),%rsi
jmp    1486 <main+0x2d6>
mov    %ebx,0xc(%rsp)
mov    0x2ac4(%rip),%rax
mov    (%rax),%edi
lea    0xbb2(%rip),%rsi
mov    0xc(%rsp),%edx
mov    %rbp,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    148d <main+0x2dd>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s file1 file2 [-c] [-z]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [5 x i8] c"c:hz\00"
@errno = global i64 0
@optarg = global i32 0
@ERANGE = global i64 0
@.str.2 = [36 x i8] c"-c argument out of range; aborting\0A\00"
@optind = global i64 0
@.str.3 = [36 x i8] c"Could not stat file \22%s\22, exiting;\0A\00"
@R_OK = global i32 0
@.str.4 = [28 x i8] c"File %s not found; exiting\0A\00"
@.str.5 = [51 x i8] c"Could not allocate %li bytes of memory for file %s\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [68 x i8] c"Could not read %lu bytes from file %s only read %lu bytes; exiting\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca [2 x i64]
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8**
%19 = alloca i32*
%20 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 0, i8* %14
store i8 0, i8* %15
%21 = call i8* @malloc(i32 16)
%22 = bitcast i8* %21 to i8**
store i8** %22, i8*** %18
%23 = load i32, i32* %4
%24 = icmp slt i32 %23, 3
br i1 %24, label %25, label %33
25: ; preds = %2
%26 = load i32, i32* @stderr
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %29)
%31 = load i32, i32* @EXIT_FAILURE
%32 = call i32 @exit(i32 %31)
unreachable
33: ; preds = %2
br label %34
34: ; preds = %64, %33
%35 = load i32, i32* %4
%36 = load i8**, i8*** %5
%37 = call i64 @getopt(i32 %35, i8** %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i64 %37, i64* %8
%38 = icmp ne i64 %37, -1
br i1 %38, label %39, label %65
39: ; preds = %34
%40 = load i64, i64* %8
switch i64 %40, label %62 [
i64 99, label %41
i64 122, label %53
i64 63, label %54
]
41: ; preds = %39
store i64 0, i64* @errno
%42 = load i32, i32* @optarg
%43 = call i64 @strtol(i32 %42, i32* null, i32 10)
store i64 %43, i64* %6
%44 = load i64, i64* @errno
%45 = load i64, i64* @ERANGE
%46 = icmp eq i64 %44, %45
br i1 %46, label %47, label %52
47: ; preds = %41
%48 = load i32, i32* @stderr
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%50 = load i32, i32* @EXIT_FAILURE
%51 = call i32 @exit(i32 %50)
unreachable
52: ; preds = %41
store i8 1, i8* %14
br label %64
53: ; preds = %39
store i8 1, i8* %15
br label %64
54: ; preds = %39
%55 = load i32, i32* @stderr
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 0
%58 = load i8*, i8** %57
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %58)
%60 = load i32, i32* @EXIT_FAILURE
%61 = call i32 @exit(i32 %60)
unreachable
62: ; preds = %39
%63 = call i32 (...) @abort()
unreachable
64: ; preds = %53, %52
br label %34
65: ; preds = %34
store i64 0, i64* %7
br label %66
66: ; preds = %150, %65
%67 = load i64, i64* %7
%68 = icmp ult i64 %67, 2
br i1 %68, label %69, label %153
69: ; preds = %66
%70 = load i8**, i8*** %5
%71 = load i64, i64* %7
%72 = load i64, i64* @optind
%73 = add i64 %71, %72
%74 = getelementptr inbounds i8*, i8** %70, i64 %73
%75 = load i8*, i8** %74
store i8* %75, i8** %16
%76 = load i8*, i8** %16
%77 = call i32 @stat(i8* %76, %struct.stat* %20)
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %83
79: ; preds = %69
%80 = load i32, i32* @stderr
%81 = load i8*, i8** %16
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %81)
br label %83
83: ; preds = %79, %69
store i64 0, i64* @errno
%84 = load i8*, i8** %16
%85 = load i32, i32* @R_OK
%86 = call i64 @access(i8* %84, i32 %85)
%87 = icmp ne i64 %86, 0
br i1 %87, label %91, label %88
88: ; preds = %83
%89 = load i64, i64* @errno
%90 = icmp ne i64 %89, 0
br i1 %90, label %91, label %100
91: ; preds = %88, %83
%92 = load i32, i32* @stderr
%93 = load i8**, i8*** %5
%94 = load i64, i64* %7
%95 = getelementptr inbounds i8*, i8** %93, i64 %94
%96 = load i8*, i8** %95
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %96)
%98 = load i32, i32* @EXIT_FAILURE
%99 = call i32 @exit(i32 %98)
unreachable
100: ; preds = %88
%101 = getelementptr inbounds %struct.stat, %struct.stat* %20, i32 0, i32 0
%102 = load i32, i32* %101
%103 = sext i32 %102 to i64
%104 = mul i64 1, %103
%105 = trunc i64 %104 to i32
%106 = call i8* @malloc(i32 %105)
%107 = load i8**, i8*** %18
%108 = load i64, i64* %7
%109 = getelementptr inbounds i8*, i8** %107, i64 %108
store i8* %106, i8** %109
%110 = load i8**, i8*** %18
%111 = load i64, i64* %7
%112 = getelementptr inbounds i8*, i8** %110, i64 %111
%113 = load i8*, i8** %112
%114 = icmp ne i8* %113, null
br i1 %114, label %123, label %115
115: ; preds = %100
%116 = load i32, i32* @stderr
%117 = getelementptr inbounds %struct.stat, %struct.stat* %20, i32 0, i32 0
%118 = load i32, i32* %117
%119 = load i8*, i8** %16
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i32 %118, i8* %119)
%121 = load i32, i32* @EXIT_FAILURE
%122 = call i32 @exit(i32 %121)
unreachable
123: ; preds = %100
%124 = load i8*, i8** %16
%125 = call i32* @fopen(i8* %124, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %125, i32** %19
%126 = load i8**, i8*** %18
%127 = load i64, i64* %7
%128 = getelementptr inbounds i8*, i8** %126, i64 %127
%129 = load i8*, i8** %128
%130 = getelementptr inbounds %struct.stat, %struct.stat* %20, i32 0, i32 0
%131 = load i32, i32* %130
%132 = load i32*, i32** %19
%133 = call i64 @fread(i8* %129, i32 %131, i32 1, i32* %132)
store i64 %133, i64* %9
%134 = icmp ne i64 %133, 0
br i1 %134, label %144, label %135
135: ; preds = %123
%136 = load i32, i32* @stderr
%137 = getelementptr inbounds %struct.stat, %struct.stat* %20, i32 0, i32 0
%138 = load i32, i32* %137
%139 = load i8*, i8** %16
%140 = load i64, i64* %9
%141 = call i32 (i32, i8*, ...) @fprintf(i32 %136, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.7, i64 0, i64 0), i32 %138, i8* %139, i64 %140)
%142 = load i32, i32* @EXIT_FAILURE
%143 = call i32 @exit(i32 %142)
unreachable
144: ; preds = %123
%145 = getelementptr inbounds %struct.stat, %struct.stat* %20, i32 0, i32 0
%146 = load i32, i32* %145
%147 = sext i32 %146 to i64
%148 = load i64, i64* %7
%149 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 %148
store i64 %147, i64* %149
br label %150
150: ; preds = %144
%151 = load i64, i64* %7
%152 = add i64 %151, 1
store i64 %152, i64* %7
br label %66
153: ; preds = %66
%154 = load i8, i8* %14
%155 = icmp ne i8 %154, 0
br i1 %155, label %156, label %201
156: ; preds = %153
%157 = load i64, i64* %6
%158 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
%159 = load i64, i64* %158
%160 = icmp ule i64 %157, %159
br i1 %160, label %161, label %168
161: ; preds = %156
%162 = load i64, i64* %6
%163 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%164 = load i64, i64* %163
%165 = icmp ule i64 %162, %164
br i1 %165, label %166, label %168
166: ; preds = %161
%167 = load i64, i64* %6
store i64 %167, i64* %10
br label %200
168: ; preds = %161, %156
%169 = load i8, i8* %15
%170 = icmp ne i8 %169, 0
br i1 %170, label %171, label %185
171: ; preds = %168
%172 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
%173 = load i64, i64* %172
%174 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%175 = load i64, i64* %174
%176 = icmp ugt i64 %173, %175
br i1 %176, label %177, label %180
177: ; preds = %171
%178 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
%179 = load i64, i64* %178
br label %183
180: ; preds = %171
%181 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%182 = load i64, i64* %181
br label %183
183: ; preds = %180, %177
%184 = phi i64 [ %179, %177 ], [ %182, %180 ]
store i64 %184, i64* %10
br label %199
185: ; preds = %168
%186 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
%187 = load i64, i64* %186
%188 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%189 = load i64, i64* %188
%190 = icmp ult i64 %187, %189
br i1 %190, label %191, label %194
191: ; preds = %185
%192 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
%193 = load i64, i64* %192
br label %197
194: ; preds = %185
%195 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%196 = load i64, i64* %195
br label %197
197: ; preds = %194, %191
%198 = phi i64 [ %193, %191 ], [ %196, %194 ]
store i64 %198, i64* %10
br label %199
199: ; preds = %197, %183
br label %200
200: ; preds = %199, %166
br label %215
201: ; preds = %153
%202 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
%203 = load i64, i64* %202
%204 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%205 = load i64, i64* %204
%206 = icmp ult i64 %203, %205
br i1 %206, label %207, label %210
207: ; preds = %201
%208 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
%209 = load i64, i64* %208
br label %213
210: ; preds = %201
%211 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%212 = load i64, i64* %211
br label %213
213: ; preds = %210, %207
%214 = phi i64 [ %209, %207 ], [ %212, %210 ]
store i64 %214, i64* %10
br label %215
215: ; preds = %213, %200
%216 = load i64, i64* %10
%217 = mul i64 1, %216
%218 = trunc i64 %217 to i32
%219 = call i8* @malloc(i32 %218)
store i8* %219, i8** %17
store i64 0, i64* %7
br label %220
220: ; preds = %283, %215
%221 = load i64, i64* %7
%222 = load i64, i64* %10
%223 = icmp ult i64 %221, %222
br i1 %223, label %224, label %286
224: ; preds = %220
%225 = load i8, i8* %15
%226 = icmp ne i8 %225, 0
br i1 %226, label %227, label %260
227: ; preds = %224
%228 = load i64, i64* %7
%229 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
%230 = load i64, i64* %229
%231 = icmp ugt i64 %228, %230
br i1 %231, label %232, label %240
232: ; preds = %227
%233 = load i8**, i8*** %18
%234 = getelementptr inbounds i8*, i8** %233, i64 0
%235 = load i8*, i8** %234
%236 = load i64, i64* %7
%237 = getelementptr inbounds i8, i8* %235, i64 %236
%238 = load i8, i8* %237
%239 = sext i8 %238 to i32
br label %241
240: ; preds = %227
br label %241
241: ; preds = %240, %232
%242 = phi i32 [ %239, %232 ], [ 0, %240 ]
%243 = trunc i32 %242 to i8
store i8 %243, i8* %12
%244 = load i64, i64* %7
%245 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
%246 = load i64, i64* %245
%247 = icmp ugt i64 %244, %246
br i1 %247, label %248, label %256
248: ; preds = %241
%249 = load i8**, i8*** %18
%250 = getelementptr inbounds i8*, i8** %249, i64 1
%251 = load i8*, i8** %250
%252 = load i64, i64* %7
%253 = getelementptr inbounds i8, i8* %251, i64 %252
%254 = load i8, i8* %253
%255 = sext i8 %254 to i32
br label %257
256: ; preds = %241
br label %257
257: ; preds = %256, %248
%258 = phi i32 [ %255, %248 ], [ 0, %256 ]
%259 = trunc i32 %258 to i8
store i8 %259, i8* %13
br label %273
260: ; preds = %224
%261 = load i8**, i8*** %18
%262 = getelementptr inbounds i8*, i8** %261, i64 0
%263 = load i8*, i8** %262
%264 = load i64, i64* %7
%265 = getelementptr inbounds i8, i8* %263, i64 %264
%266 = load i8, i8* %265
store i8 %266, i8* %12
%267 = load i8**, i8*** %18
%268 = getelementptr inbounds i8*, i8** %267, i64 1
%269 = load i8*, i8** %268
%270 = load i64, i64* %7
%271 = getelementptr inbounds i8, i8* %269, i64 %270
%272 = load i8, i8* %271
store i8 %272, i8* %13
br label %273
273: ; preds = %260, %257
%274 = load i8, i8* %12
%275 = zext i8 %274 to i32
%276 = load i8, i8* %13
%277 = zext i8 %276 to i32
%278 = xor i32 %275, %277
%279 = trunc i32 %278 to i8
%280 = load i8*, i8** %17
%281 = load i64, i64* %7
%282 = getelementptr inbounds i8, i8* %280, i64 %281
store i8 %279, i8* %282
br label %283
283: ; preds = %273
%284 = load i64, i64* %7
%285 = add i64 %284, 1
store i64 %285, i64* %7
br label %220
286: ; preds = %220
%287 = load i8*, i8** %17
%288 = load i64, i64* %10
%289 = load i32, i32* @stdout
%290 = call i32 @fwrite(i8* %287, i64 %288, i32 1, i32 %289)
%291 = load i32, i32* @EXIT_SUCCESS
ret i32 %291
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s file1 file2 [-c] [-z]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [5 x i8] c"c:hz\00"
@errno = global i64 0
@optarg = global i32 0
@ERANGE = global i64 0
@.str.2 = [36 x i8] c"-c argument out of range; aborting\0A\00"
@optind = global i64 0
@.str.3 = [36 x i8] c"Could not stat file \22%s\22, exiting;\0A\00"
@R_OK = global i32 0
@.str.4 = [28 x i8] c"File %s not found; exiting\0A\00"
@.str.5 = [51 x i8] c"Could not allocate %li bytes of memory for file %s\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [68 x i8] c"Could not read %lu bytes from file %s only read %lu bytes; exiting\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %28
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %28, %12
%13 = phi i8 [ 1, %12 ], [ %30, %28 ]
%14 = tail call i64 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
switch i64 %14, label %43 [
i64 -1, label %15
i64 99, label %22
i64 122, label %12
i64 63, label %37
]
15: ; preds = %12
%16 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%17 = load i64, i64* @optind
%18 = getelementptr inbounds i8*, i8** %1, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @stat(i8* %19, %struct.stat* %3)
%21 = icmp eq i32 %20, -1
br i1 %21, label %45, label %48
22: ; preds = %12
store i64 0, i64* @errno
%23 = load i32, i32* @optarg
%24 = tail call i64 @strtol(i32 %23, i32* null, i32 10)
%25 = load i64, i64* @errno
%26 = load i64, i64* @ERANGE
%27 = icmp eq i64 %25, %26
br i1 %27, label %32, label %28
28: ; preds = %2, %22
%29 = phi i1 [ false, %22 ], [ true, %2 ]
%30 = phi i8 [ %13, %22 ], [ 0, %2 ]
%31 = phi i64 [ %24, %22 ], [ undef, %2 ]
br label %12
32: ; preds = %22
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%35 = load i32, i32* @EXIT_FAILURE
%36 = tail call i32 @exit(i32 %35)
unreachable
37: ; preds = %12
%38 = load i32, i32* @stderr
%39 = load i8*, i8** %1
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %39)
%41 = load i32, i32* @EXIT_FAILURE
%42 = tail call i32 @exit(i32 %41)
unreachable
43: ; preds = %12
%44 = tail call i32 (...) @abort()
unreachable
45: ; preds = %15
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %19)
br label %48
48: ; preds = %45, %15
store i64 0, i64* @errno
%49 = load i32, i32* @R_OK
%50 = tail call i64 @access(i8* %19, i32 %49)
%51 = icmp ne i64 %50, 0
%52 = load i64, i64* @errno
%53 = icmp ne i64 %52, 0
%54 = select i1 %51, i1 true, i1 %53
br i1 %54, label %55, label %63
55: ; preds = %96, %48
%56 = phi i64 [ 0, %48 ], [ 1, %96 ]
%57 = load i32, i32* @stderr
%58 = getelementptr inbounds i8*, i8** %1, i64 %56
%59 = load i8*, i8** %58
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %59)
%61 = load i32, i32* @EXIT_FAILURE
%62 = tail call i32 @exit(i32 %61)
unreachable
63: ; preds = %48
%64 = load i32, i32* %16
%65 = tail call i8* @malloc(i32 %64)
%66 = icmp eq i8* %65, null
br i1 %66, label %67, label %74
67: ; preds = %103, %63
%68 = phi i32 [ %64, %63 ], [ %104, %103 ]
%69 = phi i8* [ %19, %63 ], [ %90, %103 ]
%70 = load i32, i32* @stderr
%71 = tail call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i32 %68, i8* %69)
%72 = load i32, i32* @EXIT_FAILURE
%73 = tail call i32 @exit(i32 %72)
unreachable
74: ; preds = %63
%75 = tail call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%76 = tail call i64 @fread(i8* %65, i32 %64, i32 1, i32* %75)
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %85
78: ; preds = %107, %74
%79 = phi i32 [ %64, %74 ], [ %104, %107 ]
%80 = phi i8* [ %19, %74 ], [ %90, %107 ]
%81 = load i32, i32* @stderr
%82 = tail call i32 (i32, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.7, i64 0, i64 0), i32 %79, i8* %80, i64 0)
%83 = load i32, i32* @EXIT_FAILURE
%84 = tail call i32 @exit(i32 %83)
unreachable
85: ; preds = %74
%86 = sext i32 %64 to i64
%87 = load i64, i64* @optind
%88 = add i64 %87, 1
%89 = getelementptr inbounds i8*, i8** %1, i64 %88
%90 = load i8*, i8** %89
%91 = call i32 @stat(i8* %90, %struct.stat* %3)
%92 = icmp eq i32 %91, -1
br i1 %92, label %93, label %96
93: ; preds = %85
%94 = load i32, i32* @stderr
%95 = tail call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %90)
br label %96
96: ; preds = %93, %85
store i64 0, i64* @errno
%97 = load i32, i32* @R_OK
%98 = tail call i64 @access(i8* %90, i32 %97)
%99 = icmp ne i64 %98, 0
%100 = load i64, i64* @errno
%101 = icmp ne i64 %100, 0
%102 = select i1 %99, i1 true, i1 %101
br i1 %102, label %55, label %103
103: ; preds = %96
%104 = load i32, i32* %16
%105 = tail call i8* @malloc(i32 %104)
%106 = icmp eq i8* %105, null
br i1 %106, label %67, label %107
107: ; preds = %103
%108 = tail call i32* @fopen(i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%109 = tail call i64 @fread(i8* %105, i32 %104, i32 1, i32* %108)
%110 = icmp eq i64 %109, 0
br i1 %110, label %78, label %111
111: ; preds = %107
%112 = sext i32 %104 to i64
br i1 %29, label %125, label %113
113: ; preds = %111
%114 = icmp ugt i64 %31, %86
%115 = icmp ugt i64 %31, %112
%116 = or i1 %114, %115
br i1 %116, label %117, label %128
117: ; preds = %113
%118 = icmp eq i8 %13, 0
br i1 %118, label %122, label %119
119: ; preds = %117
%120 = icmp ugt i64 %86, %112
%121 = select i1 %120, i64 %86, i64 %112
br label %128
122: ; preds = %117
%123 = icmp ult i64 %86, %112
%124 = select i1 %123, i64 %86, i64 %112
br label %128
125: ; preds = %111
%126 = icmp ult i64 %86, %112
%127 = select i1 %126, i64 %86, i64 %112
br label %128
128: ; preds = %113, %122, %119, %125
%129 = phi i64 [ %121, %119 ], [ %124, %122 ], [ %127, %125 ], [ %31, %113 ]
%130 = trunc i64 %129 to i32
%131 = tail call i8* @malloc(i32 %130)
%132 = icmp eq i64 %129, 0
br i1 %132, label %159, label %133
133: ; preds = %128
%134 = icmp eq i8 %13, 0
br label %135
135: ; preds = %133, %152
%136 = phi i64 [ 0, %133 ], [ %157, %152 ]
br i1 %134, label %145, label %137
137: ; preds = %135
%138 = icmp ugt i64 %136, %86
br i1 %138, label %139, label %142
139: ; preds = %137
%140 = getelementptr inbounds i8, i8* %65, i64 %136
%141 = load i8, i8* %140
br label %142
142: ; preds = %137, %139
%143 = phi i8 [ %141, %139 ], [ 0, %137 ]
%144 = icmp ugt i64 %136, %112
br i1 %144, label %148, label %152
145: ; preds = %135
%146 = getelementptr inbounds i8, i8* %65, i64 %136
%147 = load i8, i8* %146
br label %148
148: ; preds = %142, %145
%149 = phi i8 [ %147, %145 ], [ %143, %142 ]
%150 = getelementptr inbounds i8, i8* %105, i64 %136
%151 = load i8, i8* %150
br label %152
152: ; preds = %148, %142
%153 = phi i8 [ %143, %142 ], [ %149, %148 ]
%154 = phi i8 [ 0, %142 ], [ %151, %148 ]
%155 = xor i8 %154, %153
%156 = getelementptr inbounds i8, i8* %131, i64 %136
store i8 %155, i8* %156
%157 = add nuw i64 %136, 1
%158 = icmp eq i64 %157, %129
br i1 %158, label %159, label %135
159: ; preds = %152, %128
%160 = load i32, i32* @stdout
%161 = tail call i32 @fwrite(i8* %131, i64 %129, i32 1, i32 %160)
%162 = load i32, i32* @EXIT_SUCCESS
ret i32 %162
}