void main() {
  float a[5] = {1, 5, 8, 9, 10}, *p = a;
  int i = 0;
  for (; i < 5; i++) {
    printf("%o %f\n", p, *p);
    p++;
  }
  printf("%o %f N = %d", p, *p, p - a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    1188 <main+0x78>
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xead(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1146 <main+0x36>
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x28(%rbp),%rdx
lea    -0x20(%rbp),%rax
sub    %rax,%rdx
sar    $0x2,%rdx
lea    0xe6d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0xf03(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r14
lea    0xeec(%rip),%rbx
mov    %rsp,%rsi
movsd  0xebd(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe66(%rip),%rdi
mov    $0x5,%edx
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [5 x float] [float 1.000000e+00, float 5.000000e+00, float 8.000000e+00, float 9.000000e+00, float 1.000000e+01]
@.str = [7 x i8] c"%o %f\0A\00"
@.str.1 = [13 x i8] c"%o %f N = %d\00"
define void @main() {
%1 = alloca [5 x float]
%2 = alloca float*
%3 = alloca i32
%4 = bitcast [5 x float]* %1 to i8*
%5 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 0
store float* %5, float** %2
store i32 0, i32* %3
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load float*, float** %2
%11 = load float*, float** %2
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %10, double %13)
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i32 1
store float* %16, float** %2
br label %17
17: ; preds = %9
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %6
20: ; preds = %6
%21 = load float*, float** %2
%22 = load float*, float** %2
%23 = load float, float* %22
%24 = fpext float %23 to double
%25 = load float*, float** %2
%26 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 0
%27 = ptrtoint float* %25 to i64
%28 = ptrtoint float* %26 to i64
%29 = sub i64 %27, %28
%30 = sdiv exact i64 %29, 4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float* %21, double %24, i64 %30)
ret void
}

LLVM IR (-O2):
@__const.main.a = [5 x float] [float 1.000000e+00, float 5.000000e+00, float 8.000000e+00, float 9.000000e+00, float 1.000000e+01]
@.str = [7 x i8] c"%o %f\0A\00"
@.str.1 = [13 x i8] c"%o %f N = %d\00"
define void @main() {
%1 = alloca [5 x float]
%2 = bitcast [5 x float]* %1 to i8*
%3 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %3, double 1.000000e+00)
%5 = getelementptr inbounds [5 x float], [5 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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %5, double %7)
%9 = getelementptr inbounds [5 x float], [5 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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %9, double %11)
%13 = getelementptr inbounds [5 x float], [5 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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %13, double %15)
%17 = getelementptr inbounds [5 x float], [5 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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %17, double %19)
%21 = getelementptr inbounds [5 x float], [5 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 ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float* %21, double %23, i64 5)
ret void
}