#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ mostrar_cadena(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  char cadena[200];
  fprintf(stdout, "Escribe lo que te de la gana: ");
  fgets(cadena, 200, stdin);
  mostrar_cadena(cadena);
  fprintf(stdout, "Escribe lo que te de la gana: ");
  fgets(cadena, 200, stdin);
  mostrar_cadena(cadena);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    $0xc8,%esi
call   1040 <fgets@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <mostrar_cadena@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe73(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2e48(%rip),%rax
mov    (%rax),%edx
mov    $0xc8,%esi
call   1040 <fgets@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <mostrar_cadena@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    0x2e93(%rip),%r15
mov    (%r15),%edi
lea    0xeb1(%rip),%r14
mov    %r14,%rsi
call   1050 <fprintf@plt>
mov    0x2e8a(%rip),%r12
mov    (%r12),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <mostrar_cadena@plt>
mov    (%r15),%edi
mov    %r14,%rsi
call   1050 <fprintf@plt>
mov    (%r12),%edx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <mostrar_cadena@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [31 x i8] c"Escribe lo que te de la gana: \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 200, i32 %6)
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%9 = call i32 @mostrar_cadena(i8* %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 200, i32 %13)
%15 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%16 = call i32 @mostrar_cadena(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [31 x i8] c"Escribe lo que te de la gana: \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %2, i32 200, i32 %5)
%7 = call i32 @mostrar_cadena(i8* %2)
%8 = load i32, i32* @stdout
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %2, i32 200, i32 %10)
%12 = call i32 @mostrar_cadena(i8* %2)
ret i32 0
}