#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__ IsPalindrome(long);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long int value = 0;
  long int maxPalindrome = 0;
  for (int i = 100; i < 1000; i++) {
    for (int j = 100; j < 1000; j++) {
      value = i * j;
      if (IsPalindrome(value)) {
        if (value > maxPalindrome) {
          maxPalindrome = value;
          printf("The new max palindrome is the value:roduct of two three "
                 "digit numbers is: %ld\n",
                 maxPalindrome);
        }
      }
    }
  }
  printf("The maximum palindrome that is the product of two three digit "
         "numbers is: %ld\n",
         maxPalindrome);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x64,-0x1c(%rbp)
cmpl   $0x3e8,-0x1c(%rbp)
jge    11d8 <main+0xb8>
movl   $0x64,-0x20(%rbp)
cmpl   $0x3e8,-0x20(%rbp)
jge    11c5 <main+0xa5>
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <IsPalindrome@plt>
cmp    $0x0,%rax
je     11b2 <main+0x92>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    11ad <main+0x8d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
jmp    11b2 <main+0x92>
jmp    11b7 <main+0x97>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115a <main+0x3a>
jmp    11ca <main+0xaa>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <main+0x26>
mov    -0x18(%rbp),%rsi
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%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    $0x64,%r12d
mov    $0x2710,%r13d
xor    %r15d,%r15d
lea    0xebf(%rip),%r14
jmp    1161 <main+0x41>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r12
add    $0x64,%r13
cmp    $0x3e8,%r12
je     119b <main+0x7b>
mov    $0x384,%ebp
mov    %r13,%rbx
jmp    1179 <main+0x59>
nopl   0x0(%rax,%rax,1)
add    %r12,%rbx
add    $0xffffffffffffffff,%rbp
je     1150 <main+0x30>
mov    %rbx,%rdi
call   1030 <IsPalindrome@plt>
test   %rax,%rax
je     1170 <main+0x50>
cmp    %rbx,%r15
jge    1170 <main+0x50>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%r15
jmp    1170 <main+0x50>
lea    0xead(%rip),%rdi
mov    %r15,%rsi
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 = [79 x i8] c"The new max palindrome is the value:roduct of two three digit numbers is: %ld\0A\00"
@.str.1 = [79 x i8] c"The maximum palindrome that is the product of two three digit numbers is: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i64 0, i64* %2
store i64 0, i64* %3
store i32 100, i32* %4
br label %6
6: ; preds = %35, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 1000
br i1 %8, label %9, label %38
9: ; preds = %6
store i32 100, i32* %5
br label %10
10: ; preds = %31, %9
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 1000
br i1 %12, label %13, label %34
13: ; preds = %10
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = mul nsw i32 %14, %15
%17 = sext i32 %16 to i64
store i64 %17, i64* %2
%18 = load i64, i64* %2
%19 = call i64 @IsPalindrome(i64 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %13
%22 = load i64, i64* %2
%23 = load i64, i64* %3
%24 = icmp sgt i64 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i64, i64* %2
store i64 %26, i64* %3
%27 = load i64, i64* %3
%28 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i64 %27)
br label %29
29: ; preds = %25, %21
br label %30
30: ; preds = %29, %13
br label %31
31: ; preds = %30
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %10
34: ; preds = %10
br label %35
35: ; preds = %34
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %6
38: ; preds = %6
%39 = load i64, i64* %3
%40 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0), i64 %39)
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@.str = [79 x i8] c"The new max palindrome is the value:roduct of two three digit numbers is: %ld\0A\00"
@.str.1 = [79 x i8] c"The maximum palindrome that is the product of two three digit numbers is: %ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %6
%2 = phi i64 [ 100, %0 ], [ %7, %6 ]
%3 = phi i64 [ 0, %0 ], [ %20, %6 ]
br label %9
4: ; preds = %6
%5 = tail call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0), i64 %20)
ret i32 0
6: ; preds = %19
%7 = add nuw nsw i64 %2, 1
%8 = icmp eq i64 %7, 1000
br i1 %8, label %4, label %1
9: ; preds = %1, %19
%10 = phi i64 [ 100, %1 ], [ %21, %19 ]
%11 = phi i64 [ %3, %1 ], [ %20, %19 ]
%12 = mul nuw nsw i64 %10, %2
%13 = tail call i64 @IsPalindrome(i64 %12)
%14 = icmp ne i64 %13, 0
%15 = icmp slt i64 %11, %12
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %17, label %19
17: ; preds = %9
%18 = tail call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %19
19: ; preds = %9, %17
%20 = phi i64 [ %12, %17 ], [ %11, %9 ]
%21 = add nuw nsw i64 %10, 1
%22 = icmp eq i64 %21, 1000
br i1 %22, label %6, label %9
}