#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(int);
int solution() {
  int x, y, v, largest_number;
  for (x = 100; x < 999; x++) {
    for (y = 100; y < 999; y++) {
      v = x * y;
      if (v > largest_number && is_palindrome(v) == 0) {
        largest_number = v;
      }
    }
  }
  return largest_number;
}


x86 assembly (clang, -O0):
<solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
cmpl   $0x3e7,-0x4(%rbp)
jge    1194 <solution+0x84>
movl   $0x64,-0x8(%rbp)
cmpl   $0x3e7,-0x8(%rbp)
jge    1181 <solution+0x71>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    116e <solution+0x5e>
mov    -0xc(%rbp),%edi
call   1030 <is_palindrome@plt>
cmp    $0x0,%rax
jne    116e <solution+0x5e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1173 <solution+0x63>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <solution+0x23>
jmp    1186 <solution+0x76>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <solution+0xf>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solution>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x64,%r14d
mov    $0x2710,%r15d
jmp    1141 <solution+0x31>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r14d
add    $0x64,%r15d
cmp    $0x3e7,%r14d
je     116d <solution+0x5d>
mov    $0x383,%ebx
mov    %r15d,%ebp
jmp    1158 <solution+0x48>
nopl   0x0(%rax,%rax,1)
add    %r14d,%ebp
add    $0xffffffff,%ebx
je     1130 <solution+0x20>
cmp    %r12d,%ebp
jle    1150 <solution+0x40>
mov    %ebp,%edi
call   1030 <is_palindrome@plt>
test   %rax,%rax
cmove  %ebp,%r12d
jmp    1150 <solution+0x40>
mov    %r12d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @solution() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 100, i32* %1
br label %5
5: ; preds = %30, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 999
br i1 %7, label %8, label %33
8: ; preds = %5
store i32 100, i32* %2
br label %9
9: ; preds = %26, %8
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 999
br i1 %11, label %12, label %29
12: ; preds = %9
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = mul nsw i32 %13, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %25
19: ; preds = %12
%20 = load i32, i32* %3
%21 = call i64 @is_palindrome(i32 %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load i32, i32* %3
store i32 %24, i32* %4
br label %25
25: ; preds = %23, %19, %12
br label %26
26: ; preds = %25
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %9
29: ; preds = %9
br label %30
30: ; preds = %29
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
br label %5
33: ; preds = %5
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @solution() {
br label %1
1: ; preds = %0, %17
%2 = phi i32 [ undef, %0 ], [ %14, %17 ]
%3 = phi i32 [ 100, %0 ], [ %18, %17 ]
br label %4
4: ; preds = %1, %13
%5 = phi i32 [ %2, %1 ], [ %14, %13 ]
%6 = phi i32 [ 100, %1 ], [ %15, %13 ]
%7 = mul nuw nsw i32 %6, %3
%8 = icmp sgt i32 %7, %5
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = tail call i64 @is_palindrome(i32 %7)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i32 %7, i32 %5
br label %13
13: ; preds = %9, %4
%14 = phi i32 [ %5, %4 ], [ %12, %9 ]
%15 = add nuw nsw i32 %6, 1
%16 = icmp eq i32 %15, 999
br i1 %16, label %17, label %4
17: ; preds = %13
%18 = add nuw nsw i32 %3, 1
%19 = icmp eq i32 %18, 999
br i1 %19, label %20, label %1
20: ; preds = %17
ret i32 %14
}