#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*/ printf(char *, char *);
int /*<<< orphan*/ show_help();
int /*<<< orphan*/ show_version();
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int i;
  if (argc < 2) {
    show_help();
    return EXIT_FAILURE;
  }
  for (i = 1; i < argc; i++) {
    if (!strcmp(argv[i], "--help")) {
      show_help();
      return EXIT_SUCCESS;
    } else if (!strcmp(argv[i], "--version")) {
      show_version();
      return EXIT_SUCCESS;
    } else if (!strcmp(argv[i], "--powersave")) {
    } else if (!strcmp(argv[i], "--performance")) {
    } else {
      printf("unknown command: %s\n", argv[i]);
      return EXIT_FAILURE;
    }
  }
  return EXIT_SUCCESS;
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    1178 <main+0x38>
mov    $0x0,%al
call   1060 <show_help@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <main+0x160>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1294 <main+0x154>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe62(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11c4 <main+0x84>
mov    $0x0,%al
call   1060 <show_help@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <main+0x160>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe30(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11fd <main+0xbd>
mov    $0x0,%al
call   1030 <show_version@plt>
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <main+0x160>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe01(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1223 <main+0xe3>
jmp    1277 <main+0x137>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xde7(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1249 <main+0x109>
jmp    1272 <main+0x132>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xdcf(%rip),%rdi
call   1040 <printf@plt>
mov    0x2d78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <main+0x160>
jmp    1277 <main+0x137>
jmp    127c <main+0x13c>
jmp    1281 <main+0x141>
jmp    1286 <main+0x146>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117f <main+0x3f>
mov    0x2d3d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%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
jge    1163 <main+0x23>
xor    %eax,%eax
call   1060 <show_help@plt>
mov    0x2e82(%rip),%rax
jmp    1200 <main+0xc0>
mov    %rsi,%rbx
mov    %edi,%r13d
mov    $0x1,%r12d
lea    0xe8a(%rip),%r14
lea    0xe8a(%rip),%r15
jmp    1189 <main+0x49>
nop
add    $0x1,%r12
cmp    %r12,%r13
je     11f9 <main+0xb9>
mov    (%rbx,%r12,8),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11e9 <main+0xa9>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11f2 <main+0xb2>
mov    %rbp,%rdi
lea    0xe5c(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1180 <main+0x40>
mov    %rbp,%rdi
lea    0xe55(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1180 <main+0x40>
lea    0xe53(%rip),%rdi
mov    %rbp,%rsi
call   1040 <printf@plt>
mov    0x2df9(%rip),%rax
jmp    1200 <main+0xc0>
xor    %eax,%eax
call   1060 <show_help@plt>
jmp    11f9 <main+0xb9>
xor    %eax,%eax
call   1030 <show_version@plt>
mov    0x2dd8(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [7 x i8] c"--help\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [10 x i8] c"--version\00"
@.str.2 = [12 x i8] c"--powersave\00"
@.str.3 = [14 x i8] c"--performance\00"
@.str.4 = [21 x i8] c"unknown command: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 (...) @show_help()
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %3
br label %74
12: ; preds = %2
store i32 1, i32* %6
br label %13
13: ; preds = %69, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %72
17: ; preds = %13
%18 = load i8**, i8*** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %17
%26 = call i32 (...) @show_help()
%27 = load i32, i32* @EXIT_SUCCESS
store i32 %27, i32* %3
br label %74
28: ; preds = %17
%29 = load i8**, i8*** %5
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %39, label %36
36: ; preds = %28
%37 = call i32 (...) @show_version()
%38 = load i32, i32* @EXIT_SUCCESS
store i32 %38, i32* %3
br label %74
39: ; preds = %28
%40 = load i8**, i8*** %5
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
%45 = call i32 @strcmp(i8* %44, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %48, label %47
47: ; preds = %39
br label %66
48: ; preds = %39
%49 = load i8**, i8*** %5
%50 = load i32, i32* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = load i8*, i8** %52
%54 = call i32 @strcmp(i8* %53, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%55 = icmp ne i32 %54, 0
br i1 %55, label %57, label %56
56: ; preds = %48
br label %65
57: ; preds = %48
%58 = load i8**, i8*** %5
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %62)
%64 = load i32, i32* @EXIT_FAILURE
store i32 %64, i32* %3
br label %74
65: ; preds = %56
br label %66
66: ; preds = %65, %47
br label %67
67: ; preds = %66
br label %68
68: ; preds = %67
br label %69
69: ; preds = %68
%70 = load i32, i32* %6
%71 = add nsw i32 %70, 1
store i32 %71, i32* %6
br label %13
72: ; preds = %13
%73 = load i32, i32* @EXIT_SUCCESS
store i32 %73, i32* %3
br label %74
74: ; preds = %72, %57, %36, %25, %9
%75 = load i32, i32* %3
ret i32 %75
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [7 x i8] c"--help\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [10 x i8] c"--version\00"
@.str.2 = [12 x i8] c"--powersave\00"
@.str.3 = [14 x i8] c"--performance\00"
@.str.4 = [21 x i8] c"unknown command: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @show_help()
br label %32
8: ; preds = %4, %29
%9 = phi i64 [ 1, %4 ], [ %30, %29 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = tail call i32 (...) @show_help()
br label %32
16: ; preds = %8
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 (...) @show_version()
br label %32
21: ; preds = %16
%22 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %29, label %24
24: ; preds = %21
%25 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(14) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %24
%28 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* %11)
br label %32
29: ; preds = %21, %24
%30 = add nuw nsw i64 %9, 1
%31 = icmp eq i64 %30, %5
br i1 %31, label %32, label %8
32: ; preds = %29, %27, %19, %14, %6
%33 = phi i32* [ @EXIT_FAILURE, %6 ], [ @EXIT_FAILURE, %27 ], [ @EXIT_SUCCESS, %19 ], [ @EXIT_SUCCESS, %14 ], [ @EXIT_SUCCESS, %29 ]
%34 = load i32, i32* %33
ret i32 %34
}