#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__ pow(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, b, c;
  for (a = 1; a < 333; a++) {
    for (b = a + 1; b < 500; b++) {
      c = 1000 - a - b;
      if ((int)pow(a, 2) + (int)pow(b, 2) == (int)pow(c, 2)) {
        goto Find;
      }
    }
  }
Find:
  printf("%d\n", a * b * c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x14d,-0x8(%rbp)
jge    11d5 <main+0xb5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1f4,-0xc(%rbp)
jge    11c2 <main+0xa2>
mov    $0x3e8,%eax
sub    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%rcx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jne    11af <main+0x8f>
jmp    11da <main+0xba>
jmp    11b4 <main+0x94>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <main+0x2c>
jmp    11c7 <main+0xa7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
jmp    11da <main+0xba>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
imul   -0x10(%rbp),%esi
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x1,%r13d
mov    $0x3e5,%r15d
movl   $0x3e4,0x4(%rsp)
movl   $0x3e8,(%rsp)
lea    0x1(%r13),%ebp
mov    %r15d,%r12d
mov    %ebp,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13d,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%r14
mov    %ebp,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%rbx
add    %r14d,%ebx
mov    %r12d,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
cmp    %eax,%ebx
je     1246 <main+0x126>
add    $0x1,%ebp
add    $0xffffffff,%r12d
cmp    $0x1f4,%ebp
jne    1160 <main+0x40>
mov    %r15d,0xc(%rsp)
add    $0x2,%r13d
mov    (%rsp),%eax
mov    %eax,%r15d
mov    0x4(%rsp),%ebx
mov    %r13,0x10(%rsp)
mov    %r13d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x5(%r15),%r12d
mov    0x8(%rsp),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%r13
mov    %ebp,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%r14
add    %r13d,%r14d
mov    %r12d,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
cmp    %eax,%r14d
je     124b <main+0x12b>
add    $0x1,%ebp
add    $0xffffffff,%ebx
add    $0xffffffff,%r15d
cmp    $0x1f4,%ebp
jne    11d0 <main+0xb0>
mov    0xc(%rsp),%r15d
add    $0xfffffffc,%r15d
addl   $0xfffffffc,0x4(%rsp)
addl   $0xfffffffc,(%rsp)
mov    0x10(%rsp),%r13
cmp    $0x14d,%r13d
jne    1149 <main+0x29>
mov    $0x28a64,%eax
jmp    1255 <main+0x135>
mov    %r13d,%eax
jmp    124f <main+0x12f>
mov    0x8(%rsp),%eax
imul   %ebp,%eax
mov    %r12d,%ebx
imul   %eax,%ebx
lea    0xda1(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %20
1: ; preds = %35
%2 = add nuw nsw i32 %21, 2
br label %3
3: ; preds = %15, %1
%4 = phi i32 [ %2, %1 ], [ %16, %15 ]
%5 = add nuw nsw i32 %22, %4
%6 = sub nsw i32 1000, %5
%7 = tail call i64 @pow(i32 %22, i32 2)
%8 = trunc i64 %7 to i32
%9 = tail call i64 @pow(i32 %4, i32 2)
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %10, %8
%12 = tail call i64 @pow(i32 %6, i32 2)
%13 = trunc i64 %12 to i32
%14 = icmp eq i32 %11, %13
br i1 %14, label %38, label %15
15: ; preds = %3
%16 = add nuw nsw i32 %4, 1
%17 = icmp eq i32 %16, 500
br i1 %17, label %18, label %3
18: ; preds = %15
%19 = icmp eq i32 %2, 333
br i1 %19, label %43, label %20
20: ; preds = %18, %0
%21 = phi i32 [ 1, %0 ], [ %2, %18 ]
%22 = add nuw nsw i32 %21, 1
br label %23
23: ; preds = %20, %35
%24 = phi i32 [ %22, %20 ], [ %36, %35 ]
%25 = add nuw nsw i32 %21, %24
%26 = sub nsw i32 1000, %25
%27 = tail call i64 @pow(i32 %21, i32 2)
%28 = trunc i64 %27 to i32
%29 = tail call i64 @pow(i32 %24, i32 2)
%30 = trunc i64 %29 to i32
%31 = add nsw i32 %30, %28
%32 = tail call i64 @pow(i32 %26, i32 2)
%33 = trunc i64 %32 to i32
%34 = icmp eq i32 %31, %33
br i1 %34, label %38, label %35
35: ; preds = %23
%36 = add nuw nsw i32 %24, 1
%37 = icmp eq i32 %36, 500
br i1 %37, label %1, label %23
38: ; preds = %3, %23
%39 = phi i32 [ %21, %23 ], [ %22, %3 ]
%40 = phi i32 [ %24, %23 ], [ %4, %3 ]
%41 = phi i32 [ %26, %23 ], [ %6, %3 ]
%42 = mul nsw i32 %40, %39
br label %43
43: ; preds = %18, %38
%44 = phi i32 [ %41, %38 ], [ %6, %18 ]
%45 = phi i32 [ %42, %38 ], [ 166500, %18 ]
%46 = mul nsw i32 %45, %44
%47 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %46)
ret i32 0
}