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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
size_t fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/);
scalar_t__ ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ is_cpio(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
size_t strlen(char *);
int main(int argc, char **argv) {
  FILE *f, *output;
  char magic[strlen("070701") + 1];
  char *buffer;
  char *separator_current;
  buffer = (char *)malloc(1024);
  size_t s;
  size_t pos;
  size_t target_index = 0;
  char *separator_head = "TRAILER!!!";
  char *buffer_head = buffer;
  separator_current = separator_head;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s <packed initrd> <output>\n", argv[0]);
    exit(1);
  }
  f = fopen(argv[1], "rb");
  if (f == NULL) {
    fprintf(stderr, "Could not open file '%s'\n", argv[1]);
    exit(1);
  }
  if (fread(magic, 1, strlen("070701"), f) < strlen("070701")) {
    fprintf(stderr, "Error reading signature from file '%s'\n", argv[1]);
    fclose(f);
    exit(1);
  }
  if (!is_cpio(magic)) {
    fprintf(stderr, "File '%s' is missing CPIO signature\n", argv[1]);
    fclose(f);
    exit(1);
  }
  while (!feof(f)) {
    bool match = false;
    size_t buffer_index;
    size_t match_index = 0;
    buffer_index = 0;
    pos = (size_t)ftell(f);
    s = fread(buffer, 1, 1024, f);
    if (!s) {
      fprintf(stderr, "Error reading from file? Could this ever happen due to "
                      "EOF? Maybe, if things were perfectly aligned");
      fclose(f);
      exit(1);
    }
    while (buffer_index <= s) {
      if (*buffer == *separator_current) {
        size_t matches = 1;
        match = true;
        match_index = buffer_index;
        buffer++;
        separator_current++;
        while (*separator_current) {
          if (buffer_index == s)
            fread(buffer, 1, strlen("TRAILER!!!") - matches, f);
          match &= *buffer == *separator_current;
          buffer_index++;
          if (!match) {
            separator_current = separator_head;
            break;
          }
          buffer++;
          matches++;
          separator_current++;
        }
      }
      if (match) {
        target_index = pos + match_index;
        break;
      }
      buffer++;
      buffer_index++;
    }
    buffer = buffer_head;
    if (match) {
      break;
    }
  }
  if (!target_index) {
    fprintf(stderr,
            "Could not find '%s' in file, perhaps you don't need this?\n",
            "TRAILER!!!");
    exit(1);
  }
  fseek(f, target_index + strlen("TRAILER!!!"), SEEK_SET);
  pos = target_index + strlen("TRAILER!!!");
  while (!feof(f)) {
    s = fread(buffer, 1, 1024, f);
    size_t i;
    for (i = 0; i < s && buffer[i] == 0; i++)
      ;
    if (buffer[i] != 0) {
      pos += i;
      fseek(f, pos, SEEK_SET);
      break;
    }
  }
  fprintf(stdout, "TRAILER HEAD: %li, FILE POS: %zu\n", target_index, pos);
  if ((output = fopen(argv[2], "w")) == NULL) {
    fprintf(stderr, "Could not open file '%s'\n", argv[2]);
    exit(1);
  }
  fseek(f, pos, SEEK_SET);
  while (!feof(f)) {
    s = fread(buffer, 1, 1024, f);
    fwrite(buffer, 1, s, output);
  }
  fclose(f);
  fclose(output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe20(%rip),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdx
mov    %rdx,%rax
add    $0x1,%rax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
add    $0x10,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    $0x400,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x58(%rbp)
lea    0xdd8(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x40(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1275 <main+0xb5>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb2(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12c1 <main+0x101>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd89(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
lea    0xd38(%rip),%rdi
call   1060 <strlen@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    %rax,-0xa0(%rbp)
lea    0xd0e(%rip),%rdi
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0xa0(%rbp),%rax
cmp    %rcx,%rax
jae    133c <main+0x17c>
mov    0x2ccf(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd31(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x98(%rbp),%rdi
call   1030 <is_cpio@plt>
cmp    $0x0,%eax
jne    1383 <main+0x1c3>
mov    0x2c88(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd12(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    1388 <main+0x1c8>
mov    -0x18(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13a6 <main+0x1e6>
jmp    158e <main+0x3ce>
movl   $0x0,-0x6c(%rbp)
movq   $0x0,-0x80(%rbp)
movq   $0x0,-0x78(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <ftell@plt>
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   1040 <fread@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    141a <main+0x25a>
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
lea    0xca0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    141f <main+0x25f>
mov    -0x78(%rbp),%rax
cmp    -0x48(%rbp),%rax
ja     1572 <main+0x3b2>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
mov    -0x40(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    153a <main+0x37a>
movq   $0x1,-0x88(%rbp)
movl   $0x1,-0x6c(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmpb   $0x0,(%rax)
je     1535 <main+0x375>
mov    -0x78(%rbp),%rax
cmp    -0x48(%rbp),%rax
jne    14c5 <main+0x305>
mov    -0x38(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    0xb65(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xa8(%rbp),%rdi
sub    -0x88(%rbp),%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
mov    -0x40(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
and    -0x6c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jne    1506 <main+0x346>
mov    -0x60(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    1535 <main+0x375>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1475 <main+0x2b5>
jmp    153a <main+0x37a>
cmpl   $0x0,-0x6c(%rbp)
je     1555 <main+0x395>
mov    -0x50(%rbp),%rax
add    -0x80(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    1572 <main+0x3b2>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    141f <main+0x25f>
mov    -0x68(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x0,-0x6c(%rbp)
je     1589 <main+0x3c9>
jmp    158e <main+0x3ce>
jmp    1388 <main+0x1c8>
cmpq   $0x0,-0x58(%rbp)
jne    15c1 <main+0x401>
mov    0x2a40(%rip),%rax
mov    (%rax),%edi
lea    0xb5b(%rip),%rsi
lea    0xa57(%rip),%rdx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    0xa29(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xc0(%rbp),%rsi
mov    -0xb8(%rbp),%rdi
add    %rax,%rsi
mov    0x29dd(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
mov    -0x58(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    0x9f3(%rip),%rdi
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0xb0(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1648 <main+0x488>
jmp    1718 <main+0x558>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   1040 <fread@plt>
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x90(%rbp)
mov    -0x90(%rbp),%rcx
xor    %eax,%eax
cmp    -0x48(%rbp),%rcx
mov    %al,-0xc1(%rbp)
jae    16a2 <main+0x4e2>
mov    -0x38(%rbp),%rax
mov    -0x90(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xc1(%rbp)
mov    -0xc1(%rbp),%al
test   $0x1,%al
jne    16b5 <main+0x4f5>
jmp    16d1 <main+0x511>
jmp    16ba <main+0x4fa>
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
jmp    166e <main+0x4ae>
mov    -0x38(%rbp),%rax
mov    -0x90(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1713 <main+0x553>
mov    -0x90(%rbp),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    0x28d1(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
jmp    1718 <main+0x558>
jmp    162a <main+0x46a>
mov    0x28b1(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
mov    -0x50(%rbp),%rcx
lea    0xa0f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xa1b(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1782 <main+0x5c2>
mov    0x2880(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0x8c8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    0x2847(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    17b6 <main+0x5f6>
jmp    17ec <main+0x62c>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x400,%edx
call   1040 <fread@plt>
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   10e0 <fwrite@plt>
jmp    1798 <main+0x5d8>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%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,%rbp
mov    %edi,%r14d
mov    $0x400,%edi
call   1090 <malloc@plt>
cmp    $0x3,%r14d
jne    15cf <main+0x41f>
mov    %rax,%rbx
mov    %rbp,(%rsp)
mov    0x8(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     15e5 <main+0x435>
mov    %rax,%r13
lea    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    %rax,%rcx
call   1040 <fread@plt>
cmp    $0x5,%rax
jbe    15f8 <main+0x448>
lea    0x10(%rsp),%rdi
call   1030 <is_cpio@plt>
test   %eax,%eax
je     1612 <main+0x462>
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
je     1377 <main+0x1c7>
xor    %ebp,%ebp
test   %rbp,%rbp
je     158a <main+0x3da>
lea    0xa(%rbp),%r14
mov    0x2d84(%rip),%r15
mov    (%r15),%edx
mov    %r13,%rdi
mov    %r14,%rsi
call   10a0 <fseek@plt>
jmp    1276 <main+0xc6>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,(%rbx,%rcx,1)
jne    12b4 <main+0x104>
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    12c5 <main+0x115>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
xor    %ecx,%ecx
test   %rax,%rax
je     1270 <main+0xc0>
xchg   %ax,%ax
cmpb   $0x0,(%rbx,%rcx,1)
jne    1270 <main+0xc0>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    12a0 <main+0xf0>
mov    %rax,%rcx
jmp    1270 <main+0xc0>
add    %rcx,%r14
mov    (%r15),%edx
mov    %r13,%rdi
mov    %r14,%rsi
call   10a0 <fseek@plt>
mov    0x2d04(%rip),%rax
mov    (%rax),%edi
lea    0xe63(%rip),%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rsp),%r12
mov    0x10(%r12),%rdi
lea    0xe68(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1633 <main+0x483>
mov    %rax,%rbp
mov    (%r15),%edx
mov    %r13,%rdi
mov    %r14,%rsi
call   10a0 <fseek@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    1356 <main+0x1a6>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %rax,%rdx
mov    %rbp,%rcx
call   10d0 <fwrite@plt>
jmp    1320 <main+0x170>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,0x8(%rsp)
jmp    1395 <main+0x1e5>
xchg   %ax,%ax
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
mov    0x8(%rsp),%rbx
jne    123e <main+0x8e>
mov    %r13,%rdi
call   1070 <ftell@plt>
mov    %rax,0x20(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x400,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
test   %rax,%rax
je     15a6 <main+0x3f6>
mov    %rax,%rbp
xor    %r15d,%r15d
mov    %rbx,%r14
jmp    13e3 <main+0x233>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%r14
mov    %rax,%r15
add    $0x1,%r14
add    $0x1,%r15
cmp    %rbp,%r15
ja     1380 <main+0x1d0>
cmpb   $0x54,(%r14)
jne    13d6 <main+0x226>
lea    0x1(%r14),%rbx
cmp    %rbp,%r15
jne    1407 <main+0x257>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x9,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
lea    0x1(%r15),%rax
cmpb   $0x52,(%rbx)
jne    13d0 <main+0x220>
lea    0x2(%r14),%r12
cmp    %rbp,%rax
jne    142e <main+0x27e>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
lea    0x2(%r15),%rax
cmpb   $0x41,(%r12)
jne    156c <main+0x3bc>
lea    0x3(%r14),%rbx
cmp    %rbp,%rax
jne    145b <main+0x2ab>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x7,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
lea    0x3(%r15),%rax
cmpb   $0x49,(%rbx)
jne    13d0 <main+0x220>
lea    0x4(%r14),%rbx
cmp    %rbp,%rax
jne    1486 <main+0x2d6>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
lea    0x4(%r15),%rax
cmpb   $0x4c,(%rbx)
jne    13d0 <main+0x220>
lea    0x5(%r14),%rbx
cmp    %rbp,%rax
jne    14b1 <main+0x301>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x5,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
lea    0x5(%r15),%rax
cmpb   $0x45,(%rbx)
jne    13d0 <main+0x220>
lea    0x6(%r14),%rbx
cmp    %rbp,%rax
jne    14dc <main+0x32c>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
lea    0x6(%r15),%rax
cmpb   $0x52,(%rbx)
jne    13d0 <main+0x220>
lea    0x7(%r14),%rbx
cmp    %rbp,%rax
jne    1507 <main+0x357>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
lea    0x7(%r15),%rax
cmpb   $0x21,(%rbx)
jne    13d0 <main+0x220>
lea    0x8(%r14),%rbx
cmp    %rbp,%rax
jne    1532 <main+0x382>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
lea    0x8(%r15),%rax
cmpb   $0x21,(%rbx)
jne    13d0 <main+0x220>
add    $0x9,%r14
cmp    %rbp,%rax
jne    155d <main+0x3ad>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1040 <fread@plt>
cmpb   $0x21,(%r14)
je     1574 <main+0x3c4>
add    $0x9,%r15
jmp    13d6 <main+0x226>
mov    %r12,%r14
jmp    13d3 <main+0x223>
add    0x20(%rsp),%r15
mov    %r15,%rbp
mov    0x8(%rsp),%rbx
test   %rbp,%rbp
jne    1249 <main+0x99>
mov    0x2a4f(%rip),%rax
mov    (%rax),%edi
lea    0xb63(%rip),%rsi
lea    0xa5f(%rip),%rdx
jmp    1648 <main+0x498>
mov    0x2a33(%rip),%rax
mov    (%rax),%edi
lea    0xae3(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2a0a(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xa28(%rip),%rsi
jmp    1648 <main+0x498>
mov    0x29f4(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rax
mov    0x8(%rax),%rdx
jmp    1641 <main+0x491>
mov    0x29e1(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rax
mov    0x8(%rax),%rdx
lea    0xa3c(%rip),%rsi
jmp    162a <main+0x47a>
mov    0x29c7(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rax
mov    0x8(%rax),%rdx
lea    0xa4a(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    15bd <main+0x40d>
mov    0x29a6(%rip),%rax
mov    (%rax),%edi
mov    0x10(%r12),%rdx
lea    0x9ea(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"070701\00"
@.str.1 = [11 x i8] c"TRAILER!!!\00"
@stderr = global i32 0
@.str.2 = [36 x i8] c"Usage: %s <packed initrd> <output>\0A\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [26 x i8] c"Could not open file '%s'\0A\00"
@.str.5 = [40 x i8] c"Error reading signature from file '%s'\0A\00"
@.str.6 = [37 x i8] c"File '%s' is missing CPIO signature\0A\00"
@.str.7 = [100 x i8] c"Error reading from file? Could this ever happen due to EOF? Maybe, if things were perfectly aligned\00"
@.str.8 = [59 x i8] c"Could not find '%s' in file, perhaps you don't need this?\0A\00"
@SEEK_SET = global i32 0
@stdout = global i32 0
@.str.9 = [34 x i8] c"TRAILER HEAD: %li, FILE POS: %zu\0A\00"
@.str.10 = [2 x i8] c"w\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 i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = call i64 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%23 = add i64 %22, 1
%24 = call i8* @llvm.stacksave()
store i8* %24, i8** %8
%25 = alloca i8, i64 %23
store i64 %23, i64* %9
%26 = call i64 @malloc(i32 1024)
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %10
store i64 0, i64* %14
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %15
%28 = load i8*, i8** %10
store i8* %28, i8** %16
%29 = load i8*, i8** %15
store i8* %29, i8** %11
%30 = load i32, i32* %4
%31 = icmp ne i32 %30, 3
br i1 %31, label %32, label %39
32: ; preds = %2
%33 = load i32, i32* @stderr
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %36)
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %2
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32* @fopen(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %43, i32** %6
%44 = load i32*, i32** %6
%45 = icmp eq i32* %44, null
br i1 %45, label %46, label %53
46: ; preds = %39
%47 = load i32, i32* @stderr
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %50)
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %39
%54 = call i64 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%55 = trunc i64 %54 to i32
%56 = load i32*, i32** %6
%57 = call i64 @fread(i8* %25, i32 1, i32 %55, i32* %56)
%58 = call i64 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%59 = icmp ult i64 %57, %58
br i1 %59, label %60, label %69
60: ; preds = %53
%61 = load i32, i32* @stderr
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 1
%64 = load i8*, i8** %63
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8* %64)
%66 = load i32*, i32** %6
%67 = call i32 @fclose(i32* %66)
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %53
%70 = call i32 @is_cpio(i8* %25)
%71 = icmp ne i32 %70, 0
br i1 %71, label %81, label %72
72: ; preds = %69
%73 = load i32, i32* @stderr
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 1
%76 = load i8*, i8** %75
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* %76)
%78 = load i32*, i32** %6
%79 = call i32 @fclose(i32* %78)
%80 = call i32 @exit(i32 1)
unreachable
81: ; preds = %69
br label %82
82: ; preds = %178, %81
%83 = load i32*, i32** %6
%84 = call i32 @feof(i32* %83)
%85 = icmp ne i32 %84, 0
%86 = xor i1 %85, true
br i1 %86, label %87, label %179
87: ; preds = %82
store i32 0, i32* %17
store i64 0, i64* %19
store i64 0, i64* %18
%88 = load i32*, i32** %6
%89 = call i64 @ftell(i32* %88)
store i64 %89, i64* %13
%90 = load i8*, i8** %10
%91 = load i32*, i32** %6
%92 = call i64 @fread(i8* %90, i32 1, i32 1024, i32* %91)
store i64 %92, i64* %12
%93 = load i64, i64* %12
%94 = icmp ne i64 %93, 0
br i1 %94, label %101, label %95
95: ; preds = %87
%96 = load i32, i32* @stderr
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %96, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.7, i64 0, i64 0))
%98 = load i32*, i32** %6
%99 = call i32 @fclose(i32* %98)
%100 = call i32 @exit(i32 1)
unreachable
101: ; preds = %87
br label %102
102: ; preds = %168, %101
%103 = load i64, i64* %18
%104 = load i64, i64* %12
%105 = icmp ule i64 %103, %104
br i1 %105, label %106, label %173
106: ; preds = %102
%107 = load i8*, i8** %10
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = load i8*, i8** %11
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %109, %112
br i1 %113, label %114, label %161
114: ; preds = %106
store i64 1, i64* %20
store i32 1, i32* %17
%115 = load i64, i64* %18
store i64 %115, i64* %19
%116 = load i8*, i8** %10
%117 = getelementptr inbounds i8, i8* %116, i32 1
store i8* %117, i8** %10
%118 = load i8*, i8** %11
%119 = getelementptr inbounds i8, i8* %118, i32 1
store i8* %119, i8** %11
br label %120
120: ; preds = %153, %114
%121 = load i8*, i8** %11
%122 = load i8, i8* %121
%123 = icmp ne i8 %122, 0
br i1 %123, label %124, label %160
124: ; preds = %120
%125 = load i64, i64* %18
%126 = load i64, i64* %12
%127 = icmp eq i64 %125, %126
br i1 %127, label %128, label %136
128: ; preds = %124
%129 = load i8*, i8** %10
%130 = call i64 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%131 = load i64, i64* %20
%132 = sub i64 %130, %131
%133 = trunc i64 %132 to i32
%134 = load i32*, i32** %6
%135 = call i64 @fread(i8* %129, i32 1, i32 %133, i32* %134)
br label %136
136: ; preds = %128, %124
%137 = load i8*, i8** %10
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
%140 = load i8*, i8** %11
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp eq i32 %139, %142
%144 = zext i1 %143 to i32
%145 = load i32, i32* %17
%146 = and i32 %145, %144
store i32 %146, i32* %17
%147 = load i64, i64* %18
%148 = add i64 %147, 1
store i64 %148, i64* %18
%149 = load i32, i32* %17
%150 = icmp ne i32 %149, 0
br i1 %150, label %153, label %151
151: ; preds = %136
%152 = load i8*, i8** %15
store i8* %152, i8** %11
br label %160
153: ; preds = %136
%154 = load i8*, i8** %10
%155 = getelementptr inbounds i8, i8* %154, i32 1
store i8* %155, i8** %10
%156 = load i64, i64* %20
%157 = add i64 %156, 1
store i64 %157, i64* %20
%158 = load i8*, i8** %11
%159 = getelementptr inbounds i8, i8* %158, i32 1
store i8* %159, i8** %11
br label %120
160: ; preds = %151, %120
br label %161
161: ; preds = %160, %106
%162 = load i32, i32* %17
%163 = icmp ne i32 %162, 0
br i1 %163, label %164, label %168
164: ; preds = %161
%165 = load i64, i64* %13
%166 = load i64, i64* %19
%167 = add i64 %165, %166
store i64 %167, i64* %14
br label %173
168: ; preds = %161
%169 = load i8*, i8** %10
%170 = getelementptr inbounds i8, i8* %169, i32 1
store i8* %170, i8** %10
%171 = load i64, i64* %18
%172 = add i64 %171, 1
store i64 %172, i64* %18
br label %102
173: ; preds = %164, %102
%174 = load i8*, i8** %16
store i8* %174, i8** %10
%175 = load i32, i32* %17
%176 = icmp ne i32 %175, 0
br i1 %176, label %177, label %178
177: ; preds = %173
br label %179
178: ; preds = %173
br label %82
179: ; preds = %177, %82
%180 = load i64, i64* %14
%181 = icmp ne i64 %180, 0
br i1 %181, label %186, label %182
182: ; preds = %179
%183 = load i32, i32* @stderr
%184 = call i32 (i32, i8*, ...) @fprintf(i32 %183, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%185 = call i32 @exit(i32 1)
unreachable
186: ; preds = %179
%187 = load i32*, i32** %6
%188 = load i64, i64* %14
%189 = call i64 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%190 = add i64 %188, %189
%191 = load i32, i32* @SEEK_SET
%192 = call i32 @fseek(i32* %187, i64 %190, i32 %191)
%193 = load i64, i64* %14
%194 = call i64 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%195 = add i64 %193, %194
store i64 %195, i64* %13
br label %196
196: ; preds = %237, %186
%197 = load i32*, i32** %6
%198 = call i32 @feof(i32* %197)
%199 = icmp ne i32 %198, 0
%200 = xor i1 %199, true
br i1 %200, label %201, label %238
201: ; preds = %196
%202 = load i8*, i8** %10
%203 = load i32*, i32** %6
%204 = call i64 @fread(i8* %202, i32 1, i32 1024, i32* %203)
store i64 %204, i64* %12
store i64 0, i64* %21
br label %205
205: ; preds = %219, %201
%206 = load i64, i64* %21
%207 = load i64, i64* %12
%208 = icmp ult i64 %206, %207
br i1 %208, label %209, label %216
209: ; preds = %205
%210 = load i8*, i8** %10
%211 = load i64, i64* %21
%212 = getelementptr inbounds i8, i8* %210, i64 %211
%213 = load i8, i8* %212
%214 = sext i8 %213 to i32
%215 = icmp eq i32 %214, 0
br label %216
216: ; preds = %209, %205
%217 = phi i1 [ false, %205 ], [ %215, %209 ]
br i1 %217, label %218, label %222
218: ; preds = %216
br label %219
219: ; preds = %218
%220 = load i64, i64* %21
%221 = add i64 %220, 1
store i64 %221, i64* %21
br label %205
222: ; preds = %216
%223 = load i8*, i8** %10
%224 = load i64, i64* %21
%225 = getelementptr inbounds i8, i8* %223, i64 %224
%226 = load i8, i8* %225
%227 = sext i8 %226 to i32
%228 = icmp ne i32 %227, 0
br i1 %228, label %229, label %237
229: ; preds = %222
%230 = load i64, i64* %21
%231 = load i64, i64* %13
%232 = add i64 %231, %230
store i64 %232, i64* %13
%233 = load i32*, i32** %6
%234 = load i64, i64* %13
%235 = load i32, i32* @SEEK_SET
%236 = call i32 @fseek(i32* %233, i64 %234, i32 %235)
br label %238
237: ; preds = %222
br label %196
238: ; preds = %229, %196
%239 = load i32, i32* @stdout
%240 = load i64, i64* %14
%241 = load i64, i64* %13
%242 = call i32 (i32, i8*, ...) @fprintf(i32 %239, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i64 %240, i64 %241)
%243 = load i8**, i8*** %5
%244 = getelementptr inbounds i8*, i8** %243, i64 2
%245 = load i8*, i8** %244
%246 = call i32* @fopen(i8* %245, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %246, i32** %7
%247 = icmp eq i32* %246, null
br i1 %247, label %248, label %255
248: ; preds = %238
%249 = load i32, i32* @stderr
%250 = load i8**, i8*** %5
%251 = getelementptr inbounds i8*, i8** %250, i64 2
%252 = load i8*, i8** %251
%253 = call i32 (i32, i8*, ...) @fprintf(i32 %249, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %252)
%254 = call i32 @exit(i32 1)
unreachable
255: ; preds = %238
%256 = load i32*, i32** %6
%257 = load i64, i64* %13
%258 = load i32, i32* @SEEK_SET
%259 = call i32 @fseek(i32* %256, i64 %257, i32 %258)
br label %260
260: ; preds = %265, %255
%261 = load i32*, i32** %6
%262 = call i32 @feof(i32* %261)
%263 = icmp ne i32 %262, 0
%264 = xor i1 %263, true
br i1 %264, label %265, label %273
265: ; preds = %260
%266 = load i8*, i8** %10
%267 = load i32*, i32** %6
%268 = call i64 @fread(i8* %266, i32 1, i32 1024, i32* %267)
store i64 %268, i64* %12
%269 = load i8*, i8** %10
%270 = load i64, i64* %12
%271 = load i32*, i32** %7
%272 = call i32 @fwrite(i8* %269, i32 1, i64 %270, i32* %271)
br label %260
273: ; preds = %260
%274 = load i32*, i32** %6
%275 = call i32 @fclose(i32* %274)
%276 = load i32*, i32** %7
%277 = call i32 @fclose(i32* %276)
store i32 0, i32* %3
%278 = load i8*, i8** %8
%279 = load i32, i32* %3
ret i32 %279
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"TRAILER!!!\00"
@stderr = global i32 0
@.str.2 = [36 x i8] c"Usage: %s <packed initrd> <output>\0A\00"
@.str.3 = [3 x i8] c"rb\00"
@.str.4 = [26 x i8] c"Could not open file '%s'\0A\00"
@.str.5 = [40 x i8] c"Error reading signature from file '%s'\0A\00"
@.str.6 = [37 x i8] c"File '%s' is missing CPIO signature\0A\00"
@.str.7 = [100 x i8] c"Error reading from file? Could this ever happen due to EOF? Maybe, if things were perfectly aligned\00"
@.str.8 = [59 x i8] c"Could not find '%s' in file, perhaps you don't need this?\0A\00"
@SEEK_SET = global i32 0
@stdout = global i32 0
@.str.9 = [34 x i8] c"TRAILER HEAD: %li, FILE POS: %zu\0A\00"
@.str.10 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%5 = tail call i64 @malloc(i32 1024)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i32* @fopen(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %14
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %20)
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %13
%24 = call i64 @fread(i8* %4, i32 1, i32 6, i32* %16)
%25 = icmp ult i64 %24, 6
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i32, i32* @stderr
%28 = load i8*, i8** %14
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8* %28)
%30 = tail call i32 @fclose(i32* %16)
%31 = tail call i32 @exit(i32 1)
unreachable
32: ; preds = %23
%33 = call i32 @is_cpio(i8* %4)
%34 = icmp eq i32 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = call i32 @feof(i32* %16)
%37 = icmp eq i32 %36, 0
br i1 %37, label %47, label %150
38: ; preds = %32
%39 = load i32, i32* @stderr
%40 = load i8*, i8** %14
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i8* %40)
%42 = call i32 @fclose(i32* %16)
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %144
%45 = call i32 @feof(i32* %16)
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %150
47: ; preds = %35, %44
%48 = call i64 @ftell(i32* %16)
%49 = call i64 @fread(i8* %6, i32 1, i32 1024, i32* %16)
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %56
51: ; preds = %47
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.7, i64 0, i64 0))
%54 = call i32 @fclose(i32* %16)
%55 = call i32 @exit(i32 1)
unreachable
56: ; preds = %47, %144
%57 = phi i64 [ %148, %144 ], [ 0, %47 ]
%58 = phi i8* [ %147, %144 ], [ %6, %47 ]
%59 = load i8, i8* %58
%60 = icmp eq i8 %59, 84
br i1 %60, label %135, label %144
61: ; preds = %140
%62 = getelementptr inbounds i8, i8* %58, i64 2
%63 = icmp eq i64 %143, %49
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = call i64 @fread(i8* %62, i32 1, i32 8, i32* %16)
br label %66
66: ; preds = %64, %61
%67 = load i8, i8* %62
%68 = icmp eq i8 %67, 65
%69 = add i64 %57, 2
br i1 %68, label %70, label %144
70: ; preds = %66
%71 = getelementptr inbounds i8, i8* %58, i64 3
%72 = icmp eq i64 %69, %49
br i1 %72, label %73, label %75
73: ; preds = %70
%74 = call i64 @fread(i8* %71, i32 1, i32 7, i32* %16)
br label %75
75: ; preds = %73, %70
%76 = load i8, i8* %71
%77 = icmp eq i8 %76, 73
%78 = add i64 %57, 3
br i1 %77, label %79, label %144
79: ; preds = %75
%80 = getelementptr inbounds i8, i8* %58, i64 4
%81 = icmp eq i64 %78, %49
br i1 %81, label %82, label %84
82: ; preds = %79
%83 = call i64 @fread(i8* %80, i32 1, i32 6, i32* %16)
br label %84
84: ; preds = %82, %79
%85 = load i8, i8* %80
%86 = icmp eq i8 %85, 76
%87 = add i64 %57, 4
br i1 %86, label %88, label %144
88: ; preds = %84
%89 = getelementptr inbounds i8, i8* %58, i64 5
%90 = icmp eq i64 %87, %49
br i1 %90, label %91, label %93
91: ; preds = %88
%92 = call i64 @fread(i8* %89, i32 1, i32 5, i32* %16)
br label %93
93: ; preds = %91, %88
%94 = load i8, i8* %89
%95 = icmp eq i8 %94, 69
%96 = add i64 %57, 5
br i1 %95, label %97, label %144
97: ; preds = %93
%98 = getelementptr inbounds i8, i8* %58, i64 6
%99 = icmp eq i64 %96, %49
br i1 %99, label %100, label %102
100: ; preds = %97
%101 = call i64 @fread(i8* %98, i32 1, i32 4, i32* %16)
br label %102
102: ; preds = %100, %97
%103 = load i8, i8* %98
%104 = icmp eq i8 %103, 82
%105 = add i64 %57, 6
br i1 %104, label %106, label %144
106: ; preds = %102
%107 = getelementptr inbounds i8, i8* %58, i64 7
%108 = icmp eq i64 %105, %49
br i1 %108, label %109, label %111
109: ; preds = %106
%110 = call i64 @fread(i8* %107, i32 1, i32 3, i32* %16)
br label %111
111: ; preds = %109, %106
%112 = load i8, i8* %107
%113 = icmp eq i8 %112, 33
%114 = add i64 %57, 7
br i1 %113, label %115, label %144
115: ; preds = %111
%116 = getelementptr inbounds i8, i8* %58, i64 8
%117 = icmp eq i64 %114, %49
br i1 %117, label %118, label %120
118: ; preds = %115
%119 = call i64 @fread(i8* %116, i32 1, i32 2, i32* %16)
br label %120
120: ; preds = %118, %115
%121 = load i8, i8* %116
%122 = icmp eq i8 %121, 33
%123 = add i64 %57, 8
br i1 %122, label %124, label %144
124: ; preds = %120
%125 = getelementptr inbounds i8, i8* %58, i64 9
%126 = icmp eq i64 %123, %49
br i1 %126, label %127, label %129
127: ; preds = %124
%128 = call i64 @fread(i8* %125, i32 1, i32 1, i32* %16)
br label %129
129: ; preds = %127, %124
%130 = load i8, i8* %125
%131 = icmp eq i8 %130, 33
%132 = add i64 %57, 9
br i1 %131, label %133, label %144
133: ; preds = %129
%134 = add i64 %57, %48
br label %150
135: ; preds = %56
%136 = getelementptr inbounds i8, i8* %58, i64 1
%137 = icmp eq i64 %57, %49
br i1 %137, label %138, label %140
138: ; preds = %135
%139 = call i64 @fread(i8* %136, i32 1, i32 9, i32* %16)
br label %140
140: ; preds = %138, %135
%141 = load i8, i8* %136
%142 = icmp eq i8 %141, 82
%143 = add i64 %57, 1
br i1 %142, label %61, label %144
144: ; preds = %140, %66, %75, %84, %93, %102, %111, %120, %129, %56
%145 = phi i8* [ %58, %56 ], [ %136, %140 ], [ %62, %66 ], [ %71, %75 ], [ %80, %84 ], [ %89, %93 ], [ %98, %102 ], [ %107, %111 ], [ %116, %120 ], [ %125, %129 ]
%146 = phi i64 [ %57, %56 ], [ %143, %140 ], [ %69, %66 ], [ %78, %75 ], [ %87, %84 ], [ %96, %93 ], [ %105, %102 ], [ %114, %111 ], [ %123, %120 ], [ %132, %129 ]
%147 = getelementptr inbounds i8, i8* %145, i64 1
%148 = add i64 %146, 1
%149 = icmp ugt i64 %148, %49
br i1 %149, label %44, label %56
150: ; preds = %44, %35, %133
%151 = phi i64 [ %134, %133 ], [ 0, %35 ], [ 0, %44 ]
%152 = icmp eq i64 %151, 0
br i1 %152, label %153, label %157
153: ; preds = %150
%154 = load i32, i32* @stderr
%155 = call i32 (i32, i8*, ...) @fprintf(i32 %154, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%156 = call i32 @exit(i32 1)
unreachable
157: ; preds = %150
%158 = add i64 %151, 10
%159 = load i32, i32* @SEEK_SET
%160 = call i32 @fseek(i32* %16, i64 %158, i32 %159)
br label %161
161: ; preds = %175, %157
%162 = call i32 @feof(i32* %16)
%163 = icmp eq i32 %162, 0
br i1 %163, label %164, label %184
164: ; preds = %161
%165 = call i64 @fread(i8* %6, i32 1, i32 1024, i32* %16)
%166 = icmp eq i64 %165, 0
br i1 %166, label %175, label %167
167: ; preds = %164, %172
%168 = phi i64 [ %173, %172 ], [ 0, %164 ]
%169 = getelementptr inbounds i8, i8* %6, i64 %168
%170 = load i8, i8* %169
%171 = icmp eq i8 %170, 0
br i1 %171, label %172, label %175
172: ; preds = %167
%173 = add nuw i64 %168, 1
%174 = icmp eq i64 %173, %165
br i1 %174, label %175, label %167
175: ; preds = %167, %172, %164
%176 = phi i64 [ 0, %164 ], [ %165, %172 ], [ %168, %167 ]
%177 = getelementptr inbounds i8, i8* %6, i64 %176
%178 = load i8, i8* %177
%179 = icmp eq i8 %178, 0
br i1 %179, label %161, label %180
180: ; preds = %175
%181 = add i64 %176, %158
%182 = load i32, i32* @SEEK_SET
%183 = call i32 @fseek(i32* %16, i64 %181, i32 %182)
br label %184
184: ; preds = %161, %180
%185 = phi i64 [ %181, %180 ], [ %158, %161 ]
%186 = load i32, i32* @stdout
%187 = call i32 (i32, i8*, ...) @fprintf(i32 %186, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i64 %151, i64 %185)
%188 = getelementptr inbounds i8*, i8** %1, i64 2
%189 = load i8*, i8** %188
%190 = call i32* @fopen(i8* %189, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%191 = icmp eq i32* %190, null
br i1 %191, label %192, label %197
192: ; preds = %184
%193 = load i32, i32* @stderr
%194 = load i8*, i8** %188
%195 = call i32 (i32, i8*, ...) @fprintf(i32 %193, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %194)
%196 = call i32 @exit(i32 1)
unreachable
197: ; preds = %184
%198 = load i32, i32* @SEEK_SET
%199 = call i32 @fseek(i32* %16, i64 %185, i32 %198)
%200 = call i32 @feof(i32* %16)
%201 = icmp eq i32 %200, 0
br i1 %201, label %202, label %207
202: ; preds = %197, %202
%203 = call i64 @fread(i8* %6, i32 1, i32 1024, i32* %16)
%204 = call i32 @fwrite(i8* %6, i32 1, i64 %203, i32* %190)
%205 = call i32 @feof(i32* %16)
%206 = icmp eq i32 %205, 0
br i1 %206, label %202, label %207
207: ; preds = %202, %197
%208 = call i32 @fclose(i32* %16)
%209 = call i32 @fclose(i32* %190)
ret i32 0
}