#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*/ IdentityMatrix(float *);
int /*<<< orphan*/ Matrix4RotationX(float *, float const);
int /*<<< orphan*/ Matrix4RotationY(float *, float const);
int /*<<< orphan*/ Matrix4RotationZ(float *, float const);
int /*<<< orphan*/ MultiplyMatrix(float *, float *, float *);
void RotationXYZMatrixM(float *_matrix, const float x, const float y,
                        const float z) {
  if (x != 0.0f) {
    float _m[16];
    IdentityMatrix(_m);
    Matrix4RotationX(_m, x);
    MultiplyMatrix(_m, _matrix, _matrix);
  }
  if (y != 0.0f) {
    float _m[16];
    IdentityMatrix(_m);
    Matrix4RotationY(_m, y);
    MultiplyMatrix(_m, _matrix, _matrix);
  }
  if (z != 0.0f) {
    float _m[16];
    IdentityMatrix(_m);
    Matrix4RotationZ(_m, z);
    MultiplyMatrix(_m, _matrix, _matrix);
  }
}


x86 assembly (clang, -O0):
<RotationXYZMatrixM>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    118a <RotationXYZMatrixM+0x3a>
jp     118a <RotationXYZMatrixM+0x3a>
jmp    11b2 <RotationXYZMatrixM+0x62>
lea    -0x60(%rbp),%rdi
call   1040 <IdentityMatrix@plt>
lea    -0x60(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1070 <Matrix4RotationX@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <MultiplyMatrix@plt>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11ce <RotationXYZMatrixM+0x7e>
jp     11ce <RotationXYZMatrixM+0x7e>
jmp    11ff <RotationXYZMatrixM+0xaf>
lea    -0xa0(%rbp),%rdi
call   1040 <IdentityMatrix@plt>
lea    -0xa0(%rbp),%rdi
movss  -0x10(%rbp),%xmm0
call   1030 <Matrix4RotationY@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <MultiplyMatrix@plt>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    121b <RotationXYZMatrixM+0xcb>
jp     121b <RotationXYZMatrixM+0xcb>
jmp    124c <RotationXYZMatrixM+0xfc>
lea    -0xe0(%rbp),%rdi
call   1040 <IdentityMatrix@plt>
lea    -0xe0(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
call   1060 <Matrix4RotationZ@plt>
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <MultiplyMatrix@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotationXYZMatrixM>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movss  %xmm2,0x8(%rsp)
mov    %rdi,%rbx
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
movss  %xmm1,0x4(%rsp)
jne    1170 <RotationXYZMatrixM+0x20>
jnp    11a8 <RotationXYZMatrixM+0x58>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
movss  %xmm0,0xc(%rsp)
call   1040 <IdentityMatrix@plt>
mov    %r14,%rdi
movss  0xc(%rsp),%xmm0
call   1070 <Matrix4RotationX@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1050 <MultiplyMatrix@plt>
xorps  %xmm2,%xmm2
movss  0x4(%rsp),%xmm1
ucomiss %xmm2,%xmm1
jne    11af <RotationXYZMatrixM+0x5f>
jnp    11d8 <RotationXYZMatrixM+0x88>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1040 <IdentityMatrix@plt>
mov    %r14,%rdi
movss  0x4(%rsp),%xmm0
call   1030 <Matrix4RotationY@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1050 <MultiplyMatrix@plt>
xorps  %xmm0,%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jne    11e8 <RotationXYZMatrixM+0x98>
jnp    1211 <RotationXYZMatrixM+0xc1>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1040 <IdentityMatrix@plt>
mov    %r14,%rdi
movss  0x8(%rsp),%xmm0
call   1060 <Matrix4RotationZ@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1050 <MultiplyMatrix@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @RotationXYZMatrixM(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca [16 x float]
%10 = alloca [16 x float]
%11 = alloca [16 x float]
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%12 = load float, float* %6
%13 = fcmp une float %12, 0.000000e+00
br i1 %13, label %14, label %24
14: ; preds = %4
%15 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%16 = call i32 @IdentityMatrix(float* %15)
%17 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%18 = load float, float* %6
%19 = call i32 @Matrix4RotationX(float* %17, float %18)
%20 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%21 = load float*, float** %5
%22 = load float*, float** %5
%23 = call i32 @MultiplyMatrix(float* %20, float* %21, float* %22)
br label %24
24: ; preds = %14, %4
%25 = load float, float* %7
%26 = fcmp une float %25, 0.000000e+00
br i1 %26, label %27, label %37
27: ; preds = %24
%28 = getelementptr inbounds [16 x float], [16 x float]* %10, i64 0, i64 0
%29 = call i32 @IdentityMatrix(float* %28)
%30 = getelementptr inbounds [16 x float], [16 x float]* %10, i64 0, i64 0
%31 = load float, float* %7
%32 = call i32 @Matrix4RotationY(float* %30, float %31)
%33 = getelementptr inbounds [16 x float], [16 x float]* %10, i64 0, i64 0
%34 = load float*, float** %5
%35 = load float*, float** %5
%36 = call i32 @MultiplyMatrix(float* %33, float* %34, float* %35)
br label %37
37: ; preds = %27, %24
%38 = load float, float* %8
%39 = fcmp une float %38, 0.000000e+00
br i1 %39, label %40, label %50
40: ; preds = %37
%41 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%42 = call i32 @IdentityMatrix(float* %41)
%43 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%44 = load float, float* %8
%45 = call i32 @Matrix4RotationZ(float* %43, float %44)
%46 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%47 = load float*, float** %5
%48 = load float*, float** %5
%49 = call i32 @MultiplyMatrix(float* %46, float* %47, float* %48)
br label %50
50: ; preds = %40, %37
ret void
}

LLVM IR (-O2):
define void @RotationXYZMatrixM(float* %0, float %1, float %2, float %3) {
%5 = alloca [16 x float]
%6 = alloca [16 x float]
%7 = alloca [16 x float]
%8 = fcmp une float %1, 0.000000e+00
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = bitcast [16 x float]* %5 to i8*
%11 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%12 = call i32 @IdentityMatrix(float* %11)
%13 = call i32 @Matrix4RotationX(float* %11, float %1)
%14 = call i32 @MultiplyMatrix(float* %11, float* %0, float* %0)
br label %15
15: ; preds = %9, %4
%16 = fcmp une float %2, 0.000000e+00
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = bitcast [16 x float]* %6 to i8*
%19 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
%20 = call i32 @IdentityMatrix(float* %19)
%21 = call i32 @Matrix4RotationY(float* %19, float %2)
%22 = call i32 @MultiplyMatrix(float* %19, float* %0, float* %0)
br label %23
23: ; preds = %17, %15
%24 = fcmp une float %3, 0.000000e+00
br i1 %24, label %25, label %31
25: ; preds = %23
%26 = bitcast [16 x float]* %7 to i8*
%27 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 0
%28 = call i32 @IdentityMatrix(float* %27)
%29 = call i32 @Matrix4RotationZ(float* %27, float %3)
%30 = call i32 @MultiplyMatrix(float* %27, float* %0, float* %0)
br label %31
31: ; preds = %25, %23
ret void
}