void iniB(double *B, double *A) {
  int i;
  for (i = 0; i < 7 - 2; i++)
    B[i] = 6 * (A[i + 1] - A[i]);
}


x86 assembly (clang, -O0):
<iniB>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1163 <iniB+0x63>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xebc(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <iniB+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iniB>:
movsd  0x8(%rsi),%xmm0
subsd  (%rsi),%xmm0
movsd  0xeef(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi)
movsd  0x10(%rsi),%xmm0
subsd  0x8(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x18(%rsi),%xmm0
subsd  0x10(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rdi)
movsd  0x20(%rsi),%xmm0
subsd  0x18(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rdi)
movsd  0x28(%rsi),%xmm0
subsd  0x20(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rdi)
ret

LLVM IR (-O0):
define void @iniB(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %27, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load double*, double** %4
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %10, i64 %13
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = fsub double %15, %20
%22 = fmul double 6.000000e+00, %21
%23 = load double*, double** %3
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
store double %22, double* %26
br label %27
27: ; preds = %9
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %6
30: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @iniB(double* nocapture writeonly %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = load double, double* %3
%5 = load double, double* %1
%6 = fsub double %4, %5
%7 = fmul double %6, 6.000000e+00
store double %7, double* %0
%8 = getelementptr inbounds double, double* %1, i64 2
%9 = load double, double* %8
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = fmul double %11, 6.000000e+00
%13 = getelementptr inbounds double, double* %0, i64 1
store double %12, double* %13
%14 = getelementptr inbounds double, double* %1, i64 3
%15 = load double, double* %14
%16 = load double, double* %8
%17 = fsub double %15, %16
%18 = fmul double %17, 6.000000e+00
%19 = getelementptr inbounds double, double* %0, i64 2
store double %18, double* %19
%20 = getelementptr inbounds double, double* %1, i64 4
%21 = load double, double* %20
%22 = load double, double* %14
%23 = fsub double %21, %22
%24 = fmul double %23, 6.000000e+00
%25 = getelementptr inbounds double, double* %0, i64 3
store double %24, double* %25
%26 = getelementptr inbounds double, double* %1, i64 5
%27 = load double, double* %26
%28 = load double, double* %20
%29 = fsub double %27, %28
%30 = fmul double %29, 6.000000e+00
%31 = getelementptr inbounds double, double* %0, i64 4
store double %30, double* %31
ret void
}