#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[4]) {
  int i;
  for (i = 0; i < 4; 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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1167 <mostrar_vector+0x57>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rsi
mov    (%rax,%rsi,4),%r8d
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <mostrar_vector+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostrar_vector>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2ebb(%rip),%r12
mov    (%r12),%edi
mov    (%rsi),%r8d
lea    0xecd(%rip),%r15
mov    %r15,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    0x4(%rbx),%r8d
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    0x8(%rbx),%r8d
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x2,%ecx
call   1030 <fprintf@plt>
mov    (%r12),%edi
mov    0xc(%rbx),%r8d
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x3,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

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) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32, i32* @stdout
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i32 %17)
br label %19
19: ; preds = %9
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
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) {
%3 = load i32, i32* @stdout
%4 = load i32, i32* %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0, i32 %4)
%6 = load i32, i32* @stdout
%7 = getelementptr inbounds i32, i32* %1, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1, i32 %8)
%10 = load i32, i32* @stdout
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 2, i32 %12)
%14 = load i32, i32* @stdout
%15 = getelementptr inbounds i32, i32* %1, i64 3
%16 = load i32, i32* %15
%17 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 3, i32 %16)
ret void
}