#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__ is_palindrome(long);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long i, j, k, max = 0;
  for (i = 999; i > 99; --i)
    for (j = i; j > 99; --j) {
      k = i * j;
      if (is_palindrome(k)) {
        max = k > max ? k : max;
        break;
      }
    }
  printf("%ld\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x3e7,-0x10(%rbp)
cmpq   $0x63,-0x10(%rbp)
jle    11d9 <main+0xb9>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x63,-0x18(%rbp)
jle    11c3 <main+0xa3>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <is_palindrome@plt>
cmp    $0x0,%rax
je     11ad <main+0x8d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1198 <main+0x78>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    11a0 <main+0x80>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    11c3 <main+0xa3>
jmp    11b2 <main+0x92>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <main+0x32>
jmp    11c8 <main+0xa8>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    113f <main+0x1f>
mov    -0x28(%rbp),%rsi
lea    0xe1c(%rip),%rdi
call   1040 <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
sub    $0x18,%rsp
mov    $0x3e7,%ecx
mov    $0x3e8,%r14d
mov    $0xfffffffffffff833,%r12
mov    $0xf3a71,%r13d
mov    $0xfffffffffffffc19,%rbp
xor    %eax,%eax
mov    %rax,0x8(%rsp)
jmp    1192 <main+0x72>
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%rsp),%rax
cmp    %rax,%rbx
cmovg  %rbx,%rax
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%rcx
lea    -0x1(%rcx),%rax
add    $0xffffffffffffffff,%r14
add    %r12,%r13
add    $0x2,%r12
add    $0x1,%rbp
cmp    $0x64,%rcx
mov    %rax,%rcx
jbe    11bc <main+0x9c>
mov    %rcx,0x10(%rsp)
mov    %r13,%rbx
mov    %r14,%r15
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <is_palindrome@plt>
test   %rax,%rax
jne    1160 <main+0x40>
add    $0xffffffffffffffff,%r15
add    %rbp,%rbx
cmp    $0x65,%r15
jge    11a0 <main+0x80>
jmp    1171 <main+0x51>
lea    0xe3d(%rip),%rdi
mov    0x8(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\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* %5
store i64 999, i64* %2
br label %6
6: ; preds = %36, %0
%7 = load i64, i64* %2
%8 = icmp sgt i64 %7, 99
br i1 %8, label %9, label %39
9: ; preds = %6
%10 = load i64, i64* %2
store i64 %10, i64* %3
br label %11
11: ; preds = %32, %9
%12 = load i64, i64* %3
%13 = icmp sgt i64 %12, 99
br i1 %13, label %14, label %35
14: ; preds = %11
%15 = load i64, i64* %2
%16 = load i64, i64* %3
%17 = mul nsw i64 %15, %16
store i64 %17, i64* %4
%18 = load i64, i64* %4
%19 = call i64 @is_palindrome(i64 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %31
21: ; preds = %14
%22 = load i64, i64* %4
%23 = load i64, i64* %5
%24 = icmp sgt i64 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i64, i64* %4
br label %29
27: ; preds = %21
%28 = load i64, i64* %5
br label %29
29: ; preds = %27, %25
%30 = phi i64 [ %26, %25 ], [ %28, %27 ]
store i64 %30, i64* %5
br label %35
31: ; preds = %14
br label %32
32: ; preds = %31
%33 = load i64, i64* %3
%34 = add nsw i64 %33, -1
store i64 %34, i64* %3
br label %11
35: ; preds = %29, %11
br label %36
36: ; preds = %35
%37 = load i64, i64* %2
%38 = add nsw i64 %37, -1
store i64 %38, i64* %2
br label %6
39: ; preds = %6
%40 = load i64, i64* %5
%41 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %40)
ret i32 0
}

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