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

/* Variables and functions */
int O_APPEND;
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int O_TRUNC;
int O_WRONLY;
int atoi(char *);
scalar_t__ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
int open(char *, int, ...);
char *optarg;
scalar_t__ opterr;
int optind;
int optopt;
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int write(int, char *, int);
int main(int argc, char **argv) {
  int c;
  char *x;
  char *o_opt_arg;
  int buff_size = 512;
  opterr = 0;
  while ((c = getopt(argc, argv, "b:o:")) != -1) {
    switch (c) {
    case 'b':
      buff_size = atoi(optarg);
      if (buff_size <= 0 || buff_size >= 1000000) {
        fprintf(stderr,
                "ERROR: option '-%c' requires an argument in the range "
                "(0,1000000)\n",
                optopt);
        return -1;
      }
      break;
    case 'o':
      o_opt_arg = optarg;
      break;
    case '?':
      if (optopt == 'b' || optopt == 'o') {
        fprintf(stderr, "ERROR: option '-%c' requires an argument\n", optopt);
        return -1;
      }
      break;
    }
  }
  char buf[buff_size];
  char *error_stringin, *error_stringout;
  int index = optind - 1;
  int outfile, infile, readbuf, writefile, pwcounter = 0;
  error_stringout = o_opt_arg;
  if (o_opt_arg == NULL) {
    outfile = 1;
    error_stringout = "standard output";
  } else if ((outfile = open(o_opt_arg, O_TRUNC | O_CREAT | O_APPEND | O_WRONLY,
                             0666)) < 0) {
    perror(o_opt_arg);
    return -1;
  }
  while (index > 0) {
    char tempstr[4];
    strncpy(tempstr, argv[index], 3);
    if ((strcmp(tempstr, "-b") == 0) || (strcmp(tempstr, "-o") == 0)) {
      if (index != argc - 1 && tempstr[2] == '\0')
        index++;
      index++;
      break;
    }
    index--;
  }
  if (index == 0 && argc > 1)
    index++;
  while (1) {
    error_stringin = argv[index];
    if (index == argc || strcmp(argv[index], "-") == 0 || index == 0) {
      infile = 0;
      error_stringin = "standard input";
    } else if ((infile = open(argv[index], O_RDONLY)) < 0) {
      perror("open");
      return -1;
    }
    while (1) {
      if ((readbuf = read(infile, buf, buff_size)) < 0) {
        perror(error_stringin);
        return -1;
      }
      writefile = write(outfile, buf, readbuf);
      x = buf;
      if (writefile < 0) {
        perror(error_stringout);
        return -1;
      }
      while (writefile < readbuf) {
        pwcounter++;
        x += writefile;
        readbuf -= writefile;
        writefile = write(outfile, x, readbuf);
        if (pwcounter > 1000000) {
          fprintf(stderr, "ERROR: partial write attempts exceeded the limit");
          return -1;
        }
      }
      if (readbuf == 0)
        break;
    }
    if (infile != 0) {
      if (close(infile) < 0) {
        perror(error_stringin);
        return -1;
      }
    }
    index++;
    if (index >= argc)
      break;
  }
  if (outfile != 1) {
    if (close(outfile) < 0) {
      perror(error_stringout);
      return -1;
    }
  }
  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)
movl   $0x200,-0x2c(%rbp)
mov    0x2de1(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe24(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     12e6 <main+0x146>
mov    -0x14(%rbp),%eax
mov    %eax,-0x74(%rbp)
sub    $0x3f,%eax
je     1290 <main+0xf0>
jmp    1201 <main+0x61>
mov    -0x74(%rbp),%eax
sub    $0x62,%eax
je     1223 <main+0x83>
jmp    1212 <main+0x72>
mov    -0x74(%rbp),%eax
sub    $0x6f,%eax
je     127d <main+0xdd>
jmp    12e1 <main+0x141>
mov    0x2dc6(%rip),%rax
mov    (%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    124c <main+0xac>
cmpl   $0xf4240,-0x2c(%rbp)
jl     1278 <main+0xd8>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
mov    0x2d6c(%rip),%rax
mov    (%rax),%edx
lea    0xda0(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    16e8 <main+0x548>
jmp    12e1 <main+0x141>
mov    0x2d6c(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    12e1 <main+0x141>
mov    0x2d31(%rip),%rax
cmpl   $0x62,(%rax)
je     12b0 <main+0x110>
mov    0x2d21(%rip),%rax
cmpl   $0x6f,(%rax)
jne    12dc <main+0x13c>
mov    0x2cf9(%rip),%rax
mov    (%rax),%edi
mov    0x2d08(%rip),%rax
mov    (%rax),%edx
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    16e8 <main+0x548>
jmp    12e1 <main+0x141>
jmp    11ce <main+0x2e>
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    0x2cad(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x68(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    134c <main+0x1ac>
movl   $0x1,-0x58(%rbp)
lea    0xd2f(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    13ad <main+0x20d>
mov    -0x28(%rbp),%rdi
mov    0x2c91(%rip),%rax
mov    (%rax),%esi
mov    0x2c98(%rip),%rax
or     (%rax),%esi
mov    0x2c27(%rip),%rax
or     (%rax),%esi
mov    0x2c26(%rip),%rax
or     (%rax),%esi
mov    $0x1b6,%edx
mov    $0x0,%al
call   1090 <open@plt>
mov    %eax,-0x58(%rbp)
cmp    $0x0,%eax
jge    13a8 <main+0x208>
mov    -0x28(%rbp),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    16e1 <main+0x541>
jmp    13ad <main+0x20d>
jmp    13b2 <main+0x212>
cmpl   $0x0,-0x54(%rbp)
jle    144d <main+0x2ad>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xca1(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     140a <main+0x26a>
lea    -0x70(%rbp),%rdi
lea    0xc8a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    143f <main+0x29f>
mov    -0x54(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1431 <main+0x291>
movsbl -0x6e(%rbp),%eax
cmp    $0x0,%eax
jne    1431 <main+0x291>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    144d <main+0x2ad>
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    13b2 <main+0x212>
cmpl   $0x0,-0x54(%rbp)
jne    146a <main+0x2ca>
cmpl   $0x1,-0x8(%rbp)
jle    146a <main+0x2ca>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    146f <main+0x2cf>
jmp    1474 <main+0x2d4>
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     14bc <main+0x31c>
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbe5(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     14bc <main+0x31c>
cmpl   $0x0,-0x54(%rbp)
jne    14d3 <main+0x333>
movl   $0x0,-0x5c(%rbp)
lea    0xbc0(%rip),%rax
mov    %rax,-0x48(%rbp)
jmp    151f <main+0x37f>
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2aea(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1090 <open@plt>
mov    %eax,-0x5c(%rbp)
cmp    $0x0,%eax
jge    151a <main+0x37a>
lea    0xb97(%rip),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    16e1 <main+0x541>
jmp    151f <main+0x37f>
jmp    1524 <main+0x384>
jmp    1529 <main+0x389>
mov    -0x80(%rbp),%rsi
mov    -0x5c(%rbp),%edi
mov    -0x2c(%rbp),%edx
call   1060 <read@plt>
mov    %eax,-0x60(%rbp)
cmp    $0x0,%eax
jge    1560 <main+0x3c0>
mov    -0x48(%rbp),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    16e1 <main+0x541>
mov    -0x80(%rbp),%rsi
mov    -0x58(%rbp),%edi
mov    -0x60(%rbp),%edx
call   1040 <write@plt>
mov    %eax,%ecx
mov    -0x80(%rbp),%rax
mov    %ecx,-0x64(%rbp)
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x64(%rbp)
jge    15a2 <main+0x402>
mov    -0x50(%rbp),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    16e1 <main+0x541>
jmp    15a7 <main+0x407>
mov    -0x64(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    1626 <main+0x486>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x64(%rbp),%ecx
mov    -0x60(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x60(%rbp)
mov    -0x58(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x60(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0xf4240,-0x68(%rbp)
jle    1621 <main+0x481>
mov    0x29b2(%rip),%rax
mov    (%rax),%edi
lea    0xa97(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    16e1 <main+0x541>
jmp    15a7 <main+0x407>
cmpl   $0x0,-0x60(%rbp)
jne    1635 <main+0x495>
jmp    163a <main+0x49a>
jmp    1524 <main+0x384>
cmpl   $0x0,-0x5c(%rbp)
je     1677 <main+0x4d7>
mov    -0x5c(%rbp),%edi
call   1050 <close@plt>
cmp    $0x0,%rax
jge    1672 <main+0x4d2>
mov    -0x48(%rbp),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    16e1 <main+0x541>
jmp    1677 <main+0x4d7>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1691 <main+0x4f1>
jmp    1696 <main+0x4f6>
jmp    146f <main+0x2cf>
cmpl   $0x1,-0x58(%rbp)
je     16d3 <main+0x533>
mov    -0x58(%rbp),%edi
call   1050 <close@plt>
cmp    $0x0,%rax
jge    16ce <main+0x52e>
mov    -0x50(%rbp),%rdi
call   10a0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
jmp    16e1 <main+0x541>
jmp    16d3 <main+0x533>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x6c(%rbp)
mov    -0x38(%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    $0x58,%rsp
mov    %rsi,-0x48(%rbp)
mov    %edi,%r14d
mov    0x2de9(%rip),%rax
movq   $0x0,(%rax)
movl   $0x200,-0x3c(%rbp)
lea    0xe2c(%rip),%rbx
mov    0x2ded(%rip),%r12
mov    0x2e0e(%rip),%r13
jmp    11f5 <main+0x55>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0xffffffff,%eax
je     126e <main+0xce>
mov    %r14d,%edi
mov    -0x48(%rbp),%rsi
mov    %rbx,%rdx
call   10b0 <getopt@plt>
cmp    $0x61,%eax
jg     1220 <main+0x80>
cmp    $0x3f,%eax
jne    11f0 <main+0x50>
mov    (%r12),%edx
cmp    $0x6f,%edx
je     124d <main+0xad>
cmp    $0x62,%edx
jne    11f5 <main+0x55>
jmp    124d <main+0xad>
xchg   %ax,%ax
cmp    $0x6f,%eax
je     1247 <main+0xa7>
cmp    $0x62,%eax
jne    11f5 <main+0x55>
mov    0x0(%r13),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x3c(%rbp)
add    $0xfff0bdc0,%eax
cmp    $0xfff0bdc0,%eax
ja     11f5 <main+0x55>
jmp    156b <main+0x3cb>
mov    0x0(%r13),%r15
jmp    11f5 <main+0x55>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
lea    0xdeb(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%ebx
jmp    1550 <main+0x3b0>
mov    %rsp,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
mov    %rsp,%r12
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    0x2d33(%rip),%rax
mov    (%rax),%r13d
test   %r15,%r15
je     12d4 <main+0x134>
mov    %r15,%rdi
mov    0x2d49(%rip),%rax
mov    0x2d52(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2cdf(%rip),%rax
or     (%rax),%esi
mov    0x2cde(%rip),%rax
or     (%rax),%esi
mov    $0x1b6,%edx
xor    %eax,%eax
call   1090 <open@plt>
test   %eax,%eax
js     1561 <main+0x3c1>
mov    %eax,%ecx
jmp    12e0 <main+0x140>
mov    $0x1,%ecx
lea    0xd92(%rip),%r15
mov    %r15,-0x58(%rbp)
lea    -0x1(%r13),%eax
cmp    $0x2,%r13d
mov    %ecx,-0x2c(%rbp)
jl     1391 <main+0x1f1>
mov    %r12,%r15
mov    %eax,%ebx
mov    -0x48(%rbp),%rax
mov    (%rax,%rbx,8),%rsi
lea    -0x4c(%rbp),%r12
mov    %r12,%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
lea    0xd68(%rip),%rsi
mov    %r12,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     137c <main+0x1dc>
lea    -0x4c(%rbp),%r12
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
lea    0xd4b(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     137c <main+0x1dc>
cmp    $0x1,%rbx
jle    1396 <main+0x1f6>
mov    -0x48(%rbp),%rax
mov    -0x8(%rax,%rbx,8),%rsi
mov    %r12,%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    %r12,%rdi
lea    0xd18(%rip),%rsi
call   1070 <strcmp@plt>
add    $0xffffffff,%r13d
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
jne    1330 <main+0x190>
cmpb   $0x0,-0x4a(%rbp)
mov    %ebx,%eax
cmove  %r13d,%eax
cmp    %r14d,%r13d
cmove  %ebx,%eax
add    $0x1,%eax
jmp    1398 <main+0x1f8>
mov    %ecx,%r15d
jmp    139f <main+0x1ff>
xor    %eax,%eax
mov    %r15,%r12
mov    -0x2c(%rbp),%r15d
test   %eax,%eax
cltq
mov    $0x1,%ecx
cmovne %rax,%rcx
cmp    $0x2,%r14d
cmovl  %rax,%rcx
movslq %r14d,%rax
lea    0xccc(%rip),%rdx
xor    %r13d,%r13d
mov    %r12,-0x78(%rbp)
mov    %rax,-0x70(%rbp)
mov    %rdx,%rsi
mov    $0x0,%ebx
cmp    %rax,%rcx
mov    %rcx,-0x68(%rbp)
je     143b <main+0x29b>
mov    -0x48(%rbp),%rax
mov    (%rax,%rcx,8),%r14
mov    %r14,%rdi
lea    0xc9c(%rip),%rsi
call   1070 <strcmp@plt>
lea    0xc92(%rip),%rdx
mov    -0x68(%rbp),%rcx
mov    %rdx,%rsi
mov    $0x0,%ebx
test   %rax,%rax
je     143b <main+0x29b>
mov    %rdx,%rsi
mov    $0x0,%ebx
test   %rcx,%rcx
je     143b <main+0x29b>
mov    -0x48(%rbp),%rax
mov    (%rax,%rcx,8),%rdi
mov    0x2bab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1090 <open@plt>
mov    %eax,%ebx
mov    %r14,%rsi
test   %eax,%eax
js     1590 <main+0x3f0>
mov    %rsi,-0x60(%rbp)
mov    %ebx,-0x50(%rbp)
mov    %ebx,%edi
mov    %r12,%rsi
mov    -0x3c(%rbp),%edx
call   1060 <read@plt>
test   %eax,%eax
js     1584 <main+0x3e4>
mov    %eax,%r14d
mov    %r15d,%edi
mov    %r12,%rsi
mov    %eax,%edx
call   1040 <write@plt>
test   %eax,%eax
js     158a <main+0x3ea>
cmp    $0xf4241,%r13d
mov    $0xf4240,%r15d
cmovge %r13d,%r15d
add    $0x1,%r15d
mov    %r14d,%ebx
nopw   0x0(%rax,%rax,1)
sub    %eax,%ebx
jle    14c0 <main+0x320>
add    $0x1,%r13d
cltq
add    %rax,%r12
mov    -0x2c(%rbp),%edi
mov    %r12,%rsi
mov    %ebx,%edx
call   1040 <write@plt>
mov    %ebx,%r14d
cmp    %r13d,%r15d
jne    1490 <main+0x2f0>
jmp    152d <main+0x38d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %r14d,%r14d
mov    -0x78(%rbp),%r12
mov    -0x2c(%rbp),%r15d
mov    -0x50(%rbp),%ebx
jne    1442 <main+0x2a2>
test   %ebx,%ebx
je     14e8 <main+0x348>
mov    %ebx,%edi
call   1050 <close@plt>
test   %rax,%rax
js     1584 <main+0x3e4>
mov    -0x68(%rbp),%rcx
add    $0x1,%rcx
mov    -0x70(%rbp),%rax
cmp    %rax,%rcx
lea    0xb8c(%rip),%rdx
jl     13c9 <main+0x229>
xor    %ebx,%ebx
cmp    $0x1,%r15d
mov    -0x38(%rbp),%r14
je     154d <main+0x3ad>
mov    %r15d,%edi
call   1050 <close@plt>
test   %rax,%rax
jns    154d <main+0x3ad>
mov    -0x58(%rbp),%rdi
call   10a0 <perror@plt>
mov    $0xffffffff,%ebx
jmp    154d <main+0x3ad>
mov    0x2a7c(%rip),%rax
mov    (%rax),%edi
lea    0xb61(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    -0x38(%rbp),%r14
mov    %r14,%rsp
mov    %ebx,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15,%rdi
call   10a0 <perror@plt>
jmp    1544 <main+0x3a4>
mov    0x2a3e(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%edx
lea    0xa86(%rip),%rsi
jmp    125d <main+0xbd>
mov    -0x60(%rbp),%rdi
jmp    1564 <main+0x3c4>
mov    -0x58(%rbp),%rdi
jmp    1564 <main+0x3c4>
lea    0xb02(%rip),%rdi
jmp    1564 <main+0x3c4>

LLVM IR (-O0):
@opterr = global i64 0
@.str = [5 x i8] c"b:o:\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [67 x i8] c"ERROR: option '-%c' requires an argument in the range (0,1000000)\0A\00"
@optopt = global i32 0
@.str.2 = [42 x i8] c"ERROR: option '-%c' requires an argument\0A\00"
@optind = global i32 0
@.str.3 = [16 x i8] c"standard output\00"
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
@O_WRONLY = global i32 0
@.str.4 = [3 x i8] c"-b\00"
@.str.5 = [3 x i8] c"-o\00"
@.str.6 = [2 x i8] c"-\00"
@.str.7 = [15 x i8] c"standard input\00"
@O_RDONLY = global i32 0
@.str.8 = [5 x i8] c"open\00"
@.str.9 = [49 x i8] c"ERROR: partial write attempts exceeded the limit\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca [4 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 512, i32* %9
store i64 0, i64* @opterr
br label %22
22: ; preds = %55, %2
%23 = load i32, i32* %4
%24 = load i8**, i8*** %5
%25 = call i32 @getopt(i32 %23, i8** %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %25, i32* %6
%26 = icmp ne i32 %25, -1
br i1 %26, label %27, label %56
27: ; preds = %22
%28 = load i32, i32* %6
switch i32 %28, label %55 [
i32 98, label %29
i32 111, label %42
i32 63, label %44
]
29: ; preds = %27
%30 = load i8*, i8** @optarg
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %9
%32 = load i32, i32* %9
%33 = icmp sle i32 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %29
%35 = load i32, i32* %9
%36 = icmp sge i32 %35, 1000000
br i1 %36, label %37, label %41
37: ; preds = %34, %29
%38 = load i32, i32* @stderr
%39 = load i32, i32* @optopt
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0), i32 %39)
store i32 -1, i32* %3
br label %246
41: ; preds = %34
br label %55
42: ; preds = %27
%43 = load i8*, i8** @optarg
store i8* %43, i8** %8
br label %55
44: ; preds = %27
%45 = load i32, i32* @optopt
%46 = icmp eq i32 %45, 98
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = load i32, i32* @optopt
%49 = icmp eq i32 %48, 111
br i1 %49, label %50, label %54
50: ; preds = %47, %44
%51 = load i32, i32* @stderr
%52 = load i32, i32* @optopt
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %52)
store i32 -1, i32* %3
br label %246
54: ; preds = %47
br label %55
55: ; preds = %27, %54, %42, %41
br label %22
56: ; preds = %22
%57 = load i32, i32* %9
%58 = zext i32 %57 to i64
%59 = call i8* @llvm.stacksave()
store i8* %59, i8** %10
%60 = alloca i8, i64 %58
store i64 %58, i64* %11
%61 = load i32, i32* @optind
%62 = sub nsw i32 %61, 1
store i32 %62, i32* %14
store i32 0, i32* %19
%63 = load i8*, i8** %8
store i8* %63, i8** %13
%64 = load i8*, i8** %8
%65 = icmp eq i8* %64, null
br i1 %65, label %66, label %67
66: ; preds = %56
store i32 1, i32* %15
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8** %13
br label %82
67: ; preds = %56
%68 = load i8*, i8** %8
%69 = load i32, i32* @O_TRUNC
%70 = load i32, i32* @O_CREAT
%71 = or i32 %69, %70
%72 = load i32, i32* @O_APPEND
%73 = or i32 %71, %72
%74 = load i32, i32* @O_WRONLY
%75 = or i32 %73, %74
%76 = call i32 (i8*, i32, ...) @open(i8* %68, i32 %75, i32 438)
store i32 %76, i32* %15
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %81
78: ; preds = %67
%79 = load i8*, i8** %8
%80 = call i32 @perror(i8* %79)
store i32 -1, i32* %3
store i32 1, i32* %20
br label %244
81: ; preds = %67
br label %82
82: ; preds = %81, %66
br label %83
83: ; preds = %117, %82
%84 = load i32, i32* %14
%85 = icmp sgt i32 %84, 0
br i1 %85, label %86, label %120
86: ; preds = %83
%87 = getelementptr inbounds [4 x i8], [4 x i8]* %21, i64 0, i64 0
%88 = load i8**, i8*** %5
%89 = load i32, i32* %14
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8*, i8** %88, i64 %90
%92 = load i8*, i8** %91
%93 = call i32 @strncpy(i8* %87, i8* %92, i32 3)
%94 = getelementptr inbounds [4 x i8], [4 x i8]* %21, i64 0, i64 0
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %101, label %97
97: ; preds = %86
%98 = getelementptr inbounds [4 x i8], [4 x i8]* %21, i64 0, i64 0
%99 = call i64 @strcmp(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %117
101: ; preds = %97, %86
%102 = load i32, i32* %14
%103 = load i32, i32* %4
%104 = sub nsw i32 %103, 1
%105 = icmp ne i32 %102, %104
br i1 %105, label %106, label %114
106: ; preds = %101
%107 = getelementptr inbounds [4 x i8], [4 x i8]* %21, i64 0, i64 2
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = icmp eq i32 %109, 0
br i1 %110, label %111, label %114
111: ; preds = %106
%112 = load i32, i32* %14
%113 = add nsw i32 %112, 1
store i32 %113, i32* %14
br label %114
114: ; preds = %111, %106, %101
%115 = load i32, i32* %14
%116 = add nsw i32 %115, 1
store i32 %116, i32* %14
br label %120
117: ; preds = %97
%118 = load i32, i32* %14
%119 = add nsw i32 %118, -1
store i32 %119, i32* %14
br label %83
120: ; preds = %114, %83
%121 = load i32, i32* %14
%122 = icmp eq i32 %121, 0
br i1 %122, label %123, label %129
123: ; preds = %120
%124 = load i32, i32* %4
%125 = icmp sgt i32 %124, 1
br i1 %125, label %126, label %129
126: ; preds = %123
%127 = load i32, i32* %14
%128 = add nsw i32 %127, 1
store i32 %128, i32* %14
br label %129
129: ; preds = %126, %123, %120
br label %130
130: ; preds = %231, %129
br label %131
131: ; preds = %130
%132 = load i8**, i8*** %5
%133 = load i32, i32* %14
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i8*, i8** %132, i64 %134
%136 = load i8*, i8** %135
store i8* %136, i8** %12
%137 = load i32, i32* %14
%138 = load i32, i32* %4
%139 = icmp eq i32 %137, %138
br i1 %139, label %151, label %140
140: ; preds = %131
%141 = load i8**, i8*** %5
%142 = load i32, i32* %14
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds i8*, i8** %141, i64 %143
%145 = load i8*, i8** %144
%146 = call i64 @strcmp(i8* %145, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%147 = icmp eq i64 %146, 0
br i1 %147, label %151, label %148
148: ; preds = %140
%149 = load i32, i32* %14
%150 = icmp eq i32 %149, 0
br i1 %150, label %151, label %152
151: ; preds = %148, %140, %131
store i32 0, i32* %16
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8** %12
br label %164
152: ; preds = %148
%153 = load i8**, i8*** %5
%154 = load i32, i32* %14
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8*, i8** %153, i64 %155
%157 = load i8*, i8** %156
%158 = load i32, i32* @O_RDONLY
%159 = call i32 (i8*, i32, ...) @open(i8* %157, i32 %158)
store i32 %159, i32* %16
%160 = icmp slt i32 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %152
%162 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %3
store i32 1, i32* %20
br label %244
163: ; preds = %152
br label %164
164: ; preds = %163, %151
br label %165
165: ; preds = %212, %164
br label %166
166: ; preds = %165
%167 = load i32, i32* %16
%168 = load i32, i32* %9
%169 = call i32 @read(i32 %167, i8* %60, i32 %168)
store i32 %169, i32* %17
%170 = icmp slt i32 %169, 0
br i1 %170, label %171, label %174
171: ; preds = %166
%172 = load i8*, i8** %12
%173 = call i32 @perror(i8* %172)
store i32 -1, i32* %3
store i32 1, i32* %20
br label %244
174: ; preds = %166
%175 = load i32, i32* %15
%176 = load i32, i32* %17
%177 = call i32 @write(i32 %175, i8* %60, i32 %176)
store i32 %177, i32* %18
store i8* %60, i8** %7
%178 = load i32, i32* %18
%179 = icmp slt i32 %178, 0
br i1 %179, label %180, label %183
180: ; preds = %174
%181 = load i8*, i8** %13
%182 = call i32 @perror(i8* %181)
store i32 -1, i32* %3
store i32 1, i32* %20
br label %244
183: ; preds = %174
br label %184
184: ; preds = %207, %183
%185 = load i32, i32* %18
%186 = load i32, i32* %17
%187 = icmp slt i32 %185, %186
br i1 %187, label %188, label %208
188: ; preds = %184
%189 = load i32, i32* %19
%190 = add nsw i32 %189, 1
store i32 %190, i32* %19
%191 = load i32, i32* %18
%192 = load i8*, i8** %7
%193 = sext i32 %191 to i64
%194 = getelementptr inbounds i8, i8* %192, i64 %193
store i8* %194, i8** %7
%195 = load i32, i32* %18
%196 = load i32, i32* %17
%197 = sub nsw i32 %196, %195
store i32 %197, i32* %17
%198 = load i32, i32* %15
%199 = load i8*, i8** %7
%200 = load i32, i32* %17
%201 = call i32 @write(i32 %198, i8* %199, i32 %200)
store i32 %201, i32* %18
%202 = load i32, i32* %19
%203 = icmp sgt i32 %202, 1000000
br i1 %203, label %204, label %207
204: ; preds = %188
%205 = load i32, i32* @stderr
%206 = call i32 (i32, i8*, ...) @fprintf(i32 %205, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
store i32 -1, i32* %3
store i32 1, i32* %20
br label %244
207: ; preds = %188
br label %184
208: ; preds = %184
%209 = load i32, i32* %17
%210 = icmp eq i32 %209, 0
br i1 %210, label %211, label %212
211: ; preds = %208
br label %213
212: ; preds = %208
br label %165
213: ; preds = %211
%214 = load i32, i32* %16
%215 = icmp ne i32 %214, 0
br i1 %215, label %216, label %224
216: ; preds = %213
%217 = load i32, i32* %16
%218 = call i64 @close(i32 %217)
%219 = icmp slt i64 %218, 0
br i1 %219, label %220, label %223
220: ; preds = %216
%221 = load i8*, i8** %12
%222 = call i32 @perror(i8* %221)
store i32 -1, i32* %3
store i32 1, i32* %20
br label %244
223: ; preds = %216
br label %224
224: ; preds = %223, %213
%225 = load i32, i32* %14
%226 = add nsw i32 %225, 1
store i32 %226, i32* %14
%227 = load i32, i32* %14
%228 = load i32, i32* %4
%229 = icmp sge i32 %227, %228
br i1 %229, label %230, label %231
230: ; preds = %224
br label %232
231: ; preds = %224
br label %130
232: ; preds = %230
%233 = load i32, i32* %15
%234 = icmp ne i32 %233, 1
br i1 %234, label %235, label %243
235: ; preds = %232
%236 = load i32, i32* %15
%237 = call i64 @close(i32 %236)
%238 = icmp slt i64 %237, 0
br i1 %238, label %239, label %242
239: ; preds = %235
%240 = load i8*, i8** %13
%241 = call i32 @perror(i8* %240)
store i32 -1, i32* %3
store i32 1, i32* %20
br label %244
242: ; preds = %235
br label %243
243: ; preds = %242, %232
store i32 0, i32* %3
store i32 1, i32* %20
br label %244
244: ; preds = %243, %239, %220, %204, %180, %171, %161, %78
%245 = load i8*, i8** %10
br label %246
246: ; preds = %244, %50, %37
%247 = load i32, i32* %3
ret i32 %247
}

LLVM IR (-O2):
@opterr = global i64 0
@.str = [5 x i8] c"b:o:\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [67 x i8] c"ERROR: option '-%c' requires an argument in the range (0,1000000)\0A\00"
@optopt = global i32 0
@.str.2 = [42 x i8] c"ERROR: option '-%c' requires an argument\0A\00"
@optind = global i32 0
@.str.3 = [16 x i8] c"standard output\00"
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@O_APPEND = global i32 0
@O_WRONLY = global i32 0
@.str.4 = [3 x i8] c"-b\00"
@.str.5 = [3 x i8] c"-o\00"
@.str.6 = [2 x i8] c"-\00"
@.str.7 = [15 x i8] c"standard input\00"
@O_RDONLY = global i32 0
@.str.8 = [5 x i8] c"open\00"
@.str.9 = [49 x i8] c"ERROR: partial write attempts exceeded the limit\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [4 x i8]
store i64 0, i64* @opterr
br label %4
4: ; preds = %20, %2
%5 = phi i8* [ %21, %20 ], [ undef, %2 ]
%6 = phi i32 [ %8, %20 ], [ 512, %2 ]
br label %7
7: ; preds = %4, %11
%8 = phi i32 [ %6, %4 ], [ %13, %11 ]
br label %9
9: ; preds = %24, %7
%10 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %10, label %24 [
i32 -1, label %28
i32 98, label %11
i32 111, label %20
i32 63, label %22
]
11: ; preds = %9
%12 = load i8*, i8** @optarg
%13 = tail call i32 @atoi(i8* %12)
%14 = add i32 %13, -1000000
%15 = icmp ult i32 %14, -999999
br i1 %15, label %16, label %7
16: ; preds = %11
%17 = load i32, i32* @stderr
%18 = load i32, i32* @optopt
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0), i32 %18)
br label %165
20: ; preds = %9
%21 = load i8*, i8** @optarg
br label %4
22: ; preds = %9
%23 = load i32, i32* @optopt
switch i32 %23, label %24 [
i32 111, label %25
i32 98, label %25
]
24: ; preds = %22, %9
br label %9
25: ; preds = %22, %22
%26 = load i32, i32* @stderr
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %165
28: ; preds = %9
%29 = zext i32 %8 to i64
%30 = tail call i8* @llvm.stacksave()
%31 = alloca i8, i64 %29
%32 = load i32, i32* @optind
%33 = icmp eq i8* %5, null
br i1 %33, label %46, label %34
34: ; preds = %28
%35 = load i32, i32* @O_TRUNC
%36 = load i32, i32* @O_CREAT
%37 = or i32 %36, %35
%38 = load i32, i32* @O_APPEND
%39 = or i32 %37, %38
%40 = load i32, i32* @O_WRONLY
%41 = or i32 %39, %40
%42 = tail call i32 (i8*, i32, ...) @open(i8* %5, i32 %41, i32 438)
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %34
%45 = tail call i32 @perror(i8* %5)
br label %163
46: ; preds = %28, %34
%47 = phi i8* [ %5, %34 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), %28 ]
%48 = phi i32 [ %42, %34 ], [ 1, %28 ]
%49 = add i32 %32, -1
%50 = icmp sgt i32 %32, 1
br i1 %50, label %51, label %86
51: ; preds = %46
%52 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%53 = zext i32 %49 to i64
%54 = getelementptr inbounds i8*, i8** %1, i64 %53
%55 = load i8*, i8** %54
%56 = call i32 @strncpy(i8* %52, i8* %55, i32 3)
%57 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %72, label %66
59: ; preds = %83
%60 = trunc i64 %84 to i32
%61 = getelementptr inbounds i8*, i8** %1, i64 %84
%62 = load i8*, i8** %61
%63 = call i32 @strncpy(i8* %52, i8* %62, i32 3)
%64 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %72, label %66
66: ; preds = %51, %59
%67 = phi i32 [ %60, %59 ], [ %49, %51 ]
%68 = phi i32 [ %67, %59 ], [ %32, %51 ]
%69 = phi i64 [ %84, %59 ], [ %53, %51 ]
%70 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %83
72: ; preds = %66, %59, %51
%73 = phi i64 [ %53, %51 ], [ %69, %66 ], [ %84, %59 ]
%74 = phi i32 [ %32, %51 ], [ %68, %66 ], [ %67, %59 ]
%75 = trunc i64 %73 to i32
%76 = icmp ne i32 %74, %0
%77 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%78 = load i8, i8* %77
%79 = icmp eq i8 %78, 0
%80 = select i1 %76, i1 %79, i1 false
%81 = select i1 %80, i32 %74, i32 %75
%82 = add nuw nsw i32 %81, 1
br label %86
83: ; preds = %66
%84 = add nsw i64 %69, -1
%85 = icmp sgt i64 %69, 1
br i1 %85, label %59, label %86
86: ; preds = %83, %46, %72
%87 = phi i32 [ %82, %72 ], [ %49, %46 ], [ 0, %83 ]
%88 = icmp eq i32 %87, 0
%89 = icmp sgt i32 %0, 1
%90 = and i1 %89, %88
%91 = sext i32 %87 to i64
%92 = select i1 %90, i64 1, i64 %91
%93 = sext i32 %0 to i64
br label %94
94: ; preds = %153, %86
%95 = phi i64 [ %154, %153 ], [ %92, %86 ]
%96 = phi i32 [ %132, %153 ], [ 0, %86 ]
%97 = getelementptr inbounds i8*, i8** %1, i64 %95
%98 = load i8*, i8** %97
%99 = icmp eq i64 %95, %93
br i1 %99, label %112, label %100
100: ; preds = %94
%101 = call i64 @strcmp(i8* %98, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
%103 = icmp eq i64 %95, 0
%104 = select i1 %102, i1 true, i1 %103
br i1 %104, label %112, label %105
105: ; preds = %100
%106 = load i8*, i8** %97
%107 = load i32, i32* @O_RDONLY
%108 = call i32 (i8*, i32, ...) @open(i8* %106, i32 %107)
%109 = icmp slt i32 %108, 0
br i1 %109, label %110, label %112
110: ; preds = %105
%111 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %163
112: ; preds = %94, %100, %105
%113 = phi i8* [ %98, %105 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), %100 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), %94 ]
%114 = phi i32 [ %108, %105 ], [ 0, %100 ], [ 0, %94 ]
br label %115
115: ; preds = %144, %112
%116 = phi i32 [ %96, %112 ], [ %132, %144 ]
%117 = call i32 @read(i32 %114, i8* %31, i32 %8)
%118 = icmp slt i32 %117, 0
br i1 %118, label %119, label %121
119: ; preds = %115
%120 = call i32 @perror(i8* %113)
br label %163
121: ; preds = %115
%122 = call i32 @write(i32 %48, i8* %31, i32 %117)
%123 = icmp slt i32 %122, 0
br i1 %123, label %126, label %124
124: ; preds = %121
%125 = call i32 @llvm.smax.i32(i32 %116, i32 1000000)
br label %128
126: ; preds = %121
%127 = call i32 @perror(i8* %47)
br label %163
128: ; preds = %124, %134
%129 = phi i8* [ %137, %134 ], [ %31, %124 ]
%130 = phi i32 [ %138, %134 ], [ %117, %124 ]
%131 = phi i32 [ %139, %134 ], [ %122, %124 ]
%132 = phi i32 [ %135, %134 ], [ %116, %124 ]
%133 = icmp sgt i32 %130, %131
br i1 %133, label %134, label %144
134: ; preds = %128
%135 = add i32 %132, 1
%136 = sext i32 %131 to i64
%137 = getelementptr inbounds i8, i8* %129, i64 %136
%138 = sub nsw i32 %130, %131
%139 = call i32 @write(i32 %48, i8* %137, i32 %138)
%140 = icmp eq i32 %132, %125
br i1 %140, label %141, label %128
141: ; preds = %134
%142 = load i32, i32* @stderr
%143 = call i32 (i32, i8*, ...) @fprintf(i32 %142, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
br label %163
144: ; preds = %128
%145 = icmp eq i32 %130, 0
br i1 %145, label %146, label %115
146: ; preds = %144
%147 = icmp eq i32 %114, 0
br i1 %147, label %153, label %148
148: ; preds = %146
%149 = call i64 @close(i32 %114)
%150 = icmp slt i64 %149, 0
br i1 %150, label %151, label %153
151: ; preds = %148
%152 = call i32 @perror(i8* %113)
br label %163
153: ; preds = %148, %146
%154 = add nsw i64 %95, 1
%155 = icmp slt i64 %154, %93
br i1 %155, label %94, label %156
156: ; preds = %153
%157 = icmp eq i32 %48, 1
br i1 %157, label %163, label %158
158: ; preds = %156
%159 = call i64 @close(i32 %48)
%160 = icmp slt i64 %159, 0
br i1 %160, label %161, label %163
161: ; preds = %158
%162 = call i32 @perror(i8* %47)
br label %163
163: ; preds = %156, %158, %161, %151, %141, %126, %119, %110, %44
%164 = phi i32 [ -1, %119 ], [ -1, %126 ], [ -1, %141 ], [ -1, %151 ], [ -1, %161 ], [ -1, %110 ], [ -1, %44 ], [ 0, %158 ], [ 0, %156 ]
br label %165
165: ; preds = %163, %25, %16
%166 = phi i32 [ -1, %25 ], [ -1, %16 ], [ %164, %163 ]
ret i32 %166
}