#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__ isIntPallindrome(int);
int /*<<< orphan*/ printf(char *, int, char *);
void pallindromeTester() {
  int list[] = {23, 30, 33, 343, 2, 3456, 3223, 41214, 213, 99789};
  int i;
  for (i = 0; i < 10; i++) {
    printf("%d %s pallindrome check.\n", list[i],
           isIntPallindrome(list[i]) ? "passes" : "fails");
  }
}


x86 assembly (clang, -O0):
<pallindromeTester>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11ac <pallindromeTester+0x7c>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x38(%rbp)
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
call   1030 <isIntPallindrome@plt>
mov    -0x38(%rbp),%esi
mov    %rax,%rcx
lea    0xec6(%rip),%rdx
lea    0xeb8(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1154 <pallindromeTester+0x24>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pallindromeTester>:
push   %r15
push   %r14
push   %rbx
mov    $0x17,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
lea    0xee8(%rip),%r15
lea    0xeda(%rip),%rbx
mov    %rbx,%rdx
cmove  %r15,%rdx
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
mov    $0x17,%esi
call   1040 <printf@plt>
mov    $0x1e,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r15,%rdx
mov    %r14,%rdi
mov    $0x1e,%esi
call   1040 <printf@plt>
mov    $0x21,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r15,%rdx
mov    %r14,%rdi
mov    $0x21,%esi
call   1040 <printf@plt>
mov    $0x157,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r15,%rdx
mov    %r14,%rdi
mov    $0x157,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r15,%rdx
mov    %r14,%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    $0xd80,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r15,%rdx
mov    %r14,%rdi
mov    $0xd80,%esi
call   1040 <printf@plt>
mov    $0xc97,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r15,%rdx
mov    %r14,%rdi
mov    $0xc97,%esi
call   1040 <printf@plt>
mov    $0xa0fe,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r15,%rdx
mov    %r14,%rdi
mov    $0xa0fe,%esi
call   1040 <printf@plt>
mov    $0xd5,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
mov    %rbx,%rdx
cmove  %r15,%rdx
mov    %r14,%rdi
mov    $0xd5,%esi
call   1040 <printf@plt>
mov    $0x185cd,%edi
call   1030 <isIntPallindrome@plt>
test   %rax,%rax
cmove  %r15,%rbx
mov    %r14,%rdi
mov    $0x185cd,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

LLVM IR (-O0):
@__const.pallindromeTester.list = [10 x i32] [i32 23, i32 30, i32 33, i32 343, i32 2, i32 3456, i32 3223, i32 41214, i32 213, i32 99789]
@.str = [26 x i8] c"%d %s pallindrome check.\0A\00"
@.str.1 = [7 x i8] c"passes\00"
@.str.2 = [6 x i8] c"fails\00"
define void @pallindromeTester() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = bitcast [10 x i32]* %1 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %21, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %24
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i64 @isIntPallindrome(i32 %15)
%17 = icmp ne i64 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%20 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %19)
br label %21
21: ; preds = %7
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %4
24: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%d %s pallindrome check.\0A\00"
@.str.1 = [7 x i8] c"passes\00"
@.str.2 = [6 x i8] c"fails\00"
define void @pallindromeTester() {
%1 = tail call i64 @isIntPallindrome(i32 23)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 23, i8* %3)
%5 = tail call i64 @isIntPallindrome(i32 30)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 30, i8* %7)
%9 = tail call i64 @isIntPallindrome(i32 33)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 33, i8* %11)
%13 = tail call i64 @isIntPallindrome(i32 343)
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 343, i8* %15)
%17 = tail call i64 @isIntPallindrome(i32 2)
%18 = icmp eq i64 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 2, i8* %19)
%21 = tail call i64 @isIntPallindrome(i32 3456)
%22 = icmp eq i64 %21, 0
%23 = select i1 %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 3456, i8* %23)
%25 = tail call i64 @isIntPallindrome(i32 3223)
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%28 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 3223, i8* %27)
%29 = tail call i64 @isIntPallindrome(i32 41214)
%30 = icmp eq i64 %29, 0
%31 = select i1 %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%32 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 41214, i8* %31)
%33 = tail call i64 @isIntPallindrome(i32 213)
%34 = icmp eq i64 %33, 0
%35 = select i1 %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%36 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 213, i8* %35)
%37 = tail call i64 @isIntPallindrome(i32 99789)
%38 = icmp eq i64 %37, 0
%39 = select i1 %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%40 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 99789, i8* %39)
ret void
}