#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 is_palindrome(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int max = 0, x, i, j;
  for (i = 999; i > 99; i--)
    for (j = 999; j > 99; j--) {
      x = i * j;
      if ((is_palindrome(x) == 1) && (x > max))
        max = x;
    }
  printf("%d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x3e7,-0x10(%rbp)
cmpl   $0x63,-0x10(%rbp)
jle    11ab <main+0x8b>
movl   $0x3e7,-0x14(%rbp)
cmpl   $0x63,-0x14(%rbp)
jle    1198 <main+0x78>
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <is_palindrome@plt>
cmp    $0x1,%eax
jne    1185 <main+0x65>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1185 <main+0x65>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    118a <main+0x6a>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x2e>
jmp    119d <main+0x7d>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%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    $0x3e7,%eax
mov    $0xf3a71,%r14d
mov    $0xfffffc19,%r15d
xchg   %ax,%ax
mov    %rax,(%rsp)
mov    $0x3e8,%r13d
mov    %r14d,%ebp
nopl   (%rax)
mov    %ebx,%r12d
mov    %ebp,%edi
call   1030 <is_palindrome@plt>
cmp    %ebx,%ebp
cmovg  %ebp,%ebx
cmp    $0x1,%eax
cmovne %r12d,%ebx
add    $0xffffffff,%r13d
add    %r15d,%ebp
cmp    $0x64,%r13d
ja     1150 <main+0x30>
mov    (%rsp),%rcx
lea    -0x1(%rcx),%eax
add    $0xfffffc19,%r14d
add    $0x1,%r15d
cmp    $0x64,%ecx
ja     1140 <main+0x20>
lea    0xe6f(%rip),%rdi
mov    %ebx,%esi
call   1040 <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 i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 999, i32* %4
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 99
br i1 %8, label %9, label %34
9: ; preds = %6
store i32 999, i32* %5
br label %10
10: ; preds = %27, %9
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 99
br i1 %12, label %13, label %30
13: ; preds = %10
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = call i32 @is_palindrome(i32 %17)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %26
20: ; preds = %13
%21 = load i32, i32* %3
%22 = load i32, i32* %2
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %3
store i32 %25, i32* %2
br label %26
26: ; preds = %24, %20, %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, -1
store i32 %29, i32* %5
br label %10
30: ; preds = %10
br label %31
31: ; preds = %30
%32 = load i32, i32* %4
%33 = add nsw i32 %32, -1
store i32 %33, i32* %4
br label %6
34: ; preds = %6
%35 = load i32, i32* %2
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
ret i32 0
}

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