void BackSubstitution(double *A, int N) {
  register int i = 0;
  register double *d, *z, *x;
  z = &A[N * 4 - 1];
  x = z - 4;
  d = &A[(N - 2) * 4];
  for (i = 0; i < (N - 1); i++) {
    x[0] -= x[4] * x[-3];
    x -= 4;
  }
}


x86 assembly (clang, -O0):
<BackSubstitution>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffe0,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11c3 <BackSubstitution+0xc3>
mov    -0x28(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  -0x18(%rax),%xmm2
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
movq   %xmm0,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffe0,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115b <BackSubstitution+0x5b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BackSubstitution>:
lea    0x0(,%rsi,4),%ecx
lea    -0x1(%rsi),%eax
cmp    $0x2,%esi
jl     117d <BackSubstitution+0x7d>
movslq %ecx,%rcx
lea    -0x8(%rdi,%rcx,8),%rcx
movsd  (%rcx),%xmm1
jne    1126 <BackSubstitution+0x26>
movapd %xmm1,%xmm0
mov    %rcx,%rsi
jmp    1166 <BackSubstitution+0x66>
mov    %eax,%edx
and    $0xfffffffe,%edx
nopl   0x0(%rax,%rax,1)
movsd  -0x40(%rcx),%xmm0
movsd  -0x20(%rcx),%xmm2
mulsd  -0x38(%rcx),%xmm1
subsd  %xmm1,%xmm2
movsd  %xmm2,-0x20(%rcx)
mulsd  -0x58(%rcx),%xmm2
lea    -0x40(%rcx),%rsi
subsd  %xmm2,%xmm0
movsd  %xmm0,-0x40(%rcx)
movapd %xmm0,%xmm1
mov    %rsi,%rcx
add    $0xfffffffe,%edx
jne    1130 <BackSubstitution+0x30>
test   $0x1,%al
je     117d <BackSubstitution+0x7d>
movsd  -0x20(%rsi),%xmm1
mulsd  -0x38(%rsi),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,-0x20(%rsi)
ret

LLVM IR (-O0):
define void @BackSubstitution(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%9 = load double*, double** %3
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 4
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %9, i64 %13
store double* %14, double** %7
%15 = load double*, double** %7
%16 = getelementptr inbounds double, double* %15, i64 -4
store double* %16, double** %8
%17 = load double*, double** %3
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 2
%20 = mul nsw i32 %19, 4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %17, i64 %21
store double* %22, double** %6
store i32 0, i32* %5
br label %23
23: ; preds = %42, %2
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = sub nsw i32 %25, 1
%27 = icmp slt i32 %24, %26
br i1 %27, label %28, label %45
28: ; preds = %23
%29 = load double*, double** %8
%30 = getelementptr inbounds double, double* %29, i64 4
%31 = load double, double* %30
%32 = load double*, double** %8
%33 = getelementptr inbounds double, double* %32, i64 -3
%34 = load double, double* %33
%35 = load double*, double** %8
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = fneg double %31
%39 = call double @llvm.fmuladd.f64(double %38, double %34, double %37)
store double %39, double* %36
%40 = load double*, double** %8
%41 = getelementptr inbounds double, double* %40, i64 -4
store double* %41, double** %8
br label %42
42: ; preds = %28
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 1
store i32 %44, i32* %5
br label %23
45: ; preds = %23
ret void
}

LLVM IR (-O2):
define void @BackSubstitution(double* nocapture %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = add i32 %1, -1
%8 = icmp sgt i32 %1, 1
br i1 %8, label %9, label %44
9: ; preds = %2
%10 = load double, double* %6
%11 = and i32 %7, 1
%12 = icmp eq i32 %1, 2
br i1 %12, label %33, label %13
13: ; preds = %9
%14 = and i32 %7, -2
br label %15
15: ; preds = %15, %13
%16 = phi double [ %10, %13 ], [ %30, %15 ]
%17 = phi double* [ %6, %13 ], [ %25, %15 ]
%18 = phi i32 [ 0, %13 ], [ %31, %15 ]
%19 = getelementptr inbounds double, double* %17, i64 -4
%20 = getelementptr inbounds double, double* %17, i64 -7
%21 = load double, double* %20
%22 = load double, double* %19
%23 = fneg double %16
%24 = tail call double @llvm.fmuladd.f64(double %23, double %21, double %22)
store double %24, double* %19
%25 = getelementptr inbounds double, double* %17, i64 -8
%26 = getelementptr inbounds double, double* %17, i64 -11
%27 = load double, double* %26
%28 = load double, double* %25
%29 = fneg double %24
%30 = tail call double @llvm.fmuladd.f64(double %29, double %27, double %28)
store double %30, double* %25
%31 = add i32 %18, 2
%32 = icmp eq i32 %31, %14
br i1 %32, label %33, label %15
33: ; preds = %15, %9
%34 = phi double [ %10, %9 ], [ %30, %15 ]
%35 = phi double* [ %6, %9 ], [ %25, %15 ]
%36 = icmp eq i32 %11, 0
br i1 %36, label %44, label %37
37: ; preds = %33
%38 = getelementptr inbounds double, double* %35, i64 -4
%39 = getelementptr inbounds double, double* %35, i64 -7
%40 = load double, double* %39
%41 = load double, double* %38
%42 = fneg double %34
%43 = tail call double @llvm.fmuladd.f64(double %42, double %40, double %41)
store double %43, double* %38
br label %44
44: ; preds = %37, %33, %2
ret void
}