#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 *, int *, int *, int *);
int main() {
  int a, b, c;
  printf("Enter values of sides of triangle\n");
  scanf("%d%d%d", &a, &b, &c);
  if ((a == b) || (b == c) || (a == c)) {
    printf("Isosceles triangle\n");
  } else if ((a == b) && (b == c) && (c == a)) {
    printf("Equilateral and isosceles triangle\n");
  } else if ((a != b) && (b != c) && (c != a)) {
    printf("Scalene triangle\n");
  } else if ((b > a) && (b > c)) {
    if ((b * b) == ((a * a) + (c * c))) {
      printf("Right Triangle\n");
    } else
      printf("Not a right triangle\n");
  } else if ((a > b) && (a > c)) {
    if ((a * a) == ((b * b) + (c * c))) {
      printf("Right Triangle\n");
    } else
      printf("Not a right triangle\n");
  } else if ((c > a) && (c > b)) {
    if ((c * c) == ((a * a) + (b * b))) {
      printf("Right Triangle\n");
    } else
      printf("Not a right triangle\n");
  }
}


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    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1177 <main+0x57>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1177 <main+0x57>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1188 <main+0x68>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    1316 <main+0x1f6>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11bd <main+0x9d>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11bd <main+0x9d>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11bd <main+0x9d>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    1311 <main+0x1f1>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11f2 <main+0xd2>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     11f2 <main+0xd2>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     11f2 <main+0xd2>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    130c <main+0x1ec>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    124b <main+0x12b>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    124b <main+0x12b>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x10(%rbp),%edx
imul   -0x10(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
jne    123a <main+0x11a>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
jmp    1246 <main+0x126>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
jmp    1307 <main+0x1e7>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    12a4 <main+0x184>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    12a4 <main+0x184>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
imul   -0x10(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
jne    1293 <main+0x173>
lea    0xdeb(%rip),%rdi
call   1030 <printf@plt>
jmp    129f <main+0x17f>
lea    0xdea(%rip),%rdi
call   1030 <printf@plt>
jmp    1302 <main+0x1e2>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    12fd <main+0x1dd>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    12fd <main+0x1dd>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
jne    12ec <main+0x1cc>
lea    0xd92(%rip),%rdi
call   1030 <printf@plt>
jmp    12f8 <main+0x1d8>
lea    0xd91(%rip),%rdi
call   1030 <printf@plt>
jmp    12fd <main+0x1dd>
jmp    1302 <main+0x1e2>
jmp    1307 <main+0x1e7>
jmp    130c <main+0x1ec>
jmp    1311 <main+0x1f1>
jmp    1316 <main+0x1f6>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%ecx
mov    0x10(%rsp),%eax
cmp    %eax,%ecx
jne    1160 <main+0x40>
lea    0xedc(%rip),%rdi
jmp    117e <main+0x5e>
mov    0xc(%rsp),%edx
cmp    %edx,%ecx
lea    0xecd(%rip),%rcx
lea    0xeb5(%rip),%rdi
cmove  %rcx,%rdi
cmp    %edx,%eax
cmove  %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Enter values of sides of triangle\0A\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [20 x i8] c"Isosceles triangle\0A\00"
@.str.3 = [36 x i8] c"Equilateral and isosceles triangle\0A\00"
@.str.4 = [18 x i8] c"Scalene triangle\0A\00"
@.str.5 = [16 x i8] c"Right Triangle\0A\00"
@.str.6 = [22 x i8] c"Not a right triangle\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %7, %8
br i1 %9, label %18, label %10
10: ; preds = %0
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14, %10, %0
%19 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %128
20: ; preds = %14
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %34
24: ; preds = %20
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = load i32, i32* %4
%30 = load i32, i32* %2
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %127
34: ; preds = %28, %24, %20
%35 = load i32, i32* %2
%36 = load i32, i32* %3
%37 = icmp ne i32 %35, %36
br i1 %37, label %38, label %48
38: ; preds = %34
%39 = load i32, i32* %3
%40 = load i32, i32* %4
%41 = icmp ne i32 %39, %40
br i1 %41, label %42, label %48
42: ; preds = %38
%43 = load i32, i32* %4
%44 = load i32, i32* %2
%45 = icmp ne i32 %43, %44
br i1 %45, label %46, label %48
46: ; preds = %42
%47 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %126
48: ; preds = %42, %38, %34
%49 = load i32, i32* %3
%50 = load i32, i32* %2
%51 = icmp sgt i32 %49, %50
br i1 %51, label %52, label %73
52: ; preds = %48
%53 = load i32, i32* %3
%54 = load i32, i32* %4
%55 = icmp sgt i32 %53, %54
br i1 %55, label %56, label %73
56: ; preds = %52
%57 = load i32, i32* %3
%58 = load i32, i32* %3
%59 = mul nsw i32 %57, %58
%60 = load i32, i32* %2
%61 = load i32, i32* %2
%62 = mul nsw i32 %60, %61
%63 = load i32, i32* %4
%64 = load i32, i32* %4
%65 = mul nsw i32 %63, %64
%66 = add nsw i32 %62, %65
%67 = icmp eq i32 %59, %66
br i1 %67, label %68, label %70
68: ; preds = %56
%69 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %72
70: ; preds = %56
%71 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %72
72: ; preds = %70, %68
br label %125
73: ; preds = %52, %48
%74 = load i32, i32* %2
%75 = load i32, i32* %3
%76 = icmp sgt i32 %74, %75
br i1 %76, label %77, label %98
77: ; preds = %73
%78 = load i32, i32* %2
%79 = load i32, i32* %4
%80 = icmp sgt i32 %78, %79
br i1 %80, label %81, label %98
81: ; preds = %77
%82 = load i32, i32* %2
%83 = load i32, i32* %2
%84 = mul nsw i32 %82, %83
%85 = load i32, i32* %3
%86 = load i32, i32* %3
%87 = mul nsw i32 %85, %86
%88 = load i32, i32* %4
%89 = load i32, i32* %4
%90 = mul nsw i32 %88, %89
%91 = add nsw i32 %87, %90
%92 = icmp eq i32 %84, %91
br i1 %92, label %93, label %95
93: ; preds = %81
%94 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %97
95: ; preds = %81
%96 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %97
97: ; preds = %95, %93
br label %124
98: ; preds = %77, %73
%99 = load i32, i32* %4
%100 = load i32, i32* %2
%101 = icmp sgt i32 %99, %100
br i1 %101, label %102, label %123
102: ; preds = %98
%103 = load i32, i32* %4
%104 = load i32, i32* %3
%105 = icmp sgt i32 %103, %104
br i1 %105, label %106, label %123
106: ; preds = %102
%107 = load i32, i32* %4
%108 = load i32, i32* %4
%109 = mul nsw i32 %107, %108
%110 = load i32, i32* %2
%111 = load i32, i32* %2
%112 = mul nsw i32 %110, %111
%113 = load i32, i32* %3
%114 = load i32, i32* %3
%115 = mul nsw i32 %113, %114
%116 = add nsw i32 %112, %115
%117 = icmp eq i32 %109, %116
br i1 %117, label %118, label %120
118: ; preds = %106
%119 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %122
120: ; preds = %106
%121 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %122
122: ; preds = %120, %118
br label %123
123: ; preds = %122, %102, %98
br label %124
124: ; preds = %123, %97
br label %125
125: ; preds = %124, %72
br label %126
126: ; preds = %125, %46
br label %127
127: ; preds = %126, %32
br label %128
128: ; preds = %127, %18
%129 = load i32, i32* %1
ret i32 %129
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%d%d%d\00"
@str = [34 x i8] c"Enter values of sides of triangle\00"
@str.13 = [17 x i8] c"Scalene triangle\00"
@str.14 = [19 x i8] c"Isosceles triangle\00"
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 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 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), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %9, %10
br i1 %11, label %18, label %12
12: ; preds = %0
%13 = load i32, i32* %3
%14 = icmp eq i32 %10, %13
%15 = icmp eq i32 %9, %13
%16 = select i1 %14, i1 true, i1 %15
%17 = select i1 %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.14, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.13, i64 0, i64 0)
br label %18
18: ; preds = %12, %0
%19 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.14, i64 0, i64 0), %0 ], [ %17, %12 ]
%20 = call i32 @puts(i8* dereferenceable(1) %19)
ret i32 0
}