#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 */
int EXIT_SUCCESS;
scalar_t__ palindromic(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int result = 0;
  for (unsigned int i = 100; i < 1000; i++) {
    for (unsigned int j = i; j < 1000; j++) {
      unsigned int candidate = i * j;
      if (palindromic(candidate) && candidate > result) {
        result = candidate;
      }
    }
  }
  printf("%u\n", result);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jae    11b1 <main+0x91>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x3e8,-0x10(%rbp)
jae    119e <main+0x7e>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <palindromic@plt>
cmp    $0x0,%rax
je     118b <main+0x6b>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    118b <main+0x6b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1190 <main+0x70>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1150 <main+0x30>
jmp    11a3 <main+0x83>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%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
xor    %ebx,%ebx
mov    $0x64,%r14d
mov    $0x384,%r15d
mov    $0xc9,%eax
mov    $0x2710,%r13d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,(%rsp)
mov    %r13d,%ebp
mov    %r15d,0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r12d
mov    %ebp,%edi
call   1040 <palindromic@plt>
cmp    %ebx,%ebp
cmova  %ebp,%ebx
test   %rax,%rax
cmove  %r12d,%ebx
add    %r14d,%ebp
add    $0xffffffff,%r15d
jne    1160 <main+0x40>
add    $0x1,%r14d
mov    0x4(%rsp),%r15d
add    $0xffffffff,%r15d
mov    (%rsp),%eax
add    %eax,%r13d
add    $0x2,%eax
cmp    $0x3e8,%r14d
jne    1150 <main+0x30>
lea    0xe5b(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%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"%u\0A\00"
@EXIT_SUCCESS = global i32 0
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 100, i32* %3
br label %6
6: ; preds = %32, %0
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, 1000
br i1 %8, label %9, label %35
9: ; preds = %6
%10 = load i32, i32* %3
store i32 %10, i32* %4
br label %11
11: ; preds = %28, %9
%12 = load i32, i32* %4
%13 = icmp ult i32 %12, 1000
br i1 %13, label %14, label %31
14: ; preds = %11
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = mul i32 %15, %16
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = call i64 @palindromic(i32 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %14
%22 = load i32, i32* %5
%23 = load i32, i32* %2
%24 = icmp ugt i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32, i32* %5
store i32 %26, i32* %2
br label %27
27: ; preds = %25, %21, %14
br label %28
28: ; preds = %27
%29 = load i32, i32* %4
%30 = add i32 %29, 1
store i32 %30, i32* %4
br label %11
31: ; preds = %11
br label %32
32: ; preds = %31
%33 = load i32, i32* %3
%34 = add i32 %33, 1
store i32 %34, i32* %3
br label %6
35: ; preds = %6
%36 = load i32, i32* %2
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = load i32, i32* @EXIT_SUCCESS
ret i32 %38
}

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