#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*/ hpmZRotation(float, float *);
void hpmRotateZ(float rotation, float *mat) {
  if (rotation == 0.0)
    return;
  float rot[16], r[16];
  hpmZRotation(rotation, rot);
  hpmMultMat4(rot, mat, r);
  copyMat4(mat, r);
}


x86 assembly (clang, -O0):
<hpmRotateZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1165 <hpmRotateZ+0x35>
jp     1165 <hpmRotateZ+0x35>
jmp    1197 <hpmRotateZ+0x67>
movss  -0x4(%rbp),%xmm0
lea    -0x50(%rbp),%rdi
call   1050 <hpmZRotation@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1030 <hpmMultMat4@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1040 <copyMat4@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpmRotateZ>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    113b <hpmRotateZ+0xb>
jp     113b <hpmRotateZ+0xb>
ret
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rbx
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1050 <hpmZRotation@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 @hpmRotateZ(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca [16 x float]
%6 = alloca [16 x float]
store float %0, float* %3
store float* %1, float** %4
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %2
br label %22
11: ; preds = %2
%12 = load float, float* %3
%13 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%14 = call i32 @hpmZRotation(float %12, float* %13)
%15 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%16 = load float*, float** %4
%17 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
%18 = call i32 @hpmMultMat4(float* %15, float* %16, float* %17)
%19 = load float*, float** %4
%20 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
%21 = call i32 @copyMat4(float* %19, float* %20)
br label %22
22: ; preds = %11, %10
ret void
}

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