#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*/ intCount(int);
int /*<<< orphan*/ palCheck(int, int /*<<< orphan*/);
void palFind() {
  int i, j, n;
  for (i = 100; i < 1000; i++) {
    for (j = 100; j < 1000; j++) {
      n = i * j;
      palCheck(n, intCount(n));
    }
  }
}


x86 assembly (clang, -O0):
<palFind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    1193 <palFind+0x73>
movl   $0x64,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1180 <palFind+0x60>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <intCount@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <palCheck@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <palFind+0x23>
jmp    1185 <palFind+0x65>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <palFind+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palFind>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x64,%r15d
mov    $0x2710,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x384,%ebp
mov    %r14d,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <intCount@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <palCheck@plt>
add    %r15d,%ebx
add    $0xffffffff,%ebp
jne    1150 <palFind+0x30>
add    $0x1,%r15d
add    $0x64,%r14d
cmp    $0x3e8,%r15d
jne    1140 <palFind+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @palFind() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 100, i32* %1
br label %4
4: ; preds = %23, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1000
br i1 %6, label %7, label %26
7: ; preds = %4
store i32 100, i32* %2
br label %8
8: ; preds = %19, %7
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 1000
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = call i32 @intCount(i32 %16)
%18 = call i32 @palCheck(i32 %15, i32 %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %8
22: ; preds = %8
br label %23
23: ; preds = %22
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
br label %4
26: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @palFind() {
br label %1
1: ; preds = %0, %10
%2 = phi i32 [ 100, %0 ], [ %11, %10 ]
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 100, %1 ], [ %8, %3 ]
%5 = mul nuw nsw i32 %4, %2
%6 = tail call i32 @intCount(i32 %5)
%7 = tail call i32 @palCheck(i32 %5, i32 %6)
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = add nuw nsw i32 %2, 1
%12 = icmp eq i32 %11, 1000
br i1 %12, label %13, label %1
13: ; preds = %10
ret void
}