#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__ isValidRATriangle(int, int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a, b, c;
  for (a = 1; a <= 500; a++) {
    for (b = 1; b <= 500; b++) {
      for (c = 1; c <= 500; c++) {
        if (isValidRATriangle(a, b, c))
          printf("A=%d B=%d C=%d\n", a, b, c);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1f4,-0x8(%rbp)
jg     11d1 <main+0xb1>
movl   $0x1,-0xc(%rbp)
cmpl   $0x1f4,-0xc(%rbp)
jg     11be <main+0x9e>
movl   $0x1,-0x10(%rbp)
cmpl   $0x1f4,-0x10(%rbp)
jg     11ab <main+0x8b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <isValidRATriangle@plt>
cmp    $0x0,%rax
je     1198 <main+0x78>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
jmp    119d <main+0x7d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115e <main+0x3e>
jmp    11b0 <main+0x90>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x2a>
jmp    11c3 <main+0xa3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r15d
lea    0xecc(%rip),%r14
jmp    114d <main+0x2d>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    $0x1f5,%r15d
je     11ad <main+0x8d>
mov    $0x1,%ebp
jmp    116b <main+0x4b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0x1f5,%ebp
je     1140 <main+0x20>
mov    $0x1,%ebx
jmp    118b <main+0x6b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x1f5,%ebx
je     1160 <main+0x40>
mov    %r15d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <isValidRATriangle@plt>
test   %rax,%rax
je     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    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"A=%d B=%d C=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %5
5: ; preds = %36, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 500
br i1 %7, label %8, label %39
8: ; preds = %5
store i32 1, i32* %3
br label %9
9: ; preds = %32, %8
%10 = load i32, i32* %3
%11 = icmp sle i32 %10, 500
br i1 %11, label %12, label %35
12: ; preds = %9
store i32 1, i32* %4
br label %13
13: ; preds = %28, %12
%14 = load i32, i32* %4
%15 = icmp sle i32 %14, 500
br i1 %15, label %16, label %31
16: ; preds = %13
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i64 @isValidRATriangle(i32 %17, i32 %18, i32 %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %16
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24, i32 %25)
br label %27
27: ; preds = %22, %16
br label %28
28: ; preds = %27
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %13
31: ; preds = %13
br label %32
32: ; preds = %31
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %9
35: ; preds = %9
br label %36
36: ; preds = %35
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %5
39: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"A=%d B=%d C=%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %17
%2 = phi i32 [ 1, %0 ], [ %18, %17 ]
br label %3
3: ; preds = %1, %14
%4 = phi i32 [ 1, %1 ], [ %15, %14 ]
br label %5
5: ; preds = %3, %11
%6 = phi i32 [ 1, %3 ], [ %12, %11 ]
%7 = tail call i64 @isValidRATriangle(i32 %2, i32 %4, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6)
br label %11
11: ; preds = %5, %9
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, 501
br i1 %13, label %14, label %5
14: ; preds = %11
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i32 %15, 501
br i1 %16, label %17, label %3
17: ; preds = %14
%18 = add nuw nsw i32 %2, 1
%19 = icmp eq i32 %18, 501
br i1 %19, label %20, label %1
20: ; preds = %17
ret i32 0
}