#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*/ areaOfCircleTstDrv();
int /*<<< orphan*/ areaOfRectangleTstDrv();
int /*<<< orphan*/ areaOfTriangleTstDrv();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main(void) {
  int choice;
  while (1) {
    printf("\n1.Compute Area of Rectangle\n");
    printf("2.Compute Area of Triangle\n");
    printf("3.Compute Area of Circle\n");
    printf("4.Exit\n");
    printf("Enter ur Choice\n");
    scanf("%d", &choice);
    if (choice == 1)
      areaOfRectangleTstDrv();
    else if (choice == 2)
      areaOfTriangleTstDrv();
    else if (choice == 3)
      areaOfCircleTstDrv();
    else if (choice == 4)
      exit(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe9c(%rip),%rdi
call   1050 <printf@plt>
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
lea    0xeba(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1050 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11d1 <main+0x71>
mov    $0x0,%al
call   1060 <areaOfRectangleTstDrv@plt>
jmp    1220 <main+0xc0>
cmpl   $0x2,-0x8(%rbp)
jne    11e7 <main+0x87>
mov    $0x0,%al
call   1030 <areaOfTriangleTstDrv@plt>
jmp    121b <main+0xbb>
cmpl   $0x3,-0x8(%rbp)
jne    11fd <main+0x9d>
mov    $0x0,%al
call   1040 <areaOfCircleTstDrv@plt>
jmp    1216 <main+0xb6>
cmpl   $0x4,-0x8(%rbp)
jne    1211 <main+0xb1>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    1216 <main+0xb6>
jmp    121b <main+0xbb>
jmp    1220 <main+0xc0>
jmp    116f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed9(%rip),%r12
lea    0xeeb(%rip),%r13
lea    0xeeb(%rip),%rbx
lea    0xe89(%rip),%rbp
lea    0x4(%rsp),%r14
lea    0xe6d(%rip),%r15
jmp    11a7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <areaOfCircleTstDrv@plt>
lea    0xe65(%rip),%rdi
call   1050 <puts@plt>
lea    0xe76(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    %r13,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11a7 <main+0x47>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
xor    %eax,%eax
call   1060 <areaOfRectangleTstDrv@plt>
jmp    11a7 <main+0x47>
xor    %eax,%eax
call   1030 <areaOfTriangleTstDrv@plt>
jmp    11a7 <main+0x47>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0A1.Compute Area of Rectangle\0A\00"
@.str.1 = [28 x i8] c"2.Compute Area of Triangle\0A\00"
@.str.2 = [26 x i8] c"3.Compute Area of Circle\0A\00"
@.str.3 = [8 x i8] c"4.Exit\0A\00"
@.str.4 = [17 x i8] c"Enter ur Choice\0A\00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %32
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 (...) @areaOfRectangleTstDrv()
br label %32
14: ; preds = %3
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (...) @areaOfTriangleTstDrv()
br label %31
19: ; preds = %14
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 (...) @areaOfCircleTstDrv()
br label %30
24: ; preds = %19
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 4
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %24
br label %30
30: ; preds = %29, %22
br label %31
31: ; preds = %30, %17
br label %32
32: ; preds = %31, %12
br label %3
}

LLVM IR (-O2):
@.str.5 = [3 x i8] c"%d\00"
@str = [29 x i8] c"\0A1.Compute Area of Rectangle\00"
@str.6 = [27 x i8] c"2.Compute Area of Triangle\00"
@str.7 = [25 x i8] c"3.Compute Area of Circle\00"
@str.8 = [7 x i8] c"4.Exit\00"
@str.9 = [16 x i8] c"Enter ur Choice\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %11, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.7, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.8, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.9, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
switch i32 %10, label %11 [
i32 1, label %12
i32 2, label %14
i32 3, label %16
i32 4, label %18
]
11: ; preds = %3, %14, %16, %12
br label %3
12: ; preds = %3
%13 = call i32 (...) @areaOfRectangleTstDrv()
br label %11
14: ; preds = %3
%15 = call i32 (...) @areaOfTriangleTstDrv()
br label %11
16: ; preds = %3
%17 = call i32 (...) @areaOfCircleTstDrv()
br label %11
18: ; preds = %3
%19 = call i32 @exit(i32 1)
unreachable
}