void de_casteljau_split(double t, unsigned int N, double coeffA[N + 1],
                        double coeffB[N + 1], const double coeff[N + 1]) {
  coeffA[0] = coeff[0];
  coeffB[N] = coeff[N];
  if (0 == N)
    return;
  double coeff2[N];
  de_casteljau_step(N, coeff2, t, coeff);
  de_casteljau_split(t, N - 1, coeffA + 1, coeffB, coeff2);
}


x86 assembly (clang, -O0):
<de_casteljau_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jne    1174 <de_casteljau_split+0x54>
jmp    11d5 <de_casteljau_split+0xb5>
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,-0x40(%rbp)
mov    %rsi,%rsp
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%edi
movsd  -0x8(%rbp),%xmm0
mov    -0x28(%rbp),%rdx
mov    $0x1,%al
call   1040 <de_casteljau_step@plt>
mov    -0x40(%rbp),%rcx
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x20(%rbp),%rdx
call   1030 <de_casteljau_split@plt>
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<de_casteljau_split>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movsd  (%rcx),%xmm1
movsd  %xmm1,(%rsi)
mov    %edi,%eax
movsd  (%rcx,%rax,8),%xmm1
movsd  %xmm1,(%rdx,%rax,8)
test   %edi,%edi
je     1197 <de_casteljau_split+0x77>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebx
mov    %rsp,%r13
mov    %rsp,%r12
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    %r12,%rsi
mov    %rcx,%rdx
mov    $0x1,%al
movsd  %xmm0,-0x30(%rbp)
call   1040 <de_casteljau_step@plt>
add    $0xffffffff,%ebx
add    $0x8,%r15
movsd  -0x30(%rbp),%xmm0
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
call   1030 <de_casteljau_split@plt>
mov    %r13,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @de_casteljau_split(double %0, i32 %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i8*
%12 = alloca i64
store double %0, double* %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%13 = load i32, i32* %7
%14 = add i32 %13, 1
%15 = zext i32 %14 to i64
%16 = load i32, i32* %7
%17 = add i32 %16, 1
%18 = zext i32 %17 to i64
%19 = load i32, i32* %7
%20 = add i32 %19, 1
%21 = zext i32 %20 to i64
%22 = load double*, double** %10
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
%25 = load double*, double** %8
%26 = getelementptr inbounds double, double* %25, i64 0
store double %24, double* %26
%27 = load double*, double** %10
%28 = load i32, i32* %7
%29 = zext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = load double*, double** %9
%33 = load i32, i32* %7
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
store double %31, double* %35
%36 = load i32, i32* %7
%37 = icmp eq i32 0, %36
br i1 %37, label %38, label %39
38: ; preds = %5
br label %55
39: ; preds = %5
%40 = load i32, i32* %7
%41 = zext i32 %40 to i64
%42 = call i8* @llvm.stacksave()
store i8* %42, i8** %11
%43 = alloca double, i64 %41
store i64 %41, i64* %12
%44 = load i32, i32* %7
%45 = load double, double* %6
%46 = load double*, double** %10
%47 = call i32 (i32, double*, double, double*, ...) bitcast (i32 (...)* @de_casteljau_step to i32 (i32, double*, double, double*, ...)*)(i32 %44, double* %43, double %45, double* %46)
%48 = load double, double* %6
%49 = load i32, i32* %7
%50 = sub i32 %49, 1
%51 = load double*, double** %8
%52 = getelementptr inbounds double, double* %51, i64 1
%53 = load double*, double** %9
%54 = load i8*, i8** %11
br label %55
55: ; preds = %39, %38
ret void
}

LLVM IR (-O2):
define void @de_casteljau_split(double %0, i32 %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* %4) {
%6 = load double, double* %4
store double %6, double* %2
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds double, double* %4, i64 %7
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %3, i64 %7
store double %9, double* %10
%11 = icmp eq i32 %1, 0
br i1 %11, label %18, label %12
12: ; preds = %5
%13 = tail call i8* @llvm.stacksave()
%14 = alloca double, i64 %7
%15 = call i32 (i32, double*, double, double*, ...) bitcast (i32 (...)* @de_casteljau_step to i32 (i32, double*, double, double*, ...)*)(i32 %1, double* %14, double %0, double* %4)
%16 = add i32 %1, -1
%17 = getelementptr inbounds double, double* %2, i64 1
br label %18
18: ; preds = %5, %12
ret void
}