#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 EXIT_SUCCESS;
int num_inverso(int);
int /*<<< orphan*/ num_palindromo(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int n;
  printf("Introduza un numero entero");
  scanf("%d", &n);
  while (!num_palindromo(n + num_inverso(n)))
    ;
  printf("%d es palindromo!!", n + num_inverso(n));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <num_inverso@plt>
mov    -0x18(%rbp),%edi
add    %eax,%edi
call   1040 <num_palindromo@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11a1 <main+0x61>
jmp    11a6 <main+0x66>
jmp    1174 <main+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <num_inverso@plt>
mov    -0x1c(%rbp),%esi
add    %eax,%esi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1050 <num_inverso@plt>
add    %eax,%ebx
mov    %ebx,%edi
call   1040 <num_palindromo@plt>
test   %eax,%eax
je     1170 <main+0x30>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1050 <num_inverso@plt>
add    %eax,%ebx
lea    0xe82(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Introduza un numero entero\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"%d es palindromo!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @num_inverso(i32 %11)
%13 = add nsw i32 %10, %12
%14 = call i32 @num_palindromo(i32 %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
%19 = load i32, i32* %6
%20 = load i32, i32* %6
%21 = call i32 @num_inverso(i32 %20)
%22 = add nsw i32 %19, %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32, i32* @EXIT_SUCCESS
ret i32 %24
}

LLVM IR (-O2):
@.str = [27 x i8] c"Introduza un numero entero\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"%d es palindromo!!\00"
@EXIT_SUCCESS = global i32 0
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 ([27 x i8], [27 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)
br label %7
7: ; preds = %7, %2
%8 = load i32, i32* %3
%9 = call i32 @num_inverso(i32 %8)
%10 = add nsw i32 %9, %8
%11 = call i32 @num_palindromo(i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = call i32 @num_inverso(i32 %14)
%16 = add nsw i32 %15, %14
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}