#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 */
double perimetros_kykloy(float);
double perimetros_parllhlogrammou(float, float);
double perimetros_tetragonou(float);
double perimetros_trigwnou(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
main() {
  int choice;
  float a, b, y;
  do {
    printf("0. Ejodos\n");
    printf("1. Tetragono\n");
    printf("2. Parallhlogrammo\n");
    printf("3. Orthogonio trigono\n");
    printf("4. Kyklos\n");
    scanf("%d", &choice);
    if (choice == 0)
      printf("To programma termatisthke\n");
    else if (choice == 1) {
      printf("Dwse pleura tetragonou:");
      scanf("%f", &a);
      printf("\nH perimetros tetragonou einai:%.2f\n",
             perimetros_tetragonou(a));
    } else if (choice == 2) {
      printf("Dwse vash kai ypsos parallhlogrammou:");
      scanf("%f%f", &b, &y);
      printf("\nH perimetros parallhlogrammou einai:%.2f\n",
             perimetros_parllhlogrammou(b, y));
    } else if (choice == 3) {
      printf("Dwse to mhkos ths mias kathetou:");
      scanf("%f", &b);
      printf("Dwse to mhkos ths allhs kathetou:");
      scanf("%f", &y);
      printf("\nH perimetros trigwnoy einai:%.2f\n", perimetros_trigwnou(b, y));
    } else if (choice == 4) {
      printf("Dwse aktina kykloy:");
      scanf("%f", &a);
      printf("H perimetros kykloy einai:%.2f\n", perimetros_kykloy(a));
    } else
      printf("Lathos epilogh! \n");
  } while (choice);
  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   1040 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    11e4 <main+0x84>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1350 <main+0x1f0>
cmpl   $0x1,-0x8(%rbp)
jne    122b <main+0xcb>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movss  -0xc(%rbp),%xmm0
call   1080 <perimetros_tetragonou@plt>
lea    0xe66(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    134b <main+0x1eb>
cmpl   $0x2,-0x8(%rbp)
jne    127b <main+0x11b>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe86(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1060 <scanf@plt>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1050 <perimetros_parllhlogrammou@plt>
lea    0xe66(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1346 <main+0x1e6>
cmpl   $0x3,-0x8(%rbp)
jne    12e7 <main+0x187>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe38(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe18(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <perimetros_trigwnou@plt>
lea    0xe68(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1341 <main+0x1e1>
cmpl   $0x4,-0x8(%rbp)
jne    132e <main+0x1ce>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdcc(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movss  -0xc(%rbp),%xmm0
call   1070 <perimetros_kykloy@plt>
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    133c <main+0x1dc>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1341 <main+0x1e1>
jmp    1346 <main+0x1e6>
jmp    134b <main+0x1eb>
jmp    1350 <main+0x1f0>
jmp    1355 <main+0x1f5>
cmpl   $0x0,-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    0xfd6(%rip),%rbx
lea    0xfe2(%rip),%rbp
lea    0xff1(%rip),%r12
lea    0xe7a(%rip),%r13
lea    0x14(%rsp),%r14
lea    0xe5a(%rip),%r15
jmp    11ed <main+0x7d>
lea    0xe68(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
movss  0x10(%rsp),%xmm0
call   1090 <perimetros_tetragonou@plt>
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
cmpl   $0x0,0x14(%rsp)
je     1350 <main+0x1e0>
lea    0xf50(%rip),%rdi
call   1040 <puts@plt>
lea    0xf4e(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x4,%rax
ja     1246 <main+0xd6>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
lea    0xf5b(%rip),%rdi
jmp    124d <main+0xdd>
lea    0xf41(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0x14(%rsp)
jne    11ed <main+0x7d>
jmp    1350 <main+0x1e0>
lea    0xdef(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe07(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1070 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1060 <perimetros_parllhlogrammou@plt>
lea    0xde3(%rip),%rdi
jmp    11db <main+0x6b>
lea    0xe02(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%r15
mov    %r13,%r14
mov    %r12,%r13
lea    0xdbd(%rip),%r12
mov    %r12,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xdf6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r13,%r12
mov    %r14,%r13
mov    %r15,%r14
lea    0xd11(%rip),%r15
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1030 <perimetros_trigwnou@plt>
lea    0xdda(%rip),%rdi
jmp    11db <main+0x6b>
lea    0xdf1(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd4f(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
movss  0x10(%rsp),%xmm0
call   1080 <perimetros_kykloy@plt>
lea    0xdd9(%rip),%rdi
jmp    11db <main+0x6b>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"0. Ejodos\0A\00"
@.str.1 = [14 x i8] c"1. Tetragono\0A\00"
@.str.2 = [20 x i8] c"2. Parallhlogrammo\0A\00"
@.str.3 = [23 x i8] c"3. Orthogonio trigono\0A\00"
@.str.4 = [11 x i8] c"4. Kyklos\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [27 x i8] c"To programma termatisthke\0A\00"
@.str.7 = [24 x i8] c"Dwse pleura tetragonou:\00"
@.str.8 = [3 x i8] c"%f\00"
@.str.9 = [37 x i8] c"\0AH perimetros tetragonou einai:%.2f\0A\00"
@.str.10 = [38 x i8] c"Dwse vash kai ypsos parallhlogrammou:\00"
@.str.11 = [5 x i8] c"%f%f\00"
@.str.12 = [43 x i8] c"\0AH perimetros parallhlogrammou einai:%.2f\0A\00"
@.str.13 = [33 x i8] c"Dwse to mhkos ths mias kathetou:\00"
@.str.14 = [34 x i8] c"Dwse to mhkos ths allhs kathetou:\00"
@.str.15 = [35 x i8] c"\0AH perimetros trigwnoy einai:%.2f\0A\00"
@.str.16 = [20 x i8] c"Dwse aktina kykloy:\00"
@.str.17 = [32 x i8] c"H perimetros kykloy einai:%.2f\0A\00"
@.str.18 = [18 x i8] c"Lathos epilogh! \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 = %64, %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %6
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %63
17: ; preds = %6
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %3)
%23 = load float, float* %3
%24 = call double @perimetros_tetragonou(float %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), double %24)
br label %62
26: ; preds = %17
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 2
br i1 %28, label %29, label %36
29: ; preds = %26
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), float* %4, float* %5)
%32 = load float, float* %4
%33 = load float, float* %5
%34 = call double @perimetros_parllhlogrammou(float %32, float %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), double %34)
br label %61
36: ; preds = %26
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 3
br i1 %38, label %39, label %48
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0))
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %4)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0))
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %5)
%44 = load float, float* %4
%45 = load float, float* %5
%46 = call double @perimetros_trigwnou(float %44, float %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.15, i64 0, i64 0), double %46)
br label %60
48: ; preds = %36
%49 = load i32, i32* %2
%50 = icmp eq i32 %49, 4
br i1 %50, label %51, label %57
51: ; preds = %48
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %3)
%54 = load float, float* %3
%55 = call double @perimetros_kykloy(float %54)
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0), double %55)
br label %59
57: ; preds = %48
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.18, i64 0, i64 0))
br label %59
59: ; preds = %57, %51
br label %60
60: ; preds = %59, %39
br label %61
61: ; preds = %60, %29
br label %62
62: ; preds = %61, %20
br label %63
63: ; preds = %62, %15
br label %64
64: ; preds = %63
%65 = load i32, i32* %2
%66 = icmp ne i32 %65, 0
br i1 %66, label %6, label %67
67: ; preds = %64
ret i32 0
}

LLVM IR (-O2):
@.str.5 = [3 x i8] c"%d\00"
@.str.7 = [24 x i8] c"Dwse pleura tetragonou:\00"
@.str.8 = [3 x i8] c"%f\00"
@.str.9 = [37 x i8] c"\0AH perimetros tetragonou einai:%.2f\0A\00"
@.str.10 = [38 x i8] c"Dwse vash kai ypsos parallhlogrammou:\00"
@.str.11 = [5 x i8] c"%f%f\00"
@.str.12 = [43 x i8] c"\0AH perimetros parallhlogrammou einai:%.2f\0A\00"
@.str.13 = [33 x i8] c"Dwse to mhkos ths mias kathetou:\00"
@.str.14 = [34 x i8] c"Dwse to mhkos ths allhs kathetou:\00"
@.str.15 = [35 x i8] c"\0AH perimetros trigwnoy einai:%.2f\0A\00"
@.str.16 = [20 x i8] c"Dwse aktina kykloy:\00"
@.str.17 = [32 x i8] c"H perimetros kykloy einai:%.2f\0A\00"
@str = [10 x i8] c"0. Ejodos\00"
@str.19 = [13 x i8] c"1. Tetragono\00"
@str.20 = [19 x i8] c"2. Parallhlogrammo\00"
@str.21 = [22 x i8] c"3. Orthogonio trigono\00"
@str.22 = [10 x i8] c"4. Kyklos\00"
@str.23 = [17 x i8] c"Lathos epilogh! \00"
@str.24 = [26 x i8] c"To programma termatisthke\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast i32* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
br label %9
9: ; preds = %49, %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.19, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.20, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.21, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.22, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
switch i32 %16, label %47 [
i32 0, label %17
i32 1, label %19
i32 2, label %25
i32 3, label %32
i32 4, label %41
]
17: ; preds = %9
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.24, i64 0, i64 0))
br label %49
19: ; preds = %9
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %2)
%22 = load float, float* %2
%23 = call double @perimetros_tetragonou(float %22)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), double %23)
br label %49
25: ; preds = %9
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), float* %3, float* %4)
%28 = load float, float* %3
%29 = load float, float* %4
%30 = call double @perimetros_parllhlogrammou(float %28, float %29)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), double %30)
br label %49
32: ; preds = %9
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0))
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %3)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0))
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %4)
%37 = load float, float* %3
%38 = load float, float* %4
%39 = call double @perimetros_trigwnou(float %37, float %38)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.15, i64 0, i64 0), double %39)
br label %49
41: ; preds = %9
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %2)
%44 = load float, float* %2
%45 = call double @perimetros_kykloy(float %44)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0), double %45)
br label %49
47: ; preds = %9
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.23, i64 0, i64 0))
br label %49
49: ; preds = %17, %25, %41, %47, %32, %19
%50 = load i32, i32* %1
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %9
52: ; preds = %49
ret i32 0
}