#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__ isPalindrome(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int biggestPalindrome = 0;
  for (int i = 0; i < 1000; i++) {
    for (int j = 0; j < 1000; j++) {
      int b = i * j;
      if (b > biggestPalindrome && isPalindrome(b)) {
        biggestPalindrome = b;
        printf("%i \n", biggestPalindrome);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    11c1 <main+0xa1>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3e8,-0x10(%rbp)
jge    11ae <main+0x8e>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    119b <main+0x7b>
mov    -0x14(%rbp),%edi
call   1040 <isPalindrome@plt>
cmp    $0x0,%rax
je     119b <main+0x7b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
jmp    11a0 <main+0x80>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <main+0x31>
jmp    11b3 <main+0x93>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %r12d,%r12d
lea    0xece(%rip),%r14
xor    %r15d,%r15d
jmp    114d <main+0x2d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    $0x3e8,%r15d
je     1188 <main+0x68>
mov    $0x3e8,%ebx
xor    %ebp,%ebp
jmp    1168 <main+0x48>
cs nopw 0x0(%rax,%rax,1)
add    %r15d,%ebp
add    $0xffffffff,%ebx
je     1140 <main+0x20>
cmp    %r12d,%ebp
jle    1160 <main+0x40>
mov    %ebp,%edi
call   1040 <isPalindrome@plt>
test   %rax,%rax
je     1160 <main+0x40>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebp,%r12d
jmp    1160 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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