#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 */
scalar_t__ strcmp(char *, char *);
int test_one();
int test_three();
int test_two();
int main(int argc, char **argv) {
  if (argc == 1)
    return test_one();
  if (strcmp(argv[1], "-3") == 0)
    return test_three();
  if (strcmp(argv[1], "-2") == 0)
    return test_two();
  return test_one();
}


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   $0x1,-0x8(%rbp)
jne    116f <main+0x2f>
mov    $0x0,%al
call   1050 <test_one@plt>
mov    %eax,-0x4(%rbp)
jmp    11d3 <main+0x93>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe82(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    119c <main+0x5c>
mov    $0x0,%al
call   1060 <test_three@plt>
mov    %eax,-0x4(%rbp)
jmp    11d3 <main+0x93>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe58(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c9 <main+0x89>
mov    $0x0,%al
call   1030 <test_two@plt>
mov    %eax,-0x4(%rbp)
jmp    11d3 <main+0x93>
mov    $0x0,%al
call   1050 <test_one@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
je     1173 <main+0x33>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     117b <main+0x3b>
mov    0x8(%rbx),%rdi
lea    0xe9a(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1183 <main+0x43>
xor    %eax,%eax
pop    %rbx
jmp    1050 <test_one@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <test_three@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <test_two@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"-3\00"
@.str.1 = [3 x i8] c"-2\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @test_one()
br label %21
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 (...) @test_three()
br label %21
13: ; preds = %6
%14 = load i8*, i8** %7
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 (...) @test_two()
br label %21
19: ; preds = %13
%20 = tail call i32 (...) @test_one()
br label %21
21: ; preds = %19, %17, %11, %4
%22 = phi i32 [ %5, %4 ], [ %12, %11 ], [ %18, %17 ], [ %20, %19 ]
ret i32 %22
}