#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 /*<<< orphan*/ checkSpacing(char *, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char const *, char *);
int main(int argc, char **argv) {
  int i;
  unsigned flags = 0x002;
  for (i = 1; i < argc; i++) {
    const char *z = argv[i];
    if (z[0] == '-') {
      while (z[0] == '-')
        z++;
      if (strcmp(z, "crok") == 0) {
        flags |= 0x001;
      } else if (strcmp(z, "wseol") == 0) {
        flags &= ~0x002;
      } else if (strcmp(z, "help") == 0) {
        printf("Usage: %s [options] FILE ...\n", argv[0]);
        printf("  --crok      Do not report on carriage-returns\n");
        printf("  --wseol     Complain about whitespace at end-of-line\n");
        printf("  --help      This message\n");
      } else {
        printf("unknown command-line option: [%s]\n", argv[i]);
        printf("use --help for additional information\n");
      }
    } else {
      checkSpacing(argv[i], flags);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12b2 <main+0x182>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    128b <main+0x15b>
jmp    1185 <main+0x55>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11a6 <main+0x76>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1185 <main+0x55>
mov    -0x20(%rbp),%rdi
lea    0xe4f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ce <main+0x9e>
mov    -0x18(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1286 <main+0x156>
mov    -0x20(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f6 <main+0xc6>
mov    -0x18(%rbp),%eax
and    $0xfffffffd,%eax
mov    %eax,-0x18(%rbp)
jmp    1281 <main+0x151>
mov    -0x20(%rbp),%rdi
lea    0xe0a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1254 <main+0x124>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <main+0x14c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1281 <main+0x151>
jmp    1286 <main+0x156>
jmp    129f <main+0x16f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%esi
call   1050 <checkSpacing@plt>
jmp    12a4 <main+0x174>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1250 <main+0x110>
mov    %rsi,%rbx
mov    %edi,%r12d
mov    $0x2,%ebp
mov    $0x1,%r15d
lea    0xe94(%rip),%r14
jmp    1187 <main+0x47>
xchg   %ax,%ax
mov    %r13,%rdi
mov    %ebp,%esi
call   1060 <checkSpacing@plt>
add    $0x1,%r15
cmp    %r12,%r15
je     1250 <main+0x110>
mov    (%rbx,%r15,8),%r13
cmpb   $0x2d,0x0(%r13)
jne    1170 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x2d,0x1(%r13)
lea    0x1(%r13),%r13
je     11a0 <main+0x60>
mov    %r13,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1206 <main+0xc6>
mov    %r13,%rdi
lea    0xe40(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     120e <main+0xce>
mov    %r13,%rdi
lea    0xe32(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1216 <main+0xd6>
mov    (%rbx,%r15,8),%rsi
lea    0xe40(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe55(%rip),%rdi
call   1030 <puts@plt>
jmp    117a <main+0x3a>
or     $0x1,%ebp
jmp    117a <main+0x3a>
and    $0xfffffffd,%ebp
jmp    117a <main+0x3a>
mov    (%rbx),%rsi
lea    0xdf0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
jmp    117a <main+0x3a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"crok\00"
@.str.1 = [6 x i8] c"wseol\00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [30 x i8] c"Usage: %s [options] FILE ...\0A\00"
@.str.4 = [49 x i8] c" --crok Do not report on carriage-returns\0A\00"
@.str.5 = [56 x i8] c" --wseol Complain about whitespace at end-of-line\0A\00"
@.str.6 = [28 x i8] c" --help This message\0A\00"
@.str.7 = [35 x i8] c"unknown command-line option: [%s]\0A\00"
@.str.8 = [39 x i8] c"use --help for additional information\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 i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %7
store i32 1, i32* %6
br label %9
9: ; preds = %80, %2
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %83
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
store i8* %18, i8** %8
%19 = load i8*, i8** %8
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 45
br i1 %23, label %24, label %71
24: ; preds = %13
br label %25
25: ; preds = %31, %24
%26 = load i8*, i8** %8
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 45
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = load i8*, i8** %8
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %8
br label %25
34: ; preds = %25
%35 = load i8*, i8** %8
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i32, i32* %7
%40 = or i32 %39, 1
store i32 %40, i32* %7
br label %70
41: ; preds = %34
%42 = load i8*, i8** %8
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = load i32, i32* %7
%47 = and i32 %46, -3
store i32 %47, i32* %7
br label %69
48: ; preds = %41
%49 = load i8*, i8** %8
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %60
52: ; preds = %48
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 0
%55 = load i8*, i8** %54
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %68
60: ; preds = %48
%61 = load i8**, i8*** %5
%62 = load i32, i32* %6
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %61, i64 %63
%65 = load i8*, i8** %64
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i8* %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0))
br label %68
68: ; preds = %60, %52
br label %69
69: ; preds = %68, %45
br label %70
70: ; preds = %69, %38
br label %79
71: ; preds = %13
%72 = load i8**, i8*** %5
%73 = load i32, i32* %6
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8*, i8** %72, i64 %74
%76 = load i8*, i8** %75
%77 = load i32, i32* %7
%78 = call i32 @checkSpacing(i8* %76, i32 %77)
br label %79
79: ; preds = %71, %70
br label %80
80: ; preds = %79
%81 = load i32, i32* %6
%82 = add nsw i32 %81, 1
store i32 %82, i32* %6
br label %9
83: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"crok\00"
@.str.1 = [6 x i8] c"wseol\00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [30 x i8] c"Usage: %s [options] FILE ...\0A\00"
@.str.7 = [35 x i8] c"unknown command-line option: [%s]\0A\00"
@str = [38 x i8] c"use --help for additional information\00"
@str.9 = [48 x i8] c" --crok Do not report on carriage-returns\00"
@str.10 = [55 x i8] c" --wseol Complain about whitespace at end-of-line\00"
@str.11 = [27 x i8] c" --help This message\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %47
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %43
%7 = phi i64 [ 1, %4 ], [ %45, %43 ]
%8 = phi i32 [ 2, %4 ], [ %44, %43 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %41
13: ; preds = %6, %13
%14 = phi i8* [ %15, %13 ], [ %10, %6 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 45
br i1 %17, label %13, label %18
18: ; preds = %13
%19 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = or i32 %8, 1
br label %43
23: ; preds = %18
%24 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = and i32 %8, -3
br label %43
28: ; preds = %23
%29 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = load i8*, i8** %1
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %32)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.9, i64 0, i64 0))
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.10, i64 0, i64 0))
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.11, i64 0, i64 0))
br label %43
37: ; preds = %28
%38 = load i8*, i8** %9
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i8* %38)
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %43
41: ; preds = %6
%42 = tail call i32 @checkSpacing(i8* %10, i32 %8)
br label %43
43: ; preds = %21, %31, %37, %26, %41
%44 = phi i32 [ %22, %21 ], [ %27, %26 ], [ %8, %31 ], [ %8, %37 ], [ %8, %41 ]
%45 = add nuw nsw i64 %7, 1
%46 = icmp eq i64 %45, %5
br i1 %46, label %47, label %6
47: ; preds = %43, %2
ret i32 0
}