#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 *, char *, int, int);
int /*<<< orphan*/ stdout;
void mostrar_vector(char nombre[], int v[], int n) {
  int i;
  for (i = 0; i < n; i = i + 1) {
    fprintf(stdout, "%s[%d] = %d\n", nombre, i, v[i]);
  }
}


x86 assembly (clang, -O0):
<mostrar_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116c <mostrar_vector+0x5c>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rsi
mov    (%rax,%rsi,4),%r8d
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <mostrar_vector+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostrar_vector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    115d <mostrar_vector+0x4d>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r13d
xor    %ebx,%ebx
mov    0x2eaf(%rip),%rbp
lea    0xec8(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edi
mov    (%r14,%rbx,4),%r8d
mov    %r12,%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1140 <mostrar_vector+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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