#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*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ psidentMain(int, char **);
int /*<<< orphan*/ pswhatMain(int, char **);
scalar_t__ strcmp(char *, char *);
void main(int argc, char **argv) {
  if (argc < 2) {
    printf("usage: pswhat program or pswhat -i program\n");
    exit(-1);
  }
  if (strcmp(argv[1], "-i") == 0) {
    psidentMain(argc, argv);
  } else {
    pswhatMain(argc, argv);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    117f <main+0x2f>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ae <main+0x5e>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <psidentMain@plt>
jmp    11ba <main+0x6a>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pswhatMain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jle    1189 <main+0x39>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe98(%rip),%rsi
call   1050 <strcmp@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1182 <main+0x32>
pop    %rbx
pop    %rbp
jmp    1040 <pswhatMain@plt>
pop    %rbx
pop    %rbp
jmp    1060 <psidentMain@plt>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"usage: pswhat program or pswhat -i program\0A\00"
@.str.1 = [3 x i8] c"-i\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %4
%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.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %10
%17 = load i32, i32* %3
%18 = load i8**, i8*** %4
%19 = call i32 @psidentMain(i32 %17, i8** %18)
br label %24
20: ; preds = %10
%21 = load i32, i32* %3
%22 = load i8**, i8*** %4
%23 = call i32 @pswhatMain(i32 %21, i8** %22)
br label %24
24: ; preds = %20, %16
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"-i\00"
@str = [43 x i8] c"usage: pswhat program or pswhat -i program\00"
define void @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
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.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 @psidentMain(i32 %0, i8** %1)
br label %16
14: ; preds = %7
%15 = tail call i32 @pswhatMain(i32 %0, i8** %1)
br label %16
16: ; preds = %14, %12
ret void
}