#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*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float primoLato;
  float secondoLato;
  float terzoLato;
  float latoPiuGrande = 0;
  float secondoLatoPiuGrande = 0;
  float terzoLatoPiuGrande = 0;
  printf("%s", "Inserisci il primo lato (>0): ");
  scanf("%f", &primoLato);
  printf("%s", "Inserisci il secondo lato (>0): ");
  scanf("%f", &secondoLato);
  printf("%s", "Inserisci il terzo lato (>0): ");
  scanf("%f", &terzoLato);
  if (primoLato > secondoLato) {
    if (primoLato > terzoLato) {
      if (secondoLato > terzoLato) {
        latoPiuGrande = primoLato;
        secondoLatoPiuGrande = secondoLato;
        terzoLatoPiuGrande = terzoLato;
      } else {
        latoPiuGrande = primoLato;
        secondoLatoPiuGrande = terzoLato;
        terzoLatoPiuGrande = secondoLato;
      }
    } else {
      latoPiuGrande = primoLato;
      secondoLatoPiuGrande = secondoLato;
      terzoLatoPiuGrande = terzoLato;
    }
  } else {
    if (secondoLato > terzoLato) {
      if (primoLato > terzoLato) {
        latoPiuGrande = secondoLato;
        secondoLatoPiuGrande = primoLato;
        terzoLatoPiuGrande = terzoLato;
      } else {
        latoPiuGrande = secondoLato;
        secondoLatoPiuGrande = terzoLato;
        terzoLatoPiuGrande = primoLato;
      }
    } else {
      latoPiuGrande = terzoLato;
      secondoLatoPiuGrande = secondoLato;
      terzoLatoPiuGrande = primoLato;
    }
  }
  if ((secondoLatoPiuGrande + terzoLatoPiuGrande) > latoPiuGrande) {
    if ((secondoLatoPiuGrande - terzoLatoPiuGrande) <= latoPiuGrande) {
      if ((secondoLatoPiuGrande * secondoLatoPiuGrande) +
              (terzoLatoPiuGrande * terzoLatoPiuGrande) ==
          (latoPiuGrande * latoPiuGrande)) {
        printf("%s",
               "I lati inseriti corrispondono ad un triangolo Rettangolo!\n");
      } else {
        printf(
            "%s",
            "I lati inseriti NON corrispondono ad un triangolo Rettangolo!\n");
      }
    } else {
      printf("%s", "I lati inseriti non corrispondono ad un triangolo!\n");
    }
  } else {
    printf("%s", "I lati inseriti non corrispondono ad un triangolo!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    0xeb2(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe8f(%rip),%rdi
lea    0xead(%rip),%rsi
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe6c(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1246 <main+0x126>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1223 <main+0x103>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1200 <main+0xe0>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    121e <main+0xfe>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1241 <main+0x121>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    12cd <main+0x1ad>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    12aa <main+0x18a>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1287 <main+0x167>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    12a5 <main+0x185>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    12c8 <main+0x1a8>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    12cd <main+0x1ad>
movss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    1376 <main+0x256>
movss  -0x18(%rbp),%xmm1
subss  -0x1c(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     135e <main+0x23e>
movss  -0x18(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm1
mulss  -0x1c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jne    1346 <main+0x226>
jp     1346 <main+0x226>
lea    0xccb(%rip),%rdi
lea    0xd29(%rip),%rsi
call   1030 <printf@plt>
jmp    1359 <main+0x239>
lea    0xcb3(%rip),%rdi
lea    0xd4c(%rip),%rsi
call   1030 <printf@plt>
jmp    1371 <main+0x251>
lea    0xc9b(%rip),%rdi
lea    0xd73(%rip),%rsi
call   1030 <printf@plt>
jmp    1389 <main+0x269>
lea    0xc83(%rip),%rdi
lea    0xd5b(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%r14
lea    0xece(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xecd(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed2(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm1
movss  0x10(%rsp),%xmm0
ucomiss %xmm0,%xmm1
movss  0xc(%rsp),%xmm3
jbe    11b8 <main+0x98>
ucomiss %xmm3,%xmm1
jbe    11cd <main+0xad>
movaps %xmm0,%xmm4
maxss  %xmm3,%xmm4
minss  %xmm0,%xmm3
movaps %xmm1,%xmm2
movaps %xmm4,%xmm0
jmp    11d0 <main+0xb0>
ucomiss %xmm3,%xmm0
jbe    11d5 <main+0xb5>
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
maxss  %xmm3,%xmm0
minss  %xmm1,%xmm3
jmp    11d0 <main+0xb0>
movaps %xmm1,%xmm2
movaps %xmm3,%xmm1
jmp    11d8 <main+0xb8>
movaps %xmm3,%xmm2
movaps %xmm0,%xmm3
addss  %xmm1,%xmm3
ucomiss %xmm2,%xmm3
lea    0xef6(%rip),%rsi
jbe    1220 <main+0x100>
movaps %xmm0,%xmm3
subss  %xmm1,%xmm3
ucomiss %xmm3,%xmm2
jb     1220 <main+0x100>
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
lea    0xe8f(%rip),%rax
lea    0xe4d(%rip),%rsi
cmovne %rax,%rsi
cmovp  %rax,%rsi
lea    0xdd9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"Inserisci il primo lato (>0): \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [33 x i8] c"Inserisci il secondo lato (>0): \00"
@.str.4 = [31 x i8] c"Inserisci il terzo lato (>0): \00"
@.str.5 = [59 x i8] c"I lati inseriti corrispondono ad un triangolo Rettangolo!\0A\00"
@.str.6 = [63 x i8] c"I lati inseriti NON corrispondono ad un triangolo Rettangolo!\0A\00"
@.str.7 = [52 x i8] c"I lati inseriti non corrispondono ad un triangolo!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
%14 = load float, float* %2
%15 = load float, float* %3
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %39
17: ; preds = %0
%18 = load float, float* %2
%19 = load float, float* %4
%20 = fcmp ogt float %18, %19
br i1 %20, label %21, label %34
21: ; preds = %17
%22 = load float, float* %3
%23 = load float, float* %4
%24 = fcmp ogt float %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load float, float* %2
store float %26, float* %5
%27 = load float, float* %3
store float %27, float* %6
%28 = load float, float* %4
store float %28, float* %7
br label %33
29: ; preds = %21
%30 = load float, float* %2
store float %30, float* %5
%31 = load float, float* %4
store float %31, float* %6
%32 = load float, float* %3
store float %32, float* %7
br label %33
33: ; preds = %29, %25
br label %38
34: ; preds = %17
%35 = load float, float* %2
store float %35, float* %5
%36 = load float, float* %3
store float %36, float* %6
%37 = load float, float* %4
store float %37, float* %7
br label %38
38: ; preds = %34, %33
br label %61
39: ; preds = %0
%40 = load float, float* %3
%41 = load float, float* %4
%42 = fcmp ogt float %40, %41
br i1 %42, label %43, label %56
43: ; preds = %39
%44 = load float, float* %2
%45 = load float, float* %4
%46 = fcmp ogt float %44, %45
br i1 %46, label %47, label %51
47: ; preds = %43
%48 = load float, float* %3
store float %48, float* %5
%49 = load float, float* %2
store float %49, float* %6
%50 = load float, float* %4
store float %50, float* %7
br label %55
51: ; preds = %43
%52 = load float, float* %3
store float %52, float* %5
%53 = load float, float* %4
store float %53, float* %6
%54 = load float, float* %2
store float %54, float* %7
br label %55
55: ; preds = %51, %47
br label %60
56: ; preds = %39
%57 = load float, float* %4
store float %57, float* %5
%58 = load float, float* %3
store float %58, float* %6
%59 = load float, float* %2
store float %59, float* %7
br label %60
60: ; preds = %56, %55
br label %61
61: ; preds = %60, %38
%62 = load float, float* %6
%63 = load float, float* %7
%64 = fadd float %62, %63
%65 = load float, float* %5
%66 = fcmp ogt float %64, %65
br i1 %66, label %67, label %92
67: ; preds = %61
%68 = load float, float* %6
%69 = load float, float* %7
%70 = fsub float %68, %69
%71 = load float, float* %5
%72 = fcmp ole float %70, %71
br i1 %72, label %73, label %89
73: ; preds = %67
%74 = load float, float* %6
%75 = load float, float* %6
%76 = load float, float* %7
%77 = load float, float* %7
%78 = fmul float %76, %77
%79 = call float @llvm.fmuladd.f32(float %74, float %75, float %78)
%80 = load float, float* %5
%81 = load float, float* %5
%82 = fmul float %80, %81
%83 = fcmp oeq float %79, %82
br i1 %83, label %84, label %86
84: ; preds = %73
%85 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
br label %88
86: ; preds = %73
%87 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0))
br label %88
88: ; preds = %86, %84
br label %91
89: ; preds = %67
%90 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
br label %91
91: ; preds = %89, %88
br label %94
92: ; preds = %61
%93 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
br label %94
94: ; preds = %92, %91
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"Inserisci il primo lato (>0): \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [33 x i8] c"Inserisci il secondo lato (>0): \00"
@.str.4 = [31 x i8] c"Inserisci il terzo lato (>0): \00"
@.str.5 = [59 x i8] c"I lati inseriti corrispondono ad un triangolo Rettangolo!\0A\00"
@.str.6 = [63 x i8] c"I lati inseriti NON corrispondono ad un triangolo Rettangolo!\0A\00"
@.str.7 = [52 x i8] c"I lati inseriti non corrispondono ad un triangolo!\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%13 = load float, float* %1
%14 = load float, float* %2
%15 = fcmp ogt float %13, %14
%16 = load float, float* %3
br i1 %15, label %17, label %23
17: ; preds = %0
%18 = fcmp ogt float %13, %16
br i1 %18, label %19, label %29
19: ; preds = %17
%20 = fcmp ogt float %14, %16
%21 = select i1 %20, float %14, float %16
%22 = select i1 %20, float %16, float %14
br label %29
23: ; preds = %0
%24 = fcmp ogt float %14, %16
br i1 %24, label %25, label %29
25: ; preds = %23
%26 = fcmp ogt float %13, %16
%27 = select i1 %26, float %13, float %16
%28 = select i1 %26, float %16, float %13
br label %29
29: ; preds = %23, %25, %17, %19
%30 = phi float [ %13, %19 ], [ %13, %17 ], [ %14, %25 ], [ %16, %23 ]
%31 = phi float [ %21, %19 ], [ %14, %17 ], [ %27, %25 ], [ %14, %23 ]
%32 = phi float [ %22, %19 ], [ %16, %17 ], [ %28, %25 ], [ %13, %23 ]
%33 = fadd float %31, %32
%34 = fcmp ule float %33, %30
%35 = fsub float %31, %32
%36 = fcmp ugt float %35, %30
%37 = or i1 %34, %36
br i1 %37, label %44, label %38
38: ; preds = %29
%39 = fmul float %32, %32
%40 = call float @llvm.fmuladd.f32(float %31, float %31, float %39)
%41 = fmul float %30, %30
%42 = fcmp oeq float %40, %41
%43 = select i1 %42, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0)
br label %44
44: ; preds = %29, %38
%45 = phi i8* [ %43, %38 ], [ getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), %29 ]
%46 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %45)
ret i32 0
}