void main() {
  float V[10] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}, *ptr;
  int i;
  ptr = V;
  for (i = 0; i < 10; i++) {
    printf("Posicao: %d\tValor armazenado: %f\tEndereco da posicao: %d\n", i,
           *ptr, ptr);
    ptr++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0xa,-0x3c(%rbp)
jge    1191 <main+0x71>
mov    -0x3c(%rbp),%esi
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x38(%rbp),%rdx
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    114c <main+0x2c>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    0xf10(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xeeb(%rip),%rbx
movsd  0xeab(%rip),%xmm0
mov    %rsp,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x4(%rsp),%rdx
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x8(%rsp),%rdx
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xc(%rsp),%rdx
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r15,%rdx
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x14(%rsp),%rdx
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x18(%rsp),%rdx
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x1c(%rsp),%rdx
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x8,%esi
mov    %r14,%rdx
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x24(%rsp),%rdx
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.V = [10 x float] [float 1.000000e+01, float 2.000000e+01, float 3.000000e+01, float 4.000000e+01, float 5.000000e+01, float 6.000000e+01, float 7.000000e+01, float 8.000000e+01, float 9.000000e+01, float 1.000000e+02]
@.str = [58 x i8] c"Posicao: %d\09Valor armazenado: %f\09Endereco da posicao: %d\0A\00"
define void @main() {
%1 = alloca [10 x float]
%2 = alloca float*
%3 = alloca i32
%4 = bitcast [10 x float]* %1 to i8*
%5 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
store float* %5, float** %2
store i32 0, i32* %3
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load float*, float** %2
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = load float*, float** %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %10, double %13, float* %14)
%16 = load float*, float** %2
%17 = getelementptr inbounds float, float* %16, i32 1
store float* %17, float** %2
br label %18
18: ; preds = %9
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@__const.main.V = [10 x float] [float 1.000000e+01, float 2.000000e+01, float 3.000000e+01, float 4.000000e+01, float 5.000000e+01, float 6.000000e+01, float 7.000000e+01, float 8.000000e+01, float 9.000000e+01, float 1.000000e+02]
@.str = [58 x i8] c"Posicao: %d\09Valor armazenado: %f\09Endereco da posicao: %d\0A\00"
define void @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 0, double 1.000000e+01, float* %3)
%5 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 1
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 1, double %7, float* %5)
%9 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 2
%10 = load float, float* %9
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 2, double %11, float* %9)
%13 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 3
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 3, double %15, float* %13)
%17 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 4
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 4, double %19, float* %17)
%21 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 5
%22 = load float, float* %21
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 5, double %23, float* %21)
%25 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 6
%26 = load float, float* %25
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 6, double %27, float* %25)
%29 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 7
%30 = load float, float* %29
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 7, double %31, float* %29)
%33 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 8
%34 = load float, float* %33
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 8, double %35, float* %33)
%37 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 9
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 9, double %39, float* %37)
ret void
}