#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  printf("Digite o numero de elementos: ");
  scanf("%d", &i);
  int v[i];
  v[0] = 10;
  v[1] = 11;
  v[4] = 14;
  int k = 2;
  printf("v[0]: %d,\t v[1]: %d,\t v[4]: %d\n", v[0], v[1], v[4]);
  printf("k: %d\n", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movl   $0xa,(%rax)
movl   $0xb,0x4(%rax)
movl   $0xe,0x10(%rax)
movl   $0x2,-0x1c(%rbp)
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x10(%rax),%ecx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    %rsp,%rbx
lea    0xed4(%rip),%rdi
mov    $0xa,%esi
mov    $0xb,%edx
mov    $0xe,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rsp
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Digite o numero de elementos: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"v[0]: %d,\09 v[1]: %d,\09 v[4]: %d\0A\00"
@.str.3 = [7 x i8] c"k: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %3
%11 = alloca i32, i64 %9
store i64 %9, i64* %4
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 10, i32* %12
%13 = getelementptr inbounds i32, i32* %11, i64 1
store i32 11, i32* %13
%14 = getelementptr inbounds i32, i32* %11, i64 4
store i32 14, i32* %14
store i32 2, i32* %5
%15 = getelementptr inbounds i32, i32* %11, i64 0
%16 = load i32, i32* %15
%17 = getelementptr inbounds i32, i32* %11, i64 1
%18 = load i32, i32* %17
%19 = getelementptr inbounds i32, i32* %11, i64 4
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 %18, i32 %20)
%22 = load i32, i32* %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %22)
store i32 0, i32* %1
%24 = load i8*, i8** %3
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@.str = [31 x i8] c"Digite o numero de elementos: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"v[0]: %d,\09 v[1]: %d,\09 v[4]: %d\0A\00"
@.str.3 = [7 x i8] c"k: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i8* @llvm.stacksave()
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 10, i32 11, i32 14)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 2)
ret i32 0
}