#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__ check_palindrome(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, j, max = 0;
  for (i = 999; i >= 100; i--)
    for (j = i; j >= 100; j--)
      if (check_palindrome(i * j))
        if (max < i * j)
          max = i * j;
out:
  printf("%d\n", max);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x3e7,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jl     11b4 <main+0x94>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jl     11a1 <main+0x81>
mov    -0x8(%rbp),%edi
imul   -0xc(%rbp),%edi
call   1040 <check_palindrome@plt>
cmp    $0x0,%rax
je     118e <main+0x6e>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    1189 <main+0x69>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    118e <main+0x6e>
jmp    1193 <main+0x73>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
jmp    11a6 <main+0x86>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
jmp    11b9 <main+0x99>
mov    -0x10(%rbp),%esi
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%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,%eax
xor    %ebx,%ebx
mov    $0x3e8,%r14d
mov    $0xfffff833,%ecx
mov    $0xf3a71,%r12d
mov    $0xfffffc19,%r13d
nopl   0x0(%rax)
mov    %rax,0x10(%rsp)
mov    %ecx,0x8(%rsp)
mov    %r12d,%ebp
mov    %r14d,0xc(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r15d
mov    %ebp,%edi
call   1040 <check_palindrome@plt>
cmp    %ebp,%ebx
cmovl  %ebp,%ebx
test   %rax,%rax
cmove  %r15d,%ebx
add    $0xffffffff,%r14d
add    %r13d,%ebp
cmp    $0x64,%r14d
jg     1170 <main+0x50>
mov    0x10(%rsp),%rdx
lea    -0x1(%rdx),%eax
mov    0xc(%rsp),%r14d
add    $0xffffffff,%r14d
mov    0x8(%rsp),%ecx
add    %ecx,%r12d
add    $0x2,%ecx
add    $0x1,%r13d
cmp    $0x64,%edx
ja     1150 <main+0x30>
lea    0xe42(%rip),%rdi
mov    %ebx,%esi
call   1030 <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 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 999, i32* %2
br label %5
5: ; preds = %35, %0
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 100
br i1 %7, label %8, label %38
8: ; preds = %5
%9 = load i32, i32* %2
store i32 %9, i32* %3
br label %10
10: ; preds = %31, %8
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 100
br i1 %12, label %13, label %34
13: ; preds = %10
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = mul nsw i32 %14, %15
%17 = call i64 @check_palindrome(i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %30
19: ; preds = %13
%20 = load i32, i32* %4
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = mul nsw i32 %21, %22
%24 = icmp slt i32 %20, %23
br i1 %24, label %25, label %29
25: ; preds = %19
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = mul nsw i32 %26, %27
store i32 %28, i32* %4
br label %29
29: ; preds = %25, %19
br label %30
30: ; preds = %29, %13
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, -1
store i32 %33, i32* %3
br label %10
34: ; preds = %10
br label %35
35: ; preds = %34
%36 = load i32, i32* %2
%37 = add nsw i32 %36, -1
store i32 %37, i32* %2
br label %5
38: ; preds = %5
br label %39
39: ; preds = %38
%40 = load i32, i32* %4
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %15, %0
%2 = phi i32 [ 0, %0 ], [ %12, %15 ]
%3 = phi i32 [ 999, %0 ], [ %16, %15 ]
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %13, %4 ], [ %3, %1 ]
%7 = mul nsw i32 %6, %3
%8 = tail call i64 @check_palindrome(i32 %7)
%9 = icmp ne i64 %8, 0
%10 = icmp slt i32 %5, %7
%11 = select i1 %9, i1 %10, i1 false
%12 = select i1 %11, i32 %7, i32 %5
%13 = add nsw i32 %6, -1
%14 = icmp sgt i32 %6, 100
br i1 %14, label %4, label %15
15: ; preds = %4
%16 = add nsw i32 %3, -1
%17 = icmp ugt i32 %3, 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
}