#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
double ykykl(float);
double yotrig(float, float);
double yparal(float, float);
double ytetr(float);
int main() {
  char choice;
  float t1, t2;
  while (1) {
    printf("Menu epilogwn ypologismoy perimetroy\n");
    printf("0. Exodos\n");
    printf("1. Tetragwno\n");
    printf("2. Parallhlogrammo\n");
    printf("3. Orthogwnio trigwno\n");
    printf("4. Kyklos\n");
    printf("Eisagete thn epilogh sas: ");
    scanf(" %c", &choice);
    printf("\n");
    if (choice == '0') {
      exit(0);
    } else if (choice == '1') {
      printf("Dwste to mhkos ths pleyras toy tetragwnoy: ");
      scanf("%f", &t1);
      printf("H perimetros toy tetragwnoy einai: %f", ytetr(t1));
      exit(0);
    } else if (choice == '2') {
      printf("Dwste to mhkos kai to platos toy parallhlogrammoy: ");
      scanf("%f %f", &t1, &t2);
      printf("H perimetros toy parallhlogrammoy einai: %f", yparal(t1, t2));
      exit(0);
    } else if (choice == '3') {
      printf(
          "Dwste to mhkos twn 2 kathetwn pleyrwn toy orthogwnioy trigwnoy: ");
      scanf("%f %f", &t1, &t2);
      printf("H perimetros toy orthogwnioy trigwnoy einai: %f", yotrig(t1, t2));
      exit(0);
    } else if (choice == '4') {
      printf("Dwste to mhkos ths aktinas toy kykloy: ");
      scanf("%f", &t1);
      printf("H perimetros toy kykloy einai: %f", ykykl(t1));
      exit(0);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    1215 <main+0xa5>
xor    %edi,%edi
call   1090 <exit@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    1261 <main+0xf1>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xfcd(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movss  -0xc(%rbp),%xmm0
call   1030 <ytetr@plt>
lea    0xe6d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x32,%eax
jne    12b6 <main+0x146>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1070 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1050 <yparal@plt>
lea    0xe78(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x33,%eax
jne    130b <main+0x19b>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe42(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1070 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1080 <yotrig@plt>
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x34,%eax
jne    1357 <main+0x1e7>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movss  -0xc(%rbp),%xmm0
call   1060 <ykykl@plt>
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
jmp    135c <main+0x1ec>
jmp    1361 <main+0x1f1>
jmp    1366 <main+0x1f6>
jmp    136b <main+0x1fb>
jmp    117f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x103d(%rip),%r13
lea    0x1049(%rip),%rbx
lea    0x1058(%rip),%rbp
lea    0xe5a(%rip),%r14
lea    0xe6e(%rip),%r15
lea    0x13(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
lea    0xfcf(%rip),%rdi
call   1040 <puts@plt>
lea    0xfe8(%rip),%rdi
call   1040 <puts@plt>
lea    0xfe6(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movzbl 0x13(%rsp),%eax
add    $0xd0,%al
cmp    $0x4,%al
ja     11d0 <main+0x40>
movzbl %al,%eax
lea    0xdbe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
call   10b0 <exit@plt>
lea    0xdda(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf3c(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0xc(%rsp),%xmm0
call   1050 <ytetr@plt>
lea    0xdda(%rip),%rdi
jmp    133d <main+0x1ad>
lea    0xdf4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe1a(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
call   1070 <yparal@plt>
lea    0xdf7(%rip),%rdi
jmp    133d <main+0x1ad>
lea    0xe1a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdda(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
call   10a0 <yotrig@plt>
lea    0xe24(%rip),%rdi
jmp    133d <main+0x1ad>
lea    0xe4b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe84(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0xc(%rsp),%xmm0
call   1080 <ykykl@plt>
lea    0xe47(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Menu epilogwn ypologismoy perimetroy\0A\00"
@.str.1 = [11 x i8] c"0. Exodos\0A\00"
@.str.2 = [14 x i8] c"1. Tetragwno\0A\00"
@.str.3 = [20 x i8] c"2. Parallhlogrammo\0A\00"
@.str.4 = [23 x i8] c"3. Orthogwnio trigwno\0A\00"
@.str.5 = [11 x i8] c"4. Kyklos\0A\00"
@.str.6 = [27 x i8] c"Eisagete thn epilogh sas: \00"
@.str.7 = [4 x i8] c" %c\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [44 x i8] c"Dwste to mhkos ths pleyras toy tetragwnoy: \00"
@.str.10 = [3 x i8] c"%f\00"
@.str.11 = [38 x i8] c"H perimetros toy tetragwnoy einai: %f\00"
@.str.12 = [52 x i8] c"Dwste to mhkos kai to platos toy parallhlogrammoy: \00"
@.str.13 = [6 x i8] c"%f %f\00"
@.str.14 = [44 x i8] c"H perimetros toy parallhlogrammoy einai: %f\00"
@.str.15 = [65 x i8] c"Dwste to mhkos twn 2 kathetwn pleyrwn toy orthogwnioy trigwnoy: \00"
@.str.16 = [48 x i8] c"H perimetros toy orthogwnioy trigwnoy einai: %f\00"
@.str.17 = [40 x i8] c"Dwste to mhkos ths aktinas toy kykloy: \00"
@.str.18 = [34 x i8] c"H perimetros toy kykloy einai: %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
br label %5
5: ; preds = %0, %70
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %2)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 48
br i1 %17, label %18, label %20
18: ; preds = %5
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %5
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 49
br i1 %23, label %24, label %31
24: ; preds = %20
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %3)
%27 = load float, float* %3
%28 = call double @ytetr(float %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), double %28)
%30 = call i32 @exit(i32 0)
unreachable
31: ; preds = %20
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 50
br i1 %34, label %35, label %43
35: ; preds = %31
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.12, i64 0, i64 0))
%37 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), float* %3, float* %4)
%38 = load float, float* %3
%39 = load float, float* %4
%40 = call double @yparal(float %38, float %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.14, i64 0, i64 0), double %40)
%42 = call i32 @exit(i32 0)
unreachable
43: ; preds = %31
%44 = load i8, i8* %2
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 51
br i1 %46, label %47, label %55
47: ; preds = %43
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.15, i64 0, i64 0))
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), float* %3, float* %4)
%50 = load float, float* %3
%51 = load float, float* %4
%52 = call double @yotrig(float %50, float %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.16, i64 0, i64 0), double %52)
%54 = call i32 @exit(i32 0)
unreachable
55: ; preds = %43
%56 = load i8, i8* %2
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 52
br i1 %58, label %59, label %66
59: ; preds = %55
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.17, i64 0, i64 0))
%61 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %3)
%62 = load float, float* %3
%63 = call double @ykykl(float %62)
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.18, i64 0, i64 0), double %63)
%65 = call i32 @exit(i32 0)
unreachable
66: ; preds = %55
br label %67
67: ; preds = %66
br label %68
68: ; preds = %67
br label %69
69: ; preds = %68
br label %70
70: ; preds = %69
br label %5
}

LLVM IR (-O2):
@.str.6 = [27 x i8] c"Eisagete thn epilogh sas: \00"
@.str.7 = [4 x i8] c" %c\00"
@.str.9 = [44 x i8] c"Dwste to mhkos ths pleyras toy tetragwnoy: \00"
@.str.10 = [3 x i8] c"%f\00"
@.str.11 = [38 x i8] c"H perimetros toy tetragwnoy einai: %f\00"
@.str.12 = [52 x i8] c"Dwste to mhkos kai to platos toy parallhlogrammoy: \00"
@.str.13 = [6 x i8] c"%f %f\00"
@.str.14 = [44 x i8] c"H perimetros toy parallhlogrammoy einai: %f\00"
@.str.15 = [65 x i8] c"Dwste to mhkos twn 2 kathetwn pleyrwn toy orthogwnioy trigwnoy: \00"
@.str.16 = [48 x i8] c"H perimetros toy orthogwnioy trigwnoy einai: %f\00"
@.str.17 = [40 x i8] c"Dwste to mhkos ths aktinas toy kykloy: \00"
@.str.18 = [34 x i8] c"H perimetros toy kykloy einai: %f\00"
@str = [37 x i8] c"Menu epilogwn ypologismoy perimetroy\00"
@str.19 = [10 x i8] c"0. Exodos\00"
@str.20 = [13 x i8] c"1. Tetragwno\00"
@str.21 = [19 x i8] c"2. Parallhlogrammo\00"
@str.22 = [22 x i8] c"3. Orthogwnio trigwno\00"
@str.23 = [10 x i8] c"4. Kyklos\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %2 to i8*
%5 = bitcast float* %3 to i8*
br label %6
6: ; preds = %6, %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.19, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.20, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.21, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.22, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.23, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %1)
%15 = call i32 @putchar(i32 10)
%16 = load i8, i8* %1
switch i8 %16, label %6 [
i8 48, label %17
i8 49, label %19
i8 50, label %26
i8 51, label %34
i8 52, label %42
]
17: ; preds = %6
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %2)
%22 = load float, float* %2
%23 = call double @ytetr(float %22)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), double %23)
%25 = call i32 @exit(i32 0)
unreachable
26: ; preds = %6
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.12, i64 0, i64 0))
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), float* %2, float* %3)
%29 = load float, float* %2
%30 = load float, float* %3
%31 = call double @yparal(float %29, float %30)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.14, i64 0, i64 0), double %31)
%33 = call i32 @exit(i32 0)
unreachable
34: ; preds = %6
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.15, i64 0, i64 0))
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), float* %2, float* %3)
%37 = load float, float* %2
%38 = load float, float* %3
%39 = call double @yotrig(float %37, float %38)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.16, i64 0, i64 0), double %39)
%41 = call i32 @exit(i32 0)
unreachable
42: ; preds = %6
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.17, i64 0, i64 0))
%44 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), float* %2)
%45 = load float, float* %2
%46 = call double @ykykl(float %45)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.18, i64 0, i64 0), double %46)
%48 = call i32 @exit(i32 0)
unreachable
}