#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 */
typedef int /*<<< orphan*/ values;

/* Variables and functions */
double pow(double, double);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int /*<<< orphan*/ simple_sort(double *, int);
int main(int argc, char const *argv[]) {
  double values[3];
  scanf("%lf %lf %lf", &values[0], &values[1], &values[2]);
  int size = sizeof(values) / sizeof(double);
  simple_sort(values, size);
  double a = values[2];
  double b = values[1];
  double c = values[0];
  double a2 = pow(a, 2.0);
  double b2 = pow(b, 2.0);
  double c2 = pow(c, 2.0);
  if (a >= b + c) {
    printf("NAO FORMA TRIANGULO\n");
    return 0;
  }
  if (a2 == b2 + c2)
    printf("TRIANGULO RETANGULO\n");
  if (a2 > b2 + c2)
    printf("TRIANGULO OBTUSANGULO\n");
  if (a2 < b2 + c2)
    printf("TRIANGULO ACUTANGULO\n");
  if (a == b && b == c)
    printf("TRIANGULO EQUILATERO\n");
  if ((a == b && b != c) || (b == c && a != b))
    printf("TRIANGULO ISOSCELES\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rsi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    -0x30(%rbp),%rcx
add    $0x10,%rcx
lea    0xe97(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x3,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <simple_sort@plt>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe4c(%rip),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xe35(%rip),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xe1e(%rip),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
addsd  -0x50(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     121d <main+0xdd>
lea    0xe08(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    133a <main+0x1fa>
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
addsd  -0x68(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    1248 <main+0x108>
jp     1248 <main+0x108>
lea    0xde6(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
addsd  -0x68(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    126d <main+0x12d>
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1292 <main+0x152>
lea    0xdc8(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jne    12ca <main+0x18a>
jp     12ca <main+0x18a>
movsd  -0x48(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
jne    12ca <main+0x18a>
jp     12ca <main+0x18a>
lea    0xda6(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jne    12f6 <main+0x1b6>
jp     12f6 <main+0x1b6>
movsd  -0x48(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
jne    1327 <main+0x1e7>
jp     1327 <main+0x1e7>
movsd  -0x48(%rbp),%xmm0
ucomisd -0x50(%rbp),%xmm0
jne    1333 <main+0x1f3>
jp     1333 <main+0x1f3>
movsd  -0x40(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jne    1327 <main+0x1e7>
jp     1327 <main+0x1e7>
jmp    1333 <main+0x1f3>
lea    0xd53(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0x28(%rsp),%rdx
lea    0x30(%rsp),%rcx
lea    0xeba(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <simple_sort@plt>
movsd  0x30(%rsp),%xmm1
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
movapd %xmm0,0x50(%rsp)
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
jae    1288 <main+0x158>
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm2,%xmm0
mulpd  %xmm2,%xmm0
movapd %xmm0,%xmm4
unpckhpd %xmm0,%xmm4
addsd  %xmm0,%xmm4
ucomisd %xmm4,%xmm3
movsd  %xmm1,(%rsp)
movapd %xmm2,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
movapd %xmm4,0x40(%rsp)
jne    11e6 <main+0xb6>
jp     11e6 <main+0xb6>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
movapd 0x40(%rsp),%xmm4
movsd  0x8(%rsp),%xmm3
movapd 0x10(%rsp),%xmm2
movsd  (%rsp),%xmm1
ucomisd %xmm4,%xmm3
jbe    120f <main+0xdf>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
movapd 0x40(%rsp),%xmm4
movsd  0x8(%rsp),%xmm3
movapd 0x10(%rsp),%xmm2
movsd  (%rsp),%xmm1
ucomisd %xmm3,%xmm4
jbe    122c <main+0xfc>
lea    0xe19(%rip),%rdi
call   1030 <puts@plt>
movapd 0x10(%rsp),%xmm2
movsd  (%rsp),%xmm1
movapd 0x50(%rsp),%xmm0
ucomisd %xmm0,%xmm1
jne    125f <main+0x12f>
jp     125f <main+0x12f>
ucomisd %xmm2,%xmm0
jne    125f <main+0x12f>
jp     125f <main+0x12f>
lea    0xdd7(%rip),%rdi
call   1030 <puts@plt>
movapd 0x10(%rsp),%xmm2
movapd 0x50(%rsp),%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
lea    0xda2(%rip),%rdi
jne    1276 <main+0x146>
jp     1276 <main+0x146>
ucomisd %xmm2,%xmm0
jne    128f <main+0x15f>
jp     128f <main+0x15f>
ucomisd %xmm2,%xmm0
jne    1294 <main+0x164>
jp     1294 <main+0x164>
ucomisd %xmm0,%xmm1
jne    128f <main+0x15f>
jp     128f <main+0x15f>
jmp    1294 <main+0x164>
lea    0xde5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x double]
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%15 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%16 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%17 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %14, double* %15, double* %16)
store i32 3, i32* %7
%18 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%19 = load i32, i32* %7
%20 = call i32 @simple_sort(double* %18, i32 %19)
%21 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
%22 = load double, double* %21
store double %22, double* %8
%23 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%24 = load double, double* %23
store double %24, double* %9
%25 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%26 = load double, double* %25
store double %26, double* %10
%27 = load double, double* %8
%28 = call double @pow(double %27, double 2.000000e+00)
store double %28, double* %11
%29 = load double, double* %9
%30 = call double @pow(double %29, double 2.000000e+00)
store double %30, double* %12
%31 = load double, double* %10
%32 = call double @pow(double %31, double 2.000000e+00)
store double %32, double* %13
%33 = load double, double* %8
%34 = load double, double* %9
%35 = load double, double* %10
%36 = fadd double %34, %35
%37 = fcmp oge double %33, %36
br i1 %37, label %38, label %40
38: ; preds = %2
%39 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %93
40: ; preds = %2
%41 = load double, double* %11
%42 = load double, double* %12
%43 = load double, double* %13
%44 = fadd double %42, %43
%45 = fcmp oeq double %41, %44
br i1 %45, label %46, label %48
46: ; preds = %40
%47 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %46, %40
%49 = load double, double* %11
%50 = load double, double* %12
%51 = load double, double* %13
%52 = fadd double %50, %51
%53 = fcmp ogt double %49, %52
br i1 %53, label %54, label %56
54: ; preds = %48
%55 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %56
56: ; preds = %54, %48
%57 = load double, double* %11
%58 = load double, double* %12
%59 = load double, double* %13
%60 = fadd double %58, %59
%61 = fcmp olt double %57, %60
br i1 %61, label %62, label %64
62: ; preds = %56
%63 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %64
64: ; preds = %62, %56
%65 = load double, double* %8
%66 = load double, double* %9
%67 = fcmp oeq double %65, %66
br i1 %67, label %68, label %74
68: ; preds = %64
%69 = load double, double* %9
%70 = load double, double* %10
%71 = fcmp oeq double %69, %70
br i1 %71, label %72, label %74
72: ; preds = %68
%73 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %74
74: ; preds = %72, %68, %64
%75 = load double, double* %8
%76 = load double, double* %9
%77 = fcmp oeq double %75, %76
br i1 %77, label %78, label %82
78: ; preds = %74
%79 = load double, double* %9
%80 = load double, double* %10
%81 = fcmp une double %79, %80
br i1 %81, label %90, label %82
82: ; preds = %78, %74
%83 = load double, double* %9
%84 = load double, double* %10
%85 = fcmp oeq double %83, %84
br i1 %85, label %86, label %92
86: ; preds = %82
%87 = load double, double* %8
%88 = load double, double* %9
%89 = fcmp une double %87, %88
br i1 %89, label %90, label %92
90: ; preds = %86, %78
%91 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %92
92: ; preds = %90, %86, %82
store i32 0, i32* %3
br label %93
93: ; preds = %92, %38
%94 = load i32, i32* %3
ret i32 %94
}

LLVM IR (-O2):
@.str = [12 x i8] c"%lf %lf %lf\00"
@str = [20 x i8] c"TRIANGULO ISOSCELES\00"
@str.7 = [21 x i8] c"TRIANGULO EQUILATERO\00"
@str.8 = [21 x i8] c"TRIANGULO ACUTANGULO\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(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x double]
%4 = bitcast [3 x double]* %3 to i8*
%5 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%6 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%7 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %5, double* %6, double* %7)
%9 = call i32 @simple_sort(double* %5, i32 3)
%10 = load double, double* %7
%11 = bitcast [3 x double]* %3 to <2 x double>*
%12 = load <2 x double>, <2 x double>* %11
%13 = fmul double %10, %10
%14 = extractelement <2 x double> %12, i64 0
%15 = extractelement <2 x double> %12, i64 1
%16 = fadd double %15, %14
%17 = fcmp ult double %10, %16
br i1 %17, label %18, label %46
18: ; preds = %2
%19 = fmul <2 x double> %12, %12
%20 = shufflevector <2 x double> %19, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%21 = fadd <2 x double> %20, %19
%22 = extractelement <2 x double> %21, i64 0
%23 = fcmp oeq double %13, %22
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.10, i64 0, i64 0))
br label %26
26: ; preds = %24, %18
%27 = fcmp ogt double %13, %22
br i1 %27, label %28, label %30
28: ; preds = %26
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.9, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
%31 = fcmp olt double %13, %22
br i1 %31, label %32, label %34
32: ; preds = %30
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.8, i64 0, i64 0))
br label %34
34: ; preds = %32, %30
%35 = fcmp oeq double %10, %15
%36 = fcmp oeq double %15, %14
%37 = select i1 %35, i1 %36, i1 false
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0))
br label %40
40: ; preds = %38, %34
%41 = fcmp une double %15, %14
%42 = select i1 %35, i1 %41, i1 false
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = fcmp une double %10, %15
%45 = select i1 %36, i1 %44, i1 false
br i1 %45, label %46, label %49
46: ; preds = %40, %43, %2
%47 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.11, i64 0, i64 0), %2 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0), %43 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0), %40 ]
%48 = call i32 @puts(i8* dereferenceable(1) %47)
br label %49
49: ; preds = %46, %43
ret i32 0
}