#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv, char **envp) {
  if (strcmp(argv[0], "./hello.out") == 0) {
    printf("Hello, World!\n");
    return EXIT_SUCCESS;
  }
  if (strcmp(argv[0], "./goodbye.out") == 0) {
    printf("Goodbye, World!\n");
    return EXIT_SUCCESS;
  }
  printf("What do you want from me?!?\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1174 <main+0x54>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11c6 <main+0xa6>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe99(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ae <main+0x8e>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11c6 <main+0xa6>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
lea    0xed2(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     115e <main+0x3e>
mov    (%rbx),%rdi
lea    0xeca(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xee5(%rip),%rax
lea    0xec2(%rip),%rdi
cmove  %rax,%rdi
jmp    1165 <main+0x45>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"./hello.out\00"
@.str.1 = [15 x i8] c"Hello, World!\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.2 = [14 x i8] c"./goodbye.out\00"
@.str.3 = [17 x i8] c"Goodbye, World!\0A\00"
@.str.4 = [29 x i8] c"What do you want from me?!?\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* @EXIT_SUCCESS
store i32 %15, i32* %4
br label %28
16: ; preds = %3
%17 = load i8**, i8*** %6
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%24 = load i32, i32* @EXIT_SUCCESS
store i32 %24, i32* %4
br label %28
25: ; preds = %16
%26 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%27 = load i32, i32* @EXIT_SUCCESS
store i32 %27, i32* %4
br label %28
28: ; preds = %25, %22, %13
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
@.str = [12 x i8] c"./hello.out\00"
@EXIT_SUCCESS = global i32 0
@.str.2 = [14 x i8] c"./goodbye.out\00"
@str = [28 x i8] c"What do you want from me?!?\00"
@str.5 = [16 x i8] c"Goodbye, World!\00"
@str.6 = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = load i8*, i8** %1
%5 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = load i8*, i8** %1
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0)
br label %12
12: ; preds = %7, %3
%13 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0), %3 ], [ %11, %7 ]
%14 = tail call i32 @puts(i8* dereferenceable(1) %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}