#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *const);
int main_get(int, char *const *);
int main_ngrams(int, char *const *);
int main_scan(int, char *const *);
int main_sentences(int, char *const *);
int main_tokens(int, char *const *);
int /*<<< orphan*/ printf(char *, char *const);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *const, char *);
int /*<<< orphan*/ usage();
int /*<<< orphan*/ usage_get();
int /*<<< orphan*/ usage_ngrams();
int /*<<< orphan*/ usage_scan();
int /*<<< orphan*/ usage_sentences();
int /*<<< orphan*/ usage_tokens();
int /*<<< orphan*/ version();
int main(int argc, char *const argv[]) {
  int help = 0, err = 0;
  int ind, ch;
  for (ind = 1; ind < argc; ind++) {
    if (argv[ind][0] != '-') {
      break;
    }
    if (argv[ind][2] != '\0') {
      printf("illegal option: %s\n", argv[ind]);
      usage();
      return EXIT_FAILURE;
    }
    ch = argv[ind][1];
    switch (ch) {
    case 'h':
      help = 1;
      break;
    case 'v':
      version();
      return EXIT_SUCCESS;
    default:
      usage();
      return EXIT_FAILURE;
    }
  }
  argc -= ind;
  argv += ind;
  if (argc == 0) {
    usage();
    return EXIT_FAILURE;
  } else if (!strcmp(argv[0], "get")) {
    if (help) {
      usage_get();
      return EXIT_SUCCESS;
    }
    err = main_get(argc, argv);
  } else if (!strcmp(argv[0], "ngrams")) {
    if (help) {
      usage_ngrams();
      return EXIT_SUCCESS;
    }
    err = main_ngrams(argc, argv);
  } else if (!strcmp(argv[0], "tokens")) {
    if (help) {
      usage_tokens();
      return EXIT_SUCCESS;
    }
    err = main_tokens(argc, argv);
  } else if (!strcmp(argv[0], "sentences")) {
    if (help) {
      usage_sentences();
      return EXIT_SUCCESS;
    }
    err = main_sentences(argc, argv);
  } else if (!strcmp(argv[0], "scan")) {
    if (help) {
      usage_scan();
      return EXIT_SUCCESS;
    }
    err = main_scan(argc, argv);
  } else {
    fprintf(stderr, "Unrecognized command '%s'.\n\n", argv[0]);
    usage();
    return EXIT_FAILURE;
  }
  return err;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1314 <main+0x124>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1244 <main+0x54>
jmp    1314 <main+0x124>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
je     128d <main+0x9d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd90(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   10d0 <usage@plt>
mov    0x2d55(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x68,%eax
je     12c5 <main+0xd5>
jmp    12b4 <main+0xc4>
mov    -0x24(%rbp),%eax
sub    $0x76,%eax
je     12d1 <main+0xe1>
jmp    12e9 <main+0xf9>
movl   $0x1,-0x14(%rbp)
jmp    1301 <main+0x111>
mov    $0x0,%al
call   1090 <version@plt>
mov    0x2cf1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
mov    $0x0,%al
call   10d0 <usage@plt>
mov    0x2ce1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
jmp    1306 <main+0x116>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    121b <main+0x2b>
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1356 <main+0x166>
mov    $0x0,%al
call   10d0 <usage@plt>
mov    0x2c8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xcb0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13a8 <main+0x1b8>
cmpl   $0x0,-0x14(%rbp)
je     1394 <main+0x1a4>
mov    $0x0,%al
call   1060 <usage_get@plt>
mov    0x2c46(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10f0 <main_get@plt>
mov    %eax,-0x18(%rbp)
jmp    1538 <main+0x348>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xc62(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13fa <main+0x20a>
cmpl   $0x0,-0x14(%rbp)
je     13e6 <main+0x1f6>
mov    $0x0,%al
call   10e0 <usage_ngrams@plt>
mov    0x2bf4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10a0 <main_ngrams@plt>
mov    %eax,-0x18(%rbp)
jmp    1533 <main+0x343>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xc17(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    144c <main+0x25c>
cmpl   $0x0,-0x14(%rbp)
je     1438 <main+0x248>
mov    $0x0,%al
call   10b0 <usage_tokens@plt>
mov    0x2ba2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1110 <main_tokens@plt>
mov    %eax,-0x18(%rbp)
jmp    152e <main+0x33e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xbcc(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    149e <main+0x2ae>
cmpl   $0x0,-0x14(%rbp)
je     148a <main+0x29a>
mov    $0x0,%al
call   1030 <usage_sentences@plt>
mov    0x2b50(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <main_sentences@plt>
mov    %eax,-0x18(%rbp)
jmp    1529 <main+0x339>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xb84(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    14f0 <main+0x300>
cmpl   $0x0,-0x14(%rbp)
je     14dc <main+0x2ec>
mov    $0x0,%al
call   10c0 <usage_scan@plt>
mov    0x2afe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1100 <main_scan@plt>
mov    %eax,-0x18(%rbp)
jmp    1524 <main+0x334>
mov    0x2ae9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb2e(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x0,%al
call   10d0 <usage@plt>
mov    0x2abe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1543 <main+0x353>
jmp    1529 <main+0x339>
jmp    152e <main+0x33e>
jmp    1533 <main+0x343>
jmp    1538 <main+0x348>
jmp    153d <main+0x34d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1260 <main+0x70>
mov    0x8(%rsi),%rax
mov    (%rax),%dl
mov    $0x1,%ecx
cmp    $0x2d,%dl
jne    1250 <main+0x60>
mov    %ebx,%edi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,0x2(%rax)
jne    1381 <main+0x191>
movsbl 0x1(%rax),%eax
cmp    $0x68,%eax
jne    1333 <main+0x143>
cmp    %rcx,%rdi
je     1392 <main+0x1a2>
mov    (%rsi,%rcx,8),%rax
add    $0x1,%rcx
cmpb   $0x2d,(%rax)
je     1220 <main+0x30>
add    $0xffffffff,%ecx
cmp    $0x2d,%dl
setne  %bpl
sub    %ecx,%ebx
jne    1270 <main+0x80>
jmp    139e <main+0x1ae>
mov    $0x1,%ecx
mov    $0x1,%bpl
sub    %ecx,%ebx
je     139e <main+0x1ae>
mov    %ecx,%eax
lea    (%rsi,%rax,8),%r14
mov    (%r14),%r15
lea    0xd94(%rip),%rsi
mov    %r15,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1301 <main+0x111>
lea    0xd85(%rip),%rsi
mov    %r15,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     131a <main+0x12a>
lea    0xd79(%rip),%rsi
mov    %r15,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1358 <main+0x168>
lea    0xd69(%rip),%rsi
mov    %r15,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13b9 <main+0x1c9>
lea    0xd5c(%rip),%rsi
mov    %r15,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13e2 <main+0x1f2>
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
lea    0xd41(%rip),%rsi
mov    %r15,%rdx
call   1080 <fprintf@plt>
jmp    139e <main+0x1ae>
test   %bpl,%bpl
je     1348 <main+0x158>
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    10f0 <main_get@plt>
test   %bpl,%bpl
je     1371 <main+0x181>
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <main_ngrams@plt>
cmp    $0x76,%eax
jne    139e <main+0x1ae>
xor    %eax,%eax
call   1090 <version@plt>
mov    0x2c8a(%rip),%rax
jmp    13ac <main+0x1bc>
xor    %eax,%eax
call   1060 <usage_get@plt>
mov    0x2c7a(%rip),%rax
jmp    13ac <main+0x1bc>
test   %bpl,%bpl
je     13d2 <main+0x1e2>
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1110 <main_tokens@plt>
xor    %eax,%eax
call   10e0 <usage_ngrams@plt>
mov    0x2c51(%rip),%rax
jmp    13ac <main+0x1bc>
lea    0xc78(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
jmp    139e <main+0x1ae>
xor    %ebp,%ebp
mov    %edi,%ecx
sub    %ecx,%ebx
jne    1270 <main+0x80>
xor    %eax,%eax
call   10d0 <usage@plt>
mov    0x2c2c(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
test   %bpl,%bpl
je     13fb <main+0x20b>
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <main_sentences@plt>
xor    %eax,%eax
call   10b0 <usage_tokens@plt>
mov    0x2bf0(%rip),%rax
jmp    13ac <main+0x1bc>
test   %bpl,%bpl
je     140b <main+0x21b>
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1100 <main_scan@plt>
xor    %eax,%eax
call   1030 <usage_sentences@plt>
mov    0x2bc7(%rip),%rax
jmp    13ac <main+0x1bc>
xor    %eax,%eax
call   10c0 <usage_scan@plt>
mov    0x2bb7(%rip),%rax
jmp    13ac <main+0x1bc>

LLVM IR (-O0):
@.str = [20 x i8] c"illegal option: %s\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@.str.1 = [4 x i8] c"get\00"
@.str.2 = [7 x i8] c"ngrams\00"
@.str.3 = [7 x i8] c"tokens\00"
@.str.4 = [10 x i8] c"sentences\00"
@.str.5 = [5 x i8] c"scan\00"
@stderr = global i32 0
@.str.6 = [29 x i8] c"Unrecognized command '%s'.\0A\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 1, i32* %8
br label %10
10: ; preds = %62, %2
%11 = load i32, i32* %8
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %65
14: ; preds = %10
%15 = load i8**, i8*** %5
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 45
br i1 %23, label %24, label %25
24: ; preds = %14
br label %65
25: ; preds = %14
%26 = load i8**, i8*** %5
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8, i8* %30, i64 2
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %44
35: ; preds = %25
%36 = load i8**, i8*** %5
%37 = load i32, i32* %8
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %36, i64 %38
%40 = load i8*, i8** %39
%41 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %40)
%42 = call i32 (...) @usage()
%43 = load i32, i32* @EXIT_FAILURE
store i32 %43, i32* %3
br label %173
44: ; preds = %25
%45 = load i8**, i8*** %5
%46 = load i32, i32* %8
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %45, i64 %47
%49 = load i8*, i8** %48
%50 = getelementptr inbounds i8, i8* %49, i64 1
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
store i32 %52, i32* %9
%53 = load i32, i32* %9
switch i32 %53, label %58 [
i32 104, label %54
i32 118, label %55
]
54: ; preds = %44
store i32 1, i32* %6
br label %61
55: ; preds = %44
%56 = call i32 (...) @version()
%57 = load i32, i32* @EXIT_SUCCESS
store i32 %57, i32* %3
br label %173
58: ; preds = %44
%59 = call i32 (...) @usage()
%60 = load i32, i32* @EXIT_FAILURE
store i32 %60, i32* %3
br label %173
61: ; preds = %54
br label %62
62: ; preds = %61
%63 = load i32, i32* %8
%64 = add nsw i32 %63, 1
store i32 %64, i32* %8
br label %10
65: ; preds = %24, %10
%66 = load i32, i32* %8
%67 = load i32, i32* %4
%68 = sub nsw i32 %67, %66
store i32 %68, i32* %4
%69 = load i32, i32* %8
%70 = load i8**, i8*** %5
%71 = sext i32 %69 to i64
%72 = getelementptr inbounds i8*, i8** %70, i64 %71
store i8** %72, i8*** %5
%73 = load i32, i32* %4
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %65
%76 = call i32 (...) @usage()
%77 = load i32, i32* @EXIT_FAILURE
store i32 %77, i32* %3
br label %173
78: ; preds = %65
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 0
%81 = load i8*, i8** %80
%82 = call i32 @strcmp(i8* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%83 = icmp ne i32 %82, 0
br i1 %83, label %94, label %84
84: ; preds = %78
%85 = load i32, i32* %6
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %90
87: ; preds = %84
%88 = call i32 (...) @usage_get()
%89 = load i32, i32* @EXIT_SUCCESS
store i32 %89, i32* %3
br label %173
90: ; preds = %84
%91 = load i32, i32* %4
%92 = load i8**, i8*** %5
%93 = call i32 @main_get(i32 %91, i8** %92)
store i32 %93, i32* %7
br label %170
94: ; preds = %78
%95 = load i8**, i8*** %5
%96 = getelementptr inbounds i8*, i8** %95, i64 0
%97 = load i8*, i8** %96
%98 = call i32 @strcmp(i8* %97, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%99 = icmp ne i32 %98, 0
br i1 %99, label %110, label %100
100: ; preds = %94
%101 = load i32, i32* %6
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %106
103: ; preds = %100
%104 = call i32 (...) @usage_ngrams()
%105 = load i32, i32* @EXIT_SUCCESS
store i32 %105, i32* %3
br label %173
106: ; preds = %100
%107 = load i32, i32* %4
%108 = load i8**, i8*** %5
%109 = call i32 @main_ngrams(i32 %107, i8** %108)
store i32 %109, i32* %7
br label %169
110: ; preds = %94
%111 = load i8**, i8*** %5
%112 = getelementptr inbounds i8*, i8** %111, i64 0
%113 = load i8*, i8** %112
%114 = call i32 @strcmp(i8* %113, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%115 = icmp ne i32 %114, 0
br i1 %115, label %126, label %116
116: ; preds = %110
%117 = load i32, i32* %6
%118 = icmp ne i32 %117, 0
br i1 %118, label %119, label %122
119: ; preds = %116
%120 = call i32 (...) @usage_tokens()
%121 = load i32, i32* @EXIT_SUCCESS
store i32 %121, i32* %3
br label %173
122: ; preds = %116
%123 = load i32, i32* %4
%124 = load i8**, i8*** %5
%125 = call i32 @main_tokens(i32 %123, i8** %124)
store i32 %125, i32* %7
br label %168
126: ; preds = %110
%127 = load i8**, i8*** %5
%128 = getelementptr inbounds i8*, i8** %127, i64 0
%129 = load i8*, i8** %128
%130 = call i32 @strcmp(i8* %129, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%131 = icmp ne i32 %130, 0
br i1 %131, label %142, label %132
132: ; preds = %126
%133 = load i32, i32* %6
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %138
135: ; preds = %132
%136 = call i32 (...) @usage_sentences()
%137 = load i32, i32* @EXIT_SUCCESS
store i32 %137, i32* %3
br label %173
138: ; preds = %132
%139 = load i32, i32* %4
%140 = load i8**, i8*** %5
%141 = call i32 @main_sentences(i32 %139, i8** %140)
store i32 %141, i32* %7
br label %167
142: ; preds = %126
%143 = load i8**, i8*** %5
%144 = getelementptr inbounds i8*, i8** %143, i64 0
%145 = load i8*, i8** %144
%146 = call i32 @strcmp(i8* %145, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%147 = icmp ne i32 %146, 0
br i1 %147, label %158, label %148
148: ; preds = %142
%149 = load i32, i32* %6
%150 = icmp ne i32 %149, 0
br i1 %150, label %151, label %154
151: ; preds = %148
%152 = call i32 (...) @usage_scan()
%153 = load i32, i32* @EXIT_SUCCESS
store i32 %153, i32* %3
br label %173
154: ; preds = %148
%155 = load i32, i32* %4
%156 = load i8**, i8*** %5
%157 = call i32 @main_scan(i32 %155, i8** %156)
store i32 %157, i32* %7
br label %166
158: ; preds = %142
%159 = load i32, i32* @stderr
%160 = load i8**, i8*** %5
%161 = getelementptr inbounds i8*, i8** %160, i64 0
%162 = load i8*, i8** %161
%163 = call i32 @fprintf(i32 %159, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %162)
%164 = call i32 (...) @usage()
%165 = load i32, i32* @EXIT_FAILURE
store i32 %165, i32* %3
br label %173
166: ; preds = %154
br label %167
167: ; preds = %166, %138
br label %168
168: ; preds = %167, %122
br label %169
169: ; preds = %168, %106
br label %170
170: ; preds = %169, %90
br label %171
171: ; preds = %170
%172 = load i32, i32* %7
store i32 %172, i32* %3
br label %173
173: ; preds = %171, %158, %151, %135, %119, %103, %87, %75, %58, %55, %35
%174 = load i32, i32* %3
ret i32 %174
}

LLVM IR (-O2):
@.str = [20 x i8] c"illegal option: %s\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@.str.1 = [4 x i8] c"get\00"
@.str.2 = [7 x i8] c"ngrams\00"
@.str.3 = [7 x i8] c"tokens\00"
@.str.4 = [10 x i8] c"sentences\00"
@.str.5 = [5 x i8] c"scan\00"
@stderr = global i32 0
@.str.6 = [29 x i8] c"Unrecognized command '%s'.\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %43
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 45
br i1 %9, label %15, label %40
10: ; preds = %29
%11 = getelementptr inbounds i8*, i8** %1, i64 %30
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 45
br i1 %14, label %15, label %38
15: ; preds = %4, %10
%16 = phi i8* [ %12, %10 ], [ %7, %4 ]
%17 = phi i64 [ %30, %10 ], [ 1, %4 ]
%18 = getelementptr inbounds i8, i8* %16, i64 2
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %15
%22 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %16)
%23 = tail call i32 (...) @usage()
%24 = load i32, i32* @EXIT_FAILURE
br label %104
25: ; preds = %15
%26 = getelementptr inbounds i8, i8* %16, i64 1
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
switch i32 %28, label %35 [
i32 104, label %29
i32 118, label %32
]
29: ; preds = %25
%30 = add nuw nsw i64 %17, 1
%31 = icmp eq i64 %30, %5
br i1 %31, label %43, label %10
32: ; preds = %25
%33 = tail call i32 (...) @version()
%34 = load i32, i32* @EXIT_SUCCESS
br label %104
35: ; preds = %25
%36 = tail call i32 (...) @usage()
%37 = load i32, i32* @EXIT_FAILURE
br label %104
38: ; preds = %10
%39 = trunc i64 %30 to i32
br label %40
40: ; preds = %38, %4
%41 = phi i32 [ %39, %38 ], [ 1, %4 ]
%42 = xor i1 %9, true
br label %43
43: ; preds = %29, %40, %2
%44 = phi i1 [ true, %2 ], [ %42, %40 ], [ false, %29 ]
%45 = phi i32 [ 1, %2 ], [ %41, %40 ], [ %0, %29 ]
%46 = sub nsw i32 %0, %45
%47 = zext i32 %45 to i64
%48 = getelementptr inbounds i8*, i8** %1, i64 %47
%49 = icmp eq i32 %46, 0
br i1 %49, label %50, label %53
50: ; preds = %43
%51 = tail call i32 (...) @usage()
%52 = load i32, i32* @EXIT_FAILURE
br label %104
53: ; preds = %43
%54 = load i8*, i8** %48
%55 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %63
57: ; preds = %53
br i1 %44, label %61, label %58
58: ; preds = %57
%59 = tail call i32 (...) @usage_get()
%60 = load i32, i32* @EXIT_SUCCESS
br label %104
61: ; preds = %57
%62 = tail call i32 @main_get(i32 %46, i8** %48)
br label %104
63: ; preds = %53
%64 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %72
66: ; preds = %63
br i1 %44, label %70, label %67
67: ; preds = %66
%68 = tail call i32 (...) @usage_ngrams()
%69 = load i32, i32* @EXIT_SUCCESS
br label %104
70: ; preds = %66
%71 = tail call i32 @main_ngrams(i32 %46, i8** %48)
br label %104
72: ; preds = %63
%73 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %81
75: ; preds = %72
br i1 %44, label %79, label %76
76: ; preds = %75
%77 = tail call i32 (...) @usage_tokens()
%78 = load i32, i32* @EXIT_SUCCESS
br label %104
79: ; preds = %75
%80 = tail call i32 @main_tokens(i32 %46, i8** %48)
br label %104
81: ; preds = %72
%82 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %90
84: ; preds = %81
br i1 %44, label %88, label %85
85: ; preds = %84
%86 = tail call i32 (...) @usage_sentences()
%87 = load i32, i32* @EXIT_SUCCESS
br label %104
88: ; preds = %84
%89 = tail call i32 @main_sentences(i32 %46, i8** %48)
br label %104
90: ; preds = %81
%91 = tail call i32 @strcmp(i8* dereferenceable(1) %54, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%92 = icmp eq i32 %91, 0
br i1 %92, label %93, label %99
93: ; preds = %90
br i1 %44, label %97, label %94
94: ; preds = %93
%95 = tail call i32 (...) @usage_scan()
%96 = load i32, i32* @EXIT_SUCCESS
br label %104
97: ; preds = %93
%98 = tail call i32 @main_scan(i32 %46, i8** %48)
br label %104
99: ; preds = %90
%100 = load i32, i32* @stderr
%101 = tail call i32 @fprintf(i32 %100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %54)
%102 = tail call i32 (...) @usage()
%103 = load i32, i32* @EXIT_FAILURE
br label %104
104: ; preds = %70, %88, %97, %79, %61, %99, %94, %85, %76, %67, %58, %50, %35, %32, %21
%105 = phi i32 [ %52, %50 ], [ %103, %99 ], [ %96, %94 ], [ %87, %85 ], [ %78, %76 ], [ %69, %67 ], [ %60, %58 ], [ %24, %21 ], [ %37, %35 ], [ %34, %32 ], [ %98, %97 ], [ %89, %88 ], [ %80, %79 ], [ %71, %70 ], [ %62, %61 ]
ret i32 %105
}