#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 /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int a, b = 0, c, count1 = 0, count = 0;
  printf("Enter the number");
  scanf("%d", &a);
  if (c = a) {
    while (a != 0) {
      b = b * 10 + a % 10;
      a = a / 10;
      count1 = count1 + 1;
    }
    printf(" No. of digit is  %d\n", count1);
    printf(" No. in Reverse order is  %d\n", b);
    if (c == b)
      printf("The given No. is a penindrome number\n");
    else
      printf("The given No. is  not a penindrome number\n");
  } else
    printf("No. of digits is 1\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1211 <main+0xf1>
jmp    117d <main+0x5d>
cmpl   $0x0,-0x14(%rbp)
je     11bd <main+0x9d>
imul   $0xa,-0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    117d <main+0x5d>
mov    -0x20(%rbp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    11fe <main+0xde>
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120c <main+0xec>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121f <main+0xff>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%r14d
test   %r14d,%r14d
je     11db <main+0xab>
xor    %esi,%esi
mov    %r14d,%eax
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbx,4),%ecx
movslq %eax,%rbp
imul   $0x66666667,%rbp,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rax
add    %edi,%eax
lea    (%rax,%rax,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %ebp,%edx
sub    %edi,%edx
lea    (%rdx,%rcx,2),%ebx
add    $0x1,%esi
add    $0x9,%ebp
cmp    $0x12,%ebp
ja     1170 <main+0x40>
mov    %eax,0xc(%rsp)
lea    0xe67(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6f(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebx,%r14d
lea    0xeb7(%rip),%rax
lea    0xe86(%rip),%rdi
cmove  %rax,%rdi
jmp    11e2 <main+0xb2>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter the number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c" No. of digit is %d\0A\00"
@.str.3 = [30 x i8] c" No. in Reverse order is %d\0A\00"
@.str.4 = [38 x i8] c"The given No. is a penindrome number\0A\00"
@.str.5 = [43 x i8] c"The given No. is not a penindrome number\0A\00"
@.str.6 = [20 x i8] c"No. of digits is 1\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
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %9
store i32 0, i32* %10
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%13 = load i32, i32* %6
store i32 %13, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %42
15: ; preds = %2
br label %16
16: ; preds = %19, %15
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %16
%20 = load i32, i32* %7
%21 = mul nsw i32 %20, 10
%22 = load i32, i32* %6
%23 = srem i32 %22, 10
%24 = add nsw i32 %21, %23
store i32 %24, i32* %7
%25 = load i32, i32* %6
%26 = sdiv i32 %25, 10
store i32 %26, i32* %6
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 1
store i32 %28, i32* %9
br label %16
29: ; preds = %16
%30 = load i32, i32* %9
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %7
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %32)
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = icmp eq i32 %34, %35
br i1 %36, label %37, label %39
37: ; preds = %29
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
br label %41
39: ; preds = %29
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
br label %41
41: ; preds = %39, %37
br label %44
42: ; preds = %2
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
br label %44
44: ; preds = %42, %41
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter the number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c" No. of digit is %d\0A\00"
@.str.3 = [30 x i8] c" No. in Reverse order is %d\0A\00"
@str = [19 x i8] c"No. of digits is 1\00"
@str.7 = [42 x i8] c"The given No. is not a penindrome number\00"
@str.8 = [37 x i8] c"The given No. is a penindrome number\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %25, label %9
9: ; preds = %2, %9
%10 = phi i32 [ %15, %9 ], [ 0, %2 ]
%11 = phi i32 [ %17, %9 ], [ 0, %2 ]
%12 = phi i32 [ %16, %9 ], [ %7, %2 ]
%13 = mul nsw i32 %10, 10
%14 = srem i32 %12, 10
%15 = add nsw i32 %13, %14
%16 = sdiv i32 %12, 10
%17 = add nuw nsw i32 %11, 1
%18 = add i32 %12, 9
%19 = icmp ult i32 %18, 19
br i1 %19, label %20, label %9
20: ; preds = %9
store i32 %16, i32* %3
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%23 = icmp eq i32 %7, %15
%24 = select i1 %23, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @str.7, i64 0, i64 0)
br label %25
25: ; preds = %2, %20
%26 = phi i8* [ %24, %20 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), %2 ]
%27 = call i32 @puts(i8* dereferenceable(1) %26)
ret i32 0
}