#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__ isPythaNum(int, int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char const *argv[]) {
  for (int a = 1; a < 500; a++) {
    for (int b = 1; b < 500; b++) {
      for (int c = 1; c < 500; c++) {
        if (isPythaNum(a, b, c) && a + b + c == 1000) {
          printf("%d %d %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   $0x1f4,-0x14(%rbp)
jge    11ec <main+0xcc>
movl   $0x1,-0x18(%rbp)
cmpl   $0x1f4,-0x18(%rbp)
jge    11d9 <main+0xb9>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1f4,-0x1c(%rbp)
jge    11c6 <main+0xa6>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1040 <isPythaNum@plt>
cmp    $0x0,%rax
je     11b3 <main+0x93>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
cmp    $0x3e8,%eax
jne    11b3 <main+0x93>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
jmp    11b8 <main+0x98>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1165 <main+0x45>
jmp    11cb <main+0xab>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1151 <main+0x31>
jmp    11de <main+0xbe>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
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
push   %rax
mov    $0x1,%r15d
mov    $0xfffffc1b,%r12d
lea    0xec2(%rip),%r14
jmp    1151 <main+0x31>
add    $0x1,%r15d
add    $0x1,%r12d
cmp    $0x1f4,%r15d
je     11b6 <main+0x96>
mov    %r12d,%r13d
mov    $0x1,%ebp
jmp    116f <main+0x4f>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
add    $0x1,%r13d
cmp    $0x1f4,%ebp
je     1140 <main+0x20>
mov    $0x1,%ebx
jmp    118b <main+0x6b>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x1f4,%ebx
je     1160 <main+0x40>
mov    %r15d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <isPythaNum@plt>
test   %rax,%rax
je     1180 <main+0x60>
lea    (%rbx,%r13,1),%eax
cmp    $0x1,%eax
jne    1180 <main+0x60>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
jmp    1180 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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