#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 */
char *get_hex(int);
scalar_t__ is_palindrome(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int input = 0;
  scanf("%d", &input);
  while (1) {
    char *result = get_hex(input);
    if (is_palindrome(result) == 0) {
      printf("%s", result);
      break;
    }
    input++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xea3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <get_hex@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_palindrome@plt>
cmp    $0x0,%rax
jne    119a <main+0x5a>
mov    -0x10(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
jmp    11a8 <main+0x68>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeac(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   1050 <get_hex@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <is_palindrome@plt>
test   %rax,%rax
je     1192 <main+0x52>
mov    0xc(%rsp),%edi
add    $0x1,%edi
mov    %edi,0xc(%rsp)
jmp    1170 <main+0x30>
lea    0xe6a(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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