#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 */
float kyklos(float);
float parallilogrammo(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
float tetragono(float);
float trigono(float, float);
int main() {
  int choice;
  float a, b;
  float p;
  do {
    printf("Epileje \n");
    printf("1. tetragono \n");
    printf("2. parallilogrammo \n");
    printf("3. trigono \n");
    printf("4. kyklos \n");
    printf("0. Exit \n\n");
    scanf(" %c", &choice);
    if (choice == '1') {
      printf("Dose tin pleyra toy tetragonoy.\n");
      scanf(" %f", &a);
      p = tetragono(a);
      printf("H perimetros toy tetragonoy einai : %.2f\n", p);
    } else if (choice == '2') {
      printf("Dose to mikos kai to platos toy parallilogrammoy.\n");
      scanf(" %f %f", &a, &b);
      p = parallilogrammo(a, b);
      printf("H perimetros toy parallilogrammoy einai : %.2f\n", p);
    } else if (choice == '3') {
      printf("Dose to mikos tis protis kai tis deyteris kathetis pleyras toy "
             "trigonoy.\n");
      scanf(" %f %f", &a, &b);
      p = trigono(a, b);
      printf("H perimetros toy trigonoy einai : %.2f\n", p);
    } else if (choice == '4') {
      printf("Dose tin aktina toy kykloy.\n");
      scanf(" %f", &a);
      p = kyklos(a);
      printf("H perimetros toy kykloy einai : %.2f\n", p);
    } else if (choice == '0') {
      printf("\n");
    } else {
      printf("Lathos epilogi \n");
    }
    printf("\n\n");
  } while (choice != '0');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe88(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
cmpl   $0x31,-0x8(%rbp)
jne    122a <main+0xca>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xee3(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movss  -0xc(%rbp),%xmm0
call   1060 <tetragono@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe59(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    137a <main+0x21a>
cmpl   $0x32,-0x8(%rbp)
jne    1288 <main+0x128>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8b(%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   1030 <parallilogrammo@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5f(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1375 <main+0x215>
cmpl   $0x33,-0x8(%rbp)
jne    12e6 <main+0x186>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe2d(%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 <trigono@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7b(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    1370 <main+0x210>
cmpl   $0x34,-0x8(%rbp)
jne    133b <main+0x1db>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdd2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movss  -0xc(%rbp),%xmm0
call   1040 <kyklos@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6b(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    136b <main+0x20b>
cmpl   $0x30,-0x8(%rbp)
jne    1358 <main+0x1f8>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1366 <main+0x206>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    136b <main+0x20b>
jmp    1370 <main+0x210>
jmp    1375 <main+0x215>
jmp    137a <main+0x21a>
lea    0xcce(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x30,-0x8(%rbp)
jne    116f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xf69(%rip),%rbx
lea    0xf6d(%rip),%rbp
lea    0xe71(%rip),%r14
lea    0x14(%rsp),%r15
lea    0xf62(%rip),%r12
lea    0xe4a(%rip),%r13
jmp    1207 <main+0x87>
lea    0xffb(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7a(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0xc(%rsp),%xmm0
call   1080 <tetragono@plt>
cvtss2sd %xmm0,%xmm0
lea    0xe2b(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
cmpl   $0x30,0x14(%rsp)
je     134e <main+0x1ce>
lea    0xeb9(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
lea    0xec0(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x14(%rsp),%eax
add    $0xffffffd0,%eax
cmp    $0x4,%eax
ja     1279 <main+0xf9>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11f4 <main+0x74>
lea    0xe93(%rip),%rdi
call   1040 <puts@plt>
jmp    11f4 <main+0x74>
lea    0xef7(%rip),%rdi
call   1040 <puts@plt>
lea    0xda5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
call   1050 <parallilogrammo@plt>
cvtss2sd %xmm0,%xmm0
lea    0xd7f(%rip),%rdi
jmp    11ed <main+0x6d>
lea    0xe69(%rip),%rdi
call   1040 <puts@plt>
lea    0xd60(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
call   10a0 <trigono@plt>
cvtss2sd %xmm0,%xmm0
lea    0xd6a(%rip),%rdi
jmp    11ed <main+0x6d>
lea    0xe08(%rip),%rdi
call   1040 <puts@plt>
lea    0xd1e(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0xc(%rsp),%xmm0
call   1060 <kyklos@plt>
cvtss2sd %xmm0,%xmm0
lea    0xd58(%rip),%rdi
jmp    11ed <main+0x6d>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Epileje \0A\00"
@.str.1 = [15 x i8] c"1. tetragono \0A\00"
@.str.2 = [21 x i8] c"2. parallilogrammo \0A\00"
@.str.3 = [13 x i8] c"3. trigono \0A\00"
@.str.4 = [12 x i8] c"4. kyklos \0A\00"
@.str.5 = [11 x i8] c"0. Exit \0A\0A\00"
@.str.6 = [4 x i8] c" %c\00"
@.str.7 = [33 x i8] c"Dose tin pleyra toy tetragonoy.\0A\00"
@.str.8 = [4 x i8] c" %f\00"
@.str.9 = [42 x i8] c"H perimetros toy tetragonoy einai : %.2f\0A\00"
@.str.10 = [51 x i8] c"Dose to mikos kai to platos toy parallilogrammoy.\0A\00"
@.str.11 = [7 x i8] c" %f %f\00"
@.str.12 = [48 x i8] c"H perimetros toy parallilogrammoy einai : %.2f\0A\00"
@.str.13 = [74 x i8] c"Dose to mikos tis protis kai tis deyteris kathetis pleyras toy trigonoy.\0A\00"
@.str.14 = [40 x i8] c"H perimetros toy trigonoy einai : %.2f\0A\00"
@.str.15 = [29 x i8] c"Dose tin aktina toy kykloy.\0A\00"
@.str.16 = [38 x i8] c"H perimetros toy kykloy einai : %.2f\0A\00"
@.str.17 = [2 x i8] c"\0A\00"
@.str.18 = [17 x i8] c"Lathos epilogi \0A\00"
@.str.19 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
br label %6
6: ; preds = %72, %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 49
br i1 %15, label %16, label %24
16: ; preds = %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), float* %3)
%19 = load float, float* %3
%20 = call float @tetragono(float %19)
store float %20, float* %5
%21 = load float, float* %5
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), double %22)
br label %70
24: ; preds = %6
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 50
br i1 %26, label %27, label %36
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0))
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), float* %3, float* %4)
%30 = load float, float* %3
%31 = load float, float* %4
%32 = call float @parallilogrammo(float %30, float %31)
store float %32, float* %5
%33 = load float, float* %5
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0), double %34)
br label %69
36: ; preds = %24
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 51
br i1 %38, label %39, label %48
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.13, i64 0, i64 0))
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), float* %3, float* %4)
%42 = load float, float* %3
%43 = load float, float* %4
%44 = call float @trigono(float %42, float %43)
store float %44, float* %5
%45 = load float, float* %5
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.14, i64 0, i64 0), double %46)
br label %68
48: ; preds = %36
%49 = load i32, i32* %2
%50 = icmp eq i32 %49, 52
br i1 %50, label %51, label %59
51: ; preds = %48
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), float* %3)
%54 = load float, float* %3
%55 = call float @kyklos(float %54)
store float %55, float* %5
%56 = load float, float* %5
%57 = fpext float %56 to double
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.16, i64 0, i64 0), double %57)
br label %67
59: ; preds = %48
%60 = load i32, i32* %2
%61 = icmp eq i32 %60, 48
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
br label %66
64: ; preds = %59
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
br label %66
66: ; preds = %64, %62
br label %67
67: ; preds = %66, %51
br label %68
68: ; preds = %67, %39
br label %69
69: ; preds = %68, %27
br label %70
70: ; preds = %69, %16
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
br label %72
72: ; preds = %70
%73 = load i32, i32* %2
%74 = icmp ne i32 %73, 48
br i1 %74, label %6, label %75
75: ; preds = %72
ret i32 0
}

LLVM IR (-O2):
@.str.6 = [4 x i8] c" %c\00"
@.str.8 = [4 x i8] c" %f\00"
@.str.9 = [42 x i8] c"H perimetros toy tetragonoy einai : %.2f\0A\00"
@.str.11 = [7 x i8] c" %f %f\00"
@.str.12 = [48 x i8] c"H perimetros toy parallilogrammoy einai : %.2f\0A\00"
@.str.14 = [40 x i8] c"H perimetros toy trigonoy einai : %.2f\0A\00"
@.str.16 = [38 x i8] c"H perimetros toy kykloy einai : %.2f\0A\00"
@str = [9 x i8] c"Epileje \00"
@str.20 = [14 x i8] c"1. tetragono \00"
@str.21 = [20 x i8] c"2. parallilogrammo \00"
@str.22 = [12 x i8] c"3. trigono \00"
@str.23 = [11 x i8] c"4. kyklos \00"
@str.24 = [10 x i8] c"0. Exit \0A\00"
@str.25 = [16 x i8] c"Lathos epilogi \00"
@str.26 = [2 x i8] c"\0A\00"
@str.27 = [28 x i8] c"Dose tin aktina toy kykloy.\00"
@str.28 = [73 x i8] c"Dose to mikos tis protis kai tis deyteris kathetis pleyras toy trigonoy.\00"
@str.29 = [50 x i8] c"Dose to mikos kai to platos toy parallilogrammoy.\00"
@str.30 = [32 x i8] c"Dose tin pleyra toy tetragonoy.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
br label %7
7: ; preds = %50, %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.20, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.21, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.22, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.23, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.24, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%15 = load i32, i32* %1
switch i32 %15, label %48 [
i32 49, label %16
i32 50, label %23
i32 51, label %31
i32 52, label %39
i32 48, label %46
]
16: ; preds = %7
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.30, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), float* %2)
%19 = load float, float* %2
%20 = call float @tetragono(float %19)
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), double %21)
br label %50
23: ; preds = %7
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.29, i64 0, i64 0))
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), float* %2, float* %3)
%26 = load float, float* %2
%27 = load float, float* %3
%28 = call float @parallilogrammo(float %26, float %27)
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0), double %29)
br label %50
31: ; preds = %7
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.28, i64 0, i64 0))
%33 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), float* %2, float* %3)
%34 = load float, float* %2
%35 = load float, float* %3
%36 = call float @trigono(float %34, float %35)
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.14, i64 0, i64 0), double %37)
br label %50
39: ; preds = %7
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.27, i64 0, i64 0))
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), float* %2)
%42 = load float, float* %2
%43 = call float @kyklos(float %42)
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.16, i64 0, i64 0), double %44)
br label %50
46: ; preds = %7
%47 = call i32 @putchar(i32 10)
br label %50
48: ; preds = %7
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.25, i64 0, i64 0))
br label %50
50: ; preds = %23, %39, %48, %46, %31, %16
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.26, i64 0, i64 0))
%52 = load i32, i32* %1
%53 = icmp eq i32 %52, 48
br i1 %53, label %54, label %7
54: ; preds = %50
ret i32 0
}