#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*/ printf(char *, int);
int main(int argc, char *argv[]) {
  if (argc < 2)
    return 1;
  int n, reverse = 0, rem, temp;
  n = argv[1][0];
  temp = n;
  while (temp != 0) {
    rem = temp % 10;
    reverse = reverse * 10 + rem;
    temp /= 10;
  }
  if (reverse == n)
    printf("%d is a palindrome.\n", n);
  else
    printf("%d is not a palindrome.\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <main+0xb2>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     118c <main+0x7c>
mov    -0x20(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
imul   $0xa,-0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
jmp    1157 <main+0x47>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11ac <main+0x9c>
mov    -0x14(%rbp),%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <main+0xab>
mov    -0x14(%rbp),%esi
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1188 <main+0x78>
mov    0x8(%rsi),%rax
movsbl (%rax),%esi
xor    %ebp,%ebp
mov    $0x0,%ecx
test   %esi,%esi
je     116f <main+0x5f>
xor    %ecx,%ecx
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rcx,%rcx,4),%ecx
movslq %eax,%rbx
imul   $0x66666667,%rbx,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rax
add    %edi,%eax
lea    (%rax,%rax,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %ebx,%edx
sub    %edi,%edx
lea    (%rdx,%rcx,2),%ecx
add    $0x9,%ebx
cmp    $0x12,%ebx
ja     1140 <main+0x30>
cmp    %esi,%ecx
lea    0xe88(%rip),%rax
lea    0xe96(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"%d is a palindrome.\0A\00"
@.str.1 = [25 x i8] c"%d is not a palindrome.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %24, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i8 %7, 0
br i1 %9, label %19, label %10
10: ; preds = %4, %10
%11 = phi i32 [ %16, %10 ], [ %8, %4 ]
%12 = phi i32 [ %15, %10 ], [ 0, %4 ]
%13 = srem i32 %11, 10
%14 = mul nsw i32 %12, 10
%15 = add nsw i32 %13, %14
%16 = sdiv i32 %11, 10
%17 = add nsw i32 %11, 9
%18 = icmp ult i32 %17, 19
br i1 %18, label %19, label %10
19: ; preds = %10, %4
%20 = phi i32 [ 0, %4 ], [ %15, %10 ]
%21 = icmp eq i32 %20, %8
%22 = select i1 %21, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0)
%23 = tail call i32 @printf(i8* %22, i32 %8)
br label %24
24: ; preds = %19, %2
%25 = phi i32 [ 1, %2 ], [ 0, %19 ]
ret i32 %25
}