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

/* Variables and functions */
int EfiDecompress(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int,
                  int /*<<< orphan*/ *, int);
int GetInfo(int /*<<< orphan*/ *, int, int *, int *);
int TianoDecompress(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int,
                    int /*<<< orphan*/ *, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
char *strrchr(char *, char);
int main(int argc, char *argv[]) {
  char *progname;
  int retval = 1;
  progname = strrchr(argv[0], '/');
  if (progname)
    progname++;
  else
    progname = argv[0];
  if (argc != 3) {
    fprintf(stderr, "\nUsage:  %s INFILE OUTFILE\n\n", progname);
    exit(1);
  }
  char *infile = argv[1];
  char *outfile = argv[2];
  struct stat istat;
  if (0 != stat(infile, &istat)) {
    fprintf(stderr, "%s: can't stat %s: %s\n", progname, infile,
            strerror(errno));
    exit(1);
  }
  uint32_t isize = (uint32_t)istat.st_size;
  printf("%s is %d bytes\n", infile, isize);
  FILE *ifp = fopen(infile, "rb");
  if (!ifp) {
    fprintf(stderr, "%s: can't read %s: %s\n", progname, infile,
            strerror(errno));
    exit(1);
  }
  uint8_t *ibuf = malloc(isize);
  if (!ibuf) {
    fprintf(stderr, "%s: can't allocate %d bytes: %s\n", progname, isize,
            strerror(errno));
    goto done1;
  }
  if (1 != fread(ibuf, isize, 1, ifp)) {
    fprintf(stderr, "%s: can't read %d bytes: %s\n", progname, isize,
            strerror(errno));
    goto done2;
  }
  uint32_t ssize = 0, osize = 0;
  int r = GetInfo(ibuf, isize, &osize, &ssize);
  if (r != 0) {
    fprintf(stderr, "%s: GetInfo failed with code %d\n", progname, r);
    goto done2;
  }
  printf("need %d bytes of scratch to produce %d bytes of data\n", ssize,
         osize);
  uint8_t *sbuf = malloc(ssize);
  if (!sbuf) {
    fprintf(stderr, "%s: can't allocate %d bytes: %s\n", progname, ssize,
            strerror(errno));
    goto done2;
  }
  uint8_t *obuf = malloc(osize);
  if (!obuf) {
    fprintf(stderr, "%s: can't allocate %d bytes: %s\n", progname, osize,
            strerror(errno));
    goto done3;
  }
  r = TianoDecompress(ibuf, isize, obuf, osize, sbuf, ssize);
  if (r != 0) {
    fprintf(stderr, "%s: TianoDecompress failed with code %d\n", progname, r);
    r = EfiDecompress(ibuf, isize, obuf, osize, sbuf, ssize);
    if (r != 0) {
      fprintf(stderr, "%s: TianoDecompress failed with code %d\n", progname, r);
      goto done4;
    }
  }
  printf("Uncompressed %d bytes to %d bytes\n", isize, osize);
  FILE *ofp = fopen(outfile, "wb");
  if (!ofp) {
    fprintf(stderr, "%s: can't open %s for writing: %s\n", progname, outfile,
            strerror(errno));
    goto done4;
  }
  if (1 != fwrite(obuf, osize, 1, ofp)) {
    fprintf(stderr, "%s: can't write %d bytes: %s\n", progname, osize,
            strerror(errno));
    goto done5;
  }
  printf("wrote %d bytes to %s\n", osize, outfile);
  retval = 0;
done5:
  fclose(ofp);
done4:
  free(obuf);
done3:
  free(sbuf);
done2:
  free(ibuf);
done1:
  fclose(ifp);
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1090 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1241 <main+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    124c <main+0x5c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     127b <main+0x8b>
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xd96(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   10b0 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     130a <main+0x11a>
mov    0x2d2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    0x2d01(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0x8c(%rbp),%edi
mov    -0x88(%rbp),%rdx
mov    -0x80(%rbp),%rcx
mov    %rax,%r8
lea    0xd24(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x3c(%rbp),%edx
lea    0xd16(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x28(%rbp),%rdi
lea    0xd14(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    13a6 <main+0x1b6>
mov    0x2c95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    0x2c68(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xa4(%rbp),%edi
mov    -0xa0(%rbp),%rdx
mov    -0x98(%rbp),%rcx
mov    %rax,%r8
lea    0xcb2(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    -0x3c(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1417 <main+0x227>
mov    0x2c1c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    0x2bf1(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xb4(%rbp),%edi
mov    -0xb0(%rbp),%rdx
mov    -0xa8(%rbp),%ecx
mov    %rax,%r8
lea    0xc53(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    17c1 <main+0x5d1>
mov    -0x50(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x48(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fread@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1495 <main+0x2a5>
mov    0x2b9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0xb8(%rbp)
mov    0x2b73(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xc4(%rbp),%edi
mov    -0xc0(%rbp),%rdx
mov    -0xb8(%rbp),%ecx
mov    %rax,%r8
lea    0xbf6(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    17b8 <main+0x5c8>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x3c(%rbp),%esi
lea    -0x58(%rbp),%rdx
lea    -0x54(%rbp),%rcx
call   1060 <GetInfo@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     14e7 <main+0x2f7>
mov    0x2b15(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x5c(%rbp),%ecx
lea    0xbc1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    17b8 <main+0x5c8>
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
lea    0xbc9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x54(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    156c <main+0x37c>
mov    0x2ac7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xd4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0xc8(%rbp)
mov    0x2a9c(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xd4(%rbp),%edi
mov    -0xd0(%rbp),%rdx
mov    -0xc8(%rbp),%ecx
mov    %rax,%r8
lea    0xafe(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    17b8 <main+0x5c8>
mov    -0x58(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
jne    15dd <main+0x3ed>
mov    0x2a56(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xe4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0xd8(%rbp)
mov    0x2a2b(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xe4(%rbp),%edi
mov    -0xe0(%rbp),%rdx
mov    -0xd8(%rbp),%ecx
mov    %rax,%r8
lea    0xa8d(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    17af <main+0x5bf>
mov    -0x50(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x70(%rbp),%rdx
mov    -0x58(%rbp),%ecx
mov    -0x68(%rbp),%r8
mov    -0x54(%rbp),%r9d
call   10d0 <TianoDecompress@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     1673 <main+0x483>
mov    0x29d4(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x5c(%rbp),%ecx
lea    0xad7(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x70(%rbp),%rdx
mov    -0x58(%rbp),%ecx
mov    -0x68(%rbp),%r8
mov    -0x54(%rbp),%r9d
call   1030 <EfiDecompress@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x5c(%rbp)
je     166e <main+0x47e>
mov    0x298e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x5c(%rbp),%ecx
lea    0xa91(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    17a6 <main+0x5b6>
jmp    1673 <main+0x483>
mov    -0x3c(%rbp),%esi
mov    -0x58(%rbp),%edx
lea    0xa9c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xaad(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
jne    1703 <main+0x513>
mov    0x2933(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xfc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    0x2906(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0xfc(%rbp),%edi
mov    -0xf8(%rbp),%rdx
mov    -0xf0(%rbp),%rcx
mov    %rax,%r8
lea    0xa4b(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    17a6 <main+0x5b6>
mov    -0x70(%rbp),%rdi
mov    -0x58(%rbp),%esi
mov    -0x78(%rbp),%rcx
mov    $0x1,%edx
call   1100 <fwrite@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1781 <main+0x591>
mov    0x28b2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x100(%rbp)
mov    0x2887(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    -0x10c(%rbp),%edi
mov    -0x108(%rbp),%rdx
mov    -0x100(%rbp),%ecx
mov    %rax,%r8
lea    0x9f0(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
jmp    179d <main+0x5ad>
mov    -0x58(%rbp),%esi
mov    -0x30(%rbp),%rdx
lea    0x9f4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x78(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x70(%rbp),%rdi
call   1040 <free@plt>
mov    -0x68(%rbp),%rdi
call   1040 <free@plt>
mov    -0x50(%rbp),%rdi
call   1040 <free@plt>
mov    -0x48(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x1c(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
mov    (%rsi),%rbp
mov    %rbp,%rdi
mov    $0x2f,%esi
call   1090 <strrchr@plt>
lea    0x1(%rax),%r13
test   %rax,%rax
cmove  %rbp,%r13
cmp    $0x3,%r14d
jne    15a6 <main+0x3b6>
mov    0x8(%rbx),%rbp
mov    0x10(%rbx),%rbx
lea    0x18(%rsp),%rsi
mov    %rbp,%rdi
call   10b0 <stat@plt>
test   %rax,%rax
jne    15ca <main+0x3da>
mov    0x18(%rsp),%r12d
lea    0xde1(%rip),%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xddd(%rip),%rsi
mov    %rbp,%rdi
call   10e0 <fopen@plt>
test   %rax,%rax
je     15ea <main+0x3fa>
mov    %rax,%r14
mov    %r12d,%edi
call   10c0 <malloc@plt>
test   %rax,%rax
je     12f0 <main+0x100>
mov    %rax,%r15
mov    $0x1,%ebp
mov    %rax,%rdi
mov    %r12d,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fread@plt>
cmp    $0x1,%eax
jne    1327 <main+0x137>
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rsp,%rdx
lea    0x4(%rsp),%rcx
mov    %r15,%rdi
mov    %r12d,%esi
call   1060 <GetInfo@plt>
test   %eax,%eax
je     1378 <main+0x188>
mov    0x2d07(%rip),%rcx
mov    (%rcx),%edi
lea    0xdba(%rip),%rsi
mov    %r13,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    1357 <main+0x167>
mov    0x2ce9(%rip),%rax
mov    (%rax),%ebx
mov    0x2cd8(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xd50(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    %r12d,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%ebp
jmp    135f <main+0x16f>
mov    0x2cb2(%rip),%rax
mov    (%rax),%ebx
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xd3a(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    %r12d,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %r15,%rdi
call   1040 <free@plt>
mov    %r14,%rdi
call   1070 <fclose@plt>
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,0x10(%rsp)
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xd32(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%edi
call   10c0 <malloc@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     1440 <main+0x250>
mov    (%rsp),%ebp
mov    %ebp,%edi
call   10c0 <malloc@plt>
test   %rax,%rax
je     14da <main+0x2ea>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %rax,%rdx
mov    %rax,0x8(%rsp)
mov    %ebp,%ecx
mov    0x20(%rsp),%rbp
mov    %rbp,%r8
mov    %ebx,%r9d
call   10d0 <TianoDecompress@plt>
test   %eax,%eax
je     146c <main+0x27c>
mov    0x2bf3(%rip),%rbx
mov    (%rbx),%edi
lea    0xcfd(%rip),%rsi
mov    %r13,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    (%rsp),%ecx
mov    0x4(%rsp),%r9d
mov    %r15,%rdi
mov    %r12d,%esi
mov    0x8(%rsp),%rdx
mov    %rbp,%r8
call   1030 <EfiDecompress@plt>
test   %eax,%eax
je     146c <main+0x27c>
mov    (%rbx),%edi
lea    0xcc9(%rip),%rsi
mov    %r13,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%ebp
jmp    158d <main+0x39d>
mov    0x2b99(%rip),%rax
mov    (%rax),%r12d
mov    0x2b87(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xbff(%rip),%rsi
mov    %r12d,%edi
mov    %r13,%rdx
mov    %ebx,%ecx
jmp    134d <main+0x15d>
mov    (%rsp),%edx
lea    0xca6(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xcb8(%rip),%rsi
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1513 <main+0x323>
mov    %rax,%r12
mov    (%rsp),%esi
mov    $0x1,%ebp
mov    0x8(%rsp),%rdi
mov    $0x1,%edx
mov    %rax,%rcx
call   1100 <fwrite@plt>
cmp    $0x1,%eax
jne    154d <main+0x35d>
mov    (%rsp),%esi
lea    0xcba(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1585 <main+0x395>
mov    0x2aff(%rip),%rax
mov    (%rax),%ebx
mov    0x2aee(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xb66(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    %ebp,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%ebp
jmp    1597 <main+0x3a7>
mov    0x2ac6(%rip),%rax
mov    %rbx,%rbp
mov    (%rax),%ebx
mov    0x2ab2(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xc0e(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%ebp
jmp    158d <main+0x39d>
mov    0x2a8c(%rip),%rax
mov    (%rax),%ebx
mov    (%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x2a74(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xbf3(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    0x10(%rsp),%ecx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %r12,%rdi
call   1070 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
mov    0x20(%rsp),%rdi
call   1040 <free@plt>
jmp    1357 <main+0x167>
mov    0x2a33(%rip),%rax
mov    (%rax),%edi
lea    0xa4a(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
mov    0x2a0f(%rip),%rax
mov    (%rax),%ebx
mov    0x29fe(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xa35(%rip),%rsi
jmp    1608 <main+0x418>
mov    0x29ef(%rip),%rax
mov    (%rax),%ebx
mov    0x29de(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
lea    0xa3f(%rip),%rsi
mov    %ebx,%edi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [29 x i8] c"\0AUsage: %s INFILE OUTFILE\0A\0A\00"
@.str.1 = [23 x i8] c"%s: can't stat %s: %s\0A\00"
@errno = global i32 0
@.str.2 = [16 x i8] c"%s is %d bytes\0A\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [23 x i8] c"%s: can't read %s: %s\0A\00"
@.str.5 = [33 x i8] c"%s: can't allocate %d bytes: %s\0A\00"
@.str.6 = [29 x i8] c"%s: can't read %d bytes: %s\0A\00"
@.str.7 = [33 x i8] c"%s: GetInfo failed with code %d\0A\00"
@.str.8 = [54 x i8] c"need %d bytes of scratch to produce %d bytes of data\0A\00"
@.str.9 = [41 x i8] c"%s: TianoDecompress failed with code %d\0A\00"
@.str.10 = [35 x i8] c"Uncompressed %d bytes to %d bytes\0A\00"
@.str.11 = [3 x i8] c"wb\00"
@.str.12 = [35 x i8] c"%s: can't open %s for writing: %s\0A\00"
@.str.13 = [30 x i8] c"%s: can't write %d bytes: %s\0A\00"
@.str.14 = [22 x i8] c"wrote %d bytes to %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca %struct.stat
%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 i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i8* @strrchr(i8* %22, i8 signext 47)
store i8* %23, i8** %6
%24 = load i8*, i8** %6
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %29
26: ; preds = %2
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %6
br label %33
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
store i8* %32, i8** %6
br label %33
33: ; preds = %29, %26
%34 = load i32, i32* %4
%35 = icmp ne i32 %34, 3
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load i32, i32* @stderr
%38 = load i8*, i8** %6
%39 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %38)
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %33
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
store i8* %44, i8** %8
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
store i8* %47, i8** %9
%48 = load i8*, i8** %8
%49 = call i64 @stat(i8* %48, %struct.stat* %10)
%50 = icmp ne i64 0, %49
br i1 %50, label %51, label %59
51: ; preds = %41
%52 = load i32, i32* @stderr
%53 = load i8*, i8** %6
%54 = load i8*, i8** %8
%55 = load i32, i32* @errno
%56 = call i8* @strerror(i32 %55)
%57 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %53, i8* %54, i8* %56)
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %41
%60 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%61 = load i32, i32* %60
store i32 %61, i32* %11
%62 = load i8*, i8** %8
%63 = load i32, i32* %11
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %62, i32 %63)
%65 = load i8*, i8** %8
%66 = call i32* @fopen(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %66, i32** %12
%67 = load i32*, i32** %12
%68 = icmp ne i32* %67, null
br i1 %68, label %77, label %69
69: ; preds = %59
%70 = load i32, i32* @stderr
%71 = load i8*, i8** %6
%72 = load i8*, i8** %8
%73 = load i32, i32* @errno
%74 = call i8* @strerror(i32 %73)
%75 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %71, i8* %72, i8* %74)
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %59
%78 = load i32, i32* %11
%79 = call i32* @malloc(i32 %78)
store i32* %79, i32** %13
%80 = load i32*, i32** %13
%81 = icmp ne i32* %80, null
br i1 %81, label %89, label %82
82: ; preds = %77
%83 = load i32, i32* @stderr
%84 = load i8*, i8** %6
%85 = load i32, i32* %11
%86 = load i32, i32* @errno
%87 = call i8* @strerror(i32 %86)
%88 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %84, i32 %85, i8* %87)
br label %214
89: ; preds = %77
%90 = load i32*, i32** %13
%91 = load i32, i32* %11
%92 = load i32*, i32** %12
%93 = call i32 @fread(i32* %90, i32 %91, i32 1, i32* %92)
%94 = icmp ne i32 1, %93
br i1 %94, label %95, label %102
95: ; preds = %89
%96 = load i32, i32* @stderr
%97 = load i8*, i8** %6
%98 = load i32, i32* %11
%99 = load i32, i32* @errno
%100 = call i8* @strerror(i32 %99)
%101 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %97, i32 %98, i8* %100)
br label %211
102: ; preds = %89
store i32 0, i32* %14
store i32 0, i32* %15
%103 = load i32*, i32** %13
%104 = load i32, i32* %11
%105 = call i32 @GetInfo(i32* %103, i32 %104, i32* %15, i32* %14)
store i32 %105, i32* %16
%106 = load i32, i32* %16
%107 = icmp ne i32 %106, 0
br i1 %107, label %108, label %113
108: ; preds = %102
%109 = load i32, i32* @stderr
%110 = load i8*, i8** %6
%111 = load i32, i32* %16
%112 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %109, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %110, i32 %111)
br label %211
113: ; preds = %102
%114 = load i32, i32* %14
%115 = load i32, i32* %15
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i32 %114, i32 %115)
%117 = load i32, i32* %14
%118 = call i32* @malloc(i32 %117)
store i32* %118, i32** %17
%119 = load i32*, i32** %17
%120 = icmp ne i32* %119, null
br i1 %120, label %128, label %121
121: ; preds = %113
%122 = load i32, i32* @stderr
%123 = load i8*, i8** %6
%124 = load i32, i32* %14
%125 = load i32, i32* @errno
%126 = call i8* @strerror(i32 %125)
%127 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %123, i32 %124, i8* %126)
br label %211
128: ; preds = %113
%129 = load i32, i32* %15
%130 = call i32* @malloc(i32 %129)
store i32* %130, i32** %18
%131 = load i32*, i32** %18
%132 = icmp ne i32* %131, null
br i1 %132, label %140, label %133
133: ; preds = %128
%134 = load i32, i32* @stderr
%135 = load i8*, i8** %6
%136 = load i32, i32* %15
%137 = load i32, i32* @errno
%138 = call i8* @strerror(i32 %137)
%139 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %134, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %135, i32 %136, i8* %138)
br label %208
140: ; preds = %128
%141 = load i32*, i32** %13
%142 = load i32, i32* %11
%143 = load i32*, i32** %18
%144 = load i32, i32* %15
%145 = load i32*, i32** %17
%146 = load i32, i32* %14
%147 = call i32 @TianoDecompress(i32* %141, i32 %142, i32* %143, i32 %144, i32* %145, i32 %146)
store i32 %147, i32* %16
%148 = load i32, i32* %16
%149 = icmp ne i32 %148, 0
br i1 %149, label %150, label %170
150: ; preds = %140
%151 = load i32, i32* @stderr
%152 = load i8*, i8** %6
%153 = load i32, i32* %16
%154 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), i8* %152, i32 %153)
%155 = load i32*, i32** %13
%156 = load i32, i32* %11
%157 = load i32*, i32** %18
%158 = load i32, i32* %15
%159 = load i32*, i32** %17
%160 = load i32, i32* %14
%161 = call i32 @EfiDecompress(i32* %155, i32 %156, i32* %157, i32 %158, i32* %159, i32 %160)
store i32 %161, i32* %16
%162 = load i32, i32* %16
%163 = icmp ne i32 %162, 0
br i1 %163, label %164, label %169
164: ; preds = %150
%165 = load i32, i32* @stderr
%166 = load i8*, i8** %6
%167 = load i32, i32* %16
%168 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %165, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), i8* %166, i32 %167)
br label %205
169: ; preds = %150
br label %170
170: ; preds = %169, %140
%171 = load i32, i32* %11
%172 = load i32, i32* %15
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %171, i32 %172)
%174 = load i8*, i8** %9
%175 = call i32* @fopen(i8* %174, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
store i32* %175, i32** %19
%176 = load i32*, i32** %19
%177 = icmp ne i32* %176, null
br i1 %177, label %185, label %178
178: ; preds = %170
%179 = load i32, i32* @stderr
%180 = load i8*, i8** %6
%181 = load i8*, i8** %9
%182 = load i32, i32* @errno
%183 = call i8* @strerror(i32 %182)
%184 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0), i8* %180, i8* %181, i8* %183)
br label %205
185: ; preds = %170
%186 = load i32*, i32** %18
%187 = load i32, i32* %15
%188 = load i32*, i32** %19
%189 = call i32 @fwrite(i32* %186, i32 %187, i32 1, i32* %188)
%190 = icmp ne i32 1, %189
br i1 %190, label %191, label %198
191: ; preds = %185
%192 = load i32, i32* @stderr
%193 = load i8*, i8** %6
%194 = load i32, i32* %15
%195 = load i32, i32* @errno
%196 = call i8* @strerror(i32 %195)
%197 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %192, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i8* %193, i32 %194, i8* %196)
br label %202
198: ; preds = %185
%199 = load i32, i32* %15
%200 = load i8*, i8** %9
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i32 %199, i8* %200)
store i32 0, i32* %7
br label %202
202: ; preds = %198, %191
%203 = load i32*, i32** %19
%204 = call i32 @fclose(i32* %203)
br label %205
205: ; preds = %202, %178, %164
%206 = load i32*, i32** %18
%207 = call i32 @free(i32* %206)
br label %208
208: ; preds = %205, %133
%209 = load i32*, i32** %17
%210 = call i32 @free(i32* %209)
br label %211
211: ; preds = %208, %121, %108, %95
%212 = load i32*, i32** %13
%213 = call i32 @free(i32* %212)
br label %214
214: ; preds = %211, %82
%215 = load i32*, i32** %12
%216 = call i32 @fclose(i32* %215)
%217 = load i32, i32* %7
ret i32 %217
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [29 x i8] c"\0AUsage: %s INFILE OUTFILE\0A\0A\00"
@.str.1 = [23 x i8] c"%s: can't stat %s: %s\0A\00"
@errno = global i32 0
@.str.2 = [16 x i8] c"%s is %d bytes\0A\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [23 x i8] c"%s: can't read %s: %s\0A\00"
@.str.5 = [33 x i8] c"%s: can't allocate %d bytes: %s\0A\00"
@.str.6 = [29 x i8] c"%s: can't read %d bytes: %s\0A\00"
@.str.7 = [33 x i8] c"%s: GetInfo failed with code %d\0A\00"
@.str.8 = [54 x i8] c"need %d bytes of scratch to produce %d bytes of data\0A\00"
@.str.9 = [41 x i8] c"%s: TianoDecompress failed with code %d\0A\00"
@.str.10 = [35 x i8] c"Uncompressed %d bytes to %d bytes\0A\00"
@.str.11 = [3 x i8] c"wb\00"
@.str.12 = [35 x i8] c"%s: can't open %s for writing: %s\0A\00"
@.str.13 = [30 x i8] c"%s: can't write %d bytes: %s\0A\00"
@.str.14 = [22 x i8] c"wrote %d bytes to %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca i32
%5 = alloca i32
%6 = load i8*, i8** %1
%7 = tail call i8* @strrchr(i8* dereferenceable(1) %6, i8 signext 47)
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %6, i8* %9
%11 = icmp eq i32 %0, 3
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %10)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = bitcast %struct.stat* %3 to i8*
%22 = call i64 @stat(i8* %18, %struct.stat* %3)
%23 = icmp eq i64 %22, 0
br i1 %23, label %30, label %24
24: ; preds = %16
%25 = load i32, i32* @stderr
%26 = load i32, i32* @errno
%27 = call i8* @strerror(i32 %26)
%28 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %18, i8* %27)
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %16
%31 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %18, i32 %32)
%34 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %42
36: ; preds = %30
%37 = load i32, i32* @stderr
%38 = load i32, i32* @errno
%39 = call i8* @strerror(i32 %38)
%40 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %10, i8* %18, i8* %39)
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %30
%43 = call i32* @malloc(i32 %32)
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = load i32, i32* @stderr
%47 = load i32, i32* @errno
%48 = call i8* @strerror(i32 %47)
%49 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %10, i32 %32, i8* %48)
br label %133
50: ; preds = %42
%51 = call i32 @fread(i32* %43, i32 %32, i32 1, i32* %34)
%52 = icmp eq i32 %51, 1
br i1 %52, label %58, label %53
53: ; preds = %50
%54 = load i32, i32* @stderr
%55 = load i32, i32* @errno
%56 = call i8* @strerror(i32 %55)
%57 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %10, i32 %32, i8* %56)
br label %130
58: ; preds = %50
store i32 0, i32* %4
store i32 0, i32* %5
%59 = call i32 @GetInfo(i32* %43, i32 %32, i32* %5, i32* %4)
%60 = icmp eq i32 %59, 0
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i8* %10, i32 %59)
br label %130
64: ; preds = %58
%65 = load i32, i32* %4
%66 = load i32, i32* %5
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0), i32 %65, i32 %66)
%68 = load i32, i32* %4
%69 = call i32* @malloc(i32 %68)
%70 = icmp eq i32* %69, null
br i1 %70, label %71, label %76
71: ; preds = %64
%72 = load i32, i32* @stderr
%73 = load i32, i32* @errno
%74 = call i8* @strerror(i32 %73)
%75 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %10, i32 %68, i8* %74)
br label %130
76: ; preds = %64
%77 = load i32, i32* %5
%78 = call i32* @malloc(i32 %77)
%79 = icmp eq i32* %78, null
br i1 %79, label %80, label %85
80: ; preds = %76
%81 = load i32, i32* @stderr
%82 = load i32, i32* @errno
%83 = call i8* @strerror(i32 %82)
%84 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %10, i32 %77, i8* %83)
br label %127
85: ; preds = %76
%86 = call i32 @TianoDecompress(i32* %43, i32 %32, i32* %78, i32 %77, i32* %69, i32 %68)
%87 = icmp eq i32 %86, 0
br i1 %87, label %98, label %88
88: ; preds = %85
%89 = load i32, i32* @stderr
%90 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), i8* %10, i32 %86)
%91 = load i32, i32* %5
%92 = load i32, i32* %4
%93 = call i32 @EfiDecompress(i32* %43, i32 %32, i32* %78, i32 %91, i32* %69, i32 %92)
%94 = icmp eq i32 %93, 0
br i1 %94, label %98, label %95
95: ; preds = %88
%96 = load i32, i32* @stderr
%97 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), i8* %10, i32 %93)
br label %124
98: ; preds = %88, %85
%99 = load i32, i32* %5
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0), i32 %32, i32 %99)
%101 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%102 = icmp eq i32* %101, null
br i1 %102, label %103, label %108
103: ; preds = %98
%104 = load i32, i32* @stderr
%105 = load i32, i32* @errno
%106 = call i8* @strerror(i32 %105)
%107 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %104, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0), i8* %10, i8* %20, i8* %106)
br label %124
108: ; preds = %98
%109 = load i32, i32* %5
%110 = call i32 @fwrite(i32* %78, i32 %109, i32 1, i32* %101)
%111 = icmp eq i32 %110, 1
br i1 %111, label %118, label %112
112: ; preds = %108
%113 = load i32, i32* @stderr
%114 = load i32, i32* %5
%115 = load i32, i32* @errno
%116 = call i8* @strerror(i32 %115)
%117 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), i8* %10, i32 %114, i8* %116)
br label %121
118: ; preds = %108
%119 = load i32, i32* %5
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i32 %119, i8* %20)
br label %121
121: ; preds = %118, %112
%122 = phi i32 [ 1, %112 ], [ 0, %118 ]
%123 = call i32 @fclose(i32* %101)
br label %124
124: ; preds = %121, %103, %95
%125 = phi i32 [ 1, %95 ], [ %122, %121 ], [ 1, %103 ]
%126 = call i32 @free(i32* %78)
br label %127
127: ; preds = %124, %80
%128 = phi i32 [ %125, %124 ], [ 1, %80 ]
%129 = call i32 @free(i32* %69)
br label %130
130: ; preds = %127, %71, %61, %53
%131 = phi i32 [ 1, %53 ], [ 1, %61 ], [ %128, %127 ], [ 1, %71 ]
%132 = call i32 @free(i32* %43)
br label %133
133: ; preds = %130, %45
%134 = phi i32 [ %131, %130 ], [ 1, %45 ]
%135 = call i32 @fclose(i32* %34)
ret i32 %134
}