#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 triangle(float, float, float);
int main(int argc, const char *argv[]) {
  float a, b, c;
  printf("Informe o lado A do triangulo: ");
  scanf("%f", &a);
  printf("Informe o lado B do triangulo: ");
  scanf("%f", &b);
  printf("Informe o lado C do triangulo: ");
  scanf("%f", &c);
  if (triangle(a, b, c) == 2) {
    printf("Nao eh triangulo\n");
  } else if (triangle(a, b, c) == 3) {
    printf("Triangulo equilatero\n");
  } else if (triangle(a, b, c) == 4) {
    printf("Triangulo isosceles\n");
  } else if (triangle(a, b, c) == 5) {
    printf("Triangulo escaleno\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
call   1030 <triangle@plt>
cmp    $0x2,%eax
jne    11c8 <main+0x98>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
jmp    125c <main+0x12c>
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
call   1030 <triangle@plt>
cmp    $0x3,%eax
jne    11f6 <main+0xc6>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
jmp    1257 <main+0x127>
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
call   1030 <triangle@plt>
cmp    $0x4,%eax
jne    1224 <main+0xf4>
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
jmp    1252 <main+0x122>
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
call   1030 <triangle@plt>
cmp    $0x5,%eax
jne    124d <main+0x11d>
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
jmp    1252 <main+0x122>
jmp    1257 <main+0x127>
jmp    125c <main+0x12c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
lea    0xec8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeb7(%rip),%rdi
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1050 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
call   1040 <triangle@plt>
cmp    $0x2,%eax
jne    11bc <main+0x7c>
lea    0xee5(%rip),%rdi
jmp    1229 <main+0xe9>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
call   1040 <triangle@plt>
cmp    $0x3,%eax
jne    11e1 <main+0xa1>
lea    0xeab(%rip),%rdi
jmp    1229 <main+0xe9>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
call   1040 <triangle@plt>
cmp    $0x4,%eax
jne    1206 <main+0xc6>
lea    0xe72(%rip),%rdi
jmp    1229 <main+0xe9>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x4(%rsp),%xmm2
call   1040 <triangle@plt>
cmp    $0x5,%eax
jne    122e <main+0xee>
lea    0xe3a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Informe o lado A do triangulo: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"Informe o lado B do triangulo: \00"
@.str.3 = [32 x i8] c"Informe o lado C do triangulo: \00"
@.str.4 = [18 x i8] c"Nao eh triangulo\0A\00"
@.str.5 = [22 x i8] c"Triangulo equilatero\0A\00"
@.str.6 = [21 x i8] c"Triangulo isosceles\0A\00"
@.str.7 = [20 x i8] c"Triangulo escaleno\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %6)
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%13 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%15 = load float, float* %6
%16 = load float, float* %7
%17 = load float, float* %8
%18 = call i32 @triangle(float %15, float %16, float %17)
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %49
22: ; preds = %2
%23 = load float, float* %6
%24 = load float, float* %7
%25 = load float, float* %8
%26 = call i32 @triangle(float %23, float %24, float %25)
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %48
30: ; preds = %22
%31 = load float, float* %6
%32 = load float, float* %7
%33 = load float, float* %8
%34 = call i32 @triangle(float %31, float %32, float %33)
%35 = icmp eq i32 %34, 4
br i1 %35, label %36, label %38
36: ; preds = %30
%37 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %47
38: ; preds = %30
%39 = load float, float* %6
%40 = load float, float* %7
%41 = load float, float* %8
%42 = call i32 @triangle(float %39, float %40, float %41)
%43 = icmp eq i32 %42, 5
br i1 %43, label %44, label %46
44: ; preds = %38
%45 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
br label %46
46: ; preds = %44, %38
br label %47
47: ; preds = %46, %36
br label %48
48: ; preds = %47, %28
br label %49
49: ; preds = %48, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Informe o lado A do triangulo: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"Informe o lado B do triangulo: \00"
@.str.3 = [32 x i8] c"Informe o lado C do triangulo: \00"
@str = [19 x i8] c"Triangulo escaleno\00"
@str.8 = [20 x i8] c"Triangulo isosceles\00"
@str.9 = [21 x i8] c"Triangulo equilatero\00"
@str.10 = [17 x i8] c"Nao eh triangulo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast float* %3 to i8*
%7 = bitcast float* %4 to i8*
%8 = bitcast float* %5 to i8*
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%15 = load float, float* %3
%16 = load float, float* %4
%17 = load float, float* %5
%18 = call i32 @triangle(float %15, float %16, float %17)
%19 = icmp eq i32 %18, 2
br i1 %19, label %38, label %20
20: ; preds = %2
%21 = load float, float* %3
%22 = load float, float* %4
%23 = load float, float* %5
%24 = call i32 @triangle(float %21, float %22, float %23)
%25 = icmp eq i32 %24, 3
br i1 %25, label %38, label %26
26: ; preds = %20
%27 = load float, float* %3
%28 = load float, float* %4
%29 = load float, float* %5
%30 = call i32 @triangle(float %27, float %28, float %29)
%31 = icmp eq i32 %30, 4
br i1 %31, label %38, label %32
32: ; preds = %26
%33 = load float, float* %3
%34 = load float, float* %4
%35 = load float, float* %5
%36 = call i32 @triangle(float %33, float %34, float %35)
%37 = icmp eq i32 %36, 5
br i1 %37, label %38, label %41
38: ; preds = %32, %26, %20, %2
%39 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.10, i64 0, i64 0), %2 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0), %20 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @str.8, i64 0, i64 0), %26 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), %32 ]
%40 = call i32 @puts(i8* dereferenceable(1) %39)
br label %41
41: ; preds = %38, %32
ret i32 0
}