#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 /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void pedir_vector(char nombre[], int v[4]) {
  int i;
  for (i = 0; i < 4; i = i + 1) {
    fprintf(stdout, "Introduce %s[%d]: ", nombre, i);
    fscanf(stdin, "%d", &v[i]);
  }
}


x86 assembly (clang, -O0):
<pedir_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    118f <pedir_vector+0x6f>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe97(%rip),%rsi
call   1030 <fscanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <pedir_vector+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pedir_vector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2ea0(%rip),%r13
mov    0x0(%r13),%edi
lea    0xebd(%rip),%r15
mov    %r15,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1040 <fprintf@plt>
mov    0x2e91(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xeb2(%rip),%r12
mov    %r12,%rsi
mov    %rbx,%rdx
call   1030 <fscanf@plt>
mov    0x0(%r13),%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
call   1040 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0x4(%rbx),%rdx
mov    %r12,%rsi
call   1030 <fscanf@plt>
mov    0x0(%r13),%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x2,%ecx
call   1040 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0x8(%rbx),%rdx
mov    %r12,%rsi
call   1030 <fscanf@plt>
mov    0x0(%r13),%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x3,%ecx
call   1040 <fprintf@plt>
mov    0x0(%rbp),%edi
add    $0xc,%rbx
mov    %r12,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fscanf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [19 x i8] c"Introduce %s[%d]: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define void @pedir_vector(i8* %0, i32* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0)
%5 = load i32, i32* @stdin
%6 = tail call i32 @fscanf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
%9 = load i32, i32* @stdin
%10 = getelementptr inbounds i32, i32* %1, i64 1
%11 = tail call i32 @fscanf(i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = load i32, i32* @stdout
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i32 2)
%14 = load i32, i32* @stdin
%15 = getelementptr inbounds i32, i32* %1, i64 2
%16 = tail call i32 @fscanf(i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = load i32, i32* @stdout
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i32 3)
%19 = load i32, i32* @stdin
%20 = getelementptr inbounds i32, i32* %1, i64 3
%21 = tail call i32 @fscanf(i32 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20)
ret void
}