#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*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc == 0) {
    return 1;
  }
  if (argc == 1) {
    if (!strcmp(argv[0], "Good man")) {
      return 2;
    }
  }
  if (argc == 2) {
    if (!strcmp(argv[1], "Very Good man")) {
      return 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   $0x0,-0x8(%rbp)
jne    113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11b2 <main+0xa2>
cmpl   $0x1,-0x8(%rbp)
jne    1173 <main+0x63>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    116e <main+0x5e>
movl   $0x2,-0x4(%rbp)
jmp    11b2 <main+0xa2>
jmp    1173 <main+0x63>
cmpl   $0x2,-0x8(%rbp)
jne    11ab <main+0x9b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe74(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11a6 <main+0x96>
movl   $0x3,-0x4(%rbp)
jmp    11b2 <main+0xa2>
jmp    11ab <main+0x9b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
test   %edi,%edi
je     1139 <main+0x29>
cmp    $0x2,%edi
je     1140 <main+0x30>
cmp    $0x1,%edi
jne    1154 <main+0x44>
mov    (%rsi),%rdi
lea    0xedc(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    1154 <main+0x44>
mov    $0x2,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1158 <main+0x48>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x3,%eax
pop    %rcx
ret

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

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