#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 *, unsigned long long);
unsigned int sqrt(double);
int main() {
  unsigned long long res = -1;
  for (unsigned a = 1; a < 1000 / 2; a++) {
    for (unsigned b = a + 1; b < 1000 / 2; b++) {
      unsigned c = sqrt((double)a * a + (double)b * b);
      if (c * c == a * a + b * b && a + b + c == 1000) {
        res = a * b * c;
        goto end;
      }
    }
  }
end:
  printf("If you can trust me, the number you "
         "are looking for is %llu\n",
         res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
movl   $0x1,-0x14(%rbp)
cmpl   $0x1f4,-0x14(%rbp)
jae    11fa <main+0xda>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1f4,-0x18(%rbp)
jae    11e7 <main+0xc7>
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm0
movaps %xmm0,%xmm2
mov    -0x18(%rbp),%eax
cvtsi2sd %rax,%xmm1
movaps %xmm1,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
imul   -0x18(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
jne    11d4 <main+0xb4>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
cmp    $0x3e8,%eax
jne    11d4 <main+0xb4>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    11ff <main+0xdf>
jmp    11d9 <main+0xb9>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1154 <main+0x34>
jmp    11ec <main+0xcc>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main+0x1e>
jmp    11ff <main+0xdf>
mov    -0x10(%rbp),%rsi
lea    0xdf6(%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,%eax
mov    $0x4,%r13d
movl   $0x2,0x8(%rsp)
movl   $0x3e5,0x4(%rsp)
jmp    116d <main+0x4d>
nopl   0x0(%rax,%rax,1)
add    %r13d,0x8(%rsp)
add    $0x2,%r13d
addl   $0xfffffffe,0x4(%rsp)
mov    0xc(%rsp),%eax
cmp    $0x1f4,%eax
je     1220 <main+0x100>
mov    %eax,%ebp
lea    0x1(%rbp),%eax
mov    %eax,0xc(%rsp)
cmp    $0x1f2,%ebp
ja     1150 <main+0x30>
mov    %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %ebp,%r12d
imul   %ebp,%r12d
mov    0x4(%rsp),%r15d
mov    0x8(%rsp),%eax
mov    %eax,%ebx
mov    0xc(%rsp),%r14d
jmp    11c3 <main+0xa3>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
add    %ebp,%ebx
add    $0xffffffff,%r15d
cmp    $0x1f4,%r14d
je     1150 <main+0x30>
mov    %r14d,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
mov    %eax,%ecx
imul   %eax,%ecx
mov    %r14d,%edx
imul   %r14d,%edx
add    %r12d,%edx
cmp    %edx,%ecx
jne    11b0 <main+0x90>
cmp    %r15d,%eax
jne    11b0 <main+0x90>
imul   %eax,%ebx
lea    0xdf9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffffffffffff,%rbx
jmp    1200 <main+0xe0>

LLVM IR (-O0):
@.str = [61 x i8] c"If you can trust me, the number you are looking for is %llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i64 -1, i64* %2
store i32 1, i32* %3
br label %6
6: ; preds = %57, %0
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, 500
br i1 %8, label %9, label %60
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add i32 %10, 1
store i32 %11, i32* %4
br label %12
12: ; preds = %53, %9
%13 = load i32, i32* %4
%14 = icmp ult i32 %13, 500
br i1 %14, label %15, label %56
15: ; preds = %12
%16 = load i32, i32* %3
%17 = uitofp i32 %16 to double
%18 = load i32, i32* %3
%19 = uitofp i32 %18 to double
%20 = load i32, i32* %4
%21 = uitofp i32 %20 to double
%22 = load i32, i32* %4
%23 = uitofp i32 %22 to double
%24 = fmul double %21, %23
%25 = call double @llvm.fmuladd.f64(double %17, double %19, double %24)
%26 = call i32 @sqrt(double %25)
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = load i32, i32* %5
%29 = mul i32 %27, %28
%30 = load i32, i32* %3
%31 = load i32, i32* %3
%32 = mul i32 %30, %31
%33 = load i32, i32* %4
%34 = load i32, i32* %4
%35 = mul i32 %33, %34
%36 = add i32 %32, %35
%37 = icmp eq i32 %29, %36
br i1 %37, label %38, label %52
38: ; preds = %15
%39 = load i32, i32* %3
%40 = load i32, i32* %4
%41 = add i32 %39, %40
%42 = load i32, i32* %5
%43 = add i32 %41, %42
%44 = icmp eq i32 %43, 1000
br i1 %44, label %45, label %52
45: ; preds = %38
%46 = load i32, i32* %3
%47 = load i32, i32* %4
%48 = mul i32 %46, %47
%49 = load i32, i32* %5
%50 = mul i32 %48, %49
%51 = zext i32 %50 to i64
store i64 %51, i64* %2
br label %61
52: ; preds = %38, %15
br label %53
53: ; preds = %52
%54 = load i32, i32* %4
%55 = add i32 %54, 1
store i32 %55, i32* %4
br label %12
56: ; preds = %12
br label %57
57: ; preds = %56
%58 = load i32, i32* %3
%59 = add i32 %58, 1
store i32 %59, i32* %3
br label %6
60: ; preds = %6
br label %61
61: ; preds = %60, %45
%62 = load i64, i64* %2
%63 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 %62)
ret i32 0
}

LLVM IR (-O2):
@.str = [61 x i8] c"If you can trust me, the number you are looking for is %llu\0A\00"
define i32 @main() {
br label %3
1: ; preds = %28, %3
%2 = icmp eq i32 %5, 500
br i1 %2, label %31, label %3
3: ; preds = %0, %1
%4 = phi i32 [ 1, %0 ], [ %5, %1 ]
%5 = add nuw nsw i32 %4, 1
%6 = icmp ult i32 %4, 499
br i1 %6, label %7, label %1
7: ; preds = %3
%8 = uitofp i32 %4 to double
%9 = mul nuw nsw i32 %4, %4
br label %10
10: ; preds = %7, %28
%11 = phi i32 [ %5, %7 ], [ %29, %28 ]
%12 = uitofp i32 %11 to double
%13 = fmul double %12, %12
%14 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %13)
%15 = tail call i32 @sqrt(double %14)
%16 = mul i32 %15, %15
%17 = mul nuw nsw i32 %11, %11
%18 = add nuw i32 %17, %9
%19 = icmp eq i32 %16, %18
br i1 %19, label %20, label %28
20: ; preds = %10
%21 = add nuw nsw i32 %11, %4
%22 = add i32 %21, %15
%23 = icmp eq i32 %22, 1000
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = mul i32 %11, %4
%26 = mul i32 %25, %15
%27 = zext i32 %26 to i64
br label %31
28: ; preds = %20, %10
%29 = add nuw nsw i32 %11, 1
%30 = icmp eq i32 %29, 500
br i1 %30, label %1, label %10
31: ; preds = %1, %24
%32 = phi i64 [ %27, %24 ], [ -1, %1 ]
%33 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i64 %32)
ret i32 0
}