#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 *);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main() {
  double a, b, c;
  scanf("%lf %lf %lf", &a, &b, &c);
  double orderedV[3] = {a, b, c};
  int i, swapped, rightIndex, leftIndex;
  double aux;
  do {
    swapped = 0;
    for (i = 1; i < 3; i++) {
      leftIndex = i - 1;
      rightIndex = i;
      if (orderedV[leftIndex] < orderedV[rightIndex]) {
        aux = orderedV[leftIndex];
        orderedV[leftIndex] = orderedV[rightIndex];
        orderedV[rightIndex] = aux;
        swapped = 1;
      }
    }
  } while (swapped);
  a = orderedV[0];
  b = orderedV[1];
  c = orderedV[2];
  if (a >= b + c) {
    printf("NAO FORMA TRIANGULO\n");
  } else {
    if (a * a == b * b + c * c)
      printf("TRIANGULO RETANGULO\n");
    else if (a * a > b * b + c * c)
      printf("TRIANGULO OBTUSANGULO\n");
    else
      printf("TRIANGULO ACUTANGULO\n");
    if (a == b && b == c && a == c)
      printf("TRIANGULO EQUILATERO\n");
    else if ((a == b && b != c) || (a == c && a != b) || (b == c && b != a))
      printf("TRIANGULO ISOSCELES\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x1,-0x44(%rbp)
cmpl   $0x3,-0x44(%rbp)
jge    11f6 <main+0xd6>
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movslq -0x50(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm1
movslq -0x4c(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    11e3 <main+0xc3>
movslq -0x50(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
movslq -0x4c(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
movslq -0x50(%rbp),%rax
movsd  %xmm0,-0x40(%rbp,%rax,8)
movsd  -0x58(%rbp),%xmm0
movslq -0x4c(%rbp),%rax
movsd  %xmm0,-0x40(%rbp,%rax,8)
movl   $0x1,-0x48(%rbp)
jmp    11e8 <main+0xc8>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1173 <main+0x53>
jmp    11fb <main+0xdb>
cmpl   $0x0,-0x48(%rbp)
jne    1165 <main+0x45>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     124d <main+0x12d>
lea    0xdc9(%rip),%rdi
call   1030 <printf@plt>
jmp    13d8 <main+0x2b8>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm2
mulsd  -0x20(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    1294 <main+0x174>
jp     1294 <main+0x174>
lea    0xd97(%rip),%rdi
call   1030 <printf@plt>
jmp    12e6 <main+0x1c6>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm2
mulsd  -0x20(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    12d5 <main+0x1b5>
lea    0xd6b(%rip),%rdi
call   1030 <printf@plt>
jmp    12e1 <main+0x1c1>
lea    0xd71(%rip),%rdi
call   1030 <printf@plt>
jmp    12e6 <main+0x1c6>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1339 <main+0x219>
jp     1339 <main+0x219>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    1339 <main+0x219>
jp     1339 <main+0x219>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    1339 <main+0x219>
jp     1339 <main+0x219>
lea    0xd34(%rip),%rdi
call   1030 <printf@plt>
jmp    13d3 <main+0x2b3>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1365 <main+0x245>
jp     1365 <main+0x245>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    13c2 <main+0x2a2>
jp     13c2 <main+0x2a2>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    1391 <main+0x271>
jp     1391 <main+0x271>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    13c2 <main+0x2a2>
jp     13c2 <main+0x2a2>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    13ce <main+0x2ae>
jp     13ce <main+0x2ae>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    13c2 <main+0x2a2>
jp     13c2 <main+0x2a2>
jmp    13ce <main+0x2ae>
lea    0xcb0(%rip),%rdi
call   1030 <printf@plt>
jmp    13d3 <main+0x2b3>
jmp    13d8 <main+0x2b8>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm2
xchg   %ax,%ax
movapd %xmm1,%xmm3
movapd %xmm0,%xmm4
movapd %xmm2,%xmm0
movapd %xmm1,%xmm5
minsd  %xmm4,%xmm5
movapd %xmm4,%xmm1
maxsd  %xmm3,%xmm1
ucomisd %xmm5,%xmm2
movapd %xmm5,%xmm2
minsd  %xmm0,%xmm2
maxsd  %xmm5,%xmm0
ja     1150 <main+0x30>
ucomisd %xmm3,%xmm4
ja     1150 <main+0x30>
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,(%rsp)
movapd %xmm0,%xmm3
addsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm1
jae    120f <main+0xef>
mulsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
lea    0xe8c(%rip),%rax
lea    0xe47(%rip),%rcx
cmova  %rax,%rcx
lea    0xe90(%rip),%rdi
cmovne %rcx,%rdi
cmovp  %rcx,%rdi
call   1030 <puts@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm0
movsd  (%rsp),%xmm2
jne    1233 <main+0x113>
jp     1233 <main+0x113>
ucomisd %xmm2,%xmm1
jne    1222 <main+0x102>
jp     1222 <main+0x102>
ucomisd %xmm2,%xmm0
jne    1222 <main+0x102>
jp     1222 <main+0x102>
lea    0xe28(%rip),%rdi
jmp    1216 <main+0xf6>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
ucomisd %xmm2,%xmm1
jne    122a <main+0x10a>
jnp    1233 <main+0x113>
lea    0xdf0(%rip),%rdi
jmp    1216 <main+0xf6>
ucomisd %xmm2,%xmm0
lea    0xde3(%rip),%rdi
jne    124a <main+0x12a>
jp     124a <main+0x12a>
ucomisd %xmm1,%xmm0
jne    1216 <main+0xf6>
jp     1216 <main+0xf6>
ucomisd %xmm2,%xmm1
jne    121b <main+0xfb>
jp     121b <main+0xfb>
ucomisd %xmm1,%xmm0
jne    1216 <main+0xf6>
jp     1216 <main+0xf6>
jmp    121b <main+0xfb>

LLVM IR (-O0):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [21 x i8] c"NAO FORMA TRIANGULO\0A\00"
@.str.2 = [21 x i8] c"TRIANGULO RETANGULO\0A\00"
@.str.3 = [23 x i8] c"TRIANGULO OBTUSANGULO\0A\00"
@.str.4 = [22 x i8] c"TRIANGULO ACUTANGULO\0A\00"
@.str.5 = [22 x i8] c"TRIANGULO EQUILATERO\0A\00"
@.str.6 = [21 x i8] c"TRIANGULO ISOSCELES\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca [3 x double]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store i32 0, i32* %1
%11 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4)
%12 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%13 = load double, double* %2
store double %13, double* %12
%14 = getelementptr inbounds double, double* %12, i64 1
%15 = load double, double* %3
store double %15, double* %14
%16 = getelementptr inbounds double, double* %14, i64 1
%17 = load double, double* %4
store double %17, double* %16
br label %18
18: ; preds = %56, %0
store i32 0, i32* %7
store i32 1, i32* %6
br label %19
19: ; preds = %52, %18
%20 = load i32, i32* %6
%21 = icmp slt i32 %20, 3
br i1 %21, label %22, label %55
22: ; preds = %19
%23 = load i32, i32* %6
%24 = sub nsw i32 %23, 1
store i32 %24, i32* %9
%25 = load i32, i32* %6
store i32 %25, i32* %8
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 %27
%29 = load double, double* %28
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 %31
%33 = load double, double* %32
%34 = fcmp olt double %29, %33
br i1 %34, label %35, label %51
35: ; preds = %22
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 %37
%39 = load double, double* %38
store double %39, double* %10
%40 = load i32, i32* %8
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 %41
%43 = load double, double* %42
%44 = load i32, i32* %9
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 %45
store double %43, double* %46
%47 = load double, double* %10
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 %49
store double %47, double* %50
store i32 1, i32* %7
br label %51
51: ; preds = %35, %22
br label %52
52: ; preds = %51
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %19
55: ; preds = %19
br label %56
56: ; preds = %55
%57 = load i32, i32* %7
%58 = icmp ne i32 %57, 0
br i1 %58, label %18, label %59
59: ; preds = %56
%60 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%61 = load double, double* %60
store double %61, double* %2
%62 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%63 = load double, double* %62
store double %63, double* %3
%64 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
%65 = load double, double* %64
store double %65, double* %4
%66 = load double, double* %2
%67 = load double, double* %3
%68 = load double, double* %4
%69 = fadd double %67, %68
%70 = fcmp oge double %66, %69
br i1 %70, label %71, label %73
71: ; preds = %59
%72 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %144
73: ; preds = %59
%74 = load double, double* %2
%75 = load double, double* %2
%76 = fmul double %74, %75
%77 = load double, double* %3
%78 = load double, double* %3
%79 = load double, double* %4
%80 = load double, double* %4
%81 = fmul double %79, %80
%82 = call double @llvm.fmuladd.f64(double %77, double %78, double %81)
%83 = fcmp oeq double %76, %82
br i1 %83, label %84, label %86
84: ; preds = %73
%85 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %102
86: ; preds = %73
%87 = load double, double* %2
%88 = load double, double* %2
%89 = fmul double %87, %88
%90 = load double, double* %3
%91 = load double, double* %3
%92 = load double, double* %4
%93 = load double, double* %4
%94 = fmul double %92, %93
%95 = call double @llvm.fmuladd.f64(double %90, double %91, double %94)
%96 = fcmp ogt double %89, %95
br i1 %96, label %97, label %99
97: ; preds = %86
%98 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %101
99: ; preds = %86
%100 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %101
101: ; preds = %99, %97
br label %102
102: ; preds = %101, %84
%103 = load double, double* %2
%104 = load double, double* %3
%105 = fcmp oeq double %103, %104
br i1 %105, label %106, label %116
106: ; preds = %102
%107 = load double, double* %3
%108 = load double, double* %4
%109 = fcmp oeq double %107, %108
br i1 %109, label %110, label %116
110: ; preds = %106
%111 = load double, double* %2
%112 = load double, double* %4
%113 = fcmp oeq double %111, %112
br i1 %113, label %114, label %116
114: ; preds = %110
%115 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %143
116: ; preds = %110, %106, %102
%117 = load double, double* %2
%118 = load double, double* %3
%119 = fcmp oeq double %117, %118
br i1 %119, label %120, label %124
120: ; preds = %116
%121 = load double, double* %3
%122 = load double, double* %4
%123 = fcmp une double %121, %122
br i1 %123, label %140, label %124
124: ; preds = %120, %116
%125 = load double, double* %2
%126 = load double, double* %4
%127 = fcmp oeq double %125, %126
br i1 %127, label %128, label %132
128: ; preds = %124
%129 = load double, double* %2
%130 = load double, double* %3
%131 = fcmp une double %129, %130
br i1 %131, label %140, label %132
132: ; preds = %128, %124
%133 = load double, double* %3
%134 = load double, double* %4
%135 = fcmp oeq double %133, %134
br i1 %135, label %136, label %142
136: ; preds = %132
%137 = load double, double* %3
%138 = load double, double* %2
%139 = fcmp une double %137, %138
br i1 %139, label %140, label %142
140: ; preds = %136, %128, %120
%141 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %142
142: ; preds = %140, %136, %132
br label %143
143: ; preds = %142, %114
br label %144
144: ; preds = %143, %71
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%lf %lf %lf\00"
@str = [21 x i8] c"TRIANGULO ACUTANGULO\00"
@str.7 = [20 x i8] c"TRIANGULO ISOSCELES\00"
@str.8 = [21 x i8] c"TRIANGULO EQUILATERO\00"
@str.9 = [22 x i8] c"TRIANGULO OBTUSANGULO\00"
@str.10 = [20 x i8] c"TRIANGULO RETANGULO\00"
@str.11 = [20 x i8] c"NAO FORMA TRIANGULO\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %1
%9 = load double, double* %2
%10 = load double, double* %3
br label %11
11: ; preds = %11, %0
%12 = phi double [ %10, %0 ], [ %19, %11 ]
%13 = phi double [ %9, %0 ], [ %20, %11 ]
%14 = phi double [ %8, %0 ], [ %17, %11 ]
%15 = fcmp olt double %14, %13
%16 = select i1 %15, double %14, double %13
%17 = select i1 %15, double %13, double %14
%18 = fcmp olt double %16, %12
%19 = select i1 %18, double %16, double %12
%20 = select i1 %18, double %12, double %16
%21 = or i1 %18, %15
br i1 %21, label %11, label %22
22: ; preds = %11
store double %17, double* %1
store double %20, double* %2
store double %19, double* %3
%23 = fadd double %20, %19
%24 = fcmp ult double %17, %23
br i1 %24, label %25, label %51
25: ; preds = %22
%26 = fmul double %17, %17
%27 = fmul double %19, %19
%28 = call double @llvm.fmuladd.f64(double %20, double %20, double %27)
%29 = fcmp oeq double %26, %28
%30 = fcmp ogt double %26, %28
%31 = select i1 %30, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0)
%32 = select i1 %29, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.10, i64 0, i64 0), i8* %31
%33 = call i32 @puts(i8* dereferenceable(1) %32)
%34 = load double, double* %1
%35 = load double, double* %2
%36 = fcmp oeq double %34, %35
%37 = load double, double* %3
br i1 %36, label %38, label %44
38: ; preds = %25
%39 = fcmp oeq double %35, %37
%40 = fcmp oeq double %34, %37
%41 = select i1 %39, i1 %40, i1 false
br i1 %41, label %51, label %42
42: ; preds = %38
%43 = fcmp une double %35, %37
br i1 %43, label %51, label %44
44: ; preds = %25, %42
%45 = fcmp oeq double %34, %37
%46 = fcmp une double %34, %35
%47 = select i1 %45, i1 %46, i1 false
br i1 %47, label %51, label %48
48: ; preds = %44
%49 = fcmp oeq double %35, %37
%50 = select i1 %49, i1 %46, i1 false
br i1 %50, label %51, label %54
51: ; preds = %42, %44, %48, %38, %22
%52 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.11, i64 0, i64 0), %22 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0), %38 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0), %48 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0), %44 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0), %42 ]
%53 = call i32 @puts(i8* dereferenceable(1) %52)
br label %54
54: ; preds = %51, %48
ret i32 0
}