#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 main() {
  int a, b, c;
  printf("This program needs 3 sides of a triangle and detect if this triangle "
         "is Orthorhombic or not\n\n");
  printf("Please enter the 1st side: ");
  scanf("%d", &a);
  printf("Please enter the 2nd side: ");
  scanf("%d", &b);
  printf("Please enter the 3rd side: ");
  scanf("%d", &c);
  if ((a * a) + (b * b) == (c * c))
    printf("\nYes,Wooollllaaaa\n");
  else
    printf("\nNo,Not a good choise\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    0xf1c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf1f(%rip),%rdi
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf1f(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jne    11bf <main+0x9f>
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
jmp    11cb <main+0xab>
lea    0xf02(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
imul   %eax,%eax
mov    0x8(%rsp),%ecx
imul   %ecx,%ecx
add    %eax,%ecx
mov    0x4(%rsp),%eax
imul   %eax,%eax
cmp    %eax,%ecx
lea    0xf17(%rip),%rax
lea    0xefa(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [94 x i8] c"This program needs 3 sides of a triangle and detect if this triangle is Orthorhombic or not\0A\0A\00"
@.str.1 = [28 x i8] c"Please enter the 1st side: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [28 x i8] c"Please enter the 2nd side: \00"
@.str.4 = [28 x i8] c"Please enter the 3rd side: \00"
@.str.5 = [19 x i8] c"\0AYes,Wooollllaaaa\0A\00"
@.str.6 = [23 x i8] c"\0ANo,Not a good choise\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 ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = mul nsw i32 %15, %16
%18 = add nsw i32 %14, %17
%19 = load i32, i32* %4
%20 = load i32, i32* %4
%21 = mul nsw i32 %19, %20
%22 = icmp eq i32 %18, %21
br i1 %22, label %23, label %25
23: ; preds = %0
%24 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
br label %27
25: ; preds = %0
%26 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Please enter the 1st side: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [28 x i8] c"Please enter the 2nd side: \00"
@.str.4 = [28 x i8] c"Please enter the 3rd side: \00"
@str = [93 x i8] c"This program needs 3 sides of a triangle and detect if this triangle is Orthorhombic or not\0A\00"
@str.7 = [22 x i8] c"\0ANo,Not a good choise\00"
@str.8 = [18 x i8] c"\0AYes,Wooollllaaaa\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 ([93 x i8], [93 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %1
%15 = mul nsw i32 %14, %14
%16 = load i32, i32* %2
%17 = mul nsw i32 %16, %16
%18 = add nuw nsw i32 %17, %15
%19 = load i32, i32* %3
%20 = mul nsw i32 %19, %19
%21 = icmp eq i32 %18, %20
%22 = select i1 %21, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.7, i64 0, i64 0)
%23 = call i32 @puts(i8* dereferenceable(1) %22)
ret i32 0
}