#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 TipoTriangulo(int, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int i, a, b, c, result;
  for (i = 0; i < 5; i++) {
    scanf("%d %d %d", &a, &b, &c);
    result = TipoTriangulo(a, b, c);
    switch (result) {
    case 0:
      printf("Nao e Triangulo\n");
      break;
    case 1:
      printf("Triangulo Equilatero\n");
      break;
    case 2:
      printf("Triangulo Isosceles\n");
      break;
    case 3:
      printf("Triangulo Escaleno\n");
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11f0 <main+0xc0>
lea    0xeb9(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1050 <TipoTriangulo@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x3,%rax
ja     11dd <main+0xad>
mov    -0x20(%rbp),%rax
lea    0xe6b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    11dd <main+0xad>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    11dd <main+0xad>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
jmp    11dd <main+0xad>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
jmp    11e2 <main+0xb2>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1050 <TipoTriangulo@plt>
cmp    $0x3,%eax
ja     1177 <main+0x47>
cltq
lea    0x2c92(%rip),%rcx
mov    (%rcx,%rax,8),%rdi
call   1030 <puts@plt>
lea    0xe82(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1050 <TipoTriangulo@plt>
cmp    $0x3,%eax
ja     11ba <main+0x8a>
cltq
lea    0x2c4f(%rip),%rcx
mov    (%rcx,%rax,8),%rdi
call   1030 <puts@plt>
lea    0xe3f(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1050 <TipoTriangulo@plt>
cmp    $0x3,%eax
ja     11fd <main+0xcd>
cltq
lea    0x2c0c(%rip),%rcx
mov    (%rcx,%rax,8),%rdi
call   1030 <puts@plt>
lea    0xdfc(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1050 <TipoTriangulo@plt>
cmp    $0x3,%eax
ja     1240 <main+0x110>
cltq
lea    0x2bc9(%rip),%rcx
mov    (%rcx,%rax,8),%rdi
call   1030 <puts@plt>
lea    0xdb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1050 <TipoTriangulo@plt>
cmp    $0x3,%eax
ja     1283 <main+0x153>
cltq
lea    0x2b86(%rip),%rcx
mov    (%rcx,%rax,8),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [17 x i8] c"Nao e Triangulo\0A\00"
@.str.2 = [22 x i8] c"Triangulo Equilatero\0A\00"
@.str.3 = [21 x i8] c"Triangulo Isosceles\0A\00"
@.str.4 = [20 x i8] c"Triangulo Escaleno\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %7
7: ; preds = %26, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %29
10: ; preds = %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @TipoTriangulo(i32 %12, i32 %13, i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
switch i32 %16, label %25 [
i32 0, label %17
i32 1, label %19
i32 2, label %21
i32 3, label %23
]
17: ; preds = %10
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %25
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %25
21: ; preds = %10
%22 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %25
23: ; preds = %10
%24 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %10, %23, %21, %19, %17
br label %26
26: ; preds = %25
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %7
29: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@str = [19 x i8] c"Triangulo Escaleno\00"
@str.5 = [20 x i8] c"Triangulo Isosceles\00"
@str.6 = [21 x i8] c"Triangulo Equilatero\00"
@str.7 = [16 x i8] c"Nao e Triangulo\00"
@switch.table.main.11 = [4 x i8*] [i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0)]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @TipoTriangulo(i32 %8, i32 %9, i32 %10)
%12 = icmp ult i32 %11, 4
br i1 %12, label %13, label %18
13: ; preds = %0
%14 = sext i32 %11 to i64
%15 = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table.main.11, i64 0, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @puts(i8* dereferenceable(1) %16)
br label %18
18: ; preds = %0, %13
%19 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 @TipoTriangulo(i32 %20, i32 %21, i32 %22)
%24 = icmp ult i32 %23, 4
br i1 %24, label %25, label %30
25: ; preds = %18
%26 = sext i32 %23 to i64
%27 = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table.main.11, i64 0, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @puts(i8* dereferenceable(1) %28)
br label %30
30: ; preds = %18, %25
%31 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%32 = load i32, i32* %1
%33 = load i32, i32* %2
%34 = load i32, i32* %3
%35 = call i32 @TipoTriangulo(i32 %32, i32 %33, i32 %34)
%36 = icmp ult i32 %35, 4
br i1 %36, label %37, label %42
37: ; preds = %30
%38 = sext i32 %35 to i64
%39 = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table.main.11, i64 0, i64 %38
%40 = load i8*, i8** %39
%41 = call i32 @puts(i8* dereferenceable(1) %40)
br label %42
42: ; preds = %30, %37
%43 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%44 = load i32, i32* %1
%45 = load i32, i32* %2
%46 = load i32, i32* %3
%47 = call i32 @TipoTriangulo(i32 %44, i32 %45, i32 %46)
%48 = icmp ult i32 %47, 4
br i1 %48, label %49, label %54
49: ; preds = %42
%50 = sext i32 %47 to i64
%51 = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table.main.11, i64 0, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @puts(i8* dereferenceable(1) %52)
br label %54
54: ; preds = %42, %49
%55 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%56 = load i32, i32* %1
%57 = load i32, i32* %2
%58 = load i32, i32* %3
%59 = call i32 @TipoTriangulo(i32 %56, i32 %57, i32 %58)
%60 = icmp ult i32 %59, 4
br i1 %60, label %61, label %66
61: ; preds = %54
%62 = sext i32 %59 to i64
%63 = getelementptr inbounds [4 x i8*], [4 x i8*]* @switch.table.main.11, i64 0, i64 %62
%64 = load i8*, i8** %63
%65 = call i32 @puts(i8* dereferenceable(1) %64)
br label %66
66: ; preds = %54, %61
ret i32 0
}