#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 isPalindrome2(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int arr[] = {323, 22, 3, 34, 100021};
  int len = sizeof arr / sizeof arr[0];
  for (int i = 0; i < len; i++) {
    printf("%d: %d\n", arr[i], isPalindrome2(arr[i]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    119f <main+0x7f>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x2c(%rbp)
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
call   1030 <isPalindrome2@plt>
mov    -0x2c(%rbp),%esi
mov    %eax,%edx
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    115c <main+0x3c>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x143,%edi
call   1030 <isPalindrome2@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x143,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x16,%edi
call   1030 <isPalindrome2@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x3,%edi
call   1030 <isPalindrome2@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x22,%edi
call   1030 <isPalindrome2@plt>
mov    %rbx,%rdi
mov    $0x22,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x186b5,%edi
call   1030 <isPalindrome2@plt>
mov    %rbx,%rdi
mov    $0x186b5,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 323, i32 22, i32 3, i32 34, i32 100021]
@.str = [8 x i8] c"%d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = call i32 @isPalindrome2(i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %19)
br label %21
21: ; preds = %10
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %6
24: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @isPalindrome2(i32 323)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 323, i32 %1)
%3 = tail call i32 @isPalindrome2(i32 22)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 22, i32 %3)
%5 = tail call i32 @isPalindrome2(i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 3, i32 %5)
%7 = tail call i32 @isPalindrome2(i32 34)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 34, i32 %7)
%9 = tail call i32 @isPalindrome2(i32 100021)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 100021, i32 %9)
ret i32 0
}