#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__ ispalin(size_t);
int /*<<< orphan*/ printf(char *, size_t);
int main() {
  size_t largest = 0;
  for (size_t a = 999; a >= 100; a--)
    for (size_t b = 999; b >= a; b--) {
      size_t product = a * b;
      if (product > largest && ispalin(product))
        largest = product;
    }
  printf("%d\n", largest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x3e7,-0x18(%rbp)
cmpq   $0x64,-0x18(%rbp)
jb     11c2 <main+0xa2>
movq   $0x3e7,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     11ac <main+0x8c>
mov    -0x18(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1196 <main+0x76>
mov    -0x28(%rbp),%rdi
call   1040 <ispalin@plt>
cmp    $0x0,%rax
je     1196 <main+0x76>
mov    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    119b <main+0x7b>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1152 <main+0x32>
jmp    11b1 <main+0x91>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    113f <main+0x1f>
mov    -0x10(%rbp),%rsi
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x3e7,%r15d
mov    $0xf3a71,%r12d
mov    $0xfffffffffffffc19,%r13
xor    %r14d,%r14d
jmp    1165 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffffffffffff,%r15
add    $0xfffffffffffffc19,%r12
add    $0x1,%r13
cmp    $0x63,%r15
jbe    1192 <main+0x72>
mov    %r12,%rbx
mov    $0x3e7,%ebp
jmp    117c <main+0x5c>
nop
add    $0xffffffffffffffff,%rbp
add    %r13,%rbx
cmp    %r15,%rbp
jb     1150 <main+0x30>
cmp    %r14,%rbx
jbe    1170 <main+0x50>
mov    %rbx,%rdi
call   1040 <ispalin@plt>
test   %rax,%rax
cmovne %rbx,%r14
jmp    1170 <main+0x50>
lea    0xe67(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%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"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
store i64 999, i64* %3
br label %6
6: ; preds = %32, %0
%7 = load i64, i64* %3
%8 = icmp uge i64 %7, 100
br i1 %8, label %9, label %35
9: ; preds = %6
store i64 999, i64* %4
br label %10
10: ; preds = %28, %9
%11 = load i64, i64* %4
%12 = load i64, i64* %3
%13 = icmp uge i64 %11, %12
br i1 %13, label %14, label %31
14: ; preds = %10
%15 = load i64, i64* %3
%16 = load i64, i64* %4
%17 = mul i64 %15, %16
store i64 %17, i64* %5
%18 = load i64, i64* %5
%19 = load i64, i64* %2
%20 = icmp ugt i64 %18, %19
br i1 %20, label %21, label %27
21: ; preds = %14
%22 = load i64, i64* %5
%23 = call i64 @ispalin(i64 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i64, i64* %5
store i64 %26, i64* %2
br label %27
27: ; preds = %25, %21, %14
br label %28
28: ; preds = %27
%29 = load i64, i64* %4
%30 = add i64 %29, -1
store i64 %30, i64* %4
br label %10
31: ; preds = %10
br label %32
32: ; preds = %31
%33 = load i64, i64* %3
%34 = add i64 %33, -1
store i64 %34, i64* %3
br label %6
35: ; preds = %6
%36 = load i64, i64* %2
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %36)
ret i32 0
}

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