#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void mostrar_cadena(char cadena[200]) {
  int i;
  fprintf(stdout, "Has escrito: ");
  for (i = 0; i < 200; i = i + 1) {
    fprintf(stdout, "%c", cadena[i]);
  }
}


x86 assembly (clang, -O0):
<mostrar_cadena>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xc8,-0xc(%rbp)
jge    1178 <mostrar_cadena+0x68>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <mostrar_cadena+0x2a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostrar_cadena>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
mov    0x2ebe(%rip),%r15
mov    (%r15),%edi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xed4(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15),%edi
movsbl (%r12,%rbx,1),%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    $0xc8,%rbx
jne    1140 <mostrar_cadena+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"Has escrito: \00"
@.str.1 = [3 x i8] c"%c\00"
define void @mostrar_cadena(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 200
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* @stdout
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %9
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"Has escrito: \00"
@.str.1 = [3 x i8] c"%c\00"
define void @mostrar_cadena(i8* nocapture %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %11, %4 ]
%6 = load i32, i32* @stdout
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %5, 1
%12 = icmp eq i64 %11, 200
br i1 %12, label %13, label %4
13: ; preds = %4
ret void
}