#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 *, float *, float *, float *);
int main() {
  float a, b, c, n1, n2, n3, n4;
  printf("\nDigite 3 valores:\n");
  scanf("%f%f%f", &a, &b, &c);
  if (a <= 0 || b <= 0 || c <= 0) {
    printf("\nValores invalidos para fazer o calculo\n");
  } else {
    if (a <= b && a <= c) {
      if (b <= c) {
        printf("\n%.2f, %.2f, %.2f\n", a, b, c);
        a = n1;
        b = n2;
        c = n3;
      } else {
        printf("\n%.2f, %.2f, %.2f\n", a, c, b);
        a = n1;
        c = n2;
        b = n3;
      }
    } else {
      if (b <= c) {
        if (a <= c) {
          printf("\n%.2f, %.2f, %.2f\n", b, a, c);
          b = n1;
          a = n2;
          c = n3;
        } else {
          printf("\n%.2f, %.2f, %.2f\n", b, c, a);
          b = n1;
          c = n2;
          a = n3;
        }
      } else {
        if (a <= b) {
          printf("\n%.2f, %.2f, %.2f\n", c, a, b);
          c = n1;
          a = n2;
          b = n3;
        } else {
          printf("\n%.2f, %.2f, %.2f\n", c, b, a);
          c = n1;
          b = n2;
          a = n3;
        }
      }
    }
    n4 = n1 + n2;
    if (n4 < n3) {
      printf("\nOs valores formam um triangulo\n %.2f, %.2f", n4, n3);
    } else {
      printf("\nOs valores não formam um triangulo\n %.2f, %.2f", n4, n3);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jae    117c <main+0x5c>
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jae    117c <main+0x5c>
xorps  %xmm0,%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     118f <main+0x6f>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    143a <main+0x31a>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1260 <main+0x140>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1260 <main+0x140>
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1214 <main+0xf4>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe5a(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    125b <main+0x13b>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe0e(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    13ce <main+0x2ae>
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     131e <main+0x1fe>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     12d2 <main+0x1b2>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xd9c(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1319 <main+0x1f9>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xd50(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    13c9 <main+0x2a9>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     137d <main+0x25d>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xcf1(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    13c4 <main+0x2a4>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xca5(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    13c9 <main+0x2a9>
jmp    13ce <main+0x2ae>
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1415 <main+0x2f5>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc4e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1435 <main+0x315>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc55(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    143a <main+0x31a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jae    11ad <main+0x7d>
movss  0x10(%rsp),%xmm1
ucomiss %xmm1,%xmm2
jae    11ad <main+0x7d>
movss  0xc(%rsp),%xmm2
xorps  %xmm3,%xmm3
ucomiss %xmm2,%xmm3
jae    11ad <main+0x7d>
ucomiss %xmm0,%xmm1
jb     11bb <main+0x8b>
ucomiss %xmm0,%xmm2
jb     11bb <main+0x8b>
ucomiss %xmm1,%xmm2
movaps %xmm1,%xmm3
cmpnless %xmm2,%xmm3
movaps %xmm3,%xmm4
andps  %xmm2,%xmm4
andnps %xmm1,%xmm3
orps   %xmm4,%xmm3
jb     11a8 <main+0x78>
movaps %xmm2,%xmm1
movaps %xmm1,%xmm4
jmp    1206 <main+0xd6>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
jmp    1234 <main+0x104>
ucomiss %xmm1,%xmm2
jae    11e4 <main+0xb4>
ucomiss %xmm0,%xmm1
movaps %xmm0,%xmm3
cmpnless %xmm1,%xmm3
movaps %xmm3,%xmm4
andps  %xmm1,%xmm4
andnps %xmm0,%xmm3
orps   %xmm4,%xmm3
jb     11dc <main+0xac>
movaps %xmm1,%xmm0
movaps %xmm0,%xmm4
movaps %xmm2,%xmm0
jmp    1206 <main+0xd6>
ucomiss %xmm0,%xmm2
movaps %xmm0,%xmm3
cmpnless %xmm2,%xmm3
movaps %xmm3,%xmm4
andps  %xmm2,%xmm4
andnps %xmm0,%xmm3
orps   %xmm4,%xmm3
jb     1200 <main+0xd0>
movaps %xmm2,%xmm0
movaps %xmm0,%xmm4
movaps %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm3,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm4,%xmm2
lea    0xde8(%rip),%rdi
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xded(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0ADigite 3 valores:\0A\00"
@.str.1 = [7 x i8] c"%f%f%f\00"
@.str.2 = [41 x i8] c"\0AValores invalidos para fazer o calculo\0A\00"
@.str.3 = [19 x i8] c"\0A%.2f, %.2f, %.2f\0A\00"
@.str.4 = [44 x i8] c"\0AOs valores formam um triangulo\0A %.2f, %.2f\00"
@.str.5 = [49 x i8] c"\0AOs valores n\C3\A3o formam um triangulo\0A %.2f, %.2f\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
%8 = alloca float
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4)
%11 = load float, float* %2
%12 = fcmp ole float %11, 0.000000e+00
br i1 %12, label %19, label %13
13: ; preds = %0
%14 = load float, float* %3
%15 = fcmp ole float %14, 0.000000e+00
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load float, float* %4
%18 = fcmp ole float %17, 0.000000e+00
br i1 %18, label %19, label %21
19: ; preds = %16, %13, %0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
br label %135
21: ; preds = %16
%22 = load float, float* %2
%23 = load float, float* %3
%24 = fcmp ole float %22, %23
br i1 %24, label %25, label %56
25: ; preds = %21
%26 = load float, float* %2
%27 = load float, float* %4
%28 = fcmp ole float %26, %27
br i1 %28, label %29, label %56
29: ; preds = %25
%30 = load float, float* %3
%31 = load float, float* %4
%32 = fcmp ole float %30, %31
br i1 %32, label %33, label %44
33: ; preds = %29
%34 = load float, float* %2
%35 = fpext float %34 to double
%36 = load float, float* %3
%37 = fpext float %36 to double
%38 = load float, float* %4
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %35, double %37, double %39)
%41 = load float, float* %5
store float %41, float* %2
%42 = load float, float* %6
store float %42, float* %3
%43 = load float, float* %7
store float %43, float* %4
br label %55
44: ; preds = %29
%45 = load float, float* %2
%46 = fpext float %45 to double
%47 = load float, float* %4
%48 = fpext float %47 to double
%49 = load float, float* %3
%50 = fpext float %49 to double
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %46, double %48, double %50)
%52 = load float, float* %5
store float %52, float* %2
%53 = load float, float* %6
store float %53, float* %4
%54 = load float, float* %7
store float %54, float* %3
br label %55
55: ; preds = %44, %33
br label %115
56: ; preds = %25, %21
%57 = load float, float* %3
%58 = load float, float* %4
%59 = fcmp ole float %57, %58
br i1 %59, label %60, label %87
60: ; preds = %56
%61 = load float, float* %2
%62 = load float, float* %4
%63 = fcmp ole float %61, %62
br i1 %63, label %64, label %75
64: ; preds = %60
%65 = load float, float* %3
%66 = fpext float %65 to double
%67 = load float, float* %2
%68 = fpext float %67 to double
%69 = load float, float* %4
%70 = fpext float %69 to double
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %66, double %68, double %70)
%72 = load float, float* %5
store float %72, float* %3
%73 = load float, float* %6
store float %73, float* %2
%74 = load float, float* %7
store float %74, float* %4
br label %86
75: ; preds = %60
%76 = load float, float* %3
%77 = fpext float %76 to double
%78 = load float, float* %4
%79 = fpext float %78 to double
%80 = load float, float* %2
%81 = fpext float %80 to double
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %77, double %79, double %81)
%83 = load float, float* %5
store float %83, float* %3
%84 = load float, float* %6
store float %84, float* %4
%85 = load float, float* %7
store float %85, float* %2
br label %86
86: ; preds = %75, %64
br label %114
87: ; preds = %56
%88 = load float, float* %2
%89 = load float, float* %3
%90 = fcmp ole float %88, %89
br i1 %90, label %91, label %102
91: ; preds = %87
%92 = load float, float* %4
%93 = fpext float %92 to double
%94 = load float, float* %2
%95 = fpext float %94 to double
%96 = load float, float* %3
%97 = fpext float %96 to double
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %93, double %95, double %97)
%99 = load float, float* %5
store float %99, float* %4
%100 = load float, float* %6
store float %100, float* %2
%101 = load float, float* %7
store float %101, float* %3
br label %113
102: ; preds = %87
%103 = load float, float* %4
%104 = fpext float %103 to double
%105 = load float, float* %3
%106 = fpext float %105 to double
%107 = load float, float* %2
%108 = fpext float %107 to double
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %104, double %106, double %108)
%110 = load float, float* %5
store float %110, float* %4
%111 = load float, float* %6
store float %111, float* %3
%112 = load float, float* %7
store float %112, float* %2
br label %113
113: ; preds = %102, %91
br label %114
114: ; preds = %113, %86
br label %115
115: ; preds = %114, %55
%116 = load float, float* %5
%117 = load float, float* %6
%118 = fadd float %116, %117
store float %118, float* %8
%119 = load float, float* %8
%120 = load float, float* %7
%121 = fcmp olt float %119, %120
br i1 %121, label %122, label %128
122: ; preds = %115
%123 = load float, float* %8
%124 = fpext float %123 to double
%125 = load float, float* %7
%126 = fpext float %125 to double
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0), double %124, double %126)
br label %134
128: ; preds = %115
%129 = load float, float* %8
%130 = fpext float %129 to double
%131 = load float, float* %7
%132 = fpext float %131 to double
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), double %130, double %132)
br label %134
134: ; preds = %128, %122
br label %135
135: ; preds = %134, %19
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%f%f%f\00"
@.str.3 = [19 x i8] c"\0A%.2f, %.2f, %.2f\0A\00"
@.str.5 = [49 x i8] c"\0AOs valores n\C3\A3o formam um triangulo\0A %.2f, %.2f\00"
@str = [19 x i8] c"\0ADigite 3 valores:\00"
@str.6 = [40 x i8] c"\0AValores invalidos para fazer o calculo\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%9 = load float, float* %1
%10 = fcmp ole float %9, 0.000000e+00
%11 = load float, float* %2
%12 = fcmp ole float %11, 0.000000e+00
%13 = select i1 %10, i1 true, i1 %12
%14 = load float, float* %3
%15 = fcmp ole float %14, 0.000000e+00
%16 = select i1 %13, i1 true, i1 %15
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.6, i64 0, i64 0))
br label %43
19: ; preds = %0
%20 = fcmp ugt float %9, %11
%21 = fcmp ugt float %9, %14
%22 = select i1 %20, i1 true, i1 %21
%23 = fcmp ugt float %11, %14
br i1 %22, label %27, label %24
24: ; preds = %19
%25 = select i1 %23, float %14, float %11
%26 = select i1 %23, float %11, float %14
br label %34
27: ; preds = %19
br i1 %23, label %31, label %28
28: ; preds = %27
%29 = select i1 %21, float %14, float %9
%30 = select i1 %21, float %9, float %14
br label %34
31: ; preds = %27
%32 = select i1 %20, float %11, float %9
%33 = select i1 %20, float %9, float %11
br label %34
34: ; preds = %31, %28, %24
%35 = phi float [ %25, %24 ], [ %29, %28 ], [ %32, %31 ]
%36 = phi float [ %26, %24 ], [ %30, %28 ], [ %33, %31 ]
%37 = phi float [ %9, %24 ], [ %11, %28 ], [ %14, %31 ]
%38 = fpext float %37 to double
%39 = fpext float %35 to double
%40 = fpext float %36 to double
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), double %38, double %39, double %40)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.5, i64 0, i64 0), double undef, double undef)
br label %43
43: ; preds = %34, %17
ret i32 0
}