#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 bmp180_main(int, char const **);
int buzzer_main(int, char const **);
int lcd1602_main(int, char const **);
scalar_t__ strcmp(char const *, char *);
int ud_main(int, char const **);
int usage();
int util_main(int, char const **);
int main(int argc, const char *argv[]) {
  if (argc < 2) {
    return usage();
  }
  if (strcmp(argv[1], "ud") == 0) {
    return ud_main(argc, argv);
  } else if (strcmp(argv[1], "buzzer") == 0) {
    return buzzer_main(argc, argv);
  } else if (strcmp(argv[1], "util") == 0) {
    return util_main(argc, argv);
  } else if (strcmp(argv[1], "bmp180") == 0) {
    return bmp180_main(argc, argv);
  } else if (strcmp(argv[1], "lcd1602") == 0) {
    return lcd1602_main(argc, argv);
  } else {
    return 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)
cmpl   $0x2,-0x8(%rbp)
jge    119f <main+0x2f>
mov    $0x0,%al
call   1070 <usage@plt>
mov    %eax,-0x4(%rbp)
jmp    12a3 <main+0x133>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe52(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11d1 <main+0x61>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <ud_main@plt>
mov    %eax,-0x4(%rbp)
jmp    12a3 <main+0x133>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe23(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1203 <main+0x93>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <buzzer_main@plt>
mov    %eax,-0x4(%rbp)
jmp    12a3 <main+0x133>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdf8(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1235 <main+0xc5>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <util_main@plt>
mov    %eax,-0x4(%rbp)
jmp    12a3 <main+0x133>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdcb(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1267 <main+0xf7>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <bmp180_main@plt>
mov    %eax,-0x4(%rbp)
jmp    12a3 <main+0x133>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda0(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1299 <main+0x129>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <lcd1602_main@plt>
mov    %eax,-0x4(%rbp)
jmp    12a3 <main+0x133>
mov    $0x0,%al
call   1070 <usage@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jg     1185 <main+0x15>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <usage@plt>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe6b(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1203 <main+0x93>
mov    0x8(%rbx),%rdi
lea    0xe59(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1213 <main+0xa3>
mov    0x8(%rbx),%rdi
lea    0xe4b(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1223 <main+0xb3>
mov    0x8(%rbx),%rdi
lea    0xe3b(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1233 <main+0xc3>
mov    0x8(%rbx),%rdi
lea    0xe2d(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1178 <main+0x8>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <lcd1602_main@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <ud_main@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <buzzer_main@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1090 <util_main@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <bmp180_main@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ud\00"
@.str.1 = [7 x i8] c"buzzer\00"
@.str.2 = [5 x i8] c"util\00"
@.str.3 = [7 x i8] c"bmp180\00"
@.str.4 = [8 x i8] c"lcd1602\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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
store i32 %9, i32* %3
br label %62
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @ud_main(i32 %17, i8** %18)
store i32 %19, i32* %3
br label %62
20: ; preds = %10
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %20
%27 = load i32, i32* %4
%28 = load i8**, i8*** %5
%29 = call i32 @buzzer_main(i32 %27, i8** %28)
store i32 %29, i32* %3
br label %62
30: ; preds = %20
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %30
%37 = load i32, i32* %4
%38 = load i8**, i8*** %5
%39 = call i32 @util_main(i32 %37, i8** %38)
store i32 %39, i32* %3
br label %62
40: ; preds = %30
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 1
%43 = load i8*, i8** %42
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %40
%47 = load i32, i32* %4
%48 = load i8**, i8*** %5
%49 = call i32 @bmp180_main(i32 %47, i8** %48)
store i32 %49, i32* %3
br label %62
50: ; preds = %40
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %50
%57 = load i32, i32* %4
%58 = load i8**, i8*** %5
%59 = call i32 @lcd1602_main(i32 %57, i8** %58)
store i32 %59, i32* %3
br label %62
60: ; preds = %50
%61 = call i32 (...) @usage()
store i32 %61, i32* %3
br label %62
62: ; preds = %60, %56, %46, %36, %26, %16, %8
%63 = load i32, i32* %3
ret i32 %63
}

LLVM IR (-O2):
@.str = [3 x i8] c"ud\00"
@.str.1 = [7 x i8] c"buzzer\00"
@.str.2 = [5 x i8] c"util\00"
@.str.3 = [7 x i8] c"bmp180\00"
@.str.4 = [8 x i8] c"lcd1602\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %39
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @ud_main(i32 %0, i8** %1)
br label %39
13: ; preds = %6
%14 = load i8*, i8** %7
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 @buzzer_main(i32 %0, i8** %1)
br label %39
19: ; preds = %13
%20 = load i8*, i8** %7
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = tail call i32 @util_main(i32 %0, i8** %1)
br label %39
25: ; preds = %19
%26 = load i8*, i8** %7
%27 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = tail call i32 @bmp180_main(i32 %0, i8** %1)
br label %39
31: ; preds = %25
%32 = load i8*, i8** %7
%33 = tail call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = tail call i32 @lcd1602_main(i32 %0, i8** %1)
br label %39
37: ; preds = %31
%38 = tail call i32 (...) @usage()
br label %39
39: ; preds = %37, %35, %29, %23, %17, %11, %4
%40 = phi i32 [ %5, %4 ], [ %12, %11 ], [ %18, %17 ], [ %24, %23 ], [ %30, %29 ], [ %36, %35 ], [ %38, %37 ]
ret i32 %40
}