#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char nombre[20];
  char apellido1[20];
  char apellido2[20];
  printf("Escriba su nombre:\n");
  scanf("%s", nombre);
  printf("Escriba su primer apellido:\n");
  scanf("%s", apellido1);
  printf("Escriba su segundo apellido:\n");
  scanf("%s", apellido2);
  printf("Su nombre completo es %s %s %s.\n", nombre, apellido1, apellido2);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rbx
lea    0x40(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
lea    0xe68(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Escriba su nombre:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [29 x i8] c"Escriba su primer apellido:\0A\00"
@.str.3 = [30 x i8] c"Escriba su segundo apellido:\0A\00"
@.str.4 = [33 x i8] c"Su nombre completo es %s %s %s.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %14, i8* %15, i8* %16)
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.4 = [33 x i8] c"Su nombre completo es %s %s %s.\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [19 x i8] c"Escriba su nombre:\00"
@str.5 = [28 x i8] c"Escriba su primer apellido:\00"
@str.6 = [29 x i8] c"Escriba su segundo apellido:\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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), i8* %4)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i8* %4, i8* %5, i8* %6)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}