#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 ssize_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *,
                           ...);
int /*<<< orphan*/ lseek(int, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
int open(char const *, int /*<<< orphan*/);
int read(int, char *, size_t);
int /*<<< orphan*/ sscanf(char *, char *, size_t *);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
char *strerror(int /*<<< orphan*/);
int write(int, char *, int);
int main(int argc, char *argv[]) {
  const char *infile = NULL;
  const char *outfile = NULL;
  size_t ibs = 512;
  size_t obs = 512;
  size_t count = 0;
  int limited = 0;
  size_t skip = 0;
  size_t seek = 0;
  int i;
  for (i = 1; i < argc; i++) {
    char *equalPos = strchr(argv[i], '=');
    if (equalPos == NULL) {
      fprintf(stderr, "%s: unrecognised command-line option: `%s'\n", argv[0],
              argv[i]);
      return 1;
    };
    *equalPos = 0;
    char *paramName = argv[i];
    char *valueStr = equalPos + 1;
    if (strcmp(paramName, "if") == 0) {
      infile = valueStr;
    } else if (strcmp(paramName, "of") == 0) {
      outfile = valueStr;
    } else if (strcmp(paramName, "ibs") == 0) {
      sscanf(valueStr, "%lu", &ibs);
    } else if (strcmp(paramName, "obs") == 0) {
      sscanf(valueStr, "%lu", &obs);
    } else if (strcmp(paramName, "bsize") == 0) {
      sscanf(valueStr, "%lu", &ibs);
      obs = ibs;
    } else if (strcmp(paramName, "bs") == 0) {
      sscanf(valueStr, "%lu", &ibs);
      obs = ibs;
    } else if (strcmp(paramName, "count") == 0) {
      sscanf(valueStr, "%lu", &count);
      limited = 1;
    } else if (strcmp(paramName, "skip") == 0) {
      sscanf(valueStr, "%lu", &skip);
    } else if (strcmp(paramName, "seek") == 0) {
      sscanf(valueStr, "%lu", &seek);
    } else {
      fprintf(stderr, "%s: unrecognised option: `%s'\n", argv[0], paramName);
      return 1;
    };
  };
  int infd;
  int outfd;
  if (infile == NULL) {
    infd = 0;
  } else {
    infd = open(infile, O_RDONLY);
    if (infd == -1) {
      fprintf(stderr, "%s: cannot open %s for reading: %s\n", argv[0], infile,
              strerror(errno));
      return 1;
    };
  };
  if (outfile == NULL) {
    outfd = 1;
  } else {
    outfd = open(outfile, O_WRONLY);
    if (outfd == -1) {
      fprintf(stderr, "%s: cannot open %s for writing: %s\n", argv[0], outfile,
              strerror(errno));
      return 1;
    };
  };
  lseek(infd, ibs * skip, SEEK_SET);
  lseek(outfd, obs * seek, SEEK_SET);
  if (ibs > obs)
    ibs = obs;
  char buffer[obs];
  while ((count--) || (!limited)) {
    memset(buffer, 0, obs);
    ssize_t sz = read(infd, buffer, ibs);
    if (sz == -1) {
      fprintf(stderr, "%s: cannot read: %s\n", argv[0], strerror(errno));
      return 1;
    };
    if (sz == 0)
      break;
    sz = write(outfd, buffer, sz);
    if (sz == 0)
      break;
    if (sz == -1) {
      fprintf(stderr, "%s: cannot write: %s\n", argv[0], strerror(errno));
      return 1;
    };
  };
  close(infd);
  close(outfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x200,-0x28(%rbp)
movq   $0x200,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14cc <main+0x31c>
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    1276 <main+0xc6>
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1839 <main+0x689>
mov    -0x60(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x70(%rbp)
mov    -0x68(%rbp),%rdi
lea    0xd88(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12c0 <main+0x110>
mov    -0x70(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    14b9 <main+0x309>
mov    -0x68(%rbp),%rdi
lea    0xd64(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12e7 <main+0x137>
mov    -0x70(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    14b4 <main+0x304>
mov    -0x68(%rbp),%rdi
lea    0xd40(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    131a <main+0x16a>
mov    -0x70(%rbp),%rdi
lea    0xd2a(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   10b0 <sscanf@plt>
jmp    14af <main+0x2ff>
mov    -0x68(%rbp),%rdi
lea    0xd15(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    134d <main+0x19d>
mov    -0x70(%rbp),%rdi
lea    0xcf7(%rip),%rsi
lea    -0x30(%rbp),%rdx
call   10b0 <sscanf@plt>
jmp    14aa <main+0x2fa>
mov    -0x68(%rbp),%rdi
lea    0xce6(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1388 <main+0x1d8>
mov    -0x70(%rbp),%rdi
lea    0xcc4(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   10b0 <sscanf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    14a5 <main+0x2f5>
mov    -0x68(%rbp),%rdi
lea    0xca0(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    13c3 <main+0x213>
mov    -0x70(%rbp),%rdi
lea    0xc89(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   10b0 <sscanf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    14a0 <main+0x2f0>
mov    -0x68(%rbp),%rdi
lea    0xc76(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    13fd <main+0x24d>
mov    -0x70(%rbp),%rdi
lea    0xc4e(%rip),%rsi
lea    -0x38(%rbp),%rdx
call   10b0 <sscanf@plt>
movl   $0x1,-0x3c(%rbp)
jmp    149b <main+0x2eb>
mov    -0x68(%rbp),%rdi
lea    0xc42(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1430 <main+0x280>
mov    -0x70(%rbp),%rdi
lea    0xc14(%rip),%rsi
lea    -0x48(%rbp),%rdx
call   10b0 <sscanf@plt>
jmp    1496 <main+0x2e6>
mov    -0x68(%rbp),%rdi
lea    0xc14(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1463 <main+0x2b3>
mov    -0x70(%rbp),%rdi
lea    0xbe1(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   10b0 <sscanf@plt>
jmp    1491 <main+0x2e1>
mov    0x2b6e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x68(%rbp),%rcx
lea    0xbd6(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1839 <main+0x689>
jmp    1496 <main+0x2e6>
jmp    149b <main+0x2eb>
jmp    14a0 <main+0x2f0>
jmp    14a5 <main+0x2f5>
jmp    14aa <main+0x2fa>
jmp    14af <main+0x2ff>
jmp    14b4 <main+0x304>
jmp    14b9 <main+0x309>
jmp    14be <main+0x30e>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    120f <main+0x5f>
cmpq   $0x0,-0x18(%rbp)
jne    14e3 <main+0x333>
movl   $0x0,-0x74(%rbp)
jmp    156e <main+0x3be>
mov    -0x18(%rbp),%rdi
mov    0x2afa(%rip),%rax
mov    (%rax),%esi
call   10c0 <open@plt>
mov    %eax,-0x74(%rbp)
cmpl   $0xffffffff,-0x74(%rbp)
jne    1569 <main+0x3b9>
mov    0x2acf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    0x2a9f(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xa4(%rbp),%edi
mov    -0xa0(%rbp),%rdx
mov    -0x98(%rbp),%rcx
mov    %rax,%r8
lea    0xb1d(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1839 <main+0x689>
jmp    156e <main+0x3be>
cmpq   $0x0,-0x20(%rbp)
jne    1585 <main+0x3d5>
movl   $0x1,-0x78(%rbp)
jmp    1610 <main+0x460>
mov    -0x20(%rbp),%rdi
mov    0x2a28(%rip),%rax
mov    (%rax),%esi
call   10c0 <open@plt>
mov    %eax,-0x78(%rbp)
cmpl   $0xffffffff,-0x78(%rbp)
jne    160b <main+0x45b>
mov    0x2a2d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xbc(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    0x29fd(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xbc(%rbp),%edi
mov    -0xb8(%rbp),%rdx
mov    -0xb0(%rbp),%rcx
mov    %rax,%r8
lea    0xa9f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1839 <main+0x689>
jmp    1610 <main+0x460>
mov    -0x74(%rbp),%edi
mov    -0x28(%rbp),%rsi
imul   -0x48(%rbp),%rsi
mov    0x29a5(%rip),%rax
mov    (%rax),%edx
call   1050 <lseek@plt>
mov    -0x78(%rbp),%edi
mov    -0x30(%rbp),%rsi
imul   -0x50(%rbp),%rsi
mov    0x298b(%rip),%rax
mov    (%rax),%edx
call   1050 <lseek@plt>
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jbe    165a <main+0x4aa>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xc8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x88(%rbp)
mov    -0x38(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x38(%rbp)
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xc9(%rbp)
jne    16b7 <main+0x507>
cmpl   $0x0,-0x3c(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0xc9(%rbp)
mov    -0xc9(%rbp),%al
test   $0x1,%al
jne    16ca <main+0x51a>
jmp    1811 <main+0x661>
mov    -0xc8(%rbp),%rdi
mov    -0x30(%rbp),%rdx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0xc8(%rbp),%rsi
mov    -0x74(%rbp),%edi
mov    -0x28(%rbp),%rdx
call   1080 <read@plt>
mov    %eax,-0x8c(%rbp)
cmpl   $0xffffffff,-0x8c(%rbp)
jne    1761 <main+0x5b1>
mov    0x28cf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xdc(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0xd8(%rbp)
mov    0x28aa(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xdc(%rbp),%edi
mov    -0xd8(%rbp),%rdx
mov    %rax,%rcx
lea    0x977(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x90(%rbp)
jmp    1832 <main+0x682>
cmpl   $0x0,-0x8c(%rbp)
jne    1773 <main+0x5c3>
jmp    1811 <main+0x661>
mov    -0xc8(%rbp),%rsi
mov    -0x78(%rbp),%edi
mov    -0x8c(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x8c(%rbp)
cmpl   $0x0,-0x8c(%rbp)
jne    17a0 <main+0x5f0>
jmp    1811 <main+0x661>
cmpl   $0xffffffff,-0x8c(%rbp)
jne    180c <main+0x65c>
mov    0x2824(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xec(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0xe8(%rbp)
mov    0x27ff(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xec(%rbp),%edi
mov    -0xe8(%rbp),%rdx
mov    %rax,%rcx
lea    0x8e1(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x90(%rbp)
jmp    1832 <main+0x682>
jmp    1687 <main+0x4d7>
mov    -0x74(%rbp),%edi
call   1070 <close@plt>
mov    -0x78(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x90(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%r15
movq   $0x200,-0x30(%rbp)
movq   $0x200,-0x40(%rbp)
movq   $0x0,-0x68(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x58(%rbp)
mov    $0x1,%r14d
xor    %r12d,%r12d
cmp    $0x2,%edi
jl     13c0 <main+0x210>
mov    %edi,%r14d
xor    %eax,%eax
mov    %rax,-0x50(%rbp)
mov    $0x1,%r13d
xor    %eax,%eax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x34(%rbp)
jmp    1231 <main+0x81>
nopl   0x0(%rax)
mov    %r12,-0x50(%rbp)
add    $0x1,%r13
cmp    %r13,%r14
je     14d1 <main+0x321>
mov    (%r15,%r13,8),%rbx
mov    %rbx,%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     14aa <main+0x2fa>
mov    %rax,%r12
movb   $0x0,(%rax)
mov    (%r15,%r13,8),%rbx
add    $0x1,%r12
mov    %rbx,%rdi
lea    0xdc9(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1220 <main+0x70>
mov    %rbx,%rdi
lea    0xdb8(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1340 <main+0x190>
mov    %rbx,%rdi
lea    0xda3(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1349 <main+0x199>
mov    %rbx,%rdi
lea    0xd93(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1379 <main+0x1c9>
mov    %rbx,%rdi
lea    0xd7f(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1359 <main+0x1a9>
mov    %rbx,%rdi
lea    0xd5c(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1359 <main+0x1a9>
mov    %rbx,%rdi
lea    0xd59(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1391 <main+0x1e1>
mov    %rbx,%rdi
lea    0xd47(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13b0 <main+0x200>
mov    %rbx,%rdi
lea    0xd34(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    15d5 <main+0x425>
mov    %r12,%rdi
lea    0xd03(%rip),%rsi
lea    -0x58(%rbp),%rdx
jmp    1387 <main+0x1d7>
nopl   0x0(%rax)
mov    %r12,-0x48(%rbp)
jmp    1224 <main+0x74>
mov    %r12,%rdi
lea    0xce3(%rip),%rsi
lea    -0x30(%rbp),%rdx
jmp    1387 <main+0x1d7>
mov    %r12,%rdi
lea    0xcd3(%rip),%rsi
lea    -0x30(%rbp),%rdx
call   10b0 <sscanf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    1224 <main+0x74>
mov    %r12,%rdi
lea    0xcb3(%rip),%rsi
lea    -0x40(%rbp),%rdx
call   10b0 <sscanf@plt>
jmp    1224 <main+0x74>
mov    %r12,%rdi
lea    0xc9b(%rip),%rsi
lea    -0x68(%rbp),%rdx
call   10b0 <sscanf@plt>
movl   $0x1,-0x34(%rbp)
jmp    1224 <main+0x74>
mov    %r12,%rdi
lea    0xc7c(%rip),%rsi
lea    -0x60(%rbp),%rdx
jmp    1387 <main+0x1d7>
movl   $0x0,-0x34(%rbp)
mov    -0x60(%rbp),%rsi
imul   -0x30(%rbp),%rsi
mov    0x2bf1(%rip),%rbx
mov    (%rbx),%edx
mov    %r12d,%edi
call   1050 <lseek@plt>
mov    -0x58(%rbp),%rsi
imul   -0x40(%rbp),%rsi
mov    (%rbx),%edx
mov    %r14d,%edi
call   1050 <lseek@plt>
mov    -0x40(%rbp),%rax
cmp    %rax,-0x30(%rbp)
jbe    1402 <main+0x252>
mov    %rax,-0x30(%rbp)
mov    %rsp,%r13
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
cs nopw 0x0(%rax,%rax,1)
addq   $0xffffffffffffffff,-0x68(%rbp)
jb     142d <main+0x27d>
cmpl   $0x0,-0x34(%rbp)
jne    1493 <main+0x2e3>
mov    -0x40(%rbp),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0x30(%rbp),%rdx
mov    %r12d,%edi
mov    %rbx,%rsi
call   1080 <read@plt>
test   %eax,%eax
je     1493 <main+0x2e3>
cmp    $0xffffffff,%eax
je     151e <main+0x36e>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %eax,%eax
je     1493 <main+0x2e3>
cmp    $0xffffffff,%eax
jne    1420 <main+0x270>
mov    0x2b64(%rip),%rax
mov    (%rax),%ebx
mov    (%r15),%r14
mov    0x2b50(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xc42(%rip),%rsi
jmp    153f <main+0x38f>
mov    %r12d,%edi
call   1070 <close@plt>
mov    %r14d,%edi
call   1070 <close@plt>
xor    %eax,%eax
jmp    1553 <main+0x3a3>
mov    0x2b27(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xb43(%rip),%rsi
mov    %rbx,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%eax
jmp    1556 <main+0x3a6>
mov    -0x50(%rbp),%rbx
test   %rbx,%rbx
je     1565 <main+0x3b5>
mov    0x2b03(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10c0 <open@plt>
mov    %eax,%r12d
cmp    $0xffffffff,%eax
jne    1568 <main+0x3b8>
mov    0x2ada(%rip),%rax
mov    (%rax),%r12d
mov    (%r15),%r14
mov    0x2ac5(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xb5a(%rip),%rsi
jmp    15b0 <main+0x400>
mov    0x2ab3(%rip),%rax
mov    (%rax),%ebx
mov    (%r15),%r14
mov    0x2a9f(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xb7c(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%eax
mov    %r13,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r12d,%r12d
mov    -0x48(%rbp),%rbx
test   %rbx,%rbx
je     15ca <main+0x41a>
mov    0x2a40(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10c0 <open@plt>
mov    %eax,%r14d
cmp    $0xffffffff,%eax
jne    13c7 <main+0x217>
mov    0x2a43(%rip),%rax
mov    (%rax),%r12d
mov    (%r15),%r14
mov    0x2a2e(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xae7(%rip),%rsi
mov    %r12d,%edi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%eax
jmp    1556 <main+0x3a6>
mov    $0x1,%r14d
jmp    13c7 <main+0x217>
mov    0x29fc(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xa6c(%rip),%rsi
jmp    14bd <main+0x30d>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"%s: unrecognised command-line option: `%s'\0A\00"
@.str.1 = [3 x i8] c"if\00"
@.str.2 = [3 x i8] c"of\00"
@.str.3 = [4 x i8] c"ibs\00"
@.str.4 = [4 x i8] c"%lu\00"
@.str.5 = [4 x i8] c"obs\00"
@.str.6 = [6 x i8] c"bsize\00"
@.str.7 = [3 x i8] c"bs\00"
@.str.8 = [6 x i8] c"count\00"
@.str.9 = [5 x i8] c"skip\00"
@.str.10 = [5 x i8] c"seek\00"
@.str.11 = [31 x i8] c"%s: unrecognised option: `%s'\0A\00"
@O_RDONLY = global i32 0
@.str.12 = [36 x i8] c"%s: cannot open %s for reading: %s\0A\00"
@errno = global i32 0
@O_WRONLY = global i32 0
@.str.13 = [36 x i8] c"%s: cannot open %s for writing: %s\0A\00"
@SEEK_SET = global i32 0
@.str.14 = [21 x i8] c"%s: cannot read: %s\0A\00"
@.str.15 = [22 x i8] c"%s: cannot write: %s\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 i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i8*
%21 = alloca i64
%22 = alloca i32
%23 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i64 512, i64* %8
store i64 512, i64* %9
store i64 0, i64* %10
store i32 0, i32* %11
store i64 0, i64* %12
store i64 0, i64* %13
store i32 1, i32* %14
br label %24
24: ; preds = %135, %2
%25 = load i32, i32* %14
%26 = load i32, i32* %4
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %138
28: ; preds = %24
%29 = load i8**, i8*** %5
%30 = load i32, i32* %14
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i8* @strchr(i8* %33, i8 signext 61)
store i8* %34, i8** %15
%35 = load i8*, i8** %15
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %48
37: ; preds = %28
%38 = load i32, i32* @stderr
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 0
%41 = load i8*, i8** %40
%42 = load i8**, i8*** %5
%43 = load i32, i32* %14
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %42, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %41, i8* %46)
store i32 1, i32* %3
br label %256
48: ; preds = %28
%49 = load i8*, i8** %15
store i8 0, i8* %49
%50 = load i8**, i8*** %5
%51 = load i32, i32* %14
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
store i8* %54, i8** %16
%55 = load i8*, i8** %15
%56 = getelementptr inbounds i8, i8* %55, i64 1
store i8* %56, i8** %17
%57 = load i8*, i8** %16
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %48
%61 = load i8*, i8** %17
store i8* %61, i8** %6
br label %134
62: ; preds = %48
%63 = load i8*, i8** %16
%64 = call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %62
%67 = load i8*, i8** %17
store i8* %67, i8** %7
br label %133
68: ; preds = %62
%69 = load i8*, i8** %16
%70 = call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %68
%73 = load i8*, i8** %17
%74 = call i32 @sscanf(i8* %73, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %8)
br label %132
75: ; preds = %68
%76 = load i8*, i8** %16
%77 = call i64 @strcmp(i8* %76, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %75
%80 = load i8*, i8** %17
%81 = call i32 @sscanf(i8* %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %9)
br label %131
82: ; preds = %75
%83 = load i8*, i8** %16
%84 = call i64 @strcmp(i8* %83, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %90
86: ; preds = %82
%87 = load i8*, i8** %17
%88 = call i32 @sscanf(i8* %87, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %8)
%89 = load i64, i64* %8
store i64 %89, i64* %9
br label %130
90: ; preds = %82
%91 = load i8*, i8** %16
%92 = call i64 @strcmp(i8* %91, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %98
94: ; preds = %90
%95 = load i8*, i8** %17
%96 = call i32 @sscanf(i8* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %8)
%97 = load i64, i64* %8
store i64 %97, i64* %9
br label %129
98: ; preds = %90
%99 = load i8*, i8** %16
%100 = call i64 @strcmp(i8* %99, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %98
%103 = load i8*, i8** %17
%104 = call i32 @sscanf(i8* %103, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %10)
store i32 1, i32* %11
br label %128
105: ; preds = %98
%106 = load i8*, i8** %16
%107 = call i64 @strcmp(i8* %106, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%108 = icmp eq i64 %107, 0
br i1 %108, label %109, label %112
109: ; preds = %105
%110 = load i8*, i8** %17
%111 = call i32 @sscanf(i8* %110, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %12)
br label %127
112: ; preds = %105
%113 = load i8*, i8** %16
%114 = call i64 @strcmp(i8* %113, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%115 = icmp eq i64 %114, 0
br i1 %115, label %116, label %119
116: ; preds = %112
%117 = load i8*, i8** %17
%118 = call i32 @sscanf(i8* %117, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %13)
br label %126
119: ; preds = %112
%120 = load i32, i32* @stderr
%121 = load i8**, i8*** %5
%122 = getelementptr inbounds i8*, i8** %121, i64 0
%123 = load i8*, i8** %122
%124 = load i8*, i8** %16
%125 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %120, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %123, i8* %124)
store i32 1, i32* %3
br label %256
126: ; preds = %116
br label %127
127: ; preds = %126, %109
br label %128
128: ; preds = %127, %102
br label %129
129: ; preds = %128, %94
br label %130
130: ; preds = %129, %86
br label %131
131: ; preds = %130, %79
br label %132
132: ; preds = %131, %72
br label %133
133: ; preds = %132, %66
br label %134
134: ; preds = %133, %60
br label %135
135: ; preds = %134
%136 = load i32, i32* %14
%137 = add nsw i32 %136, 1
store i32 %137, i32* %14
br label %24
138: ; preds = %24
%139 = load i8*, i8** %6
%140 = icmp eq i8* %139, null
br i1 %140, label %141, label %142
141: ; preds = %138
store i32 0, i32* %18
br label %158
142: ; preds = %138
%143 = load i8*, i8** %6
%144 = load i32, i32* @O_RDONLY
%145 = call i32 @open(i8* %143, i32 %144)
store i32 %145, i32* %18
%146 = load i32, i32* %18
%147 = icmp eq i32 %146, -1
br i1 %147, label %148, label %157
148: ; preds = %142
%149 = load i32, i32* @stderr
%150 = load i8**, i8*** %5
%151 = getelementptr inbounds i8*, i8** %150, i64 0
%152 = load i8*, i8** %151
%153 = load i8*, i8** %6
%154 = load i32, i32* @errno
%155 = call i8* @strerror(i32 %154)
%156 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %149, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i8* %152, i8* %153, i8* %155)
store i32 1, i32* %3
br label %256
157: ; preds = %142
br label %158
158: ; preds = %157, %141
%159 = load i8*, i8** %7
%160 = icmp eq i8* %159, null
br i1 %160, label %161, label %162
161: ; preds = %158
store i32 1, i32* %19
br label %178
162: ; preds = %158
%163 = load i8*, i8** %7
%164 = load i32, i32* @O_WRONLY
%165 = call i32 @open(i8* %163, i32 %164)
store i32 %165, i32* %19
%166 = load i32, i32* %19
%167 = icmp eq i32 %166, -1
br i1 %167, label %168, label %177
168: ; preds = %162
%169 = load i32, i32* @stderr
%170 = load i8**, i8*** %5
%171 = getelementptr inbounds i8*, i8** %170, i64 0
%172 = load i8*, i8** %171
%173 = load i8*, i8** %7
%174 = load i32, i32* @errno
%175 = call i8* @strerror(i32 %174)
%176 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %169, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i8* %172, i8* %173, i8* %175)
store i32 1, i32* %3
br label %256
177: ; preds = %162
br label %178
178: ; preds = %177, %161
%179 = load i32, i32* %18
%180 = load i64, i64* %8
%181 = load i64, i64* %12
%182 = mul i64 %180, %181
%183 = load i32, i32* @SEEK_SET
%184 = call i32 @lseek(i32 %179, i64 %182, i32 %183)
%185 = load i32, i32* %19
%186 = load i64, i64* %9
%187 = load i64, i64* %13
%188 = mul i64 %186, %187
%189 = load i32, i32* @SEEK_SET
%190 = call i32 @lseek(i32 %185, i64 %188, i32 %189)
%191 = load i64, i64* %8
%192 = load i64, i64* %9
%193 = icmp ugt i64 %191, %192
br i1 %193, label %194, label %196
194: ; preds = %178
%195 = load i64, i64* %9
store i64 %195, i64* %8
br label %196
196: ; preds = %194, %178
%197 = load i64, i64* %9
%198 = call i8* @llvm.stacksave()
store i8* %198, i8** %20
%199 = alloca i8, i64 %197
store i64 %197, i64* %21
br label %200
200: ; preds = %248, %196
%201 = load i64, i64* %10
%202 = add i64 %201, -1
store i64 %202, i64* %10
%203 = icmp ne i64 %201, 0
br i1 %203, label %208, label %204
204: ; preds = %200
%205 = load i32, i32* %11
%206 = icmp ne i32 %205, 0
%207 = xor i1 %206, true
br label %208
208: ; preds = %204, %200
%209 = phi i1 [ true, %200 ], [ %207, %204 ]
br i1 %209, label %210, label %249
210: ; preds = %208
%211 = load i64, i64* %9
%212 = call i32 @memset(i8* %199, i32 0, i64 %211)
%213 = load i32, i32* %18
%214 = load i64, i64* %8
%215 = call i32 @read(i32 %213, i8* %199, i64 %214)
store i32 %215, i32* %22
%216 = load i32, i32* %22
%217 = icmp eq i32 %216, -1
br i1 %217, label %218, label %226
218: ; preds = %210
%219 = load i32, i32* @stderr
%220 = load i8**, i8*** %5
%221 = getelementptr inbounds i8*, i8** %220, i64 0
%222 = load i8*, i8** %221
%223 = load i32, i32* @errno
%224 = call i8* @strerror(i32 %223)
%225 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %219, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i8* %222, i8* %224)
store i32 1, i32* %3
store i32 1, i32* %23
br label %254
226: ; preds = %210
%227 = load i32, i32* %22
%228 = icmp eq i32 %227, 0
br i1 %228, label %229, label %230
229: ; preds = %226
br label %249
230: ; preds = %226
%231 = load i32, i32* %19
%232 = load i32, i32* %22
%233 = call i32 @write(i32 %231, i8* %199, i32 %232)
store i32 %233, i32* %22
%234 = load i32, i32* %22
%235 = icmp eq i32 %234, 0
br i1 %235, label %236, label %237
236: ; preds = %230
br label %249
237: ; preds = %230
%238 = load i32, i32* %22
%239 = icmp eq i32 %238, -1
br i1 %239, label %240, label %248
240: ; preds = %237
%241 = load i32, i32* @stderr
%242 = load i8**, i8*** %5
%243 = getelementptr inbounds i8*, i8** %242, i64 0
%244 = load i8*, i8** %243
%245 = load i32, i32* @errno
%246 = call i8* @strerror(i32 %245)
%247 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %241, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0), i8* %244, i8* %246)
store i32 1, i32* %3
store i32 1, i32* %23
br label %254
248: ; preds = %237
br label %200
249: ; preds = %236, %229, %208
%250 = load i32, i32* %18
%251 = call i32 @close(i32 %250)
%252 = load i32, i32* %19
%253 = call i32 @close(i32 %252)
store i32 0, i32* %3
store i32 1, i32* %23
br label %254
254: ; preds = %249, %240, %218
%255 = load i8*, i8** %20
br label %256
256: ; preds = %254, %168, %148, %119, %37
%257 = load i32, i32* %3
ret i32 %257
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"%s: unrecognised command-line option: `%s'\0A\00"
@.str.1 = [3 x i8] c"if\00"
@.str.2 = [3 x i8] c"of\00"
@.str.3 = [4 x i8] c"ibs\00"
@.str.4 = [4 x i8] c"%lu\00"
@.str.5 = [4 x i8] c"obs\00"
@.str.6 = [6 x i8] c"bsize\00"
@.str.7 = [3 x i8] c"bs\00"
@.str.8 = [6 x i8] c"count\00"
@.str.9 = [5 x i8] c"skip\00"
@.str.10 = [5 x i8] c"seek\00"
@.str.11 = [31 x i8] c"%s: unrecognised option: `%s'\0A\00"
@O_RDONLY = global i32 0
@.str.12 = [36 x i8] c"%s: cannot open %s for reading: %s\0A\00"
@errno = global i32 0
@O_WRONLY = global i32 0
@.str.13 = [36 x i8] c"%s: cannot open %s for writing: %s\0A\00"
@SEEK_SET = global i32 0
@.str.14 = [21 x i8] c"%s: cannot read: %s\0A\00"
@.str.15 = [22 x i8] c"%s: cannot write: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = bitcast i64* %3 to i8*
store i64 512, i64* %3
%9 = bitcast i64* %4 to i8*
store i64 512, i64* %4
%10 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%11 = bitcast i64* %6 to i8*
store i64 0, i64* %6
%12 = bitcast i64* %7 to i8*
store i64 0, i64* %7
%13 = icmp sgt i32 %0, 1
br i1 %13, label %14, label %109
14: ; preds = %2
%15 = zext i32 %0 to i64
br label %16
16: ; preds = %14, %78
%17 = phi i64 [ 1, %14 ], [ %82, %78 ]
%18 = phi i8* [ null, %14 ], [ %81, %78 ]
%19 = phi i8* [ null, %14 ], [ %80, %78 ]
%20 = phi i32 [ 0, %14 ], [ %79, %78 ]
%21 = getelementptr inbounds i8*, i8** %1, i64 %17
%22 = load i8*, i8** %21
%23 = call i8* @strchr(i8* dereferenceable(1) %22, i8 signext 61)
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %29
25: ; preds = %16
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %1
%28 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %27, i8* %22)
br label %160
29: ; preds = %16
store i8 0, i8* %23
%30 = load i8*, i8** %21
%31 = getelementptr inbounds i8, i8* %23, i64 1
%32 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %78, label %34
34: ; preds = %29
%35 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %78, label %37
37: ; preds = %34
%38 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %3)
br label %78
42: ; preds = %37
%43 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %4)
br label %78
47: ; preds = %42
%48 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %3)
%52 = load i64, i64* %3
store i64 %52, i64* %4
br label %78
53: ; preds = %47
%54 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %3)
%58 = load i64, i64* %3
store i64 %58, i64* %4
br label %78
59: ; preds = %53
%60 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %5)
br label %78
64: ; preds = %59
%65 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %6)
br label %78
69: ; preds = %64
%70 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %7)
br label %78
74: ; preds = %69
%75 = load i32, i32* @stderr
%76 = load i8*, i8** %1
%77 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %76, i8* %30)
br label %160
78: ; preds = %34, %29, %45, %56, %67, %72, %62, %50, %40
%79 = phi i32 [ %20, %34 ], [ %20, %29 ], [ %20, %72 ], [ %20, %67 ], [ 1, %62 ], [ %20, %56 ], [ %20, %50 ], [ %20, %45 ], [ %20, %40 ]
%80 = phi i8* [ %31, %34 ], [ %19, %29 ], [ %19, %72 ], [ %19, %67 ], [ %19, %62 ], [ %19, %56 ], [ %19, %50 ], [ %19, %45 ], [ %19, %40 ]
%81 = phi i8* [ %18, %34 ], [ %31, %29 ], [ %18, %72 ], [ %18, %67 ], [ %18, %62 ], [ %18, %56 ], [ %18, %50 ], [ %18, %45 ], [ %18, %40 ]
%82 = add nuw nsw i64 %17, 1
%83 = icmp eq i64 %82, %15
br i1 %83, label %84, label %16
84: ; preds = %78
%85 = icmp eq i8* %81, null
br i1 %85, label %96, label %86
86: ; preds = %84
%87 = load i32, i32* @O_RDONLY
%88 = call i32 @open(i8* %81, i32 %87)
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %96
90: ; preds = %86
%91 = load i32, i32* @stderr
%92 = load i8*, i8** %1
%93 = load i32, i32* @errno
%94 = call i8* @strerror(i32 %93)
%95 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i8* %92, i8* %81, i8* %94)
br label %160
96: ; preds = %84, %86
%97 = phi i32 [ %88, %86 ], [ 0, %84 ]
%98 = icmp eq i8* %80, null
br i1 %98, label %109, label %99
99: ; preds = %96
%100 = load i32, i32* @O_WRONLY
%101 = call i32 @open(i8* %80, i32 %100)
%102 = icmp eq i32 %101, -1
br i1 %102, label %103, label %109
103: ; preds = %99
%104 = load i32, i32* @stderr
%105 = load i8*, i8** %1
%106 = load i32, i32* @errno
%107 = call i8* @strerror(i32 %106)
%108 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %104, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), i8* %105, i8* %80, i8* %107)
br label %160
109: ; preds = %2, %96, %99
%110 = phi i32 [ %97, %99 ], [ %97, %96 ], [ 0, %2 ]
%111 = phi i32 [ %79, %99 ], [ %79, %96 ], [ 0, %2 ]
%112 = phi i32 [ %101, %99 ], [ 1, %96 ], [ 1, %2 ]
%113 = load i64, i64* %3
%114 = load i64, i64* %6
%115 = mul i64 %114, %113
%116 = load i32, i32* @SEEK_SET
%117 = call i32 @lseek(i32 %110, i64 %115, i32 %116)
%118 = load i64, i64* %4
%119 = load i64, i64* %7
%120 = mul i64 %119, %118
%121 = load i32, i32* @SEEK_SET
%122 = call i32 @lseek(i32 %112, i64 %120, i32 %121)
%123 = load i64, i64* %3
%124 = load i64, i64* %4
%125 = icmp ugt i64 %123, %124
br i1 %125, label %126, label %127
126: ; preds = %109
store i64 %124, i64* %3
br label %127
127: ; preds = %126, %109
%128 = call i8* @llvm.stacksave()
%129 = alloca i8, i64 %124
%130 = icmp eq i32 %111, 0
br label %131
131: ; preds = %147, %127
%132 = load i64, i64* %5
%133 = add i64 %132, -1
store i64 %133, i64* %5
%134 = icmp ne i64 %132, 0
%135 = select i1 %134, i1 true, i1 %130
br i1 %135, label %136, label %155
136: ; preds = %131
%137 = load i64, i64* %4
%138 = call i32 @memset(i8* %129, i32 0, i64 %137)
%139 = load i64, i64* %3
%140 = call i32 @read(i32 %110, i8* %129, i64 %139)
switch i32 %140, label %147 [
i32 -1, label %141
i32 0, label %155
]
141: ; preds = %136
%142 = load i32, i32* @stderr
%143 = load i8*, i8** %1
%144 = load i32, i32* @errno
%145 = call i8* @strerror(i32 %144)
%146 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %142, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i8* %143, i8* %145)
br label %158
147: ; preds = %136
%148 = call i32 @write(i32 %112, i8* %129, i32 %140)
switch i32 %148, label %131 [
i32 0, label %155
i32 -1, label %149
]
149: ; preds = %147
%150 = load i32, i32* @stderr
%151 = load i8*, i8** %1
%152 = load i32, i32* @errno
%153 = call i8* @strerror(i32 %152)
%154 = call i32 (i32, i8*, i8*, i8*, ...) @fprintf(i32 %150, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0), i8* %151, i8* %153)
br label %158
155: ; preds = %147, %136, %131
%156 = call i32 @close(i32 %110)
%157 = call i32 @close(i32 %112)
br label %158
158: ; preds = %149, %141, %155
%159 = phi i32 [ 0, %155 ], [ 1, %141 ], [ 1, %149 ]
br label %160
160: ; preds = %25, %74, %90, %103, %158
%161 = phi i32 [ %159, %158 ], [ 1, %103 ], [ 1, %90 ], [ 1, %25 ], [ 1, %74 ]
ret i32 %161
}