#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 */
scalar_t__ EOF;
int /*<<< orphan*/ buble_sort(long *, long);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, long *, long *, long *);
int main() {
  long int ara[3], n = 3;
  while (scanf("%ld %ld %ld", &ara[0], &ara[1], &ara[2]) != EOF) {
    buble_sort(ara, n);
    if (ara[0] == 0 || ara[1] == 0 || ara[2] == 0)
      continue;
    else if ((ara[0] * ara[0]) + (ara[1] * ara[1]) == (ara[2] * ara[2]))
      printf("right\n");
    else
      printf("wrong\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x3,-0x28(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
add    $0x8,%rdx
lea    -0x20(%rbp),%rcx
add    $0x10,%rcx
lea    0xe9e(%rip),%rdi
call   1050 <scanf@plt>
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%rax
je     11f8 <main+0xc8>
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <buble_sort@plt>
cmpq   $0x0,-0x20(%rbp)
je     11a5 <main+0x75>
cmpq   $0x0,-0x18(%rbp)
je     11a5 <main+0x75>
cmpq   $0x0,-0x10(%rbp)
jne    11aa <main+0x7a>
jmp    1147 <main+0x17>
mov    -0x20(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
imul   -0x18(%rbp),%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
imul   -0x10(%rbp),%rcx
cmp    %rcx,%rax
jne    11e2 <main+0xb2>
lea    0xe34(%rip),%rdi
call   1040 <printf@plt>
jmp    11ee <main+0xbe>
lea    0xe2a(%rip),%rdi
call   1040 <printf@plt>
jmp    11f3 <main+0xc3>
jmp    1147 <main+0x17>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x8(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xeb1(%rip),%rdi
mov    %rsp,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1050 <scanf@plt>
mov    0x2e84(%rip),%r13
cmp    0x0(%r13),%rax
jne    117b <main+0x4b>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%rbx
lea    0xe7b(%rip),%r12
lea    0xe86(%rip),%rbp
jmp    11ac <main+0x7c>
xchg   %ax,%ax
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1050 <scanf@plt>
cmp    0x0(%r13),%rax
je     116a <main+0x3a>
mov    $0x3,%esi
mov    %rbx,%rdi
call   1030 <buble_sort@plt>
mov    (%rsp),%rax
test   %rax,%rax
je     1195 <main+0x65>
mov    0x8(%rsp),%rcx
test   %rcx,%rcx
je     1195 <main+0x65>
mov    0x10(%rsp),%rdx
test   %rdx,%rdx
je     1195 <main+0x65>
imul   %rax,%rax
imul   %rcx,%rcx
add    %rax,%rcx
imul   %rdx,%rdx
mov    %rbp,%rdi
cmp    %rdx,%rcx
je     1190 <main+0x60>
lea    0xe18(%rip),%rdi
jmp    1190 <main+0x60>

LLVM IR (-O0):
@.str = [12 x i8] c"%ld %ld %ld\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"right\0A\00"
@.str.2 = [7 x i8] c"wrong\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i64]
%3 = alloca i64
store i32 0, i32* %1
store i64 3, i64* %3
br label %4
4: ; preds = %50, %26, %0
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 1
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 2
%8 = call i64 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64* %5, i64* %6, i64* %7)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %51
11: ; preds = %4
%12 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
%13 = load i64, i64* %3
%14 = call i32 @buble_sort(i64* %12, i64 %13)
%15 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
%16 = load i64, i64* %15
%17 = icmp eq i64 %16, 0
br i1 %17, label %26, label %18
18: ; preds = %11
%19 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 1
%20 = load i64, i64* %19
%21 = icmp eq i64 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %18
%23 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 2
%24 = load i64, i64* %23
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %22, %18, %11
br label %4
27: ; preds = %22
%28 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
%29 = load i64, i64* %28
%30 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
%31 = load i64, i64* %30
%32 = mul nsw i64 %29, %31
%33 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 1
%34 = load i64, i64* %33
%35 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 1
%36 = load i64, i64* %35
%37 = mul nsw i64 %34, %36
%38 = add nsw i64 %32, %37
%39 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 2
%40 = load i64, i64* %39
%41 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 2
%42 = load i64, i64* %41
%43 = mul nsw i64 %40, %42
%44 = icmp eq i64 %38, %43
br i1 %44, label %45, label %47
45: ; preds = %27
%46 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %49
47: ; preds = %27
%48 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %49
49: ; preds = %47, %45
br label %50
50: ; preds = %49
br label %4
51: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%ld %ld %ld\00"
@EOF = global i64 0
@str = [6 x i8] c"wrong\00"
@str.3 = [6 x i8] c"right\00"
define i32 @main() {
%1 = alloca [3 x i64]
%2 = bitcast [3 x i64]* %1 to i8*
%3 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%6 = call i64 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64* %3, i64* %4, i64* %5)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %31, label %9
9: ; preds = %0, %27
%10 = call i32 @buble_sort(i64* %3, i64 3)
%11 = load i64, i64* %3
%12 = icmp eq i64 %11, 0
%13 = load i64, i64* %4
%14 = icmp eq i64 %13, 0
%15 = select i1 %12, i1 true, i1 %14
%16 = load i64, i64* %5
%17 = icmp eq i64 %16, 0
%18 = select i1 %15, i1 true, i1 %17
br i1 %18, label %27, label %19
19: ; preds = %9
%20 = mul nsw i64 %11, %11
%21 = mul nsw i64 %13, %13
%22 = add nuw nsw i64 %21, %20
%23 = mul nsw i64 %16, %16
%24 = icmp eq i64 %22, %23
%25 = select i1 %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%26 = call i32 @puts(i8* dereferenceable(1) %25)
br label %27
27: ; preds = %19, %9
%28 = call i64 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64* %3, i64* %4, i64* %5)
%29 = load i64, i64* @EOF
%30 = icmp eq i64 %28, %29
br i1 %30, label %31, label %9
31: ; preds = %27, %0
ret i32 0
}