#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 atoi(char *);
int /*<<< orphan*/ exec0();
int /*<<< orphan*/ exec1();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int option = 0;
  if (argc > 1)
    option = atoi(argv[1]);
  switch (option) {
  case 0:
    exec0();
    break;
  case 1:
    exec1();
    break;
  default:
    printf("Unknown option %d\n", option);
    break;
  }
  return 0;
}


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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1177 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     119b <main+0x5b>
jmp    118a <main+0x4a>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     11a7 <main+0x67>
jmp    11b3 <main+0x73>
mov    $0x0,%al
call   1050 <exec0@plt>
jmp    11c2 <main+0x82>
mov    $0x0,%al
call   1030 <exec1@plt>
jmp    11c2 <main+0x82>
mov    -0x14(%rbp),%esi
lea    0xe43(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1158 <main+0x18>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
cmp    $0x1,%eax
je     1161 <main+0x21>
test   %eax,%eax
jne    116a <main+0x2a>
xor    %eax,%eax
call   1050 <exec0@plt>
jmp    1178 <main+0x38>
xor    %eax,%eax
call   1030 <exec1@plt>
jmp    1178 <main+0x38>
lea    0xe8f(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Unknown option %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %6
switch i32 %15, label %20 [
i32 0, label %16
i32 1, label %18
]
16: ; preds = %14
%17 = call i32 (...) @exec0()
br label %23
18: ; preds = %14
%19 = call i32 (...) @exec1()
br label %23
20: ; preds = %14
%21 = load i32, i32* %6
%22 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %18, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Unknown option %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
switch i32 %7, label %12 [
i32 0, label %8
i32 1, label %10
]
8: ; preds = %2, %4
%9 = tail call i32 (...) @exec0()
br label %14
10: ; preds = %4
%11 = tail call i32 (...) @exec1()
br label %14
12: ; preds = %4
%13 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %14
14: ; preds = %12, %10, %8
ret i32 0
}