#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 */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
main() {
  char nombre[30];
  int edad;
  struct tm *tiempo;
  time_t segundos;
  time(&segundos);
  tiempo = localtime(&segundos);
  printf("Introduzca su nombre: ");
  scanf("%s", nombre);
  printf("Introduzca su edad: ");
  scanf("%d", &edad);
  printf("Hola %s, en el año 2030 cumplirás %d años\n", nombre,
         edad + (2030 - (tiempo->tm_year + 1900) + 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x34(%rbp),%rdi
call   1050 <time@plt>
lea    -0x34(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x30(%rbp)
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
add    $0x76c,%ecx
mov    $0x7ee,%eax
sub    %ecx,%eax
add    $0x1,%eax
add    %eax,%edx
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x8(%rsp),%edx
sub    (%rbx),%edx
add    $0x83,%edx
lea    0xe7b(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [23 x i8] c"Introduzca su nombre: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [21 x i8] c"Introduzca su edad: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [46 x i8] c"Hola %s, en el a\C3\B1o 2030 cumplir\C3\A1s %d a\C3\B1os\0A\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = alloca i32
%5 = call i32 @time(i32* %4)
%6 = call %struct.tm* @localtime(i32* %4)
store %struct.tm* %6, %struct.tm** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%12 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%13 = load i32, i32* %2
%14 = load %struct.tm*, %struct.tm** %3
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1900
%18 = sub nsw i32 2030, %17
%19 = add nsw i32 %18, 1
%20 = add nsw i32 %13, %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* %12, i32 %20)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [23 x i8] c"Introduzca su nombre: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [21 x i8] c"Introduzca su edad: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [46 x i8] c"Hola %s, en el a\C3\B1o 2030 cumplir\C3\A1s %d a\C3\B1os\0A\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @time(i32* %3)
%8 = call %struct.tm* @localtime(i32* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 0
%15 = load i32, i32* %14
%16 = add i32 %13, 131
%17 = sub i32 %16, %15
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* %4, i32 %17)
ret i32 0
}