#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 *, ...);
void checkpalin(int num) {
  int temp = num;
  int rev = 0;
  if (num < 0) {
    num = -num;
  }
  while (temp > 0) {
    rev = temp % 10 + rev * 10;
    temp = temp / 10;
  }
  if (rev == num) {
    printf("Yes");
    printf("%d", rev);
    return;
  }
  printf("No");
  printf("%d\n", rev);
  printf("%d\n", num);
}


x86 assembly (clang, -O0):
<checkpalin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113a <checkpalin+0x2a>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <checkpalin+0x2f>
cmpl   $0x0,-0x8(%rbp)
jle    1170 <checkpalin+0x60>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0xa,-0xc(%rbp),%eax
add    %eax,%edx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    113f <checkpalin+0x2f>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    11a0 <checkpalin+0x90>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d0 <checkpalin+0xc0>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkpalin>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
neg    %ebp
cmovs  %edi,%ebp
xor    %ebx,%ebx
test   %edi,%edi
jle    1151 <checkpalin+0x41>
mov    $0xcccccccd,%eax
cs nopw 0x0(%rax,%rax,1)
lea    (%rbx,%rbx,4),%ecx
mov    %edi,%edx
imul   %rax,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ebx
sub    %esi,%ebx
lea    (%rbx,%rcx,2),%ebx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1130 <checkpalin+0x20>
cmp    %ebp,%ebx
jne    116c <checkpalin+0x5c>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9a(%rip),%r14
jmp    118d <checkpalin+0x7d>
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe89(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"No\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define void @checkpalin(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ 0, %1 ]
%6 = phi i32 [ %10, %4 ], [ %0, %1 ]
%7 = urem i32 %6, 10
%8 = mul nsw i32 %5, 10
%9 = add nsw i32 %8, %7
%10 = udiv i32 %6, 10
%11 = icmp ult i32 %6, 10
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %9, %4 ]
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %20
17: ; preds = %12
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %13)
br label %20
20: ; preds = %17, %15
%21 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %17 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %15 ]
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %21, i32 %2)
ret void
}