#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 sqrt(int);
int main(void) {
  int first, second, third = 0;
  printf("Enter the first integer  value:");
  scanf("%d", &first);
  printf("Enter the second integer value:");
  scanf("%d", &second);
  printf("Enter the third integer  value:");
  scanf("%d", &third);
  int hypotenuse = first;
  int medium = second;
  int minimum = third;
  if (second > first) {
    hypotenuse = second;
    minimum = first;
    if (third > hypotenuse) {
      hypotenuse = third;
    } else if (third < hypotenuse) {
      medium = third;
    }
  } else if (second < first) {
    if (third > hypotenuse) {
      hypotenuse = third;
      minimum = second;
      medium = first;
    } else if (second < third) {
      minimum = second;
      medium = third;
    }
  } else if (second == first) {
    if (third > first) {
      minimum = hypotenuse;
      hypotenuse = third;
      medium = first;
    }
  }
  printf("=====================================\n");
  if (sqrt(medium * medium + minimum * minimum) == hypotenuse) {
    printf("The triangle is right one ");
  } else {
    printf("The triangle is not right");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11f7 <main+0xc7>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11db <main+0xab>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11f2 <main+0xc2>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ed <main+0xbd>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11f2 <main+0xc2>
jmp    1281 <main+0x151>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1248 <main+0x118>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1226 <main+0xf6>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1243 <main+0x113>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    123e <main+0x10e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1243 <main+0x113>
jmp    127c <main+0x14c>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1277 <main+0x147>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1272 <main+0x142>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1277 <main+0x147>
jmp    127c <main+0x14c>
jmp    1281 <main+0x151>
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%edi
imul   -0x18(%rbp),%edi
mov    -0x1c(%rbp),%eax
imul   -0x1c(%rbp),%eax
add    %eax,%edi
call   1050 <sqrt@plt>
cmp    -0x14(%rbp),%eax
jne    12bc <main+0x18c>
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
jmp    12c8 <main+0x198>
lea    0xde2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%eax
cmp    %ebx,%ecx
jle    11bd <main+0x7d>
cmp    %ecx,%eax
jle    11cc <main+0x8c>
mov    %eax,%r14d
mov    %ecx,%ebp
jmp    11f9 <main+0xb9>
jge    11d6 <main+0x96>
cmp    %ebx,%eax
jle    11e3 <main+0xa3>
mov    %eax,%r14d
mov    %ebx,%ebp
mov    %ecx,%ebx
jmp    11f9 <main+0xb9>
cmovge %ecx,%eax
mov    %ecx,%r14d
mov    %eax,%ebp
jmp    11f9 <main+0xb9>
jne    11f2 <main+0xb2>
cmp    %ebx,%eax
jle    11f2 <main+0xb2>
mov    %eax,%r14d
mov    %ebx,%ebp
jmp    11f9 <main+0xb9>
cmp    %eax,%ecx
mov    %ecx,%ebp
cmovl  %eax,%ebp
cmovl  %ecx,%eax
mov    %ebx,%r14d
jmp    11f7 <main+0xb7>
mov    %ebx,%r14d
mov    %ecx,%ebp
mov    %eax,%ebx
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
imul   %ebp,%ebp
imul   %ebx,%ebx
add    %ebp,%ebx
mov    %ebx,%edi
call   1060 <sqrt@plt>
cmp    %r14d,%eax
lea    0xe45(%rip),%rax
lea    0xe59(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter the first integer value:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"Enter the second integer value:\00"
@.str.3 = [32 x i8] c"Enter the third integer value:\00"
@.str.4 = [39 x i8] c"=====================================\0A\00"
@.str.5 = [27 x i8] c"The triangle is right one \00"
@.str.6 = [26 x i8] c"The triangle is not right\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%14 = load i32, i32* %2
store i32 %14, i32* %5
%15 = load i32, i32* %3
store i32 %15, i32* %6
%16 = load i32, i32* %4
store i32 %16, i32* %7
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %36
20: ; preds = %0
%21 = load i32, i32* %3
store i32 %21, i32* %5
%22 = load i32, i32* %2
store i32 %22, i32* %7
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = icmp sgt i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = load i32, i32* %4
store i32 %27, i32* %5
br label %35
28: ; preds = %20
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = load i32, i32* %4
store i32 %33, i32* %6
br label %34
34: ; preds = %32, %28
br label %35
35: ; preds = %34, %26
br label %72
36: ; preds = %0
%37 = load i32, i32* %3
%38 = load i32, i32* %2
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %57
40: ; preds = %36
%41 = load i32, i32* %4
%42 = load i32, i32* %5
%43 = icmp sgt i32 %41, %42
br i1 %43, label %44, label %48
44: ; preds = %40
%45 = load i32, i32* %4
store i32 %45, i32* %5
%46 = load i32, i32* %3
store i32 %46, i32* %7
%47 = load i32, i32* %2
store i32 %47, i32* %6
br label %56
48: ; preds = %40
%49 = load i32, i32* %3
%50 = load i32, i32* %4
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i32, i32* %3
store i32 %53, i32* %7
%54 = load i32, i32* %4
store i32 %54, i32* %6
br label %55
55: ; preds = %52, %48
br label %56
56: ; preds = %55, %44
br label %71
57: ; preds = %36
%58 = load i32, i32* %3
%59 = load i32, i32* %2
%60 = icmp eq i32 %58, %59
br i1 %60, label %61, label %70
61: ; preds = %57
%62 = load i32, i32* %4
%63 = load i32, i32* %2
%64 = icmp sgt i32 %62, %63
br i1 %64, label %65, label %69
65: ; preds = %61
%66 = load i32, i32* %5
store i32 %66, i32* %7
%67 = load i32, i32* %4
store i32 %67, i32* %5
%68 = load i32, i32* %2
store i32 %68, i32* %6
br label %69
69: ; preds = %65, %61
br label %70
70: ; preds = %69, %57
br label %71
71: ; preds = %70, %56
br label %72
72: ; preds = %71, %35
%73 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%74 = load i32, i32* %6
%75 = load i32, i32* %6
%76 = mul nsw i32 %74, %75
%77 = load i32, i32* %7
%78 = load i32, i32* %7
%79 = mul nsw i32 %77, %78
%80 = add nsw i32 %76, %79
%81 = call i32 @sqrt(i32 %80)
%82 = load i32, i32* %5
%83 = icmp eq i32 %81, %82
br i1 %83, label %84, label %86
84: ; preds = %72
%85 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %88
86: ; preds = %72
%87 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
br label %88
88: ; preds = %86, %84
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter the first integer value:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"Enter the second integer value:\00"
@.str.3 = [32 x i8] c"Enter the third integer value:\00"
@.str.5 = [27 x i8] c"The triangle is right one \00"
@.str.6 = [26 x i8] c"The triangle is not right\00"
@str = [38 x i8] c"=====================================\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*
store i32 0, i32* %3
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 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), i32* %1)
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 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), i32* %2)
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 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), i32* %3)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = icmp sgt i32 %14, %13
br i1 %16, label %17, label %22
17: ; preds = %0
%18 = icmp sgt i32 %15, %14
br i1 %18, label %35, label %19
19: ; preds = %17
%20 = icmp slt i32 %15, %14
%21 = select i1 %20, i32 %15, i32 %14
br label %35
22: ; preds = %0
%23 = icmp slt i32 %14, %13
br i1 %23, label %24, label %30
24: ; preds = %22
%25 = icmp sgt i32 %15, %13
br i1 %25, label %35, label %26
26: ; preds = %24
%27 = icmp slt i32 %14, %15
%28 = select i1 %27, i32 %15, i32 %14
%29 = select i1 %27, i32 %14, i32 %15
br label %35
30: ; preds = %22
%31 = icmp eq i32 %14, %13
%32 = icmp sgt i32 %15, %13
%33 = select i1 %31, i1 %32, i1 false
br i1 %33, label %34, label %35
34: ; preds = %30
br label %35
35: ; preds = %26, %19, %24, %17, %34, %30
%36 = phi i32 [ %15, %34 ], [ %13, %30 ], [ %15, %17 ], [ %14, %19 ], [ %15, %24 ], [ %13, %26 ]
%37 = phi i32 [ %13, %34 ], [ %14, %30 ], [ %14, %17 ], [ %21, %19 ], [ %13, %24 ], [ %28, %26 ]
%38 = phi i32 [ %13, %34 ], [ %15, %30 ], [ %13, %17 ], [ %13, %19 ], [ %14, %24 ], [ %29, %26 ]
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%40 = mul nsw i32 %37, %37
%41 = mul nsw i32 %38, %38
%42 = add nuw nsw i32 %41, %40
%43 = call i32 @sqrt(i32 %42)
%44 = icmp eq i32 %43, %36
%45 = select i1 %44, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0)
%46 = call i32 @printf(i8* dereferenceable(1) %45)
ret i32 0
}