#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*/ destroy_box();
int /*<<< orphan*/ init();
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ provision_box();
int /*<<< orphan*/ spindown_box();
int /*<<< orphan*/ spinup_box();
int /*<<< orphan*/ ssh_box();
scalar_t__ strcmp(char *, char *);
int main(int number_arguments, char *argument[]) {
  init();
  if (number_arguments < 2) {
    print_usage();
  } else {
    if (strcmp(argument[1], "up") == 0) {
      spinup_box();
    } else if (strcmp(argument[1], "down") == 0) {
      spindown_box();
    } else if (strcmp(argument[1], "ssh") == 0) {
      ssh_box();
    } else if (strcmp(argument[1], "provision") == 0) {
      provision_box();
    } else if (strcmp(argument[1], "destroy") == 0) {
      destroy_box();
    } else {
      printf("I don't recognize the command: %s\n", argument[1]);
      print_usage();
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <init@plt>
cmpl   $0x2,-0x8(%rbp)
jge    11c3 <main+0x33>
mov    $0x0,%al
call   1090 <print_usage@plt>
jmp    12c9 <main+0x139>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11ed <main+0x5d>
mov    $0x0,%al
call   10b0 <spinup_box@plt>
jmp    12c4 <main+0x134>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe07(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1217 <main+0x87>
mov    $0x0,%al
call   1040 <spindown_box@plt>
jmp    12bf <main+0x12f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1241 <main+0xb1>
mov    $0x0,%al
call   10a0 <ssh_box@plt>
jmp    12ba <main+0x12a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdbc(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    126b <main+0xdb>
mov    $0x0,%al
call   1050 <provision_box@plt>
jmp    12b5 <main+0x125>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd9c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1295 <main+0x105>
mov    $0x0,%al
call   1080 <destroy_box@plt>
jmp    12b0 <main+0x120>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd7a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1090 <print_usage@plt>
jmp    12b5 <main+0x125>
jmp    12ba <main+0x12a>
jmp    12bf <main+0x12f>
jmp    12c4 <main+0x134>
jmp    12c9 <main+0x139>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <init@plt>
cmp    $0x1,%ebp
jg     11b0 <main+0x20>
xor    %eax,%eax
call   1090 <print_usage@plt>
jmp    1259 <main+0xc9>
mov    0x8(%rbx),%rdi
lea    0xe45(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     122e <main+0x9e>
mov    0x8(%rbx),%rdi
lea    0xe33(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1237 <main+0xa7>
mov    0x8(%rbx),%rdi
lea    0xe23(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1240 <main+0xb0>
mov    0x8(%rbx),%rdi
lea    0xe12(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1249 <main+0xb9>
mov    0x8(%rbx),%rdi
lea    0xe07(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1252 <main+0xc2>
mov    0x8(%rbx),%rsi
lea    0xdfa(%rip),%rdi
call   1030 <printf@plt>
jmp    11a4 <main+0x14>
xor    %eax,%eax
call   10b0 <spinup_box@plt>
jmp    1259 <main+0xc9>
xor    %eax,%eax
call   1040 <spindown_box@plt>
jmp    1259 <main+0xc9>
xor    %eax,%eax
call   10a0 <ssh_box@plt>
jmp    1259 <main+0xc9>
xor    %eax,%eax
call   1050 <provision_box@plt>
jmp    1259 <main+0xc9>
xor    %eax,%eax
call   1080 <destroy_box@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"up\00"
@.str.1 = [5 x i8] c"down\00"
@.str.2 = [4 x i8] c"ssh\00"
@.str.3 = [10 x i8] c"provision\00"
@.str.4 = [8 x i8] c"destroy\00"
@.str.5 = [35 x i8] c"I don't recognize the command: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init()
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @print_usage()
br label %62
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 (...) @spinup_box()
br label %61
19: ; preds = %11
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = call i32 (...) @spindown_box()
br label %60
27: ; preds = %19
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = call i32 (...) @ssh_box()
br label %59
35: ; preds = %27
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %35
%42 = call i32 (...) @provision_box()
br label %58
43: ; preds = %35
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %43
%50 = call i32 (...) @destroy_box()
br label %57
51: ; preds = %43
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i8* %54)
%56 = call i32 (...) @print_usage()
br label %57
57: ; preds = %51, %49
br label %58
58: ; preds = %57, %41
br label %59
59: ; preds = %58, %33
br label %60
60: ; preds = %59, %25
br label %61
61: ; preds = %60, %17
br label %62
62: ; preds = %61, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"up\00"
@.str.1 = [5 x i8] c"down\00"
@.str.2 = [4 x i8] c"ssh\00"
@.str.3 = [10 x i8] c"provision\00"
@.str.4 = [8 x i8] c"destroy\00"
@.str.5 = [35 x i8] c"I don't recognize the command: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @init()
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @print_usage()
br label %42
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 (...) @spinup_box()
br label %42
14: ; preds = %7
%15 = load i8*, i8** %8
%16 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = tail call i32 (...) @spindown_box()
br label %42
20: ; preds = %14
%21 = load i8*, i8** %8
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = tail call i32 (...) @ssh_box()
br label %42
26: ; preds = %20
%27 = load i8*, i8** %8
%28 = tail call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = tail call i32 (...) @provision_box()
br label %42
32: ; preds = %26
%33 = load i8*, i8** %8
%34 = tail call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = tail call i32 (...) @destroy_box()
br label %42
38: ; preds = %32
%39 = load i8*, i8** %8
%40 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i8* %39)
%41 = tail call i32 (...) @print_usage()
br label %42
42: ; preds = %12, %24, %36, %38, %30, %18, %5
ret i32 0
}