#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 Pop(int *, int *);
int /*<<< orphan*/ Push(int *, int *, int);
int /*<<< orphan*/ printf(char *);
Palindrome(int num) {
  int i, arr[100], top = -1, temp = num, dig = 0, isPalin = 1;
  while (temp != 0) {
    Push(arr, &top, temp % 10);
    temp /= 10;
    dig++;
  }
  temp = num;
  for (i = 0; i <= dig / 2; i++) {
    if (temp % 10 != Pop(arr, &top)) {
      isPalin = 0;
      break;
    }
    temp /= 10;
  }
  if (isPalin) {
    printf("Palindrome.\n");
  } else {
    printf("Not Palindrome.\n");
  }
}


x86 assembly (clang, -O0):
<Palindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
mov    %edi,-0x8(%rbp)
movl   $0xffffffff,-0x1a4(%rbp)
ff ff ff
mov    -0x8(%rbp),%eax
mov    %eax,-0x1a8(%rbp)
movl   $0x0,-0x1ac(%rbp)
movl   $0x1,-0x1b0(%rbp)
cmpl   $0x0,-0x1a8(%rbp)
je     11bb <Palindrome+0x8b>
lea    -0x1a0(%rbp),%rdi
mov    -0x1a8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
lea    -0x1a4(%rbp),%rsi
call   1050 <Push@plt>
mov    -0x1a8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1a8(%rbp)
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1165 <Palindrome+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1a8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x1ac(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1b4(%rbp),%eax
cmp    %ecx,%eax
jg     1258 <Palindrome+0x128>
mov    -0x1a8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1b8(%rbp)
lea    -0x1a0(%rbp),%rdi
lea    -0x1a4(%rbp),%rsi
call   1040 <Pop@plt>
mov    -0x1b8(%rbp),%edx
cmp    %eax,%edx
je     1236 <Palindrome+0x106>
movl   $0x0,-0x1b0(%rbp)
jmp    1258 <Palindrome+0x128>
mov    -0x1a8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1a8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11cb <Palindrome+0x9b>
cmpl   $0x0,-0x1b0(%rbp)
je     1276 <Palindrome+0x146>
lea    0xd98(%rip),%rdi
call   1030 <printf@plt>
jmp    1282 <Palindrome+0x152>
lea    0xd83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Palindrome>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a8,%rsp
mov    %edi,%r13d
movl   $0xffffffff,0xc(%rsp)
ff
test   %edi,%edi
je     11a1 <Palindrome+0x71>
xor    %r12d,%r12d
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%r15
mov    %r13d,%ebx
movslq %ebx,%rbp
imul   $0x66666667,%rbp,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x22,%rbx
add    %eax,%ebx
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ebp,%edx
sub    %eax,%edx
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <Push@plt>
add    $0x1,%r12d
add    $0x9,%ebp
cmp    $0x13,%ebp
jae    1160 <Palindrome+0x30>
shr    %r12d
add    $0x1,%r12d
jmp    11a7 <Palindrome+0x77>
mov    $0x1,%r12d
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%rbp
lea    0xe48(%rip),%r14
nopl   0x0(%rax,%rax,1)
movslq %r13d,%rbx
imul   $0x66666667,%rbx,%r13
mov    %r13,%rax
shr    $0x3f,%rax
sar    $0x22,%r13
add    %eax,%r13d
lea    0x0(%r13,%r13,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
mov    %r15,%rdi
mov    %rbp,%rsi
call   1040 <Pop@plt>
cmp    %eax,%ebx
jne    11fe <Palindrome+0xce>
add    $0xffffffff,%r12d
jne    11c0 <Palindrome+0x90>
lea    0xe06(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Palindrome.\0A\00"
@.str.1 = [17 x i8] c"Not Palindrome.\0A\00"
define i32 @Palindrome(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 -1, i32* %6
%10 = load i32, i32* %3
store i32 %10, i32* %7
store i32 0, i32* %8
store i32 1, i32* %9
br label %11
11: ; preds = %14, %1
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%16 = load i32, i32* %7
%17 = srem i32 %16, 10
%18 = call i32 @Push(i32* %15, i32* %6, i32 %17)
%19 = load i32, i32* %7
%20 = sdiv i32 %19, 10
store i32 %20, i32* %7
%21 = load i32, i32* %8
%22 = add nsw i32 %21, 1
store i32 %22, i32* %8
br label %11
23: ; preds = %11
%24 = load i32, i32* %3
store i32 %24, i32* %7
store i32 0, i32* %4
br label %25
25: ; preds = %40, %23
%26 = load i32, i32* %4
%27 = load i32, i32* %8
%28 = sdiv i32 %27, 2
%29 = icmp sle i32 %26, %28
br i1 %29, label %30, label %43
30: ; preds = %25
%31 = load i32, i32* %7
%32 = srem i32 %31, 10
%33 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%34 = call i32 @Pop(i32* %33, i32* %6)
%35 = icmp ne i32 %32, %34
br i1 %35, label %36, label %37
36: ; preds = %30
store i32 0, i32* %9
br label %43
37: ; preds = %30
%38 = load i32, i32* %7
%39 = sdiv i32 %38, 10
store i32 %39, i32* %7
br label %40
40: ; preds = %37
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %25
43: ; preds = %36, %25
%44 = load i32, i32* %9
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %50
48: ; preds = %43
%49 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %50
50: ; preds = %48, %46
%51 = load i32, i32* %2
ret i32 %51
}

LLVM IR (-O2):
@str = [16 x i8] c"Not Palindrome.\00"
@str.2 = [12 x i8] c"Palindrome.\00"
define i32 @Palindrome(i32 %0) {
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = bitcast [100 x i32]* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%6 = icmp eq i32 %0, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
br label %15
9: ; preds = %15
%10 = lshr i32 %21, 1
%11 = add nuw nsw i32 %10, 1
br label %12
12: ; preds = %9, %1
%13 = phi i32 [ 1, %1 ], [ %11, %9 ]
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
br label %24
15: ; preds = %7, %15
%16 = phi i32 [ 0, %7 ], [ %21, %15 ]
%17 = phi i32 [ %0, %7 ], [ %20, %15 ]
%18 = srem i32 %17, 10
%19 = call i32 @Push(i32* %8, i32* %3, i32 %18)
%20 = sdiv i32 %17, 10
%21 = add nuw nsw i32 %16, 1
%22 = add i32 %17, 9
%23 = icmp ult i32 %22, 19
br i1 %23, label %9, label %15
24: ; preds = %12, %31
%25 = phi i32 [ %0, %12 ], [ %28, %31 ]
%26 = phi i32 [ 0, %12 ], [ %32, %31 ]
%27 = srem i32 %25, 10
%28 = sdiv i32 %25, 10
%29 = call i32 @Pop(i32* %14, i32* %3)
%30 = icmp eq i32 %27, %29
br i1 %30, label %31, label %34
31: ; preds = %24
%32 = add nuw i32 %26, 1
%33 = icmp eq i32 %32, %13
br i1 %33, label %34, label %24
34: ; preds = %24, %31
%35 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), %31 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0), %24 ]
%36 = call i32 @puts(i8* dereferenceable(1) %35)
ret i32 undef
}