#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*/ hpmRotation(float, float, float, float, float *);
void hpmRotate(float x, float y, float z, float angle, float *mat) {
  if (angle == 0.0)
    return;
  float rot[16], r[16];
  hpmRotation(x, y, z, angle, rot);
  hpmMultMat4(rot, mat, r);
  copyMat4(mat, r);
}


x86 assembly (clang, -O0):
<hpmRotate>:
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  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1174 <hpmRotate+0x44>
jp     1174 <hpmRotate+0x44>
jmp    11b5 <hpmRotate+0x85>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
lea    -0x60(%rbp),%rdi
call   1050 <hpmRotation@plt>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
call   1030 <hpmMultMat4@plt>
mov    -0x18(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1040 <copyMat4@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpmRotate>:
xorps  %xmm4,%xmm4
ucomiss %xmm4,%xmm3
jne    113b <hpmRotate+0xb>
jp     113b <hpmRotate+0xb>
ret
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rbx
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1050 <hpmRotation@plt>
mov    %rsp,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <hpmMultMat4@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <copyMat4@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @hpmRotate(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* %9
%14 = fpext float %13 to double
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %5
br label %31
17: ; preds = %5
%18 = load float, float* %6
%19 = load float, float* %7
%20 = load float, float* %8
%21 = load float, float* %9
%22 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%23 = call i32 @hpmRotation(float %18, float %19, float %20, float %21, float* %22)
%24 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%25 = load float*, float** %10
%26 = getelementptr inbounds [16 x float], [16 x float]* %12, i64 0, i64 0
%27 = call i32 @hpmMultMat4(float* %24, float* %25, float* %26)
%28 = load float*, float** %10
%29 = getelementptr inbounds [16 x float], [16 x float]* %12, i64 0, i64 0
%30 = call i32 @copyMat4(float* %28, float* %29)
br label %31
31: ; preds = %17, %16
ret void
}

LLVM IR (-O2):
define void @hpmRotate(float %0, float %1, float %2, float %3, float* %4) {
%6 = alloca [16 x float]
%7 = alloca [16 x float]
%8 = fcmp oeq float %3, 0.000000e+00
br i1 %8, label %17, label %9
9: ; preds = %5
%10 = bitcast [16 x float]* %6 to i8*
%11 = bitcast [16 x float]* %7 to i8*
%12 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
%13 = call i32 @hpmRotation(float %0, float %1, float %2, float %3, float* %12)
%14 = getelementptr inbounds [16 x float], [16 x float]* %7, i64 0, i64 0
%15 = call i32 @hpmMultMat4(float* %12, float* %4, float* %14)
%16 = call i32 @copyMat4(float* %4, float* %14)
br label %17
17: ; preds = %5, %9
ret void
}