#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 /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void ES_teclado_2() {
  char str[100];
  printf("Enter a value: ");
  fgets(str, 100, stdin);
  printf("\n");
  printf("You entered: ");
  fputs(str, stdout);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<ES_teclado_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1050 <fgets@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    0x2e5a(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ES_teclado_2>:
push   %rbx
sub    $0x70,%rsp
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1060 <fgets@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <fputs@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a value: \00"
@stdin = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [14 x i8] c"You entered: \00"
@stdout = global i32 0
define void @ES_teclado_2() {
%1 = alloca [100 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 100, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = load i32, i32* @stdout
%10 = call i32 @fputs(i8* %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter a value: \00"
@stdin = global i32 0
@.str.2 = [14 x i8] c"You entered: \00"
@stdout = global i32 0
define void @ES_teclado_2() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 100, i32 %4)
%6 = call i32 @putchar(i32 10)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fputs(i8* %2, i32 %8)
%10 = call i32 @putchar(i32 10)
ret void
}