#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*/ hexadecimal(int, char *);
int isPalindrom(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  char hex[9];
  int isPoly = 0;
  scanf("%d", &num);
  do {
    hexadecimal(num, hex);
    isPoly = isPalindrom(hex);
    if (isPoly == 1) {
      printf("%s\n", hex);
    }
    num++;
  } while (isPoly == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xea3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
lea    -0x11(%rbp),%rsi
call   1040 <hexadecimal@plt>
lea    -0x11(%rbp),%rdi
call   1060 <isPalindrom@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1198 <main+0x58>
lea    -0x11(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1166 <main+0x26>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%edi
lea    0x7(%rsp),%rbx
nopl   0x0(%rax)
mov    %rbx,%rsi
call   1040 <hexadecimal@plt>
mov    %rbx,%rdi
call   1060 <isPalindrom@plt>
cmp    $0x1,%eax
je     1184 <main+0x44>
mov    (%rsp),%edi
add    $0x1,%edi
mov    %edi,(%rsp)
test   %eax,%eax
je     1160 <main+0x20>
jmp    1195 <main+0x55>
lea    0xe78(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [9 x i8]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %2
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%9 = call i32 @hexadecimal(i32 %7, i8* %8)
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%11 = call i32 @isPalindrom(i8* %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %6
%15 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %6
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %20
20: ; preds = %17
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 0
br i1 %22, label %6, label %23
23: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
br label %7
7: ; preds = %14, %0
%8 = phi i32 [ %16, %14 ], [ %6, %0 ]
%9 = call i32 @hexadecimal(i32 %8, i8* %4)
%10 = call i32 @isPalindrom(i8* %4)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %18
14: ; preds = %7
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
%17 = icmp eq i32 %10, 0
br i1 %17, label %7, label %18
18: ; preds = %14, %12
ret i32 0
}