#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*/ copyMat4(float *, float *);
int /*<<< orphan*/ hpmMultMat4(float *, float *, float *);
int /*<<< orphan*/ hpmQuaternionRotation(float, float, float, float, float *);
void hpmRotateQuaternion(float x, float y, float z, float w, float *mat) {
  float rot[16], r[16];
  hpmQuaternionRotation(x, y, z, w, rot);
  hpmMultMat4(rot, mat, r);
  copyMat4(mat, r);
}


x86 assembly (clang, -O0):
<hpmRotateQuaternion>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
lea    -0x60(%rbp),%rdi
call   1030 <hpmQuaternionRotation@plt>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
call   1040 <hpmMultMat4@plt>
mov    -0x18(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1050 <copyMat4@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpmRotateQuaternion>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rbx
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1030 <hpmQuaternionRotation@plt>
mov    %rsp,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <hpmMultMat4@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <copyMat4@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @hpmRotateQuaternion(float %0, float %1, float %2, float %3, float* %4) {
%6 = alloca [16 x float]
%7 = alloca [16 x float]
%8 = bitcast [16 x float]* %6 to i8*
%9 = bitcast [16 x float]* %7 to i8*
%10 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
%11 = call i32 @hpmQuaternionRotation(float %0, float %1, float %2, float %3, float* %10)
%12 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 0
%13 = call i32 @hpmMultMat4(float* %10, float* %4, float* %12)
%14 = call i32 @copyMat4(float* %4, float* %12)
ret void
}