#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ quaternion_inverse(double *, double *);
int /*<<< orphan*/ quaternion_mult(double *, double *, double *);
int /*<<< orphan*/ quaternion_pow(double *, double *, double);
void quaternion_interpolation(double q[4], double q0[4], double q1[4],
                              double t) {
  double q0_inv[4], q01[4];
  quaternion_inverse(q0_inv, q0);
  quaternion_mult(q01, q1, q0_inv);
  quaternion_pow(q01, q01, t);
  quaternion_mult(q, q01, q0);
}


x86 assembly (clang, -O0):
<quaternion_interpolation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <quaternion_inverse@plt>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <quaternion_mult@plt>
lea    -0x60(%rbp),%rdi
lea    -0x60(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
call   1050 <quaternion_pow@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <quaternion_mult@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaternion_interpolation>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x50,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %rdx,%r14
mov    %rsi,%r13
mov    %rdi,%r15
lea    0x30(%rsp),%r12
mov    %r12,%rdi
call   1040 <quaternion_inverse@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1030 <quaternion_mult@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
movsd  0x8(%rsp),%xmm0
call   1050 <quaternion_pow@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
call   1030 <quaternion_mult@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @quaternion_interpolation(double* %0, double* %1, double* %2, double %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca [4 x double]
%10 = alloca [4 x double]
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double %3, double* %8
%11 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%12 = load double*, double** %6
%13 = call i32 @quaternion_inverse(double* %11, double* %12)
%14 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%15 = load double*, double** %7
%16 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%17 = call i32 @quaternion_mult(double* %14, double* %15, double* %16)
%18 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%19 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%20 = load double, double* %8
%21 = call i32 @quaternion_pow(double* %18, double* %19, double %20)
%22 = load double*, double** %5
%23 = getelementptr inbounds [4 x double], [4 x double]* %10, i64 0, i64 0
%24 = load double*, double** %6
%25 = call i32 @quaternion_mult(double* %22, double* %23, double* %24)
ret void
}

LLVM IR (-O2):
define void @quaternion_interpolation(double* %0, double* %1, double* %2, double %3) {
%5 = alloca [4 x double]
%6 = alloca [4 x double]
%7 = bitcast [4 x double]* %5 to i8*
%8 = bitcast [4 x double]* %6 to i8*
%9 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%10 = call i32 @quaternion_inverse(double* %9, double* %1)
%11 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%12 = call i32 @quaternion_mult(double* %11, double* %2, double* %9)
%13 = call i32 @quaternion_pow(double* %11, double* %11, double %3)
%14 = call i32 @quaternion_mult(double* %0, double* %11, double* %1)
ret void
}