#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*/ area_of_circle(int);
int /*<<< orphan*/ area_of_rectangle(int, int);
int /*<<< orphan*/ area_of_triangle(int, int);
int atoi(char *);
char *get_roman_num(int);
int /*<<< orphan*/ printf(char *, int, char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (strcmp(argv[1], "Circle") == 0) {
    area_of_circle(atoi(argv[2]));
  } else if (strcmp(argv[1], "Rectangle") == 0) {
    area_of_rectangle(atoi(argv[2]), atoi(argv[3]));
  } else if (strcmp(argv[1], "Triangle") == 0) {
    area_of_triangle(atoi(argv[2]), atoi(argv[3]));
  } else if (strcmp(argv[1], "Roman") == 0) {
    char *roman = get_roman_num(atoi(argv[2]));
    printf("Roman numeral from: %d = %s", atoi(argv[2]), roman);
  }
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11bd <main+0x4d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,%edi
call   1040 <area_of_circle@plt>
jmp    12b5 <main+0x145>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1207 <main+0x97>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <atoi@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1080 <area_of_rectangle@plt>
jmp    12b0 <main+0x140>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdfb(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1251 <main+0xe1>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <atoi@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1030 <area_of_triangle@plt>
jmp    12ab <main+0x13b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdba(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12a6 <main+0x136>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,%edi
call   1070 <get_roman_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
lea    0xd7f(%rip),%rdi
call   1050 <printf@plt>
jmp    12ab <main+0x13b>
jmp    12b0 <main+0x140>
jmp    12b5 <main+0x145>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe7f(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11f9 <main+0x89>
mov    0x8(%rbx),%rdi
lea    0xe71(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     120b <main+0x9b>
mov    0x8(%rbx),%rdi
lea    0xe66(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     122a <main+0xba>
mov    0x8(%rbx),%rdi
lea    0xe5a(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1247 <main+0xd7>
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%edi
call   1070 <get_roman_num@plt>
mov    %rax,%rbp
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
lea    0xe33(%rip),%rdi
mov    %eax,%esi
mov    %rbp,%rdx
call   1050 <printf@plt>
jmp    1247 <main+0xd7>
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%edi
call   1040 <area_of_circle@plt>
jmp    1247 <main+0xd7>
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   1090 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1080 <area_of_rectangle@plt>
jmp    1247 <main+0xd7>
mov    0x10(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebp
mov    0x18(%rbx),%rdi
call   1090 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <area_of_triangle@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Circle\00"
@.str.1 = [10 x i8] c"Rectangle\00"
@.str.2 = [9 x i8] c"Triangle\00"
@.str.3 = [6 x i8] c"Roman\00"
@.str.4 = [28 x i8] c"Roman numeral from: %d = %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
%17 = call i32 @area_of_circle(i32 %16)
br label %71
18: ; preds = %2
%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 ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %34
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @atoi(i8* %27)
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
%32 = call i32 @atoi(i8* %31)
%33 = call i32 @area_of_rectangle(i32 %28, i32 %32)
br label %70
34: ; preds = %18
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %50
40: ; preds = %34
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 2
%43 = load i8*, i8** %42
%44 = call i32 @atoi(i8* %43)
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 3
%47 = load i8*, i8** %46
%48 = call i32 @atoi(i8* %47)
%49 = call i32 @area_of_triangle(i32 %44, i32 %48)
br label %69
50: ; preds = %34
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %68
56: ; preds = %50
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 2
%59 = load i8*, i8** %58
%60 = call i32 @atoi(i8* %59)
%61 = call i8* @get_roman_num(i32 %60)
store i8* %61, i8** %6
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 2
%64 = load i8*, i8** %63
%65 = call i32 @atoi(i8* %64)
%66 = load i8*, i8** %6
%67 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %65, i8* %66)
br label %68
68: ; preds = %56, %50
br label %69
69: ; preds = %68, %40
br label %70
70: ; preds = %69, %24
br label %71
71: ; preds = %70, %12
%72 = load i32, i32* %3
ret i32 %72
}

LLVM IR (-O2):
@.str = [7 x i8] c"Circle\00"
@.str.1 = [10 x i8] c"Rectangle\00"
@.str.2 = [9 x i8] c"Triangle\00"
@.str.3 = [6 x i8] c"Roman\00"
@.str.4 = [28 x i8] c"Roman numeral from: %d = %s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @area_of_circle(i32 %10)
br label %48
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = tail call i32 @atoi(i8* %18)
%20 = getelementptr inbounds i8*, i8** %1, i64 3
%21 = load i8*, i8** %20
%22 = tail call i32 @atoi(i8* %21)
%23 = tail call i32 @area_of_rectangle(i32 %19, i32 %22)
br label %48
24: ; preds = %12
%25 = load i8*, i8** %3
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %24
%29 = getelementptr inbounds i8*, i8** %1, i64 2
%30 = load i8*, i8** %29
%31 = tail call i32 @atoi(i8* %30)
%32 = getelementptr inbounds i8*, i8** %1, i64 3
%33 = load i8*, i8** %32
%34 = tail call i32 @atoi(i8* %33)
%35 = tail call i32 @area_of_triangle(i32 %31, i32 %34)
br label %48
36: ; preds = %24
%37 = load i8*, i8** %3
%38 = tail call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %48
40: ; preds = %36
%41 = getelementptr inbounds i8*, i8** %1, i64 2
%42 = load i8*, i8** %41
%43 = tail call i32 @atoi(i8* %42)
%44 = tail call i8* @get_roman_num(i32 %43)
%45 = load i8*, i8** %41
%46 = tail call i32 @atoi(i8* %45)
%47 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i32 %46, i8* %44)
br label %48
48: ; preds = %16, %36, %40, %28, %7
ret i32 0
}