#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 *);
int main() {
  float a, b, c;
  printf("Ingrese la longitud del primer lado: ");
  scanf("%f", &a);
  printf("Ingrese la longitud del segundo lado: ");
  scanf("%f", &b);
  printf("Ingrese la longitud del tercer lado: ");
  scanf("%f", &c);
  if (a < 0 || b < 0 || c < 0) {
    printf("\nLongitudes invalidas\n");
    return -1;
  }
  if (a != b && a != c && b != c)
    printf("\nEs un triangulo escaleno\n");
  else if (a == b && a != c || a == c && a != b || b == c && b != a)
    printf("\nEs un triangulo isoceles\n");
  else
    printf("\nEs un triangulo equilatero\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
ja     11aa <main+0x8a>
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
ja     11aa <main+0x8a>
xorps  %xmm0,%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11c2 <main+0xa2>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12cd <main+0x1ad>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    11dc <main+0xbc>
jp     11dc <main+0xbc>
jmp    1221 <main+0x101>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    11f6 <main+0xd6>
jp     11f6 <main+0xd6>
jmp    1221 <main+0x101>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    1210 <main+0xf0>
jp     1210 <main+0xf0>
jmp    1221 <main+0x101>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    12c6 <main+0x1a6>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    124b <main+0x12b>
jp     124b <main+0x12b>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    12a4 <main+0x184>
jp     12a4 <main+0x184>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    1275 <main+0x155>
jp     1275 <main+0x155>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    12a4 <main+0x184>
jp     12a4 <main+0x184>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jne    12b5 <main+0x195>
jp     12b5 <main+0x195>
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    12a4 <main+0x184>
jp     12a4 <main+0x184>
jmp    12b5 <main+0x195>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
jmp    12c1 <main+0x1a1>
lea    0xe07(%rip),%rdi
call   1030 <printf@plt>
jmp    12c6 <main+0x1a6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xede(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
mov    $0xffffffff,%ebx
lea    0xf27(%rip),%rdi
ja     1228 <main+0xf8>
movss  0x8(%rsp),%xmm1
ucomiss %xmm1,%xmm2
ja     1228 <main+0xf8>
movss  0x4(%rsp),%xmm2
xorps  %xmm3,%xmm3
ucomiss %xmm2,%xmm3
ja     1228 <main+0xf8>
xor    %ebx,%ebx
ucomiss %xmm1,%xmm0
jne    11c7 <main+0x97>
jnp    11de <main+0xae>
ucomiss %xmm2,%xmm0
jne    11ce <main+0x9e>
jnp    11de <main+0xae>
ucomiss %xmm2,%xmm1
jne    11d5 <main+0xa5>
jnp    11de <main+0xae>
lea    0xed0(%rip),%rdi
jmp    1228 <main+0xf8>
ucomiss %xmm1,%xmm0
lea    0xeaa(%rip),%rdi
jne    11f3 <main+0xc3>
jp     11f3 <main+0xc3>
ucomiss %xmm2,%xmm0
jne    1228 <main+0xf8>
jp     1228 <main+0xf8>
ucomiss %xmm2,%xmm0
jne    1201 <main+0xd1>
jp     1201 <main+0xd1>
ucomiss %xmm1,%xmm0
jne    1228 <main+0xf8>
jp     1228 <main+0xf8>
ucomiss %xmm1,%xmm0
lea    0xe87(%rip),%rax
lea    0xe64(%rip),%rcx
mov    %rcx,%rdi
cmovne %rax,%rdi
cmovp  %rax,%rdi
ucomiss %xmm2,%xmm1
cmovne %rcx,%rdi
cmovp  %rcx,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Ingrese la longitud del primer lado: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [39 x i8] c"Ingrese la longitud del segundo lado: \00"
@.str.3 = [38 x i8] c"Ingrese la longitud del tercer lado: \00"
@.str.4 = [23 x i8] c"\0ALongitudes invalidas\0A\00"
@.str.5 = [27 x i8] c"\0AEs un triangulo escaleno\0A\00"
@.str.6 = [27 x i8] c"\0AEs un triangulo isoceles\0A\00"
@.str.7 = [29 x i8] c"\0AEs un triangulo equilatero\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%11 = load float, float* %2
%12 = fcmp olt float %11, 0.000000e+00
br i1 %12, label %19, label %13
13: ; preds = %0
%14 = load float, float* %3
%15 = fcmp olt float %14, 0.000000e+00
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load float, float* %4
%18 = fcmp olt float %17, 0.000000e+00
br i1 %18, label %19, label %21
19: ; preds = %16, %13, %0
%20 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %1
br label %65
21: ; preds = %16
%22 = load float, float* %2
%23 = load float, float* %3
%24 = fcmp une float %22, %23
br i1 %24, label %25, label %35
25: ; preds = %21
%26 = load float, float* %2
%27 = load float, float* %4
%28 = fcmp une float %26, %27
br i1 %28, label %29, label %35
29: ; preds = %25
%30 = load float, float* %3
%31 = load float, float* %4
%32 = fcmp une float %30, %31
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %64
35: ; preds = %29, %25, %21
%36 = load float, float* %2
%37 = load float, float* %3
%38 = fcmp oeq float %36, %37
br i1 %38, label %39, label %43
39: ; preds = %35
%40 = load float, float* %2
%41 = load float, float* %4
%42 = fcmp une float %40, %41
br i1 %42, label %59, label %43
43: ; preds = %39, %35
%44 = load float, float* %2
%45 = load float, float* %4
%46 = fcmp oeq float %44, %45
br i1 %46, label %47, label %51
47: ; preds = %43
%48 = load float, float* %2
%49 = load float, float* %3
%50 = fcmp une float %48, %49
br i1 %50, label %59, label %51
51: ; preds = %47, %43
%52 = load float, float* %3
%53 = load float, float* %4
%54 = fcmp oeq float %52, %53
br i1 %54, label %55, label %61
55: ; preds = %51
%56 = load float, float* %3
%57 = load float, float* %2
%58 = fcmp une float %56, %57
br i1 %58, label %59, label %61
59: ; preds = %55, %47, %39
%60 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %63
61: ; preds = %55, %51
%62 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
br label %63
63: ; preds = %61, %59
br label %64
64: ; preds = %63, %33
store i32 0, i32* %1
br label %65
65: ; preds = %64, %19
%66 = load i32, i32* %1
ret i32 %66
}

LLVM IR (-O2):
@.str = [38 x i8] c"Ingrese la longitud del primer lado: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [39 x i8] c"Ingrese la longitud del segundo lado: \00"
@.str.3 = [38 x i8] c"Ingrese la longitud del tercer lado: \00"
@str = [28 x i8] c"\0AEs un triangulo equilatero\00"
@str.8 = [26 x i8] c"\0AEs un triangulo isoceles\00"
@str.9 = [26 x i8] c"\0AEs un triangulo escaleno\00"
@str.10 = [22 x i8] c"\0ALongitudes invalidas\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* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%13 = load float, float* %1
%14 = fcmp olt float %13, 0.000000e+00
%15 = load float, float* %2
%16 = fcmp olt float %15, 0.000000e+00
%17 = select i1 %14, i1 true, i1 %16
%18 = load float, float* %3
%19 = fcmp olt float %18, 0.000000e+00
%20 = select i1 %17, i1 true, i1 %19
br i1 %20, label %37, label %21
21: ; preds = %0
%22 = fcmp une float %13, %15
%23 = fcmp une float %13, %18
%24 = select i1 %22, i1 %23, i1 false
%25 = fcmp une float %15, %18
%26 = select i1 %24, i1 %25, i1 false
br i1 %26, label %37, label %27
27: ; preds = %21
%28 = fcmp oeq float %13, %15
%29 = select i1 %28, i1 %23, i1 false
br i1 %29, label %37, label %30
30: ; preds = %27
%31 = fcmp oeq float %13, %18
%32 = select i1 %31, i1 %22, i1 false
br i1 %32, label %37, label %33
33: ; preds = %30
%34 = fcmp oeq float %15, %18
%35 = select i1 %34, i1 %22, i1 false
%36 = select i1 %35, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0)
br label %37
37: ; preds = %33, %27, %30, %21, %0
%38 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @str.10, i64 0, i64 0), %0 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.9, i64 0, i64 0), %21 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0), %30 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.8, i64 0, i64 0), %27 ], [ %36, %33 ]
%39 = phi i32 [ -1, %0 ], [ 0, %21 ], [ 0, %30 ], [ 0, %27 ], [ 0, %33 ]
%40 = call i32 @puts(i8* dereferenceable(1) %38)
ret i32 %39
}