#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 /*<<< orphan*/ getch();
scalar_t__ isPalindrome(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, j, ans, mul;
  ans = 1;
  for (i = 100; i < 1000; i++) {
    for (j = 100; j < 1000; j++) {
      mul = i * j;
      if (isPalindrome(mul) && mul > ans) {
        ans = mul;
      }
    }
  }
  printf("\n%d", ans);
  getch();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x64,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    11c2 <main+0x92>
movl   $0x64,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    11af <main+0x7f>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <isPalindrome@plt>
cmp    $0x0,%rax
je     119c <main+0x6c>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    119c <main+0x6c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11a1 <main+0x71>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1161 <main+0x31>
jmp    11b4 <main+0x84>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
mov    -0x10(%rbp),%esi
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@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
mov    $0x1,%ebx
mov    $0x64,%r14d
mov    $0x2710,%r15d
nopl   0x0(%rax)
mov    $0x384,%r12d
mov    %r15d,%ebp
nopl   0x0(%rax)
mov    %ebx,%r13d
mov    %ebp,%edi
call   1040 <isPalindrome@plt>
cmp    %ebx,%ebp
cmovg  %ebp,%ebx
test   %rax,%rax
cmove  %r13d,%ebx
add    %r14d,%ebp
add    $0xffffffff,%r12d
jne    1160 <main+0x30>
add    $0x1,%r14d
add    $0x64,%r15d
cmp    $0x3e8,%r14d
jne    1150 <main+0x20>
lea    0xe69(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getch@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"\0A%d\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 1, i32* %4
store i32 100, i32* %2
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 1000
br i1 %8, label %9, label %34
9: ; preds = %6
store i32 100, i32* %3
br label %10
10: ; preds = %27, %9
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 1000
br i1 %12, label %13, label %30
13: ; preds = %10
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = call i64 @isPalindrome(i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %13
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = icmp sgt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %5
store i32 %25, i32* %4
br label %26
26: ; preds = %24, %20, %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %10
30: ; preds = %10
br label %31
31: ; preds = %30
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %6
34: ; preds = %6
%35 = load i32, i32* %4
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = call i32 (...) @getch()
ret i32 0
}

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