#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 main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Usage:\n    $PRO YOURNAME YOURGENDER\n"
           "    M/m for male, F/f for female.\n");
    exit(1);
  }
  if ('M' == argv[2][0] || 'm' == argv[2][0])
    printf("Welcome, Mr. %s!\n", argv[1]);
  else if (('F' == argv[2][0] || 'f' == argv[2][0]))
    printf("Welcome, Ms. %s!\n", argv[1]);
  else
    printf("Sorry, maybe you've input the wrong "
           "information.\n");
  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   $0x2,-0x8(%rbp)
jge    1158 <main+0x38>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%ecx
mov    $0x4d,%eax
cmp    %ecx,%eax
je     1188 <main+0x68>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%ecx
mov    $0x6d,%eax
cmp    %ecx,%eax
jne    11a3 <main+0x83>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1201 <main+0xe1>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%ecx
mov    $0x46,%eax
cmp    %ecx,%eax
je     11d3 <main+0xb3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsbl (%rax),%ecx
mov    $0x66,%eax
cmp    %ecx,%eax
jne    11ee <main+0xce>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fc <main+0xdc>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1201 <main+0xe1>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1186 <main+0x56>
mov    0x10(%rsi),%rax
mov    (%rax),%al
add    $0xba,%al
cmp    $0x27,%al
ja     1178 <main+0x48>
movzbl %al,%eax
lea    0xeb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x8(%rsi),%rsi
lea    0xf52(%rip),%rdi
jmp    116d <main+0x3d>
mov    0x8(%rsi),%rsi
lea    0xf33(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xf45(%rip),%rdi
call   1030 <puts@plt>
jmp    1174 <main+0x44>
lea    0xf68(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"Usage:\0A $PRO YOURNAME YOURGENDER\0A M/m for male, F/f for female.\0A\00"
@.str.1 = [18 x i8] c"Welcome, Mr. %s!\0A\00"
@.str.2 = [18 x i8] c"Welcome, Ms. %s!\0A\00"
@.str.3 = [50 x i8] c"Sorry, maybe you've input the wrong information.\0A\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 slt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 77, %17
br i1 %18, label %27, label %19
19: ; preds = %11
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 109, %25
br i1 %26, label %27, label %32
27: ; preds = %19, %11
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %30)
br label %56
32: ; preds = %19
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8, i8* %35, i64 0
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 70, %38
br i1 %39, label %48, label %40
40: ; preds = %32
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 2
%43 = load i8*, i8** %42
%44 = getelementptr inbounds i8, i8* %43, i64 0
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 102, %46
br i1 %47, label %48, label %53
48: ; preds = %40, %32
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %51)
br label %55
53: ; preds = %40
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
br label %55
55: ; preds = %53, %48
br label %56
56: ; preds = %55, %27
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"Welcome, Mr. %s!\0A\00"
@.str.2 = [18 x i8] c"Welcome, Ms. %s!\0A\00"
@str = [49 x i8] c"Sorry, maybe you've input the wrong information.\00"
@str.4 = [70 x i8] c"Usage:\0A $PRO YOURNAME YOURGENDER\0A M/m for male, F/f for female.\00"
define i32 @main(i32 %0, i8** nocapture %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 ([70 x i8], [70 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
switch i8 %10, label %19 [
i8 77, label %11
i8 109, label %11
i8 70, label %15
i8 102, label %15
]
11: ; preds = %7, %7
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %21
15: ; preds = %7, %7
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %17)
br label %21
19: ; preds = %7
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
br label %21
21: ; preds = %15, %19, %11
ret i32 0
}