#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, int, int);
int main(void) {
  int side1, side2, hypotenuse = 0;
  for (side1 = 1; side1 < 500; side1++) {
    for (side2 = 1; side2 < 500; side2++) {
      for (hypotenuse = 1; hypotenuse < 500; hypotenuse++) {
        if ((hypotenuse * hypotenuse) == (side1 * side1) + (side2 * side2)) {
          printf("side1 is :%4d, side2 is : %4d, hypotenuse is : %4d\n", side1,
                 side2, hypotenuse);
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1f4,-0x8(%rbp)
jge    11cf <main+0xbf>
movl   $0x1,-0xc(%rbp)
cmpl   $0x1f4,-0xc(%rbp)
jge    11bc <main+0xac>
movl   $0x1,-0x10(%rbp)
cmpl   $0x1f4,-0x10(%rbp)
jge    11a9 <main+0x99>
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    1196 <main+0x86>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x8b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <main+0x45>
jmp    11ae <main+0x9e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <main+0x31>
jmp    11c1 <main+0xb1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%r15d
lea    0xed8(%rip),%r14
jmp    113d <main+0x2d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    $0x1f4,%r15d
je     1196 <main+0x86>
mov    %r15d,%r12d
imul   %r15d,%r12d
mov    $0x1,%r13d
jmp    115d <main+0x4d>
nopl   0x0(%rax)
add    $0x1,%r13d
cmp    $0x1f4,%r13d
je     1130 <main+0x20>
mov    %r13d,%ebp
imul   %r13d,%ebp
add    %r12d,%ebp
mov    $0x1,%ebx
jmp    117b <main+0x6b>
xchg   %ax,%ax
add    $0x1,%ebx
cmp    $0x1f4,%ebx
je     1150 <main+0x40>
mov    %ebx,%eax
imul   %ebx,%eax
cmp    %ebp,%eax
jne    1170 <main+0x60>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
jmp    1170 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [52 x i8] c"side1 is :%4d, side2 is : %4d, hypotenuse is : %4d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %20
%2 = phi i32 [ 1, %0 ], [ %21, %20 ]
%3 = mul nsw i32 %2, %2
br label %4
4: ; preds = %1, %17
%5 = phi i32 [ 1, %1 ], [ %18, %17 ]
%6 = mul nsw i32 %5, %5
%7 = add nuw nsw i32 %6, %3
br label %8
8: ; preds = %4, %14
%9 = phi i32 [ 1, %4 ], [ %15, %14 ]
%10 = mul nuw nsw i32 %9, %9
%11 = icmp eq i32 %10, %7
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %5, i32 %9)
br label %14
14: ; preds = %8, %12
%15 = add nuw nsw i32 %9, 1
%16 = icmp eq i32 %15, 500
br i1 %16, label %17, label %8
17: ; preds = %14
%18 = add nuw nsw i32 %5, 1
%19 = icmp eq i32 %18, 500
br i1 %19, label %20, label %4
20: ; preds = %17
%21 = add nuw nsw i32 %2, 1
%22 = icmp eq i32 %21, 500
br i1 %22, label %23, label %1
23: ; preds = %20
ret i32 0
}