#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__ isTriplet(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int count = 1000;
  int i = 1;
  int j = 1;
  int k = 1;
  for (i = 1; i < count; i++) {
    for (j = 1; j < count; j++) {
      for (k = 1; k < count; k++) {
        if (isTriplet(i, j, k) == 0) {
          if ((i + j + k) == count) {
            printf("%d\n", i * j * k);
            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   $0x3e8,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1216 <main+0xf6>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1203 <main+0xe3>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11f0 <main+0xd0>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <isTriplet@plt>
cmp    $0x0,%rax
jne    11dd <main+0xbd>
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11d8 <main+0xb8>
mov    -0x18(%rbp),%esi
imul   -0x1c(%rbp),%esi
imul   -0x20(%rbp),%esi
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1216 <main+0xf6>
jmp    11dd <main+0xbd>
jmp    11e2 <main+0xc2>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    117f <main+0x5f>
jmp    11f5 <main+0xd5>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116c <main+0x4c>
jmp    1208 <main+0xe8>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1159 <main+0x39>
mov    -0x4(%rbp),%eax
add    $0x20,%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,%r12d
mov    $0xfffffc1b,%eax
mov    %eax,0x4(%rsp)
mov    %eax,%r13d
mov    %r12d,%r14d
mov    $0x1,%r15d
mov    $0x1,%ebp
mov    %r14d,%ebx
jmp    115e <main+0x3e>
add    $0x1,%ebp
add    %r14d,%ebx
cmp    $0x3e8,%ebp
je     1180 <main+0x60>
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
call   1040 <isTriplet@plt>
test   %rax,%rax
jne    1150 <main+0x30>
lea    0x0(%r13,%rbp,1),%eax
cmp    $0x1,%eax
jne    1150 <main+0x30>
jmp    11aa <main+0x8a>
nopl   0x0(%rax)
add    $0x1,%r15d
add    %r12d,%r14d
add    $0x1,%r13d
cmp    $0x3e8,%r15d
jne    1146 <main+0x26>
add    $0x1,%r12d
mov    0x4(%rsp),%eax
add    $0x1,%eax
cmp    $0x3e8,%r12d
jne    1136 <main+0x16>
jmp    11b8 <main+0x98>
lea    0xe4f(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%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(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 1000, i32* %6
store i32 1, i32* %7
store i32 1, i32* %8
store i32 1, i32* %9
store i32 1, i32* %7
br label %10
10: ; preds = %55, %2
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %58
14: ; preds = %10
store i32 1, i32* %8
br label %15
15: ; preds = %51, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %6
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %54
19: ; preds = %15
store i32 1, i32* %9
br label %20
20: ; preds = %47, %19
%21 = load i32, i32* %9
%22 = load i32, i32* %6
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %50
24: ; preds = %20
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = load i32, i32* %9
%28 = call i64 @isTriplet(i32 %25, i32 %26, i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %46
30: ; preds = %24
%31 = load i32, i32* %7
%32 = load i32, i32* %8
%33 = add nsw i32 %31, %32
%34 = load i32, i32* %9
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %6
%37 = icmp eq i32 %35, %36
br i1 %37, label %38, label %45
38: ; preds = %30
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = mul nsw i32 %39, %40
%42 = load i32, i32* %9
%43 = mul nsw i32 %41, %42
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %43)
store i32 0, i32* %3
br label %58
45: ; preds = %30
br label %46
46: ; preds = %45, %24
br label %47
47: ; preds = %46
%48 = load i32, i32* %9
%49 = add nsw i32 %48, 1
store i32 %49, i32* %9
br label %20
50: ; preds = %20
br label %51
51: ; preds = %50
%52 = load i32, i32* %8
%53 = add nsw i32 %52, 1
store i32 %53, i32* %8
br label %15
54: ; preds = %15
br label %55
55: ; preds = %54
%56 = load i32, i32* %7
%57 = add nsw i32 %56, 1
store i32 %57, i32* %7
br label %10
58: ; preds = %38, %10
%59 = load i32, i32* %3
ret i32 %59
}

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