#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, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main() {
  int i;
  int v[10];
  for (i = 0; i < 10; i = i + 1) {
    fprintf(stdout, "Introduce v[%d]: ", i);
    fscanf(stdin, "%d", &v[i]);
  }
  for (i = 0; i < 10; i = i + 1) {
    fprintf(stdout, "v[%d] = %d\n", i, v[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    118c <main+0x6c>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
movslq -0x8(%rbp),%rax
lea    -0x30(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe99(%rip),%rsi
call   1030 <fscanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11cd <main+0xad>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1193 <main+0x73>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2ea6(%rip),%r15
mov    (%r15),%edi
lea    0xec4(%rip),%r14
mov    %r14,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e99(%rip),%r12
mov    (%r12),%edi
lea    0xeb8(%rip),%rbx
mov    %rsp,%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r12),%edi
lea    0x4(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r12),%edi
lea    0x8(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r12),%edi
lea    0xc(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r12),%edi
lea    0x10(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r12),%edi
lea    0x14(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r12),%edi
lea    0x18(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r12),%edi
lea    0x1c(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r12),%edi
lea    0x20(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    %r14,%rsi
mov    $0x9,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r12),%edi
lea    0x24(%rsp),%rdx
mov    %rbx,%rsi
call   1030 <fscanf@plt>
mov    (%r15),%edi
mov    (%rsp),%ecx
lea    0xd68(%rip),%rbx
mov    %rbx,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    0x4(%rsp),%ecx
mov    %rbx,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    0x8(%rsp),%ecx
mov    %rbx,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    0xc(%rsp),%ecx
mov    %rbx,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    0x10(%rsp),%ecx
mov    %rbx,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    0x14(%rsp),%ecx
mov    %rbx,%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    0x18(%rsp),%ecx
mov    %rbx,%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    0x1c(%rsp),%ecx
mov    %rbx,%rsi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    0x20(%rsp),%ecx
mov    %rbx,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    0x24(%rsp),%ecx
mov    %rbx,%rsi
mov    $0x9,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [18 x i8] c"Introduce v[%d]: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"v[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = load i32, i32* @stdout
%4 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = load i32, i32* @stdin
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @fscanf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = load i32, i32* @stdout
%9 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = load i32, i32* @stdin
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%12 = call i32 @fscanf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %11)
%13 = load i32, i32* @stdout
%14 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 2)
%15 = load i32, i32* @stdin
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%17 = call i32 @fscanf(i32 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = load i32, i32* @stdout
%19 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 3)
%20 = load i32, i32* @stdin
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%22 = call i32 @fscanf(i32 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %21)
%23 = load i32, i32* @stdout
%24 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4)
%25 = load i32, i32* @stdin
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%27 = call i32 @fscanf(i32 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %26)
%28 = load i32, i32* @stdout
%29 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 5)
%30 = load i32, i32* @stdin
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%32 = call i32 @fscanf(i32 %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %31)
%33 = load i32, i32* @stdout
%34 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 6)
%35 = load i32, i32* @stdin
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%37 = call i32 @fscanf(i32 %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %36)
%38 = load i32, i32* @stdout
%39 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 7)
%40 = load i32, i32* @stdin
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%42 = call i32 @fscanf(i32 %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %41)
%43 = load i32, i32* @stdout
%44 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 8)
%45 = load i32, i32* @stdin
%46 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%47 = call i32 @fscanf(i32 %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %46)
%48 = load i32, i32* @stdout
%49 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 9)
%50 = load i32, i32* @stdin
%51 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%52 = call i32 @fscanf(i32 %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %51)
%53 = load i32, i32* @stdout
%54 = load i32, i32* %6
%55 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %54)
%56 = load i32, i32* @stdout
%57 = load i32, i32* %11
%58 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %57)
%59 = load i32, i32* @stdout
%60 = load i32, i32* %16
%61 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %60)
%62 = load i32, i32* @stdout
%63 = load i32, i32* %21
%64 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %63)
%65 = load i32, i32* @stdout
%66 = load i32, i32* %26
%67 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 %66)
%68 = load i32, i32* @stdout
%69 = load i32, i32* %31
%70 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %68, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 %69)
%71 = load i32, i32* @stdout
%72 = load i32, i32* %36
%73 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 %72)
%74 = load i32, i32* @stdout
%75 = load i32, i32* %41
%76 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 7, i32 %75)
%77 = load i32, i32* @stdout
%78 = load i32, i32* %46
%79 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 8, i32 %78)
%80 = load i32, i32* @stdout
%81 = load i32, i32* %51
%82 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 9, i32 %81)
ret i32 0
}