#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 *, unsigned int, ...);
int main(int argc, char *argv[]) {
  unsigned prod = 0;
  for (int i = 1; i <= 333; i++) {
    for (int j = i; j <= 666; j++) {
      int k = 1000 - i - j;
      if (pow(i, 2) + pow(j, 2) == pow(k, 2)) {
        printf("The numbers are: %d %d and %d\n", i, j, k);
        prod = (unsigned)i * j * k;
      }
    }
  }
  printf("Product: %u\n", prod);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x14d,-0x18(%rbp)
jg     1206 <main+0xe6>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x29a,-0x1c(%rbp)
jg     11f3 <main+0xd3>
mov    $0x3e8,%eax
sub    -0x18(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jne    11e0 <main+0xc0>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11e5 <main+0xc5>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1157 <main+0x37>
jmp    11f8 <main+0xd8>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1144 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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
mov    $0x3e6,%ebx
mov    $0x3,%eax
mov    $0x1,%r15d
mov    $0x1,%r12d
movl   $0x0,0x8(%rsp)
jmp    1177 <main+0x57>
xchg   %ax,%ax
add    $0x1,%r12d
mov    0x14(%rsp),%ebx
add    $0xfffffffe,%ebx
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%r15d
add    %eax,%r15d
add    $0x2,%eax
cmp    $0x14e,%r12d
je     11f5 <main+0xd5>
mov    %eax,0x10(%rsp)
mov    %r15d,0xc(%rsp)
mov    %ebx,0x14(%rsp)
mov    %r12d,%ebp
jmp    11a1 <main+0x81>
nopl   0x0(%rax)
add    $0x1,%ebp
add    $0xffffffff,%ebx
add    %r12d,%r15d
cmp    $0x29b,%ebp
je     1150 <main+0x30>
mov    %r12d,%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    %r13,%r14
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
cmp    %rax,%r14
jne    1190 <main+0x70>
lea    0xe25(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15d,%eax
imul   %ebx,%eax
mov    %eax,0x8(%rsp)
jmp    1190 <main+0x70>
lea    0xe23(%rip),%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
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 = [31 x i8] c"The numbers are: %d %d and %d\0A\00"
@.str.1 = [13 x i8] c"Product: %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
br label %10
10: ; preds = %46, %2
%11 = load i32, i32* %7
%12 = icmp sle i32 %11, 333
br i1 %12, label %13, label %49
13: ; preds = %10
%14 = load i32, i32* %7
store i32 %14, i32* %8
br label %15
15: ; preds = %42, %13
%16 = load i32, i32* %8
%17 = icmp sle i32 %16, 666
br i1 %17, label %18, label %45
18: ; preds = %15
%19 = load i32, i32* %7
%20 = sub nsw i32 1000, %19
%21 = load i32, i32* %8
%22 = sub nsw i32 %20, %21
store i32 %22, i32* %9
%23 = load i32, i32* %7
%24 = call i64 @pow(i32 %23, i32 2)
%25 = load i32, i32* %8
%26 = call i64 @pow(i32 %25, i32 2)
%27 = add nsw i64 %24, %26
%28 = load i32, i32* %9
%29 = call i64 @pow(i32 %28, i32 2)
%30 = icmp eq i64 %27, %29
br i1 %30, label %31, label %41
31: ; preds = %18
%32 = load i32, i32* %7
%33 = load i32, i32* %8
%34 = load i32, i32* %9
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %33, i32 %34)
%36 = load i32, i32* %7
%37 = load i32, i32* %8
%38 = mul i32 %36, %37
%39 = load i32, i32* %9
%40 = mul i32 %38, %39
store i32 %40, i32* %6
br label %41
41: ; preds = %31, %18
br label %42
42: ; preds = %41
%43 = load i32, i32* %8
%44 = add nsw i32 %43, 1
store i32 %44, i32* %8
br label %15
45: ; preds = %15
br label %46
46: ; preds = %45
%47 = load i32, i32* %7
%48 = add nsw i32 %47, 1
store i32 %48, i32* %7
br label %10
49: ; preds = %10
%50 = load i32, i32* %6
%51 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %50)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"The numbers are: %d %d and %d\0A\00"
@.str.1 = [13 x i8] c"Product: %u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i32 [ 1, %2 ], [ %9, %8 ]
%5 = phi i32 [ 0, %2 ], [ %26, %8 ]
br label %11
6: ; preds = %8
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %26)
ret i32 0
8: ; preds = %25
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, 334
br i1 %10, label %6, label %3
11: ; preds = %3, %25
%12 = phi i32 [ %4, %3 ], [ %27, %25 ]
%13 = phi i32 [ %5, %3 ], [ %26, %25 ]
%14 = add nuw nsw i32 %4, %12
%15 = sub nsw i32 1000, %14
%16 = tail call i64 @pow(i32 %4, i32 2)
%17 = tail call i64 @pow(i32 %12, i32 2)
%18 = add nsw i64 %17, %16
%19 = tail call i64 @pow(i32 %15, i32 2)
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %11
%22 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %12, i32 %15)
%23 = mul i32 %12, %4
%24 = mul i32 %23, %15
br label %25
25: ; preds = %21, %11
%26 = phi i32 [ %24, %21 ], [ %13, %11 ]
%27 = add nuw nsw i32 %12, 1
%28 = icmp eq i32 %27, 667
br i1 %28, label %8, label %11
}