#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*/ darwin_print_help();
int /*<<< orphan*/ darwin_print_version();
int /*<<< orphan*/ run(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc != 4) {
    if ((argv[1] != NULL) && (strcmp(argv[1], "--version") == 0)) {
      darwin_print_version();
    } else {
      darwin_print_help();
    }
  } else {
    run(argv[1], argv[2], argv[3]);
  }
  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   $0x4,-0x8(%rbp)
je     11a5 <main+0x65>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1199 <main+0x59>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe82(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1199 <main+0x59>
mov    $0x0,%al
call   1060 <darwin_print_version@plt>
jmp    11a0 <main+0x60>
mov    $0x0,%al
call   1050 <darwin_print_help@plt>
jmp    11c2 <main+0x82>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1030 <run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    0x8(%rsi),%rdi
cmp    $0x4,%eax
jne    115e <main+0x1e>
mov    0x10(%rsi),%rax
mov    0x18(%rsi),%rdx
mov    %rax,%rsi
call   1030 <run@plt>
jmp    1184 <main+0x44>
test   %rdi,%rdi
je     1174 <main+0x34>
lea    0xe96(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     117d <main+0x3d>
xor    %eax,%eax
call   1050 <darwin_print_help@plt>
jmp    1184 <main+0x44>
xor    %eax,%eax
call   1060 <darwin_print_version@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"--version\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, 4
br i1 %7, label %8, label %24
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %21
13: ; preds = %8
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (...) @darwin_print_version()
br label %23
21: ; preds = %13, %8
%22 = call i32 (...) @darwin_print_help()
br label %23
23: ; preds = %21, %19
br label %35
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 3
%33 = load i8*, i8** %32
%34 = call i32 @run(i8* %27, i8* %30, i8* %33)
br label %35
35: ; preds = %24, %23
ret i32 0
}

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