#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 main(int argc, char *argv[]) {
  int a, b, c, found;
  for (a = 1; a < 1000 / 3; a++) {
    for (b = 1; b < 1000 / 2; b++) {
      c = 1000 - a - b;
      if (a * a + b * b == c * c) {
        found = 1;
        break;
      }
    }
    if (found)
      break;
  }
  printf("The product is: %d\n", a * b * c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x14d,-0x14(%rbp)
jge    11bc <main+0xac>
movl   $0x1,-0x18(%rbp)
cmpl   $0x1f4,-0x18(%rbp)
jge    119a <main+0x8a>
mov    $0x3e8,%eax
sub    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
mov    -0x1c(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jne    1187 <main+0x77>
movl   $0x1,-0x20(%rbp)
jmp    119a <main+0x8a>
jmp    118c <main+0x7c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1141 <main+0x31>
cmpl   $0x0,-0x20(%rbp)
je     11a9 <main+0x99>
jmp    11bc <main+0xac>
jmp    11ae <main+0x9e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x14(%rbp),%esi
imul   -0x18(%rbp),%esi
imul   -0x1c(%rbp),%esi
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3d090,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"The product is: %d\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 1, i32* %6
br label %10
10: ; preds = %43, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 333
br i1 %12, label %13, label %46
13: ; preds = %10
store i32 1, i32* %7
br label %14
14: ; preds = %35, %13
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 500
br i1 %16, label %17, label %38
17: ; preds = %14
%18 = load i32, i32* %6
%19 = sub nsw i32 1000, %18
%20 = load i32, i32* %7
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %8
%22 = load i32, i32* %6
%23 = load i32, i32* %6
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %7
%26 = load i32, i32* %7
%27 = mul nsw i32 %25, %26
%28 = add nsw i32 %24, %27
%29 = load i32, i32* %8
%30 = load i32, i32* %8
%31 = mul nsw i32 %29, %30
%32 = icmp eq i32 %28, %31
br i1 %32, label %33, label %34
33: ; preds = %17
store i32 1, i32* %9
br label %38
34: ; preds = %17
br label %35
35: ; preds = %34
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %14
38: ; preds = %33, %14
%39 = load i32, i32* %9
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %38
br label %46
42: ; preds = %38
br label %43
43: ; preds = %42
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %10
46: ; preds = %41, %10
%47 = load i32, i32* %6
%48 = load i32, i32* %7
%49 = mul nsw i32 %47, %48
%50 = load i32, i32* %8
%51 = mul nsw i32 %49, %50
%52 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %51)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"The product is: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 250000)
ret i32 0
}