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


x86 assembly (clang, -O0):
<iniB>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1163 <iniB+0x63>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%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>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xe9d(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe81(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe71(%rip),%xmm1
subsd  0x18(%rax),%xmm1
movsd  0xe5c(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<iniB>:
movsd  0x8(%rsi),%xmm0
subsd  (%rsi),%xmm0
movsd  0xeef(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
subsd  0x8(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rdi)
movsd  0x18(%rsi),%xmm0
subsd  0x10(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rdi)
movsd  (%rsi),%xmm0
addsd  0xebc(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi)
movsd  0xeb4(%rip),%xmm0
subsd  0x18(%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 1, i32* %5
br label %6
6: ; preds = %27, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load double*, double** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = load double*, double** %4
%16 = load i32, i32* %5
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %15, i64 %18
%20 = load double, double* %19
%21 = fsub double %14, %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
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = fsub double %33, 8.000000e-01
%35 = fmul double 6.000000e+00, %34
%36 = load double*, double** %3
%37 = getelementptr inbounds double, double* %36, i64 0
store double %35, double* %37
%38 = load double*, double** %4
%39 = getelementptr inbounds double, double* %38, i64 3
%40 = load double, double* %39
%41 = fsub double 2.000000e-01, %40
%42 = fmul double 6.000000e+00, %41
%43 = load double*, double** %3
%44 = getelementptr inbounds double, double* %43, i64 4
store double %42, double* %44
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
%8 = getelementptr inbounds double, double* %0, i64 1
store double %7, double* %8
%9 = getelementptr inbounds double, double* %1, i64 2
%10 = load double, double* %9
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = fmul double %12, 6.000000e+00
%14 = getelementptr inbounds double, double* %0, i64 2
store double %13, double* %14
%15 = getelementptr inbounds double, double* %1, i64 3
%16 = load double, double* %15
%17 = load double, double* %9
%18 = fsub double %16, %17
%19 = fmul double %18, 6.000000e+00
%20 = getelementptr inbounds double, double* %0, i64 3
store double %19, double* %20
%21 = load double, double* %1
%22 = fadd double %21, -8.000000e-01
%23 = fmul double %22, 6.000000e+00
store double %23, double* %0
%24 = load double, double* %15
%25 = fsub double 2.000000e-01, %24
%26 = fmul double %25, 6.000000e+00
%27 = getelementptr inbounds double, double* %0, i64 4
store double %26, double* %27
ret void
}