#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 */
scalar_t__ palindrom(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  char hex[16];
  scanf("%d", &number);
  while (palindrom(number, hex) == 0) {
    number++;
  }
  printf("%s \n", hex);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1050 <palindrom@plt>
cmp    $0x0,%rax
jne    1173 <main+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <main+0x1f>
lea    -0x20(%rbp),%rsi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rsi
call   1050 <palindrom@plt>
test   %rax,%rax
jne    1178 <main+0x48>
lea    0x10(%rsp),%rbx
xchg   %ax,%ax
mov    0xc(%rsp),%edi
add    $0x1,%edi
mov    %edi,0xc(%rsp)
mov    %rbx,%rsi
call   1050 <palindrom@plt>
test   %rax,%rax
je     1160 <main+0x30>
lea    0xe84(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

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