#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 do_calibrate();
int do_usage(char *);
int /*<<< orphan*/ strcasecmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    return do_usage(argv[0]);
  }
  if (!strcasecmp(argv[1], "c")) {
    return do_calibrate();
  }
  return do_usage(argv[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)
je     1164 <main+0x34>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <do_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    119f <main+0x6f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1190 <main+0x60>
mov    $0x0,%al
call   1050 <do_calibrate@plt>
mov    %eax,-0x4(%rbp)
jmp    119f <main+0x6f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <do_usage@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    114d <main+0x1d>
mov    0x8(%rbx),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1156 <main+0x26>
mov    (%rbx),%rdi
pop    %rbx
jmp    1040 <do_usage@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <do_calibrate@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"c\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 ne i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @do_usage(i8* %11)
store i32 %12, i32* %3
br label %26
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strcasecmp(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %13
%20 = call i32 (...) @do_calibrate()
store i32 %20, i32* %3
br label %26
21: ; preds = %13
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @do_usage(i8* %24)
store i32 %25, i32* %3
br label %26
26: ; preds = %21, %19, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [2 x i8] c"c\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @do_usage(i8* %5)
br label %17
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strcasecmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 (...) @do_calibrate()
br label %17
14: ; preds = %7
%15 = load i8*, i8** %1
%16 = tail call i32 @do_usage(i8* %15)
br label %17
17: ; preds = %14, %12, %4
%18 = phi i32 [ %6, %4 ], [ %16, %14 ], [ %13, %12 ]
ret i32 %18
}