#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 letra1, letra2, letra3, letra4;
  printf("Escriba \"hola\":\n");
  scanf("%c", &letra1);
  scanf("%c", &letra2);
  scanf("%c", &letra3);
  scanf("%c", &letra4);
  printf("Enhorabuena, sabe escribir %c%c%c%c.\n", letra1, letra2, letra3,
         letra4);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebd(%rip),%rdi
lea    -0x6(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xead(%rip),%rdi
lea    -0x7(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe9d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%esi
movsbl -0x6(%rbp),%edx
movsbl -0x7(%rbp),%ecx
movsbl -0x8(%rbp),%r8d
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e3d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xd(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%esi
movsbl 0xe(%rsp),%edx
movsbl 0xd(%rsp),%ecx
movsbl 0xc(%rsp),%r8d
lea    0xe6b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e3a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Escriba \22hola\22:\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [38 x i8] c"Enhorabuena, sabe escribir %c%c%c%c.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = load i8, i8* %5
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %14, i32 %16, i32 %18)
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [38 x i8] c"Enhorabuena, sabe escribir %c%c%c%c.\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [16 x i8] c"Escriba \22hola\22:\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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), i8* %1)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %13, i32 %15, i32 %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}