#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 /*<<< orphan*/);
int /*<<< orphan*/ funArea();
int /*<<< orphan*/ funHello();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int iAns;
  do {
    system("cls");
    printf("0-exit\n");
    printf("1-hello\n");
    printf("2-area\n");
    printf("enter your choice ");
    scanf("%d", &iAns);
    switch (iAns) {
    case 0:
      exit(0);
    case 1:
      funHello();
      break;
    case 2:
      funArea();
      break;
    default:
      printf("wrong input, try again \n");
      system("pause");
      break;
    }
  } while (iAns != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1030 <system@plt>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11f0 <main+0x90>
jmp    11ce <main+0x6e>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     11f7 <main+0x97>
jmp    11df <main+0x7f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1203 <main+0xa3>
jmp    120f <main+0xaf>
xor    %edi,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1050 <funHello@plt>
jmp    1227 <main+0xc7>
mov    $0x0,%al
call   1080 <funArea@plt>
jmp    1227 <main+0xc7>
lea    0xe1d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe2a(%rip),%rdi
call   1030 <system@plt>
jmp    122c <main+0xcc>
cmpl   $0x0,-0x8(%rbp)
jne    116f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%r15
lea    0xe9e(%rip),%r12
lea    0xe9f(%rip),%r13
lea    0xe6d(%rip),%rbx
lea    0xe79(%rip),%rbp
lea    0x4(%rsp),%r14
jmp    11be <main+0x4e>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1090 <funArea@plt>
cmpl   $0x0,0x4(%rsp)
je     123c <main+0xcc>
lea    0xe3b(%rip),%rdi
call   1040 <system@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     1230 <main+0xc0>
cmp    $0x2,%eax
je     11b0 <main+0x40>
test   %eax,%eax
je     124d <main+0xdd>
lea    0xe28(%rip),%rdi
call   1030 <puts@plt>
lea    0xe00(%rip),%rdi
call   1040 <system@plt>
jmp    11b7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <funHello@plt>
jmp    11b7 <main+0x47>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [8 x i8] c"0-exit\0A\00"
@.str.2 = [9 x i8] c"1-hello\0A\00"
@.str.3 = [8 x i8] c"2-area\0A\00"
@.str.4 = [19 x i8] c"enter your choice \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [25 x i8] c"wrong input, try again \0A\00"
@.str.7 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %21, %0
%4 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 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 ([19 x i8], [19 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
switch i32 %10, label %17 [
i32 0, label %11
i32 1, label %13
i32 2, label %15
]
11: ; preds = %3
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %3
%14 = call i32 (...) @funHello()
br label %20
15: ; preds = %3
%16 = call i32 (...) @funArea()
br label %20
17: ; preds = %3
%18 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%19 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %20
20: ; preds = %17, %15, %13
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = icmp ne i32 %22, 0
br i1 %23, label %3, label %24
24: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.4 = [19 x i8] c"enter your choice \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.7 = [6 x i8] c"pause\00"
@str = [7 x i8] c"0-exit\00"
@str.8 = [8 x i8] c"1-hello\00"
@str.9 = [7 x i8] c"2-area\00"
@str.10 = [24 x i8] c"wrong input, try again \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %20, %0
%4 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.8, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.9, i64 0, i64 0))
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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* %1)
%10 = load i32, i32* %1
switch i32 %10, label %17 [
i32 0, label %11
i32 1, label %13
i32 2, label %15
]
11: ; preds = %3
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %3
%14 = call i32 (...) @funHello()
br label %20
15: ; preds = %3
%16 = call i32 (...) @funArea()
br label %20
17: ; preds = %3
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.10, i64 0, i64 0))
%19 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %20
20: ; preds = %13, %15, %17
%21 = load i32, i32* %1
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %3
23: ; preds = %20
ret i32 0
}