#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__ istriple(int, int);
int main(int argc, char *argv[]) {
  int i, j;
  for (j = 1; j < 1000; ++j)
    for (i = j; i < 1000; ++i)
      if (istriple(i, j))
        return 0;
  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,-0x18(%rbp)
cmpl   $0x3e8,-0x18(%rbp)
jge    1194 <main+0x84>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    1181 <main+0x71>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <istriple@plt>
cmp    $0x0,%rax
je     116e <main+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    119b <main+0x8b>
jmp    1173 <main+0x63>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x30>
jmp    1186 <main+0x76>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112d <main+0x1d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    %ebx,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <istriple@plt>
test   %rax,%rax
jne    1144 <main+0x34>
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1120 <main+0x10>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1118 <main+0x8>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
br label %8
8: ; preds = %27, %2
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 1000
br i1 %10, label %11, label %30
11: ; preds = %8
%12 = load i32, i32* %7
store i32 %12, i32* %6
br label %13
13: ; preds = %23, %11
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 1000
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = call i64 @istriple(i32 %17, i32 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 0, i32* %3
br label %31
22: ; preds = %16
br label %23
23: ; preds = %22
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %13
26: ; preds = %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %8
30: ; preds = %8
store i32 0, i32* %3
br label %31
31: ; preds = %30, %21
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %12, %2
%4 = phi i32 [ 1, %2 ], [ %13, %12 ]
br label %8
5: ; preds = %8
%6 = add nuw nsw i32 %9, 1
%7 = icmp eq i32 %6, 1000
br i1 %7, label %12, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ %4, %3 ]
%10 = tail call i64 @istriple(i32 %9, i32 %4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %5, label %15
12: ; preds = %5
%13 = add nuw nsw i32 %4, 1
%14 = icmp eq i32 %13, 1000
br i1 %14, label %15, label %3
15: ; preds = %12, %8
ret i32 0
}