int main() {
  float scores[] = {80, 95, 10, 30, 100};
  float result[5];
  printf("*scores = %f\n", *scores);
  printf("scores[0] = %f\n", scores[0]);
  printf("scores[1] = %d\n", &scores[1]);
  myArrayDiv(scores, 10.0, result);
  puts(" ");
  int i;
  for (i = 0; i < 5; ++i) {
    printf(" %f", result[i]);
  }
  puts(" ");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xead(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
add    $0x4,%rsi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
movsd  0xe4e(%rip),%xmm0
mov    $0x1,%al
call   1050 <myArrayDiv@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x5,-0x44(%rbp)
jge    1202 <main+0xd2>
movslq -0x44(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe67(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11ce <main+0x9e>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    0xee3(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xed0(%rip),%rdi
movsd  0xea4(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
movsd  0xe8e(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0x24(%rsp),%rsi
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x20(%rsp),%rdi
movsd  0xe6f(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x1,%al
call   1050 <myArrayDiv@plt>
lea    0xea8(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe90(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.scores = [5 x float] [float 8.000000e+01, float 9.500000e+01, float 1.000000e+01, float 3.000000e+01, float 1.000000e+02]
@.str = [14 x i8] c"*scores = %f\0A\00"
@.str.1 = [16 x i8] c"scores[0] = %f\0A\00"
@.str.2 = [16 x i8] c"scores[1] = %d\0A\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [4 x i8] c" %f\00"
define i32 @main() {
%1 = alloca [5 x float]
%2 = alloca [5 x float]
%3 = bitcast [5 x float]* %1 to i8*
%4 = bitcast [5 x float]* %2 to i8*
%5 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double 8.000000e+01)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double 8.000000e+01)
%8 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 1
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), float* %8)
%10 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 0
%11 = call i32 (float*, double, float*, ...) bitcast (i32 (...)* @myArrayDiv to i32 (float*, double, float*, ...)*)(float* %5, double 1.000000e+01, float* %10)
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%13 = load float, float* %10
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %14)
%16 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 1
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %18)
%20 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 2
%21 = load float, float* %20
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %22)
%24 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 3
%25 = load float, float* %24
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %26)
%28 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 4
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %30)
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}