#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*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fatal_error(char *, ...);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned long,
                           unsigned char, unsigned char, unsigned char,
                           unsigned char);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned long,
                         int /*<<< orphan*/);
unsigned long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
scalar_t__ strcmp(char *, char *);
void *strtoul(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  char *ifname, *ofname;
  int i;
  unsigned long istart, iend, ilen, ostart, ipos, fsize;
  unsigned int val, def_val, def_set;
  unsigned char buf[4];
  FILE *in_fd, *out_fd;
  ifname = ofname = NULL;
  istart = iend = ilen = ostart = 0;
  def_set = 0;
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) {
      usage(argv[0]);
    }
    if (strcmp(argv[i], "--input") == 0 || strcmp(argv[i], "-i") == 0) {
      i++;
      if (i >= argc)
        fatal_error("insufficent arguments");
      ifname = argv[i];
      continue;
    }
    if (strcmp(argv[i], "--output") == 0 || strcmp(argv[i], "-o") == 0) {
      i++;
      if (i >= argc)
        fatal_error("insufficent arguments");
      ofname = argv[i];
      continue;
    }
    if (strcmp(argv[i], "--istart") == 0 || strcmp(argv[i], "-is") == 0) {
      i++;
      if (i >= argc)
        fatal_error("insufficent arguments");
      istart = strtoul(argv[i], NULL, 0);
      continue;
    }
    if (strcmp(argv[i], "--iend") == 0 || strcmp(argv[i], "-ie") == 0) {
      i++;
      if (i >= argc)
        fatal_error("insufficent arguments");
      iend = strtoul(argv[i], NULL, 0);
      continue;
    }
    if (strcmp(argv[i], "--ilen") == 0 || strcmp(argv[i], "-il") == 0) {
      i++;
      if (i >= argc)
        fatal_error("insufficent arguments");
      ilen = strtoul(argv[i], NULL, 0);
      continue;
    }
    if (strcmp(argv[i], "--ostart") == 0 || strcmp(argv[i], "-os") == 0) {
      i++;
      if (i >= argc)
        fatal_error("insufficent arguments");
      ostart = strtoul(argv[i], NULL, 0);
      continue;
    }
    if (strcmp(argv[i], "--def-val") == 0 || strcmp(argv[i], "-dv") == 0) {
      i++;
      if (i >= argc)
        fatal_error("insufficent arguments");
      def_val = strtoul(argv[i], NULL, 0);
      def_set++;
      continue;
    }
    fatal_error("invalid argument %s", argv[i]);
  }
  if (!ifname)
    fatal_error("input filename not specified");
  if (!ofname)
    fatal_error("output filename not specified");
  in_fd = fopen(ifname, "rb");
  if (!in_fd)
    fatal_error("failed to open input file: %s", ifname);
  fseek(in_fd, 0, SEEK_END);
  fsize = ftell(in_fd);
  fseek(in_fd, 0, SEEK_SET);
  if (!ilen && !iend)
    iend = fsize;
  if (iend) {
    if (iend < istart)
      fatal_error("iend < istart");
    ilen = iend - istart;
  } else
    iend = istart + ilen;
  if (iend - istart > fsize)
    fatal_error("specified size larger that input file size");
  if (!ilen)
    fatal_error("zero input size");
  out_fd = fopen(ofname, "w");
  if (!out_fd)
    fatal_error("failed to open output file: %s", ofname);
  fseek(in_fd, istart, SEEK_SET);
  for (ipos = 0; ipos < ilen; ipos += sizeof(buf)) {
    memset(buf, 0, sizeof(buf));
    fread(buf, sizeof(buf[0]), sizeof(buf), in_fd);
    val = buf[0];
    val <<= 8;
    val |= buf[1];
    val <<= 8;
    val |= buf[2];
    val <<= 8;
    val |= buf[3];
    if (def_set && val == def_val)
      continue;
    fprintf(out_fd, "%u: wb_dat_o <= 32'h%02x%02x%02x%02x;\n",
            (ipos + ostart) / 4, buf[0], buf[1], buf[2], buf[3]);
  }
  fclose(out_fd);
  fclose(in_fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    162e <main+0x47e>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdda(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1257 <main+0xa7>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdbf(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1263 <main+0xb3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10b0 <usage@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd94(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     12a7 <main+0xf7>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd7a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12df <main+0x12f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     12ca <main+0x11a>
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
jmp    1620 <main+0x470>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd39(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1323 <main+0x173>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd20(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    135b <main+0x1ab>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1346 <main+0x196>
lea    0xcd6(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    1620 <main+0x470>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcc9(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     139f <main+0x1ef>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcb0(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    13e2 <main+0x232>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     13c2 <main+0x212>
lea    0xc5a(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %rax,-0x30(%rbp)
jmp    1620 <main+0x470>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc4f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1426 <main+0x276>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc34(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1469 <main+0x2b9>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1449 <main+0x299>
lea    0xbd3(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %rax,-0x38(%rbp)
jmp    1620 <main+0x470>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbd3(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     14ad <main+0x2fd>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbb8(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    14f0 <main+0x340>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     14d0 <main+0x320>
lea    0xb4c(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %rax,-0x40(%rbp)
jmp    1620 <main+0x470>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb57(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1534 <main+0x384>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb3e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1577 <main+0x3c7>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1557 <main+0x3a7>
lea    0xac5(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %rax,-0x48(%rbp)
jmp    1620 <main+0x470>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xadd(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     15bb <main+0x40b>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xac5(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1606 <main+0x456>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     15de <main+0x42e>
lea    0xa3e(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %eax,-0x60(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1620 <main+0x470>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xa5c(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1207 <main+0x57>
cmpq   $0x0,-0x18(%rbp)
jne    1647 <main+0x497>
lea    0xa49(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
cmpq   $0x0,-0x20(%rbp)
jne    1660 <main+0x4b0>
lea    0xa4d(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x18(%rbp),%rdi
lea    0xa59(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
jne    1691 <main+0x4e1>
mov    -0x18(%rbp),%rsi
lea    0xa3d(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x70(%rbp),%rdi
mov    0x294c(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10a0 <fseek@plt>
mov    -0x70(%rbp),%rdi
call   1080 <ftell@plt>
mov    %rax,-0x58(%rbp)
mov    -0x70(%rbp),%rdi
mov    0x2919(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   10a0 <fseek@plt>
cmpq   $0x0,-0x40(%rbp)
jne    16e8 <main+0x538>
cmpq   $0x0,-0x38(%rbp)
jne    16e8 <main+0x538>
mov    -0x58(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     1720 <main+0x570>
mov    -0x38(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    170f <main+0x55f>
lea    0x9dd(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x38(%rbp),%rax
sub    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    172c <main+0x57c>
mov    -0x30(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
sub    -0x30(%rbp),%rax
cmp    -0x58(%rbp),%rax
jbe    174c <main+0x59c>
lea    0x9ae(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
cmpq   $0x0,-0x40(%rbp)
jne    1765 <main+0x5b5>
lea    0x9c0(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x20(%rbp),%rdi
lea    0x9be(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
jne    1796 <main+0x5e6>
mov    -0x20(%rbp),%rsi
lea    0x9a1(%rip),%rdi
mov    $0x0,%al
call   1090 <fatal_error@plt>
mov    -0x70(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    0x2833(%rip),%rax
mov    (%rax),%edx
call   10a0 <fseek@plt>
movq   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%rax
cmp    -0x40(%rbp),%rax
jae    188d <main+0x6dd>
lea    -0x68(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
lea    -0x68(%rbp),%rdi
mov    -0x70(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
movzbl -0x68(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x5c(%rbp)
movzbl -0x67(%rbp),%eax
or     -0x5c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x5c(%rbp)
movzbl -0x66(%rbp),%eax
or     -0x5c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x5c(%rbp)
movzbl -0x65(%rbp),%eax
or     -0x5c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     1844 <main+0x694>
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jne    1844 <main+0x694>
jmp    187c <main+0x6cc>
mov    -0x78(%rbp),%rdi
mov    -0x50(%rbp),%rdx
add    -0x48(%rbp),%rdx
shr    $0x2,%rdx
mov    -0x68(%rbp),%cl
mov    -0x67(%rbp),%r8b
mov    -0x66(%rbp),%al
lea    0x8ea(%rip),%rsi
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %al,%r9d
movzbl -0x65(%rbp),%eax
mov    %eax,(%rsp)
call   1070 <fprintf@plt>
mov    -0x50(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x50(%rbp)
jmp    17b4 <main+0x604>
mov    -0x78(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x70(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x2,%edi
jl     1501 <main+0x351>
mov    %rsi,%r12
mov    %edi,%ebp
mov    $0x1,%ebx
xor    %r13d,%r13d
xor    %r14d,%r14d
movl   $0x0,0xc(%rsp)
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x30(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
jmp    1222 <main+0x72>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %ebx,%rax
mov    (%r12,%rax,8),%r13
add    $0x1,%ebx
cmp    %ebp,%ebx
jge    1526 <main+0x376>
movslq %ebx,%r15
mov    (%r12,%r15,8),%rdi
lea    0xdd0(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     124f <main+0x9f>
mov    (%r12,%r15,8),%rdi
lea    0xdc2(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1258 <main+0xa8>
mov    (%r12),%rdi
call   10b0 <usage@plt>
mov    (%r12,%r15,8),%rdi
lea    0xda7(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     13d0 <main+0x220>
mov    (%r12,%r15,8),%rdi
lea    0xd96(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     13d0 <main+0x220>
mov    (%r12,%r15,8),%rdi
lea    0xd96(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     13f0 <main+0x240>
mov    (%r12,%r15,8),%rdi
lea    0xd86(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     13f0 <main+0x240>
mov    (%r12,%r15,8),%rdi
lea    0xd70(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1411 <main+0x261>
mov    (%r12,%r15,8),%rdi
lea    0xd60(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1411 <main+0x261>
mov    (%r12,%r15,8),%rdi
lea    0xd4b(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1440 <main+0x290>
mov    (%r12,%r15,8),%rdi
lea    0xd39(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1440 <main+0x290>
mov    (%r12,%r15,8),%rdi
lea    0xd24(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     146f <main+0x2bf>
mov    (%r12,%r15,8),%rdi
lea    0xd12(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     146f <main+0x2bf>
mov    (%r12,%r15,8),%rdi
lea    0xcfd(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     149e <main+0x2ee>
mov    (%r12,%r15,8),%rdi
lea    0xced(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     149e <main+0x2ee>
mov    (%r12,%r15,8),%rdi
lea    0xcd8(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     14cd <main+0x31d>
mov    (%r12,%r15,8),%rdi
lea    0xcc9(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     14cd <main+0x31d>
mov    (%r12,%r15,8),%rsi
lea    0xcb4(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
jmp    1217 <main+0x67>
nopl   (%rax)
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     1210 <main+0x60>
lea    0xc33(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
jmp    1210 <main+0x60>
xchg   %ax,%ax
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     1405 <main+0x255>
lea    0xc17(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
movslq %ebx,%rax
mov    (%r12,%rax,8),%r14
jmp    1217 <main+0x67>
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     1426 <main+0x276>
lea    0xbf6(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
movslq %ebx,%rax
mov    (%r12,%rax,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %rax,0x10(%rsp)
jmp    1217 <main+0x67>
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     1455 <main+0x2a5>
lea    0xbc7(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
movslq %ebx,%rax
mov    (%r12,%rax,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %rax,0x30(%rsp)
jmp    1217 <main+0x67>
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     1484 <main+0x2d4>
lea    0xb98(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
movslq %ebx,%rax
mov    (%r12,%rax,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %rax,0x28(%rsp)
jmp    1217 <main+0x67>
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     14b3 <main+0x303>
lea    0xb69(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
movslq %ebx,%rax
mov    (%r12,%rax,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %rax,0x20(%rsp)
jmp    1217 <main+0x67>
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     14e2 <main+0x332>
lea    0xb3a(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
movslq %ebx,%rax
mov    (%r12,%rax,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10d0 <strtoul@plt>
mov    %rax,0x18(%rsp)
addl   $0x1,0xc(%rsp)
jmp    1217 <main+0x67>
xor    %r14d,%r14d
movl   $0x0,0xc(%rsp)
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %r12d,%r12d
xor    %ebp,%ebp
xor    %eax,%eax
mov    %rax,0x10(%rsp)
jmp    1535 <main+0x385>
test   %r13,%r13
mov    0x28(%rsp),%r12
mov    0x30(%rsp),%rbp
jne    1546 <main+0x396>
lea    0xb4d(%rip),%rdi
xor    %r13d,%r13d
xor    %eax,%eax
call   1090 <fatal_error@plt>
test   %r14,%r14
jne    1559 <main+0x3a9>
lea    0xb54(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
lea    0xb64(%rip),%rsi
mov    %r13,%rdi
call   10c0 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
jne    1581 <main+0x3d1>
lea    0xb50(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1090 <fatal_error@plt>
mov    0x2a60(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %r15,%rdi
call   1080 <ftell@plt>
mov    %rax,%rbx
mov    0x2a32(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %r12,%rax
or     %rbp,%rax
cmove  %rbx,%rbp
test   %rbp,%rbp
je     15d9 <main+0x429>
sub    0x10(%rsp),%rbp
jae    15d6 <main+0x426>
lea    0xb16(%rip),%rdi
xor    %eax,%eax
call   1090 <fatal_error@plt>
mov    %rbp,%r12
cmp    %rbx,%r12
jbe    15e7 <main+0x437>
lea    0xb0e(%rip),%rdi
jmp    15f7 <main+0x447>
test   %r12,%r12
je     15f0 <main+0x440>
xor    %ebx,%ebx
jmp    1604 <main+0x454>
lea    0xb27(%rip),%rdi
cmp    %rbx,%r12
setbe  %bl
xor    %eax,%eax
call   1090 <fatal_error@plt>
lea    0xb23(%rip),%rsi
mov    %r14,%rdi
call   10c0 <fopen@plt>
mov    %rax,%r13
test   %rax,%rax
jne    162c <main+0x47c>
lea    0xb0e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <fatal_error@plt>
mov    0x29a5(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
mov    0x10(%rsp),%rsi
call   10a0 <fseek@plt>
test   %bl,%bl
je     1667 <main+0x4b7>
mov    %r13,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
lea    0x8(%rsp),%r14
jmp    16b3 <main+0x503>
movzbl 0x9(%rsp),%ebp
movzbl 0xa(%rsp),%esi
movzbl 0xb(%rsp),%edi
mov    0x20(%rsp),%rax
lea    (%rax,%rbx,1),%rdx
shr    $0x2,%rdx
movzbl %dil,%eax
mov    %eax,(%rsp)
movzbl %bpl,%r8d
movzbl %sil,%r9d
mov    %r13,%rdi
lea    0xaaa(%rip),%rsi
call   1070 <fprintf@plt>
add    $0x4,%rbx
cmp    %r12,%rbx
jae    1646 <main+0x496>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
movzbl 0x8(%rsp),%ecx
cmpl   $0x0,0xc(%rsp)
je     1670 <main+0x4c0>
mov    %ecx,%edx
shl    $0x10,%edx
movzbl 0x9(%rsp),%ebp
mov    %ebp,%eax
shl    $0x8,%eax
or     %edx,%eax
movzbl 0xa(%rsp),%esi
or     %esi,%eax
shl    $0x8,%eax
movzbl 0xb(%rsp),%edi
or     %edi,%eax
cmp    0x18(%rsp),%eax
jne    167f <main+0x4cf>
jmp    16aa <main+0x4fa>

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [8 x i8] c"--input\00"
@.str.3 = [3 x i8] c"-i\00"
@.str.4 = [22 x i8] c"insufficent arguments\00"
@.str.5 = [9 x i8] c"--output\00"
@.str.6 = [3 x i8] c"-o\00"
@.str.7 = [9 x i8] c"--istart\00"
@.str.8 = [4 x i8] c"-is\00"
@.str.9 = [7 x i8] c"--iend\00"
@.str.10 = [4 x i8] c"-ie\00"
@.str.11 = [7 x i8] c"--ilen\00"
@.str.12 = [4 x i8] c"-il\00"
@.str.13 = [9 x i8] c"--ostart\00"
@.str.14 = [4 x i8] c"-os\00"
@.str.15 = [10 x i8] c"--def-val\00"
@.str.16 = [4 x i8] c"-dv\00"
@.str.17 = [20 x i8] c"invalid argument %s\00"
@.str.18 = [29 x i8] c"input filename not specified\00"
@.str.19 = [30 x i8] c"output filename not specified\00"
@.str.20 = [3 x i8] c"rb\00"
@.str.21 = [30 x i8] c"failed to open input file: %s\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.22 = [14 x i8] c"iend < istart\00"
@.str.23 = [43 x i8] c"specified size larger that input file size\00"
@.str.24 = [16 x i8] c"zero input size\00"
@.str.25 = [2 x i8] c"w\00"
@.str.26 = [31 x i8] c"failed to open output file: %s\00"
@.str.27 = [39 x i8] c"%u: wb_dat_o <= 32'h%02x%02x%02x%02x;\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [4 x i8]
%19 = alloca i32*
%20 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
store i8* null, i8** %6
store i64 0, i64* %12
store i64 0, i64* %11
store i64 0, i64* %10
store i64 0, i64* %9
store i32 0, i32* %17
store i32 1, i32* %8
br label %21
21: ; preds = %275, %2
%22 = load i32, i32* %8
%23 = load i32, i32* %4
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %278
25: ; preds = %21
%26 = load i8**, i8*** %5
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %41, label %33
33: ; preds = %25
%34 = load i8**, i8*** %5
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %33, %25
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 0
%44 = load i8*, i8** %43
%45 = call i32 @usage(i8* %44)
br label %46
46: ; preds = %41, %33
%47 = load i8**, i8*** %5
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %62, label %54
54: ; preds = %46
%55 = load i8**, i8*** %5
%56 = load i32, i32* %8
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %55, i64 %57
%59 = load i8*, i8** %58
%60 = call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %76
62: ; preds = %54, %46
%63 = load i32, i32* %8
%64 = add nsw i32 %63, 1
store i32 %64, i32* %8
%65 = load i32, i32* %8
%66 = load i32, i32* %4
%67 = icmp sge i32 %65, %66
br i1 %67, label %68, label %70
68: ; preds = %62
%69 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %70
70: ; preds = %68, %62
%71 = load i8**, i8*** %5
%72 = load i32, i32* %8
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8*, i8** %71, i64 %73
%75 = load i8*, i8** %74
store i8* %75, i8** %6
br label %275
76: ; preds = %54
%77 = load i8**, i8*** %5
%78 = load i32, i32* %8
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8*, i8** %77, i64 %79
%81 = load i8*, i8** %80
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %92, label %84
84: ; preds = %76
%85 = load i8**, i8*** %5
%86 = load i32, i32* %8
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8*, i8** %85, i64 %87
%89 = load i8*, i8** %88
%90 = call i64 @strcmp(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %106
92: ; preds = %84, %76
%93 = load i32, i32* %8
%94 = add nsw i32 %93, 1
store i32 %94, i32* %8
%95 = load i32, i32* %8
%96 = load i32, i32* %4
%97 = icmp sge i32 %95, %96
br i1 %97, label %98, label %100
98: ; preds = %92
%99 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %100
100: ; preds = %98, %92
%101 = load i8**, i8*** %5
%102 = load i32, i32* %8
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8*, i8** %101, i64 %103
%105 = load i8*, i8** %104
store i8* %105, i8** %7
br label %275
106: ; preds = %84
%107 = load i8**, i8*** %5
%108 = load i32, i32* %8
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8*, i8** %107, i64 %109
%111 = load i8*, i8** %110
%112 = call i64 @strcmp(i8* %111, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%113 = icmp eq i64 %112, 0
br i1 %113, label %122, label %114
114: ; preds = %106
%115 = load i8**, i8*** %5
%116 = load i32, i32* %8
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds i8*, i8** %115, i64 %117
%119 = load i8*, i8** %118
%120 = call i64 @strcmp(i8* %119, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %138
122: ; preds = %114, %106
%123 = load i32, i32* %8
%124 = add nsw i32 %123, 1
store i32 %124, i32* %8
%125 = load i32, i32* %8
%126 = load i32, i32* %4
%127 = icmp sge i32 %125, %126
br i1 %127, label %128, label %130
128: ; preds = %122
%129 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %130
130: ; preds = %128, %122
%131 = load i8**, i8*** %5
%132 = load i32, i32* %8
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i8*, i8** %131, i64 %133
%135 = load i8*, i8** %134
%136 = call i8* @strtoul(i8* %135, i32* null, i32 0)
%137 = ptrtoint i8* %136 to i64
store i64 %137, i64* %9
br label %275
138: ; preds = %114
%139 = load i8**, i8*** %5
%140 = load i32, i32* %8
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i8*, i8** %139, i64 %141
%143 = load i8*, i8** %142
%144 = call i64 @strcmp(i8* %143, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%145 = icmp eq i64 %144, 0
br i1 %145, label %154, label %146
146: ; preds = %138
%147 = load i8**, i8*** %5
%148 = load i32, i32* %8
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8*, i8** %147, i64 %149
%151 = load i8*, i8** %150
%152 = call i64 @strcmp(i8* %151, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%153 = icmp eq i64 %152, 0
br i1 %153, label %154, label %170
154: ; preds = %146, %138
%155 = load i32, i32* %8
%156 = add nsw i32 %155, 1
store i32 %156, i32* %8
%157 = load i32, i32* %8
%158 = load i32, i32* %4
%159 = icmp sge i32 %157, %158
br i1 %159, label %160, label %162
160: ; preds = %154
%161 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %162
162: ; preds = %160, %154
%163 = load i8**, i8*** %5
%164 = load i32, i32* %8
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds i8*, i8** %163, i64 %165
%167 = load i8*, i8** %166
%168 = call i8* @strtoul(i8* %167, i32* null, i32 0)
%169 = ptrtoint i8* %168 to i64
store i64 %169, i64* %10
br label %275
170: ; preds = %146
%171 = load i8**, i8*** %5
%172 = load i32, i32* %8
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8*, i8** %171, i64 %173
%175 = load i8*, i8** %174
%176 = call i64 @strcmp(i8* %175, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%177 = icmp eq i64 %176, 0
br i1 %177, label %186, label %178
178: ; preds = %170
%179 = load i8**, i8*** %5
%180 = load i32, i32* %8
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds i8*, i8** %179, i64 %181
%183 = load i8*, i8** %182
%184 = call i64 @strcmp(i8* %183, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%185 = icmp eq i64 %184, 0
br i1 %185, label %186, label %202
186: ; preds = %178, %170
%187 = load i32, i32* %8
%188 = add nsw i32 %187, 1
store i32 %188, i32* %8
%189 = load i32, i32* %8
%190 = load i32, i32* %4
%191 = icmp sge i32 %189, %190
br i1 %191, label %192, label %194
192: ; preds = %186
%193 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %194
194: ; preds = %192, %186
%195 = load i8**, i8*** %5
%196 = load i32, i32* %8
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds i8*, i8** %195, i64 %197
%199 = load i8*, i8** %198
%200 = call i8* @strtoul(i8* %199, i32* null, i32 0)
%201 = ptrtoint i8* %200 to i64
store i64 %201, i64* %11
br label %275
202: ; preds = %178
%203 = load i8**, i8*** %5
%204 = load i32, i32* %8
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds i8*, i8** %203, i64 %205
%207 = load i8*, i8** %206
%208 = call i64 @strcmp(i8* %207, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%209 = icmp eq i64 %208, 0
br i1 %209, label %218, label %210
210: ; preds = %202
%211 = load i8**, i8*** %5
%212 = load i32, i32* %8
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds i8*, i8** %211, i64 %213
%215 = load i8*, i8** %214
%216 = call i64 @strcmp(i8* %215, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%217 = icmp eq i64 %216, 0
br i1 %217, label %218, label %234
218: ; preds = %210, %202
%219 = load i32, i32* %8
%220 = add nsw i32 %219, 1
store i32 %220, i32* %8
%221 = load i32, i32* %8
%222 = load i32, i32* %4
%223 = icmp sge i32 %221, %222
br i1 %223, label %224, label %226
224: ; preds = %218
%225 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %226
226: ; preds = %224, %218
%227 = load i8**, i8*** %5
%228 = load i32, i32* %8
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds i8*, i8** %227, i64 %229
%231 = load i8*, i8** %230
%232 = call i8* @strtoul(i8* %231, i32* null, i32 0)
%233 = ptrtoint i8* %232 to i64
store i64 %233, i64* %12
br label %275
234: ; preds = %210
%235 = load i8**, i8*** %5
%236 = load i32, i32* %8
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds i8*, i8** %235, i64 %237
%239 = load i8*, i8** %238
%240 = call i64 @strcmp(i8* %239, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%241 = icmp eq i64 %240, 0
br i1 %241, label %250, label %242
242: ; preds = %234
%243 = load i8**, i8*** %5
%244 = load i32, i32* %8
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds i8*, i8** %243, i64 %245
%247 = load i8*, i8** %246
%248 = call i64 @strcmp(i8* %247, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%249 = icmp eq i64 %248, 0
br i1 %249, label %250, label %268
250: ; preds = %242, %234
%251 = load i32, i32* %8
%252 = add nsw i32 %251, 1
store i32 %252, i32* %8
%253 = load i32, i32* %8
%254 = load i32, i32* %4
%255 = icmp sge i32 %253, %254
br i1 %255, label %256, label %258
256: ; preds = %250
%257 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %258
258: ; preds = %256, %250
%259 = load i8**, i8*** %5
%260 = load i32, i32* %8
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds i8*, i8** %259, i64 %261
%263 = load i8*, i8** %262
%264 = call i8* @strtoul(i8* %263, i32* null, i32 0)
%265 = ptrtoint i8* %264 to i32
store i32 %265, i32* %16
%266 = load i32, i32* %17
%267 = add i32 %266, 1
store i32 %267, i32* %17
br label %275
268: ; preds = %242
%269 = load i8**, i8*** %5
%270 = load i32, i32* %8
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds i8*, i8** %269, i64 %271
%273 = load i8*, i8** %272
%274 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %273)
br label %275
275: ; preds = %268, %258, %226, %194, %162, %130, %100, %70
%276 = load i32, i32* %8
%277 = add nsw i32 %276, 1
store i32 %277, i32* %8
br label %21
278: ; preds = %21
%279 = load i8*, i8** %6
%280 = icmp ne i8* %279, null
br i1 %280, label %283, label %281
281: ; preds = %278
%282 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0))
br label %283
283: ; preds = %281, %278
%284 = load i8*, i8** %7
%285 = icmp ne i8* %284, null
br i1 %285, label %288, label %286
286: ; preds = %283
%287 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0))
br label %288
288: ; preds = %286, %283
%289 = load i8*, i8** %6
%290 = call i32* @fopen(i8* %289, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0))
store i32* %290, i32** %19
%291 = load i32*, i32** %19
%292 = icmp ne i32* %291, null
br i1 %292, label %296, label %293
293: ; preds = %288
%294 = load i8*, i8** %6
%295 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.21, i64 0, i64 0), i8* %294)
br label %296
296: ; preds = %293, %288
%297 = load i32*, i32** %19
%298 = load i32, i32* @SEEK_END
%299 = call i32 @fseek(i32* %297, i64 0, i32 %298)
%300 = load i32*, i32** %19
%301 = call i64 @ftell(i32* %300)
store i64 %301, i64* %14
%302 = load i32*, i32** %19
%303 = load i32, i32* @SEEK_SET
%304 = call i32 @fseek(i32* %302, i64 0, i32 %303)
%305 = load i64, i64* %11
%306 = icmp ne i64 %305, 0
br i1 %306, label %312, label %307
307: ; preds = %296
%308 = load i64, i64* %10
%309 = icmp ne i64 %308, 0
br i1 %309, label %312, label %310
310: ; preds = %307
%311 = load i64, i64* %14
store i64 %311, i64* %10
br label %312
312: ; preds = %310, %307, %296
%313 = load i64, i64* %10
%314 = icmp ne i64 %313, 0
br i1 %314, label %315, label %325
315: ; preds = %312
%316 = load i64, i64* %10
%317 = load i64, i64* %9
%318 = icmp ult i64 %316, %317
br i1 %318, label %319, label %321
319: ; preds = %315
%320 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0))
br label %321
321: ; preds = %319, %315
%322 = load i64, i64* %10
%323 = load i64, i64* %9
%324 = sub i64 %322, %323
store i64 %324, i64* %11
br label %329
325: ; preds = %312
%326 = load i64, i64* %9
%327 = load i64, i64* %11
%328 = add i64 %326, %327
store i64 %328, i64* %10
br label %329
329: ; preds = %325, %321
%330 = load i64, i64* %10
%331 = load i64, i64* %9
%332 = sub i64 %330, %331
%333 = load i64, i64* %14
%334 = icmp ugt i64 %332, %333
br i1 %334, label %335, label %337
335: ; preds = %329
%336 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.23, i64 0, i64 0))
br label %337
337: ; preds = %335, %329
%338 = load i64, i64* %11
%339 = icmp ne i64 %338, 0
br i1 %339, label %342, label %340
340: ; preds = %337
%341 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.24, i64 0, i64 0))
br label %342
342: ; preds = %340, %337
%343 = load i8*, i8** %7
%344 = call i32* @fopen(i8* %343, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0))
store i32* %344, i32** %20
%345 = load i32*, i32** %20
%346 = icmp ne i32* %345, null
br i1 %346, label %350, label %347
347: ; preds = %342
%348 = load i8*, i8** %7
%349 = call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.26, i64 0, i64 0), i8* %348)
br label %350
350: ; preds = %347, %342
%351 = load i32*, i32** %19
%352 = load i64, i64* %9
%353 = load i32, i32* @SEEK_SET
%354 = call i32 @fseek(i32* %351, i64 %352, i32 %353)
store i64 0, i64* %13
br label %355
355: ; preds = %411, %350
%356 = load i64, i64* %13
%357 = load i64, i64* %11
%358 = icmp ult i64 %356, %357
br i1 %358, label %359, label %414
359: ; preds = %355
%360 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%361 = call i32 @memset(i8* %360, i32 0, i32 4)
%362 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%363 = load i32*, i32** %19
%364 = call i32 @fread(i8* %362, i32 1, i32 4, i32* %363)
%365 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%366 = load i8, i8* %365
%367 = zext i8 %366 to i32
store i32 %367, i32* %15
%368 = load i32, i32* %15
%369 = shl i32 %368, 8
store i32 %369, i32* %15
%370 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 1
%371 = load i8, i8* %370
%372 = zext i8 %371 to i32
%373 = load i32, i32* %15
%374 = or i32 %373, %372
store i32 %374, i32* %15
%375 = load i32, i32* %15
%376 = shl i32 %375, 8
store i32 %376, i32* %15
%377 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 2
%378 = load i8, i8* %377
%379 = zext i8 %378 to i32
%380 = load i32, i32* %15
%381 = or i32 %380, %379
store i32 %381, i32* %15
%382 = load i32, i32* %15
%383 = shl i32 %382, 8
store i32 %383, i32* %15
%384 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 3
%385 = load i8, i8* %384
%386 = zext i8 %385 to i32
%387 = load i32, i32* %15
%388 = or i32 %387, %386
store i32 %388, i32* %15
%389 = load i32, i32* %17
%390 = icmp ne i32 %389, 0
br i1 %390, label %391, label %396
391: ; preds = %359
%392 = load i32, i32* %15
%393 = load i32, i32* %16
%394 = icmp eq i32 %392, %393
br i1 %394, label %395, label %396
395: ; preds = %391
br label %411
396: ; preds = %391, %359
%397 = load i32*, i32** %20
%398 = load i64, i64* %13
%399 = load i64, i64* %12
%400 = add i64 %398, %399
%401 = udiv i64 %400, 4
%402 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%403 = load i8, i8* %402
%404 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 1
%405 = load i8, i8* %404
%406 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 2
%407 = load i8, i8* %406
%408 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 3
%409 = load i8, i8* %408
%410 = call i32 @fprintf(i32* %397, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.27, i64 0, i64 0), i64 %401, i8 zeroext %403, i8 zeroext %405, i8 zeroext %407, i8 zeroext %409)
br label %411
411: ; preds = %396, %395
%412 = load i64, i64* %13
%413 = add i64 %412, 4
store i64 %413, i64* %13
br label %355
414: ; preds = %355
%415 = load i32*, i32** %20
%416 = call i32 @fclose(i32* %415)
%417 = load i32*, i32** %19
%418 = call i32 @fclose(i32* %417)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [8 x i8] c"--input\00"
@.str.3 = [3 x i8] c"-i\00"
@.str.4 = [22 x i8] c"insufficent arguments\00"
@.str.5 = [9 x i8] c"--output\00"
@.str.6 = [3 x i8] c"-o\00"
@.str.7 = [9 x i8] c"--istart\00"
@.str.8 = [4 x i8] c"-is\00"
@.str.9 = [7 x i8] c"--iend\00"
@.str.10 = [4 x i8] c"-ie\00"
@.str.11 = [7 x i8] c"--ilen\00"
@.str.12 = [4 x i8] c"-il\00"
@.str.13 = [9 x i8] c"--ostart\00"
@.str.14 = [4 x i8] c"-os\00"
@.str.15 = [10 x i8] c"--def-val\00"
@.str.16 = [4 x i8] c"-dv\00"
@.str.17 = [20 x i8] c"invalid argument %s\00"
@.str.18 = [29 x i8] c"input filename not specified\00"
@.str.19 = [30 x i8] c"output filename not specified\00"
@.str.20 = [3 x i8] c"rb\00"
@.str.21 = [30 x i8] c"failed to open input file: %s\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.22 = [14 x i8] c"iend < istart\00"
@.str.23 = [43 x i8] c"specified size larger that input file size\00"
@.str.24 = [16 x i8] c"zero input size\00"
@.str.25 = [2 x i8] c"w\00"
@.str.26 = [31 x i8] c"failed to open output file: %s\00"
@.str.27 = [39 x i8] c"%u: wb_dat_o <= 32'h%02x%02x%02x%02x;\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %176
6: ; preds = %2, %162
%7 = phi i8* [ %171, %162 ], [ null, %2 ]
%8 = phi i8* [ %170, %162 ], [ null, %2 ]
%9 = phi i32 [ %169, %162 ], [ 0, %2 ]
%10 = phi i32 [ %168, %162 ], [ undef, %2 ]
%11 = phi i32 [ %172, %162 ], [ 1, %2 ]
%12 = phi i64 [ %166, %162 ], [ 0, %2 ]
%13 = phi i64 [ %165, %162 ], [ 0, %2 ]
%14 = phi i64 [ %164, %162 ], [ 0, %2 ]
%15 = phi i64 [ %163, %162 ], [ 0, %2 ]
%16 = sext i32 %11 to i64
%17 = getelementptr inbounds i8*, i8** %1, i64 %16
%18 = load i8*, i8** %17
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %6
%22 = load i8*, i8** %17
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21, %6
%26 = load i8*, i8** %1
%27 = tail call i32 @usage(i8* %26)
br label %28
28: ; preds = %25, %21
%29 = load i8*, i8** %17
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i8*, i8** %17
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %45
36: ; preds = %32, %28
%37 = add nsw i32 %11, 1
%38 = icmp slt i32 %37, %0
br i1 %38, label %41, label %39
39: ; preds = %36
%40 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %41
41: ; preds = %39, %36
%42 = sext i32 %37 to i64
%43 = getelementptr inbounds i8*, i8** %1, i64 %42
%44 = load i8*, i8** %43
br label %162
45: ; preds = %32
%46 = load i8*, i8** %17
%47 = tail call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %53, label %49
49: ; preds = %45
%50 = load i8*, i8** %17
%51 = tail call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %62
53: ; preds = %49, %45
%54 = add nsw i32 %11, 1
%55 = icmp slt i32 %54, %0
br i1 %55, label %58, label %56
56: ; preds = %53
%57 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %58
58: ; preds = %56, %53
%59 = sext i32 %54 to i64
%60 = getelementptr inbounds i8*, i8** %1, i64 %59
%61 = load i8*, i8** %60
br label %162
62: ; preds = %49
%63 = load i8*, i8** %17
%64 = tail call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %70, label %66
66: ; preds = %62
%67 = load i8*, i8** %17
%68 = tail call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %81
70: ; preds = %66, %62
%71 = add nsw i32 %11, 1
%72 = icmp slt i32 %71, %0
br i1 %72, label %75, label %73
73: ; preds = %70
%74 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %75
75: ; preds = %73, %70
%76 = sext i32 %71 to i64
%77 = getelementptr inbounds i8*, i8** %1, i64 %76
%78 = load i8*, i8** %77
%79 = tail call i8* @strtoul(i8* nocapture %78, i32* null, i32 0)
%80 = ptrtoint i8* %79 to i64
br label %162
81: ; preds = %66
%82 = load i8*, i8** %17
%83 = tail call i64 @strcmp(i8* %82, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%84 = icmp eq i64 %83, 0
br i1 %84, label %89, label %85
85: ; preds = %81
%86 = load i8*, i8** %17
%87 = tail call i64 @strcmp(i8* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %100
89: ; preds = %85, %81
%90 = add nsw i32 %11, 1
%91 = icmp slt i32 %90, %0
br i1 %91, label %94, label %92
92: ; preds = %89
%93 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %94
94: ; preds = %92, %89
%95 = sext i32 %90 to i64
%96 = getelementptr inbounds i8*, i8** %1, i64 %95
%97 = load i8*, i8** %96
%98 = tail call i8* @strtoul(i8* nocapture %97, i32* null, i32 0)
%99 = ptrtoint i8* %98 to i64
br label %162
100: ; preds = %85
%101 = load i8*, i8** %17
%102 = tail call i64 @strcmp(i8* %101, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%103 = icmp eq i64 %102, 0
br i1 %103, label %108, label %104
104: ; preds = %100
%105 = load i8*, i8** %17
%106 = tail call i64 @strcmp(i8* %105, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %119
108: ; preds = %104, %100
%109 = add nsw i32 %11, 1
%110 = icmp slt i32 %109, %0
br i1 %110, label %113, label %111
111: ; preds = %108
%112 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %113
113: ; preds = %111, %108
%114 = sext i32 %109 to i64
%115 = getelementptr inbounds i8*, i8** %1, i64 %114
%116 = load i8*, i8** %115
%117 = tail call i8* @strtoul(i8* nocapture %116, i32* null, i32 0)
%118 = ptrtoint i8* %117 to i64
br label %162
119: ; preds = %104
%120 = load i8*, i8** %17
%121 = tail call i64 @strcmp(i8* %120, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%122 = icmp eq i64 %121, 0
br i1 %122, label %127, label %123
123: ; preds = %119
%124 = load i8*, i8** %17
%125 = tail call i64 @strcmp(i8* %124, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%126 = icmp eq i64 %125, 0
br i1 %126, label %127, label %138
127: ; preds = %123, %119
%128 = add nsw i32 %11, 1
%129 = icmp slt i32 %128, %0
br i1 %129, label %132, label %130
130: ; preds = %127
%131 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %132
132: ; preds = %130, %127
%133 = sext i32 %128 to i64
%134 = getelementptr inbounds i8*, i8** %1, i64 %133
%135 = load i8*, i8** %134
%136 = tail call i8* @strtoul(i8* nocapture %135, i32* null, i32 0)
%137 = ptrtoint i8* %136 to i64
br label %162
138: ; preds = %123
%139 = load i8*, i8** %17
%140 = tail call i64 @strcmp(i8* %139, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%141 = icmp eq i64 %140, 0
br i1 %141, label %146, label %142
142: ; preds = %138
%143 = load i8*, i8** %17
%144 = tail call i64 @strcmp(i8* %143, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%145 = icmp eq i64 %144, 0
br i1 %145, label %146, label %159
146: ; preds = %142, %138
%147 = add nsw i32 %11, 1
%148 = icmp slt i32 %147, %0
br i1 %148, label %151, label %149
149: ; preds = %146
%150 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %151
151: ; preds = %149, %146
%152 = sext i32 %147 to i64
%153 = getelementptr inbounds i8*, i8** %1, i64 %152
%154 = load i8*, i8** %153
%155 = tail call i8* @strtoul(i8* nocapture %154, i32* null, i32 0)
%156 = ptrtoint i8* %155 to i64
%157 = trunc i64 %156 to i32
%158 = add i32 %9, 1
br label %162
159: ; preds = %142
%160 = load i8*, i8** %17
%161 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %160)
br label %162
162: ; preds = %159, %151, %132, %113, %94, %75, %58, %41
%163 = phi i64 [ %15, %41 ], [ %15, %58 ], [ %80, %75 ], [ %15, %94 ], [ %15, %113 ], [ %15, %132 ], [ %15, %151 ], [ %15, %159 ]
%164 = phi i64 [ %14, %41 ], [ %14, %58 ], [ %14, %75 ], [ %99, %94 ], [ %14, %113 ], [ %14, %132 ], [ %14, %151 ], [ %14, %159 ]
%165 = phi i64 [ %13, %41 ], [ %13, %58 ], [ %13, %75 ], [ %13, %94 ], [ %118, %113 ], [ %13, %132 ], [ %13, %151 ], [ %13, %159 ]
%166 = phi i64 [ %12, %41 ], [ %12, %58 ], [ %12, %75 ], [ %12, %94 ], [ %12, %113 ], [ %137, %132 ], [ %12, %151 ], [ %12, %159 ]
%167 = phi i32 [ %37, %41 ], [ %54, %58 ], [ %71, %75 ], [ %90, %94 ], [ %109, %113 ], [ %128, %132 ], [ %147, %151 ], [ %11, %159 ]
%168 = phi i32 [ %10, %41 ], [ %10, %58 ], [ %10, %75 ], [ %10, %94 ], [ %10, %113 ], [ %10, %132 ], [ %157, %151 ], [ %10, %159 ]
%169 = phi i32 [ %9, %41 ], [ %9, %58 ], [ %9, %75 ], [ %9, %94 ], [ %9, %113 ], [ %9, %132 ], [ %158, %151 ], [ %9, %159 ]
%170 = phi i8* [ %8, %41 ], [ %61, %58 ], [ %8, %75 ], [ %8, %94 ], [ %8, %113 ], [ %8, %132 ], [ %8, %151 ], [ %8, %159 ]
%171 = phi i8* [ %44, %41 ], [ %7, %58 ], [ %7, %75 ], [ %7, %94 ], [ %7, %113 ], [ %7, %132 ], [ %7, %151 ], [ %7, %159 ]
%172 = add nsw i32 %167, 1
%173 = icmp slt i32 %172, %0
br i1 %173, label %6, label %174
174: ; preds = %162
%175 = icmp eq i8* %171, null
br i1 %175, label %176, label %185
176: ; preds = %2, %174
%177 = phi i8* [ %170, %174 ], [ null, %2 ]
%178 = phi i32 [ %169, %174 ], [ 0, %2 ]
%179 = phi i32 [ %168, %174 ], [ undef, %2 ]
%180 = phi i64 [ %166, %174 ], [ 0, %2 ]
%181 = phi i64 [ %165, %174 ], [ 0, %2 ]
%182 = phi i64 [ %164, %174 ], [ 0, %2 ]
%183 = phi i64 [ %163, %174 ], [ 0, %2 ]
%184 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.18, i64 0, i64 0))
br label %185
185: ; preds = %176, %174
%186 = phi i8* [ null, %176 ], [ %171, %174 ]
%187 = phi i8* [ %177, %176 ], [ %170, %174 ]
%188 = phi i32 [ %178, %176 ], [ %169, %174 ]
%189 = phi i32 [ %179, %176 ], [ %168, %174 ]
%190 = phi i64 [ %180, %176 ], [ %166, %174 ]
%191 = phi i64 [ %181, %176 ], [ %165, %174 ]
%192 = phi i64 [ %182, %176 ], [ %164, %174 ]
%193 = phi i64 [ %183, %176 ], [ %163, %174 ]
%194 = icmp eq i8* %187, null
br i1 %194, label %195, label %197
195: ; preds = %185
%196 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0))
br label %197
197: ; preds = %195, %185
%198 = tail call i32* @fopen(i8* %186, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0))
%199 = icmp eq i32* %198, null
br i1 %199, label %200, label %202
200: ; preds = %197
%201 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.21, i64 0, i64 0), i8* %186)
br label %202
202: ; preds = %200, %197
%203 = load i32, i32* @SEEK_END
%204 = tail call i32 @fseek(i32* %198, i64 0, i32 %203)
%205 = tail call i64 @ftell(i32* %198)
%206 = load i32, i32* @SEEK_SET
%207 = tail call i32 @fseek(i32* %198, i64 0, i32 %206)
%208 = icmp ne i64 %191, 0
%209 = icmp ne i64 %192, 0
%210 = select i1 %208, i1 true, i1 %209
%211 = select i1 %210, i64 %192, i64 %205
%212 = icmp eq i64 %211, 0
br i1 %212, label %219, label %213
213: ; preds = %202
%214 = icmp ult i64 %211, %193
br i1 %214, label %215, label %217
215: ; preds = %213
%216 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0))
br label %217
217: ; preds = %215, %213
%218 = sub i64 %211, %193
br label %219
219: ; preds = %202, %217
%220 = phi i64 [ %218, %217 ], [ %191, %202 ]
%221 = icmp ugt i64 %220, %205
br i1 %221, label %224, label %222
222: ; preds = %219
%223 = icmp eq i64 %220, 0
br i1 %223, label %224, label %228
224: ; preds = %222, %219
%225 = phi i8* [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str.23, i64 0, i64 0), %219 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.24, i64 0, i64 0), %222 ]
%226 = xor i1 %221, true
%227 = tail call i32 (i8*, ...) @fatal_error(i8* %225)
br label %228
228: ; preds = %224, %222
%229 = phi i1 [ false, %222 ], [ %226, %224 ]
%230 = tail call i32* @fopen(i8* %187, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0))
%231 = icmp eq i32* %230, null
br i1 %231, label %232, label %234
232: ; preds = %228
%233 = tail call i32 (i8*, ...) @fatal_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.26, i64 0, i64 0), i8* %187)
br label %234
234: ; preds = %232, %228
%235 = load i32, i32* @SEEK_SET
%236 = tail call i32 @fseek(i32* %198, i64 %193, i32 %235)
br i1 %229, label %276, label %237
237: ; preds = %234
%238 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%239 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%240 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%241 = icmp eq i32 %188, 0
br label %242
242: ; preds = %237, %273
%243 = phi i64 [ 0, %237 ], [ %274, %273 ]
%244 = call i32 @memset(i8* %4, i32 0, i32 4)
%245 = call i32 @fread(i8* %4, i32 1, i32 4, i32* %198)
%246 = load i8, i8* %4
br i1 %241, label %247, label %251
247: ; preds = %242
%248 = load i8, i8* %238
%249 = load i8, i8* %239
%250 = load i8, i8* %240
br label %266
251: ; preds = %242
%252 = zext i8 %246 to i32
%253 = shl nuw nsw i32 %252, 16
%254 = load i8, i8* %238
%255 = zext i8 %254 to i32
%256 = shl nuw nsw i32 %255, 8
%257 = or i32 %256, %253
%258 = load i8, i8* %239
%259 = zext i8 %258 to i32
%260 = or i32 %257, %259
%261 = shl nuw i32 %260, 8
%262 = load i8, i8* %240
%263 = zext i8 %262 to i32
%264 = or i32 %261, %263
%265 = icmp eq i32 %264, %189
br i1 %265, label %273, label %266
266: ; preds = %247, %251
%267 = phi i8 [ %250, %247 ], [ %262, %251 ]
%268 = phi i8 [ %249, %247 ], [ %258, %251 ]
%269 = phi i8 [ %248, %247 ], [ %254, %251 ]
%270 = add i64 %243, %190
%271 = lshr i64 %270, 2
%272 = call i32 @fprintf(i32* %230, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.27, i64 0, i64 0), i64 %271, i8 zeroext %246, i8 zeroext %269, i8 zeroext %268, i8 zeroext %267)
br label %273
273: ; preds = %251, %266
%274 = add i64 %243, 4
%275 = icmp ult i64 %274, %220
br i1 %275, label %242, label %276
276: ; preds = %273, %234
%277 = call i32 @fclose(i32* %230)
%278 = call i32 @fclose(i32* %198)
ret i32 0
}