#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
int main(void) {
  float a, b, c, temp;
  puts("Enter the lenghts of the 3 sides of a triangle:");
  scanf("%f %f %f", &a, &b, &c);
  if (a > b) {
    temp = a;
    a = b;
    b = temp;
  }
  if (a > c) {
    temp = a;
    a = c;
    c = temp;
  }
  if (b > c) {
    temp = b;
    b = c;
    c = temp;
  }
  if (a <= 0 || a + b < c)
    printf("Not a triangle!\n\n");
  else if (a == b && b == c)
    printf("You've got an equilateral triangle!\n\n");
  else if (a == b || b == c)
    printf("You've got an isosceles triangle\n\n");
  else
    printf("You've got an scalene triangle!\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1190 <main+0x60>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11bd <main+0x8d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11ea <main+0xba>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jae    120f <main+0xdf>
movss  -0x8(%rbp),%xmm1
addss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1220 <main+0xf0>
lea    0xe23(%rip),%rdi
call   1040 <printf@plt>
jmp    12b1 <main+0x181>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    125b <main+0x12b>
jp     125b <main+0x12b>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    125b <main+0x12b>
jp     125b <main+0x12b>
lea    0xdfa(%rip),%rdi
call   1040 <printf@plt>
jmp    12ac <main+0x17c>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    1275 <main+0x145>
jp     1275 <main+0x145>
jmp    128a <main+0x15a>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    129b <main+0x16b>
jp     129b <main+0x16b>
lea    0xde0(%rip),%rdi
call   1040 <printf@plt>
jmp    12a7 <main+0x177>
lea    0xdf2(%rip),%rdi
call   1040 <printf@plt>
jmp    12ac <main+0x17c>
jmp    12b1 <main+0x181>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm1
movss  0x10(%rsp),%xmm0
ucomiss %xmm0,%xmm1
jbe    116d <main+0x4d>
movss  %xmm0,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movaps %xmm1,%xmm2
jmp    1173 <main+0x53>
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movss  0xc(%rsp),%xmm3
ucomiss %xmm3,%xmm0
jbe    119a <main+0x7a>
movss  %xmm3,0x14(%rsp)
movss  %xmm0,0xc(%rsp)
movaps %xmm3,%xmm1
ucomiss %xmm0,%xmm2
ja     11a5 <main+0x85>
movaps %xmm0,%xmm3
movaps %xmm2,%xmm0
jmp    11b4 <main+0x94>
movaps %xmm0,%xmm1
movaps %xmm3,%xmm0
ucomiss %xmm0,%xmm2
jbe    1192 <main+0x72>
movss  %xmm0,0x10(%rsp)
movss  %xmm2,0xc(%rsp)
movaps %xmm2,%xmm3
xorps  %xmm2,%xmm2
ucomiss %xmm1,%xmm2
lea    0xee0(%rip),%rdi
jae    120d <main+0xed>
movaps %xmm1,%xmm2
addss  %xmm0,%xmm2
ucomiss %xmm2,%xmm3
ja     120d <main+0xed>
ucomiss %xmm0,%xmm1
jne    11e6 <main+0xc6>
jp     11e6 <main+0xc6>
ucomiss %xmm3,%xmm0
jne    11e6 <main+0xc6>
jp     11e6 <main+0xc6>
lea    0xe98(%rip),%rdi
jmp    120d <main+0xed>
ucomiss %xmm3,%xmm0
lea    0xe49(%rip),%rax
lea    0xe63(%rip),%rdi
mov    %rdi,%rcx
cmovne %rax,%rcx
cmovp  %rax,%rcx
ucomiss %xmm0,%xmm1
cmovne %rcx,%rdi
cmovp  %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Enter the lenghts of the 3 sides of a triangle:\00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [18 x i8] c"Not a triangle!\0A\0A\00"
@.str.3 = [38 x i8] c"You've got an equilateral triangle!\0A\0A\00"
@.str.4 = [35 x i8] c"You've got an isosceles triangle\0A\0A\00"
@.str.5 = [34 x i8] c"You've got an scalene triangle!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4)
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fcmp ogt float %8, %9
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = load float, float* %2
store float %12, float* %5
%13 = load float, float* %3
store float %13, float* %2
%14 = load float, float* %5
store float %14, float* %3
br label %15
15: ; preds = %11, %0
%16 = load float, float* %2
%17 = load float, float* %4
%18 = fcmp ogt float %16, %17
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load float, float* %2
store float %20, float* %5
%21 = load float, float* %4
store float %21, float* %2
%22 = load float, float* %5
store float %22, float* %4
br label %23
23: ; preds = %19, %15
%24 = load float, float* %3
%25 = load float, float* %4
%26 = fcmp ogt float %24, %25
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load float, float* %3
store float %28, float* %5
%29 = load float, float* %4
store float %29, float* %3
%30 = load float, float* %5
store float %30, float* %4
br label %31
31: ; preds = %27, %23
%32 = load float, float* %2
%33 = fcmp ole float %32, 0.000000e+00
br i1 %33, label %40, label %34
34: ; preds = %31
%35 = load float, float* %2
%36 = load float, float* %3
%37 = fadd float %35, %36
%38 = load float, float* %4
%39 = fcmp olt float %37, %38
br i1 %39, label %40, label %42
40: ; preds = %34, %31
%41 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %66
42: ; preds = %34
%43 = load float, float* %2
%44 = load float, float* %3
%45 = fcmp oeq float %43, %44
br i1 %45, label %46, label %52
46: ; preds = %42
%47 = load float, float* %3
%48 = load float, float* %4
%49 = fcmp oeq float %47, %48
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %65
52: ; preds = %46, %42
%53 = load float, float* %2
%54 = load float, float* %3
%55 = fcmp oeq float %53, %54
br i1 %55, label %60, label %56
56: ; preds = %52
%57 = load float, float* %3
%58 = load float, float* %4
%59 = fcmp oeq float %57, %58
br i1 %59, label %60, label %62
60: ; preds = %56, %52
%61 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
br label %64
62: ; preds = %56
%63 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
br label %64
64: ; preds = %62, %60
br label %65
65: ; preds = %64, %50
br label %66
66: ; preds = %65, %40
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"Enter the lenghts of the 3 sides of a triangle:\00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@str = [33 x i8] c"You've got an scalene triangle!\0A\00"
@str.6 = [34 x i8] c"You've got an isosceles triangle\0A\00"
@str.7 = [37 x i8] c"You've got an equilateral triangle!\0A\00"
@str.8 = [17 x i8] c"Not a triangle!\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%9 = load float, float* %1
%10 = load float, float* %2
%11 = fcmp ogt float %9, %10
br i1 %11, label %12, label %13
12: ; preds = %0
store float %10, float* %1
store float %9, float* %2
br label %13
13: ; preds = %12, %0
%14 = phi float [ %9, %12 ], [ %10, %0 ]
%15 = phi float [ %10, %12 ], [ %9, %0 ]
%16 = load float, float* %3
%17 = fcmp ogt float %15, %16
br i1 %17, label %18, label %19
18: ; preds = %13
store float %16, float* %1
store float %15, float* %3
br label %19
19: ; preds = %18, %13
%20 = phi float [ %16, %18 ], [ %15, %13 ]
%21 = phi float [ %15, %18 ], [ %16, %13 ]
%22 = fcmp ogt float %14, %21
br i1 %22, label %23, label %24
23: ; preds = %19
store float %21, float* %2
store float %14, float* %3
br label %24
24: ; preds = %23, %19
%25 = phi float [ %14, %23 ], [ %21, %19 ]
%26 = phi float [ %21, %23 ], [ %14, %19 ]
%27 = fcmp ole float %20, 0.000000e+00
%28 = fadd float %20, %26
%29 = fcmp olt float %28, %25
%30 = select i1 %27, i1 true, i1 %29
br i1 %30, label %38, label %31
31: ; preds = %24
%32 = fcmp oeq float %20, %26
%33 = fcmp oeq float %26, %25
%34 = select i1 %32, i1 %33, i1 false
br i1 %34, label %38, label %35
35: ; preds = %31
%36 = select i1 %32, i1 true, i1 %33
%37 = select i1 %36, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0)
br label %38
38: ; preds = %35, %31, %24
%39 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.8, i64 0, i64 0), %24 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @str.7, i64 0, i64 0), %31 ], [ %37, %35 ]
%40 = call i32 @puts(i8* dereferenceable(1) %39)
ret i32 0
}