#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 */
struct option {
  char *member_0;
  char member_3;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_1;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int countchar(int /*<<< orphan*/ *);
int countline(int /*<<< orphan*/ *);
int countword(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char getopt_long(int, char **, char *, struct option *, int *);
int /*<<< orphan*/ help();
int optind;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ version();
int main(int argc, char *argv[]) {
  int i;
  int cmdx;
  int cmdopt_c = 0;
  int cmdopt_w = 0;
  int cmdopt_l = 0;
  int wcnt;
  int ccnt;
  int lcnt;
  int total_word;
  int total_char;
  int total_line;
  char optstring[] = "hvwcl";
  FILE *in;
  char ch;
  struct option long_opts[] = {{"help", 0, 0, 'h'},      {"version", 0, 0, 'v'},
                               {"character", 0, 0, 'c'}, {"word", 0, 0, 'w'},
                               {"line", 0, 0, 'l'},      {0, 0, 0, 0}};
  while ((ch = getopt_long(argc, argv, optstring, long_opts, &cmdx)) != -1) {
    switch (ch) {
    case 'h':
      help();
      return 0;
    case 'v':
      version();
      return 0;
    case 'c':
      cmdopt_c = 1;
      break;
    case 'w':
      cmdopt_w = 1;
      break;
    case 'l':
      cmdopt_l = 1;
      break;
    default:
      fprintf(stderr, "Unkown options; Try -h or --help for help\n");
      exit(EXIT_FAILURE);
    }
  }
  if (argc - optind < 1) {
    fprintf(stderr, "Missing input file(s).\n");
    fprintf(stderr, "Use -h or --help for help.\n");
    exit(EXIT_FAILURE);
  }
  total_word = total_char = total_line = 0;
  for (i = optind; i < argc; i++) {
    wcnt = ccnt = lcnt = 0;
    in = fopen(argv[i], "r");
    if (in == NULL) {
      perror(argv[i]);
      continue;
    }
    ccnt = countchar(in);
    rewind(in);
    wcnt = countword(in);
    rewind(in);
    lcnt = countline(in);
    if (cmdopt_c + cmdopt_w + cmdopt_l == 0 ||
        cmdopt_c + cmdopt_w + cmdopt_l == 3) {
      printf("%s: %d character(s) %d word(s) %d line(s)\n", argv[i], ccnt, wcnt,
             lcnt);
      total_word += wcnt;
      total_char += ccnt;
      total_line += lcnt;
    } else if (cmdopt_c == 1 && cmdopt_w + cmdopt_l == 0) {
      printf("%s: %d character(s)\n", argv[i], ccnt);
      total_char += ccnt;
    } else if (cmdopt_w == 1 && cmdopt_c + cmdopt_l == 0) {
      printf("%s: %d word(s)\n", argv[i], wcnt);
      total_word += wcnt;
    } else if (cmdopt_l == 1 && cmdopt_c + cmdopt_w == 0) {
      printf("%s: %d line(s)\n", argv[i], lcnt);
      total_line += lcnt;
    } else if (cmdopt_c + cmdopt_w == 2 && cmdopt_l == 0) {
      printf("%s: %d character(s) %d word(s)\n", argv[i], ccnt, wcnt);
      total_char += ccnt;
      total_word += wcnt;
    } else if (cmdopt_c + cmdopt_l == 2 && cmdopt_w == 0) {
      printf("%s: %d character(s) %d line(s)\n", argv[i], ccnt, lcnt);
      total_char += ccnt;
      total_line += lcnt;
    } else if (cmdopt_w + cmdopt_l == 2 && cmdopt_c == 0) {
      printf("%s: %d word(s) %d line(s)\n", argv[i], wcnt, lcnt);
      total_word += wcnt;
      total_line += lcnt;
    }
    fclose(in);
  }
  if (argc >= 3) {
    if (total_char != 0) {
      printf("\t%d character(s)", total_char);
    }
    if (total_word != 0) {
      printf("\t%d word(s)", total_word);
    }
    if (total_line != 0) {
      printf("\t%d line(s)", total_line);
    }
    printf(" in sum\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    0xe40(%rip),%eax
mov    %eax,-0x42(%rbp)
mov    0xe3a(%rip),%ax
mov    %ax,-0x3e(%rbp)
lea    -0xf0(%rbp),%rdi
lea    0x2b40(%rip),%rsi
mov    $0x90,%edx
call   1090 <memcpy@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x42(%rbp),%rdx
lea    -0xf0(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1050 <getopt_long@plt>
mov    %al,-0x51(%rbp)
movsbl %al,%eax
cmp    $0xffffffff,%eax
je     1306 <main+0x126>
movsbl -0x51(%rbp),%eax
add    $0xffffff9d,%eax
mov    %eax,%ecx
mov    %rcx,-0xf8(%rbp)
sub    $0x14,%eax
ja     12de <main+0xfe>
mov    -0xf8(%rbp),%rax
lea    0xd75(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   10f0 <help@plt>
movl   $0x0,-0x4(%rbp)
jmp    16cc <main+0x4ec>
mov    $0x0,%al
call   10a0 <version@plt>
movl   $0x0,-0x4(%rbp)
jmp    16cc <main+0x4ec>
movl   $0x1,-0x1c(%rbp)
jmp    1301 <main+0x121>
movl   $0x1,-0x20(%rbp)
jmp    1301 <main+0x121>
movl   $0x1,-0x24(%rbp)
jmp    1301 <main+0x121>
mov    0x2ceb(%rip),%rax
mov    (%rax),%edi
lea    0xd8d(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
jmp    123a <main+0x5a>
mov    -0x8(%rbp),%eax
mov    0x2cd0(%rip),%rcx
sub    (%rcx),%eax
cmp    $0x1,%eax
jge    1353 <main+0x173>
mov    0x2cae(%rip),%rax
mov    (%rax),%edi
lea    0xd7b(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2c99(%rip),%rax
mov    (%rax),%edi
lea    0xd7e(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2c7c(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
mov    0x2c71(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    165c <main+0x47c>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcc7(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    13d2 <main+0x1f2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   10e0 <perror@plt>
jmp    164e <main+0x46e>
mov    -0x50(%rbp),%rdi
call   1030 <countchar@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x50(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x50(%rbp),%rdi
call   10b0 <countword@plt>
mov    %eax,-0x28(%rbp)
mov    -0x50(%rbp),%rdi
call   1070 <rewind@plt>
mov    -0x50(%rbp),%rdi
call   10c0 <countline@plt>
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
cmp    $0x0,%eax
je     142c <main+0x24c>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
cmp    $0x3,%eax
jne    1470 <main+0x290>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x30(%rbp),%r8d
lea    0xc91(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    1645 <main+0x465>
cmpl   $0x1,-0x1c(%rbp)
jne    14b4 <main+0x2d4>
mov    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
cmp    $0x0,%eax
jne    14b4 <main+0x2d4>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x2c(%rbp),%edx
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1640 <main+0x460>
cmpl   $0x1,-0x20(%rbp)
jne    14f8 <main+0x318>
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
cmp    $0x0,%eax
jne    14f8 <main+0x318>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x28(%rbp),%edx
lea    0xc37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    163b <main+0x45b>
cmpl   $0x1,-0x24(%rbp)
jne    153c <main+0x35c>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
cmp    $0x0,%eax
jne    153c <main+0x35c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x30(%rbp),%edx
lea    0xc03(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    1636 <main+0x456>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
cmp    $0x2,%eax
jne    158c <main+0x3ac>
cmpl   $0x0,-0x24(%rbp)
jne    158c <main+0x3ac>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
lea    0xbcc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1631 <main+0x451>
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
cmp    $0x2,%eax
jne    15dc <main+0x3fc>
cmpl   $0x0,-0x20(%rbp)
jne    15dc <main+0x3fc>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%ecx
lea    0xb9c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x30(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    162c <main+0x44c>
mov    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
cmp    $0x2,%eax
jne    1627 <main+0x447>
cmpl   $0x0,-0x1c(%rbp)
jne    1627 <main+0x447>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x28(%rbp),%edx
mov    -0x30(%rbp),%ecx
lea    0xb6c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    162c <main+0x44c>
jmp    1631 <main+0x451>
jmp    1636 <main+0x456>
jmp    163b <main+0x45b>
jmp    1640 <main+0x460>
jmp    1645 <main+0x465>
mov    -0x50(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1374 <main+0x194>
cmpl   $0x3,-0x8(%rbp)
jl     16c5 <main+0x4e5>
cmpl   $0x0,-0x38(%rbp)
je     1681 <main+0x4a1>
mov    -0x38(%rbp),%esi
lea    0xb1b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x34(%rbp)
je     169c <main+0x4bc>
mov    -0x34(%rbp),%esi
lea    0xb11(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x3c(%rbp)
je     16b7 <main+0x4d7>
mov    -0x3c(%rbp),%esi
lea    0xb02(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb00(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movw   $0x6c,0x24(%rsp)
movl   $0x63777668,0x20(%rsp)
63
lea    0x2b54(%rip),%rsi
lea    0x30(%rsp),%r14
mov    $0x90,%edx
mov    %r14,%rdi
call   10a0 <memcpy@plt>
lea    0x20(%rsp),%rdx
lea    0x2c(%rsp),%r8
mov    %ebp,0x14(%rsp)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rcx
call   1060 <getopt_long@plt>
cmp    $0xff,%al
je     12c0 <main+0xd0>
xor    %ebp,%ebp
lea    0xdaa(%rip),%r14
lea    0x30(%rsp),%r15
lea    0x2c(%rsp),%r12
xor    %ecx,%ecx
mov    %rcx,0x18(%rsp)
xor    %ecx,%ecx
jmp    1297 <main+0xa7>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
mov    %rax,0x18(%rsp)
mov    %ecx,%r13d
mov    %rbx,%rsi
lea    0x20(%rsp),%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1060 <getopt_long@plt>
mov    %r13d,%ecx
cmp    $0xff,%al
je     12cc <main+0xdc>
movsbl %al,%eax
add    $0xffffff9d,%eax
cmp    $0x14,%eax
mov    0x14(%rsp),%edi
ja     158f <main+0x39f>
mov    $0x1,%r13d
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
mov    $0x1,%ebp
jmp    127a <main+0x8a>
xor    %r13d,%r13d
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %ebp,%ebp
mov    0x2d0d(%rip),%rax
movslq (%rax),%r9
mov    0x14(%rsp),%r8d
cmp    %r8d,%r9d
jge    15b2 <main+0x3c2>
mov    0x18(%rsp),%rax
lea    (%rax,%r13,1),%ecx
lea    (%rcx,%rbp,1),%edx
mov    %edx,0x28(%rsp)
mov    %r13d,%edx
xor    $0x1,%edx
mov    %ebp,%esi
neg    %esi
mov    %eax,%edi
xor    %esi,%edi
or     %edx,%edi
sete   0x7(%rsp)
mov    %eax,%edx
xor    $0x1,%edx
xor    %r13d,%esi
or     %edx,%esi
sete   0x6(%rsp)
mov    %ebp,%edx
xor    $0x1,%edx
or     %ecx,%edx
sete   0x5(%rsp)
xor    $0x2,%ecx
or     %ebp,%ecx
sete   0x4(%rsp)
lea    0x0(%rbp,%r13,1),%ecx
xor    $0x2,%ecx
or     %eax,%ecx
sete   0x3(%rsp)
add    %eax,%ebp
xor    $0x2,%ebp
or     %r13d,%ebp
sete   0x2(%rsp)
lea    (%rbx,%r9,8),%rbx
mov    %r8d,%ecx
sub    %r9d,%ecx
mov    %rcx,0x18(%rsp)
xor    %ebp,%ebp
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx,%rbp,8),%rdi
lea    0xce4(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1487 <main+0x297>
mov    %rax,%r13
mov    %rax,%rdi
call   1030 <countchar@plt>
mov    %eax,%r14d
mov    %r13,%rdi
call   1080 <rewind@plt>
mov    %r13,%rdi
call   10c0 <countword@plt>
mov    %eax,%r12d
mov    %r13,%rdi
call   1080 <rewind@plt>
mov    %r13,%rdi
call   10d0 <countline@plt>
mov    %eax,%r15d
mov    0x28(%rsp),%eax
cmp    $0x3,%eax
je     13da <main+0x1ea>
test   %eax,%eax
jne    1420 <main+0x230>
mov    (%rbx,%rbp,8),%rsi
lea    0xcf5(%rip),%rdi
mov    %r14d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
xor    %eax,%eax
call   1070 <printf@plt>
add    %r12d,0xc(%rsp)
add    %r14d,0x10(%rsp)
add    %r15d,0x8(%rsp)
mov    %r13,%rdi
call   1050 <fclose@plt>
add    $0x1,%rbp
cmp    %ebp,0x18(%rsp)
jne    1380 <main+0x190>
jmp    1514 <main+0x324>
nop
cmpb   $0x0,0x7(%rsp)
je     1443 <main+0x253>
mov    (%rbx,%rbp,8),%rsi
lea    0xcd3(%rip),%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1070 <printf@plt>
add    %r14d,0x10(%rsp)
jmp    1404 <main+0x214>
cmpb   $0x0,0x6(%rsp)
je     1466 <main+0x276>
mov    (%rbx,%rbp,8),%rsi
lea    0xcc5(%rip),%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1070 <printf@plt>
add    %r12d,0xc(%rsp)
jmp    1404 <main+0x214>
cmpb   $0x0,0x5(%rsp)
je     1495 <main+0x2a5>
mov    (%rbx,%rbp,8),%rsi
lea    0xcb2(%rip),%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    13ff <main+0x20f>
mov    (%rbx,%rbp,8),%rdi
call   10f0 <perror@plt>
jmp    140c <main+0x21c>
cmpb   $0x0,0x4(%rsp)
je     14c3 <main+0x2d3>
mov    (%rbx,%rbp,8),%rsi
lea    0xc93(%rip),%rdi
mov    %r14d,%edx
mov    %r12d,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
add    %r14d,0x10(%rsp)
add    %r12d,0xc(%rsp)
jmp    1404 <main+0x214>
cmpb   $0x0,0x3(%rsp)
je     14e7 <main+0x2f7>
mov    (%rbx,%rbp,8),%rsi
lea    0xc85(%rip),%rdi
mov    %r14d,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    13fa <main+0x20a>
cmpb   $0x0,0x2(%rsp)
je     1404 <main+0x214>
mov    (%rbx,%rbp,8),%rsi
lea    0xc7d(%rip),%rdi
mov    %r12d,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
add    %r12d,0xc(%rsp)
jmp    13ff <main+0x20f>
cmpl   $0x3,0x14(%rsp)
jl     157b <main+0x38b>
mov    0x10(%rsp),%esi
test   %esi,%esi
je     1531 <main+0x341>
lea    0xc6b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
je     1547 <main+0x357>
lea    0xc66(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rsp),%esi
test   %esi,%esi
je     155d <main+0x36d>
lea    0xc5c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc5a(%rip),%rdi
call   1040 <puts@plt>
jmp    157b <main+0x38b>
xor    %eax,%eax
call   1100 <help@plt>
jmp    157b <main+0x38b>
xor    %eax,%eax
call   10b0 <version@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a3a(%rip),%rax
mov    (%rax),%edi
lea    0xadc(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x2a1d(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
mov    0x2a17(%rip),%rbx
mov    (%rbx),%edi
lea    0xae4(%rip),%rsi
call   1090 <fprintf@plt>
mov    (%rbx),%edi
lea    0xaee(%rip),%rsi
jmp    159f <main+0x3af>

LLVM IR (-O0):
%struct.option = type { i8*, i8, i32, i32 }
@__const.main.optstring = [6 x i8] c"hvwcl\00"
@.str = [5 x i8] c"help\00"
@.str.1 = [8 x i8] c"version\00"
@.str.2 = [10 x i8] c"character\00"
@.str.3 = [5 x i8] c"word\00"
@.str.4 = [5 x i8] c"line\00"
@__const.main.long_opts = [6 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 0, i32 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8 0, i32 0, i32 118 }, %struct.option { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8 0, i32 0, i32 99 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8 0, i32 0, i32 119 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8 0, i32 0, i32 108 }, %struct.option zeroinitializer]
@stderr = global i32 0
@.str.5 = [43 x i8] c"Unkown options; Try -h or --help for help\0A\00"
@EXIT_FAILURE = global i32 0
@optind = global i32 0
@.str.6 = [24 x i8] c"Missing input file(s).\0A\00"
@.str.7 = [28 x i8] c"Use -h or --help for help.\0A\00"
@.str.8 = [2 x i8] c"r\00"
@.str.9 = [43 x i8] c"%s: %d character(s) %d word(s) %d line(s)\0A\00"
@.str.10 = [21 x i8] c"%s: %d character(s)\0A\00"
@.str.11 = [16 x i8] c"%s: %d word(s)\0A\00"
@.str.12 = [16 x i8] c"%s: %d line(s)\0A\00"
@.str.13 = [32 x i8] c"%s: %d character(s) %d word(s)\0A\00"
@.str.14 = [32 x i8] c"%s: %d character(s) %d line(s)\0A\00"
@.str.15 = [27 x i8] c"%s: %d word(s) %d line(s)\0A\00"
@.str.16 = [17 x i8] c"\09%d character(s)\00"
@.str.17 = [12 x i8] c"\09%d word(s)\00"
@.str.18 = [12 x i8] c"\09%d line(s)\00"
@.str.19 = [9 x i8] c" in sum\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [6 x i8]
%18 = alloca i32*
%19 = alloca i8
%20 = alloca [6 x %struct.option]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%21 = bitcast [6 x i8]* %17 to i8*
%22 = bitcast [6 x %struct.option]* %20 to i8*
br label %23
23: ; preds = %46, %2
%24 = load i32, i32* %4
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds [6 x i8], [6 x i8]* %17, i64 0, i64 0
%27 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %20, i64 0, i64 0
%28 = call signext i8 @getopt_long(i32 %24, i8** %25, i8* %26, %struct.option* %27, i32* %7)
store i8 %28, i8* %19
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, -1
br i1 %30, label %31, label %47
31: ; preds = %23
%32 = load i8, i8* %19
%33 = sext i8 %32 to i32
switch i32 %33, label %41 [
i32 104, label %34
i32 118, label %36
i32 99, label %38
i32 119, label %39
i32 108, label %40
]
34: ; preds = %31
%35 = call i32 (...) @help()
store i32 0, i32* %3
br label %286
36: ; preds = %31
%37 = call i32 (...) @version()
store i32 0, i32* %3
br label %286
38: ; preds = %31
store i32 1, i32* %8
br label %46
39: ; preds = %31
store i32 1, i32* %9
br label %46
40: ; preds = %31
store i32 1, i32* %10
br label %46
41: ; preds = %31
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %40, %39, %38
br label %23
47: ; preds = %23
%48 = load i32, i32* %4
%49 = load i32, i32* @optind
%50 = sub nsw i32 %48, %49
%51 = icmp slt i32 %50, 1
br i1 %51, label %52, label %59
52: ; preds = %47
%53 = load i32, i32* @stderr
%54 = call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%55 = load i32, i32* @stderr
%56 = call i32 @fprintf(i32 %55, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%57 = load i32, i32* @EXIT_FAILURE
%58 = call i32 @exit(i32 %57)
unreachable
59: ; preds = %47
store i32 0, i32* %16
store i32 0, i32* %15
store i32 0, i32* %14
%60 = load i32, i32* @optind
store i32 %60, i32* %6
br label %61
61: ; preds = %259, %59
%62 = load i32, i32* %6
%63 = load i32, i32* %4
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %262
65: ; preds = %61
store i32 0, i32* %13
store i32 0, i32* %12
store i32 0, i32* %11
%66 = load i8**, i8*** %5
%67 = load i32, i32* %6
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8*, i8** %66, i64 %68
%70 = load i8*, i8** %69
%71 = call i32* @fopen(i8* %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %71, i32** %18
%72 = load i32*, i32** %18
%73 = icmp eq i32* %72, null
br i1 %73, label %74, label %81
74: ; preds = %65
%75 = load i8**, i8*** %5
%76 = load i32, i32* %6
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %75, i64 %77
%79 = load i8*, i8** %78
%80 = call i32 @perror(i8* %79)
br label %259
81: ; preds = %65
%82 = load i32*, i32** %18
%83 = call i32 @countchar(i32* %82)
store i32 %83, i32* %12
%84 = load i32*, i32** %18
%85 = call i32 @rewind(i32* %84)
%86 = load i32*, i32** %18
%87 = call i32 @countword(i32* %86)
store i32 %87, i32* %11
%88 = load i32*, i32** %18
%89 = call i32 @rewind(i32* %88)
%90 = load i32*, i32** %18
%91 = call i32 @countline(i32* %90)
store i32 %91, i32* %13
%92 = load i32, i32* %8
%93 = load i32, i32* %9
%94 = add nsw i32 %92, %93
%95 = load i32, i32* %10
%96 = add nsw i32 %94, %95
%97 = icmp eq i32 %96, 0
br i1 %97, label %105, label %98
98: ; preds = %81
%99 = load i32, i32* %8
%100 = load i32, i32* %9
%101 = add nsw i32 %99, %100
%102 = load i32, i32* %10
%103 = add nsw i32 %101, %102
%104 = icmp eq i32 %103, 3
br i1 %104, label %105, label %124
105: ; preds = %98, %81
%106 = load i8**, i8*** %5
%107 = load i32, i32* %6
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8*, i8** %106, i64 %108
%110 = load i8*, i8** %109
%111 = load i32, i32* %12
%112 = load i32, i32* %11
%113 = load i32, i32* %13
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), i8* %110, i32 %111, i32 %112, i32 %113)
%115 = load i32, i32* %11
%116 = load i32, i32* %14
%117 = add nsw i32 %116, %115
store i32 %117, i32* %14
%118 = load i32, i32* %12
%119 = load i32, i32* %15
%120 = add nsw i32 %119, %118
store i32 %120, i32* %15
%121 = load i32, i32* %13
%122 = load i32, i32* %16
%123 = add nsw i32 %122, %121
store i32 %123, i32* %16
br label %256
124: ; preds = %98
%125 = load i32, i32* %8
%126 = icmp eq i32 %125, 1
br i1 %126, label %127, label %143
127: ; preds = %124
%128 = load i32, i32* %9
%129 = load i32, i32* %10
%130 = add nsw i32 %128, %129
%131 = icmp eq i32 %130, 0
br i1 %131, label %132, label %143
132: ; preds = %127
%133 = load i8**, i8*** %5
%134 = load i32, i32* %6
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8*, i8** %133, i64 %135
%137 = load i8*, i8** %136
%138 = load i32, i32* %12
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i8* %137, i32 %138)
%140 = load i32, i32* %12
%141 = load i32, i32* %15
%142 = add nsw i32 %141, %140
store i32 %142, i32* %15
br label %255
143: ; preds = %127, %124
%144 = load i32, i32* %9
%145 = icmp eq i32 %144, 1
br i1 %145, label %146, label %162
146: ; preds = %143
%147 = load i32, i32* %8
%148 = load i32, i32* %10
%149 = add nsw i32 %147, %148
%150 = icmp eq i32 %149, 0
br i1 %150, label %151, label %162
151: ; preds = %146
%152 = load i8**, i8*** %5
%153 = load i32, i32* %6
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i8*, i8** %152, i64 %154
%156 = load i8*, i8** %155
%157 = load i32, i32* %11
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i8* %156, i32 %157)
%159 = load i32, i32* %11
%160 = load i32, i32* %14
%161 = add nsw i32 %160, %159
store i32 %161, i32* %14
br label %254
162: ; preds = %146, %143
%163 = load i32, i32* %10
%164 = icmp eq i32 %163, 1
br i1 %164, label %165, label %181
165: ; preds = %162
%166 = load i32, i32* %8
%167 = load i32, i32* %9
%168 = add nsw i32 %166, %167
%169 = icmp eq i32 %168, 0
br i1 %169, label %170, label %181
170: ; preds = %165
%171 = load i8**, i8*** %5
%172 = load i32, i32* %6
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8*, i8** %171, i64 %173
%175 = load i8*, i8** %174
%176 = load i32, i32* %13
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i8* %175, i32 %176)
%178 = load i32, i32* %13
%179 = load i32, i32* %16
%180 = add nsw i32 %179, %178
store i32 %180, i32* %16
br label %253
181: ; preds = %165, %162
%182 = load i32, i32* %8
%183 = load i32, i32* %9
%184 = add nsw i32 %182, %183
%185 = icmp eq i32 %184, 2
br i1 %185, label %186, label %204
186: ; preds = %181
%187 = load i32, i32* %10
%188 = icmp eq i32 %187, 0
br i1 %188, label %189, label %204
189: ; preds = %186
%190 = load i8**, i8*** %5
%191 = load i32, i32* %6
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds i8*, i8** %190, i64 %192
%194 = load i8*, i8** %193
%195 = load i32, i32* %12
%196 = load i32, i32* %11
%197 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0), i8* %194, i32 %195, i32 %196)
%198 = load i32, i32* %12
%199 = load i32, i32* %15
%200 = add nsw i32 %199, %198
store i32 %200, i32* %15
%201 = load i32, i32* %11
%202 = load i32, i32* %14
%203 = add nsw i32 %202, %201
store i32 %203, i32* %14
br label %252
204: ; preds = %186, %181
%205 = load i32, i32* %8
%206 = load i32, i32* %10
%207 = add nsw i32 %205, %206
%208 = icmp eq i32 %207, 2
br i1 %208, label %209, label %227
209: ; preds = %204
%210 = load i32, i32* %9
%211 = icmp eq i32 %210, 0
br i1 %211, label %212, label %227
212: ; preds = %209
%213 = load i8**, i8*** %5
%214 = load i32, i32* %6
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds i8*, i8** %213, i64 %215
%217 = load i8*, i8** %216
%218 = load i32, i32* %12
%219 = load i32, i32* %13
%220 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.14, i64 0, i64 0), i8* %217, i32 %218, i32 %219)
%221 = load i32, i32* %12
%222 = load i32, i32* %15
%223 = add nsw i32 %222, %221
store i32 %223, i32* %15
%224 = load i32, i32* %13
%225 = load i32, i32* %16
%226 = add nsw i32 %225, %224
store i32 %226, i32* %16
br label %251
227: ; preds = %209, %204
%228 = load i32, i32* %9
%229 = load i32, i32* %10
%230 = add nsw i32 %228, %229
%231 = icmp eq i32 %230, 2
br i1 %231, label %232, label %250
232: ; preds = %227
%233 = load i32, i32* %8
%234 = icmp eq i32 %233, 0
br i1 %234, label %235, label %250
235: ; preds = %232
%236 = load i8**, i8*** %5
%237 = load i32, i32* %6
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds i8*, i8** %236, i64 %238
%240 = load i8*, i8** %239
%241 = load i32, i32* %11
%242 = load i32, i32* %13
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), i8* %240, i32 %241, i32 %242)
%244 = load i32, i32* %11
%245 = load i32, i32* %14
%246 = add nsw i32 %245, %244
store i32 %246, i32* %14
%247 = load i32, i32* %13
%248 = load i32, i32* %16
%249 = add nsw i32 %248, %247
store i32 %249, i32* %16
br label %250
250: ; preds = %235, %232, %227
br label %251
251: ; preds = %250, %212
br label %252
252: ; preds = %251, %189
br label %253
253: ; preds = %252, %170
br label %254
254: ; preds = %253, %151
br label %255
255: ; preds = %254, %132
br label %256
256: ; preds = %255, %105
%257 = load i32*, i32** %18
%258 = call i32 @fclose(i32* %257)
br label %259
259: ; preds = %256, %74
%260 = load i32, i32* %6
%261 = add nsw i32 %260, 1
store i32 %261, i32* %6
br label %61
262: ; preds = %61
%263 = load i32, i32* %4
%264 = icmp sge i32 %263, 3
br i1 %264, label %265, label %285
265: ; preds = %262
%266 = load i32, i32* %15
%267 = icmp ne i32 %266, 0
br i1 %267, label %268, label %271
268: ; preds = %265
%269 = load i32, i32* %15
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), i32 %269)
br label %271
271: ; preds = %268, %265
%272 = load i32, i32* %14
%273 = icmp ne i32 %272, 0
br i1 %273, label %274, label %277
274: ; preds = %271
%275 = load i32, i32* %14
%276 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i32 %275)
br label %277
277: ; preds = %274, %271
%278 = load i32, i32* %16
%279 = icmp ne i32 %278, 0
br i1 %279, label %280, label %283
280: ; preds = %277
%281 = load i32, i32* %16
%282 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), i32 %281)
br label %283
283: ; preds = %280, %277
%284 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0))
br label %285
285: ; preds = %283, %262
store i32 0, i32* %3
br label %286
286: ; preds = %285, %36, %34
%287 = load i32, i32* %3
ret i32 %287
}

LLVM IR (-O2):
%struct.option = type { i8*, i8, i32, i32 }
@__const.main.optstring = [6 x i8] c"hvwcl\00"
@.str = [5 x i8] c"help\00"
@.str.1 = [8 x i8] c"version\00"
@.str.2 = [10 x i8] c"character\00"
@.str.3 = [5 x i8] c"word\00"
@.str.4 = [5 x i8] c"line\00"
@__const.main.long_opts = [6 x %struct.option] [%struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8 0, i32 0, i32 104 }, %struct.option { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8 0, i32 0, i32 118 }, %struct.option { i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8 0, i32 0, i32 99 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8 0, i32 0, i32 119 }, %struct.option { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8 0, i32 0, i32 108 }, %struct.option zeroinitializer]
@stderr = global i32 0
@.str.5 = [43 x i8] c"Unkown options; Try -h or --help for help\0A\00"
@EXIT_FAILURE = global i32 0
@optind = global i32 0
@.str.6 = [24 x i8] c"Missing input file(s).\0A\00"
@.str.7 = [28 x i8] c"Use -h or --help for help.\0A\00"
@.str.8 = [2 x i8] c"r\00"
@.str.9 = [43 x i8] c"%s: %d character(s) %d word(s) %d line(s)\0A\00"
@.str.10 = [21 x i8] c"%s: %d character(s)\0A\00"
@.str.11 = [16 x i8] c"%s: %d word(s)\0A\00"
@.str.12 = [16 x i8] c"%s: %d line(s)\0A\00"
@.str.13 = [32 x i8] c"%s: %d character(s) %d word(s)\0A\00"
@.str.14 = [32 x i8] c"%s: %d character(s) %d line(s)\0A\00"
@.str.15 = [27 x i8] c"%s: %d word(s) %d line(s)\0A\00"
@.str.16 = [17 x i8] c"\09%d character(s)\00"
@.str.17 = [12 x i8] c"\09%d word(s)\00"
@.str.18 = [12 x i8] c"\09%d line(s)\00"
@str = [8 x i8] c" in sum\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca [6 x i8]
%5 = alloca [6 x %struct.option]
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%8 = bitcast [6 x %struct.option]* %5 to i8*
%9 = getelementptr inbounds [6 x %struct.option], [6 x %struct.option]* %5, i64 0, i64 0
%10 = call signext i8 @getopt_long(i32 %0, i8** %1, i8* %7, %struct.option* %9, i32* %3)
%11 = icmp eq i8 %10, -1
br i1 %11, label %35, label %12
12: ; preds = %2, %29
%13 = phi i8 [ %33, %29 ], [ %10, %2 ]
%14 = phi i32 [ %32, %29 ], [ 0, %2 ]
%15 = phi i32 [ %31, %29 ], [ 0, %2 ]
%16 = phi i32 [ %30, %29 ], [ 0, %2 ]
%17 = sext i8 %13 to i32
switch i32 %17, label %24 [
i32 104, label %18
i32 118, label %20
i32 99, label %29
i32 119, label %22
i32 108, label %23
]
18: ; preds = %12
%19 = call i32 (...) @help()
br label %158
20: ; preds = %12
%21 = call i32 (...) @version()
br label %158
22: ; preds = %12
br label %29
23: ; preds = %12
br label %29
24: ; preds = %12
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%27 = load i32, i32* @EXIT_FAILURE
%28 = call i32 @exit(i32 %27)
unreachable
29: ; preds = %12, %23, %22
%30 = phi i32 [ %16, %23 ], [ %16, %22 ], [ 1, %12 ]
%31 = phi i32 [ %15, %23 ], [ 1, %22 ], [ %15, %12 ]
%32 = phi i32 [ 1, %23 ], [ %14, %22 ], [ %14, %12 ]
%33 = call signext i8 @getopt_long(i32 %0, i8** %1, i8* %7, %struct.option* %9, i32* %3)
%34 = icmp eq i8 %33, -1
br i1 %34, label %35, label %12
35: ; preds = %29, %2
%36 = phi i32 [ 0, %2 ], [ %30, %29 ]
%37 = phi i32 [ 0, %2 ], [ %31, %29 ]
%38 = phi i32 [ 0, %2 ], [ %32, %29 ]
%39 = load i32, i32* @optind
%40 = icmp slt i32 %39, %0
br i1 %40, label %41, label %66
41: ; preds = %35
%42 = add nsw i32 %37, %36
%43 = add nsw i32 %42, %38
%44 = icmp eq i32 %36, 1
%45 = sub i32 0, %38
%46 = icmp eq i32 %37, %45
%47 = select i1 %44, i1 %46, i1 false
%48 = icmp eq i32 %37, 1
%49 = icmp eq i32 %36, %45
%50 = select i1 %48, i1 %49, i1 false
%51 = icmp eq i32 %38, 1
%52 = icmp eq i32 %42, 0
%53 = select i1 %51, i1 %52, i1 false
%54 = icmp eq i32 %42, 2
%55 = icmp eq i32 %38, 0
%56 = select i1 %54, i1 %55, i1 false
%57 = add nsw i32 %38, %36
%58 = icmp eq i32 %57, 2
%59 = icmp eq i32 %37, 0
%60 = select i1 %58, i1 %59, i1 false
%61 = add nsw i32 %38, %37
%62 = icmp eq i32 %61, 2
%63 = icmp eq i32 %36, 0
%64 = select i1 %62, i1 %63, i1 false
%65 = sext i32 %39 to i64
br label %73
66: ; preds = %35
%67 = load i32, i32* @stderr
%68 = call i32 @fprintf(i32 %67, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%69 = load i32, i32* @stderr
%70 = call i32 @fprintf(i32 %69, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%71 = load i32, i32* @EXIT_FAILURE
%72 = call i32 @exit(i32 %71)
unreachable
73: ; preds = %41, %135
%74 = phi i64 [ %65, %41 ], [ %139, %135 ]
%75 = phi i32 [ 0, %41 ], [ %138, %135 ]
%76 = phi i32 [ 0, %41 ], [ %137, %135 ]
%77 = phi i32 [ 0, %41 ], [ %136, %135 ]
%78 = getelementptr inbounds i8*, i8** %1, i64 %74
%79 = load i8*, i8** %78
%80 = call i32* @fopen(i8* %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%81 = icmp eq i32* %80, null
br i1 %81, label %82, label %85
82: ; preds = %73
%83 = load i8*, i8** %78
%84 = call i32 @perror(i8* %83)
br label %135
85: ; preds = %73
%86 = call i32 @countchar(i32* %80)
%87 = call i32 @rewind(i32* %80)
%88 = call i32 @countword(i32* %80)
%89 = call i32 @rewind(i32* %80)
%90 = call i32 @countline(i32* %80)
switch i32 %43, label %97 [
i32 0, label %91
i32 3, label %91
]
91: ; preds = %85, %85
%92 = load i8*, i8** %78
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), i8* %92, i32 %86, i32 %88, i32 %90)
%94 = add nsw i32 %88, %77
%95 = add nsw i32 %86, %76
%96 = add nsw i32 %90, %75
br label %130
97: ; preds = %85
br i1 %47, label %98, label %102
98: ; preds = %97
%99 = load i8*, i8** %78
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i8* %99, i32 %86)
%101 = add nsw i32 %86, %76
br label %130
102: ; preds = %97
br i1 %50, label %103, label %107
103: ; preds = %102
%104 = load i8*, i8** %78
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0), i8* %104, i32 %88)
%106 = add nsw i32 %88, %77
br label %130
107: ; preds = %102
br i1 %53, label %108, label %112
108: ; preds = %107
%109 = load i8*, i8** %78
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i8* %109, i32 %90)
%111 = add nsw i32 %90, %75
br label %130
112: ; preds = %107
br i1 %56, label %113, label %118
113: ; preds = %112
%114 = load i8*, i8** %78
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0), i8* %114, i32 %86, i32 %88)
%116 = add nsw i32 %86, %76
%117 = add nsw i32 %88, %77
br label %130
118: ; preds = %112
br i1 %60, label %119, label %124
119: ; preds = %118
%120 = load i8*, i8** %78
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.14, i64 0, i64 0), i8* %120, i32 %86, i32 %90)
%122 = add nsw i32 %86, %76
%123 = add nsw i32 %90, %75
br label %130
124: ; preds = %118
br i1 %64, label %125, label %130
125: ; preds = %124
%126 = load i8*, i8** %78
%127 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), i8* %126, i32 %88, i32 %90)
%128 = add nsw i32 %88, %77
%129 = add nsw i32 %90, %75
br label %130
130: ; preds = %98, %108, %119, %125, %124, %113, %103, %91
%131 = phi i32 [ %94, %91 ], [ %77, %98 ], [ %106, %103 ], [ %77, %108 ], [ %117, %113 ], [ %77, %119 ], [ %128, %125 ], [ %77, %124 ]
%132 = phi i32 [ %95, %91 ], [ %101, %98 ], [ %76, %103 ], [ %76, %108 ], [ %116, %113 ], [ %122, %119 ], [ %76, %125 ], [ %76, %124 ]
%133 = phi i32 [ %96, %91 ], [ %75, %98 ], [ %75, %103 ], [ %111, %108 ], [ %75, %113 ], [ %123, %119 ], [ %129, %125 ], [ %75, %124 ]
%134 = call i32 @fclose(i32* %80)
br label %135
135: ; preds = %130, %82
%136 = phi i32 [ %77, %82 ], [ %131, %130 ]
%137 = phi i32 [ %76, %82 ], [ %132, %130 ]
%138 = phi i32 [ %75, %82 ], [ %133, %130 ]
%139 = add nsw i64 %74, 1
%140 = trunc i64 %139 to i32
%141 = icmp eq i32 %140, %0
br i1 %141, label %142, label %73
142: ; preds = %135
%143 = icmp sgt i32 %0, 2
br i1 %143, label %144, label %158
144: ; preds = %142
%145 = icmp eq i32 %137, 0
br i1 %145, label %148, label %146
146: ; preds = %144
%147 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), i32 %137)
br label %148
148: ; preds = %146, %144
%149 = icmp eq i32 %136, 0
br i1 %149, label %152, label %150
150: ; preds = %148
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i32 %136)
br label %152
152: ; preds = %150, %148
%153 = icmp eq i32 %138, 0
br i1 %153, label %156, label %154
154: ; preds = %152
%155 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), i32 %138)
br label %156
156: ; preds = %154, %152
%157 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
br label %158
158: ; preds = %142, %156, %20, %18
ret i32 0
}