#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*/ lib3ds_matrix_rotate_quat(float **, float *);
int /*<<< orphan*/ lib3ds_quat_axis_angle(float *, float *, float);
int /*<<< orphan*/ lib3ds_vector_make(float *, float, float, float);
void lib3ds_matrix_rotate(float m[4][4], float angle, float ax, float ay,
                          float az) {
  float q[4];
  float axis[3];
  lib3ds_vector_make(axis, ax, ay, az);
  lib3ds_quat_axis_angle(q, axis, angle);
  lib3ds_matrix_rotate_quat(m, q);
}


x86 assembly (clang, -O0):
<lib3ds_matrix_rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
lea    -0x3c(%rbp),%rdi
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1030 <lib3ds_vector_make@plt>
lea    -0x30(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
movss  -0xc(%rbp),%xmm0
call   1050 <lib3ds_quat_axis_angle@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <lib3ds_matrix_rotate_quat@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib3ds_matrix_rotate>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movss  %xmm0,(%rsp)
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
call   1030 <lib3ds_vector_make@plt>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
movss  (%rsp),%xmm0
call   1050 <lib3ds_quat_axis_angle@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <lib3ds_matrix_rotate_quat@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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