#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 *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strrev(char *);
int main() {
  int decimalNumber, remainder, quotient;
  int i = 1, j, temp;
  char hexadecimalNumber[100];
  char comparable[100];
  scanf("%d", &decimalNumber);
  quotient = decimalNumber;
  while (quotient != 0) {
    temp = quotient % 16;
    if (temp < 10)
      temp = temp + 48;
    else
      temp = temp + 55;
    hexadecimalNumber[i++] = temp;
    quotient = quotient / 16;
  }
  strcpy(comparable, hexadecimalNumber);
  strrev(comparable);
  if (strcmp(hexadecimalNumber, comparable) == 0) {
    for (j = 0; j = strlen(hexadecimalNumber); j++) {
      printf("%c", hexadecimalNumber[j]);
    }
  } else {
    printf("Nope");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xe80(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     11f1 <main+0x91>
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    11bf <main+0x5f>
mov    -0x1c(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c8 <main+0x68>
mov    -0x1c(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x14(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
cltq
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    118f <main+0x2f>
lea    -0xf0(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xf0(%rbp),%rdi
call   1080 <strrev@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    126d <main+0x10d>
movl   $0x0,-0x18(%rbp)
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1268 <main+0x108>
movslq -0x18(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%esi
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    122e <main+0xce>
jmp    127b <main+0x11b>
lea    0xd92(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xe8,%rsp
lea    0xe7f(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%ebx
test   %ebx,%ebx
je     11d5 <main+0x65>
lea    0x11(%rsp),%rax
nopl   0x0(%rax,%rax,1)
lea    0xf(%rbx),%r8d
test   %ebx,%ebx
mov    %ebx,%esi
cmovs  %r8d,%esi
mov    %esi,%edi
and    $0xfffffff0,%edi
mov    %ebx,%ecx
sub    %edi,%ecx
lea    0x30(%rcx),%edx
neg    %edi
cmp    $0xa,%ecx
lea    0x37(%rbx,%rdi,1),%ecx
cmovl  %edx,%ecx
mov    %cl,(%rax)
sar    $0x4,%esi
add    $0x1,%rax
mov    %esi,%ebx
cmp    $0x1e,%r8d
ja     11a0 <main+0x30>
lea    0x80(%rsp),%rbx
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1090 <strrev@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1215 <main+0xa5>
lea    0xdf7(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1248 <main+0xd8>
lea    0x10(%rsp),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
je     1248 <main+0xd8>
lea    0x10(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
cltq
movsbl 0x10(%rsp,%rax,1),%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jne    1230 <main+0xc0>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [5 x i8] c"Nope\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [100 x i8]
%9 = alloca [100 x i8]
store i32 0, i32* %1
store i32 1, i32* %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
store i32 %11, i32* %4
br label %12
12: ; preds = %26, %0
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %35
15: ; preds = %12
%16 = load i32, i32* %4
%17 = srem i32 %16, 16
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = icmp slt i32 %18, 10
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 48
store i32 %22, i32* %7
br label %26
23: ; preds = %15
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 55
store i32 %25, i32* %7
br label %26
26: ; preds = %23, %20
%27 = load i32, i32* %7
%28 = trunc i32 %27 to i8
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
%31 = sext i32 %29 to i64
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 %31
store i8 %28, i8* %32
%33 = load i32, i32* %4
%34 = sdiv i32 %33, 16
store i32 %34, i32* %4
br label %12
35: ; preds = %12
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%38 = call i32 @strcpy(i8* %36, i8* %37)
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%40 = call i32 @strrev(i8* %39)
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%43 = call i64 @strcmp(i8* %41, i8* %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %61
45: ; preds = %35
store i32 0, i32* %6
br label %46
46: ; preds = %57, %45
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%48 = call i32 @strlen(i8* %47)
store i32 %48, i32* %6
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %60
50: ; preds = %46
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %50
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
br label %46
60: ; preds = %46
br label %63
61: ; preds = %35
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %63
63: ; preds = %61, %60
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"Nope\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %23, label %10
10: ; preds = %0, %10
%11 = phi i64 [ %18, %10 ], [ 1, %0 ]
%12 = phi i32 [ %20, %10 ], [ %8, %0 ]
%13 = srem i32 %12, 16
%14 = icmp slt i32 %13, 10
%15 = select i1 %14, i32 48, i32 55
%16 = add nsw i32 %15, %13
%17 = trunc i32 %16 to i8
%18 = add nuw i64 %11, 1
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %11
store i8 %17, i8* %19
%20 = sdiv i32 %12, 16
%21 = add i32 %12, 15
%22 = icmp ult i32 %21, 31
br i1 %22, label %23, label %10
23: ; preds = %10, %0
%24 = call i32 @strcpy(i8* %6, i8* %5)
%25 = call i32 @strrev(i8* %6)
%26 = call i64 @strcmp(i8* %5, i8* %6)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %40
28: ; preds = %23
%29 = call i32 @strlen(i8* %5)
%30 = icmp eq i32 %29, 0
br i1 %30, label %42, label %31
31: ; preds = %28, %31
%32 = phi i32 [ %38, %31 ], [ %29, %28 ]
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = call i32 @putchar(i32 %36)
%38 = call i32 @strlen(i8* %5)
%39 = icmp eq i32 %38, 0
br i1 %39, label %42, label %31
40: ; preds = %23
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %42
42: ; preds = %31, %28, %40
ret i32 0
}