#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 */
float M_PI;
float cosf(float);
float sinf(float);
void mtxRotateZApply(float *mtx, float deg) {
  float rad = deg * (M_PI / 180.0f);
  float cosrad = cosf(rad);
  float sinrad = sinf(rad);
  float mtx00 = mtx[0];
  float mtx01 = mtx[1];
  float mtx02 = mtx[2];
  float mtx03 = mtx[3];
  mtx[0] = mtx[4] * sinrad + mtx00 * cosrad;
  mtx[4] = mtx[4] * cosrad - mtx00 * sinrad;
  mtx[1] = mtx[5] * sinrad + mtx01 * cosrad;
  mtx[5] = mtx[5] * cosrad - mtx01 * sinrad;
  mtx[2] = mtx[6] * sinrad + mtx02 * cosrad;
  mtx[6] = mtx[6] * cosrad - mtx02 * sinrad;
  mtx[3] = mtx[7] * sinrad + mtx03 * cosrad;
  mtx[7] = mtx[7] * cosrad - mtx03 * sinrad;
}


x86 assembly (clang, -O0):
<mtxRotateZApply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    0x2eab(%rip),%rax
movss  (%rax),%xmm1
movss  0xeb7(%rip),%xmm2
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movss  0x10(%rax),%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x10(%rax),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movss  0x14(%rax),%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x14(%rax),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
movss  0x18(%rax),%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0x24(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0x18(%rax),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x24(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movss  0x1c(%rax),%xmm0
movss  -0x18(%rbp),%xmm2
movss  -0x28(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
movss  0x1c(%rax),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x28(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x1c(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtxRotateZApply>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
mov    0x2eb9(%rip),%rax
movss  (%rax),%xmm1
divss  0xec5(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
call   1040 <cosf@plt>
movaps %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
movups (%rbx),%xmm1
movups 0x10(%rbx),%xmm2
movaps 0x10(%rsp),%xmm4
shufps $0x0,%xmm4,%xmm4
movaps %xmm4,%xmm3
mulps  %xmm1,%xmm3
shufps $0x0,%xmm0,%xmm0
mulps  %xmm2,%xmm4
mulps  %xmm0,%xmm2
addps  %xmm3,%xmm2
movups %xmm2,(%rbx)
mulps  %xmm1,%xmm0
subps  %xmm0,%xmm4
movups %xmm4,0x10(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define void @mtxRotateZApply(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float* %0, float** %3
store float %1, float* %4
%12 = load float, float* %4
%13 = load float, float* @M_PI
%14 = fdiv float %13, 1.800000e+02
%15 = fmul float %12, %14
store float %15, float* %5
%16 = load float, float* %5
%17 = call float @cosf(float %16)
store float %17, float* %6
%18 = load float, float* %5
%19 = call float @sinf(float %18)
store float %19, float* %7
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 0
%22 = load float, float* %21
store float %22, float* %8
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 1
%25 = load float, float* %24
store float %25, float* %9
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 2
%28 = load float, float* %27
store float %28, float* %10
%29 = load float*, float** %3
%30 = getelementptr inbounds float, float* %29, i64 3
%31 = load float, float* %30
store float %31, float* %11
%32 = load float*, float** %3
%33 = getelementptr inbounds float, float* %32, i64 4
%34 = load float, float* %33
%35 = load float, float* %7
%36 = load float, float* %8
%37 = load float, float* %6
%38 = fmul float %36, %37
%39 = call float @llvm.fmuladd.f32(float %34, float %35, float %38)
%40 = load float*, float** %3
%41 = getelementptr inbounds float, float* %40, i64 0
store float %39, float* %41
%42 = load float*, float** %3
%43 = getelementptr inbounds float, float* %42, i64 4
%44 = load float, float* %43
%45 = load float, float* %6
%46 = load float, float* %8
%47 = load float, float* %7
%48 = fmul float %46, %47
%49 = fneg float %48
%50 = call float @llvm.fmuladd.f32(float %44, float %45, float %49)
%51 = load float*, float** %3
%52 = getelementptr inbounds float, float* %51, i64 4
store float %50, float* %52
%53 = load float*, float** %3
%54 = getelementptr inbounds float, float* %53, i64 5
%55 = load float, float* %54
%56 = load float, float* %7
%57 = load float, float* %9
%58 = load float, float* %6
%59 = fmul float %57, %58
%60 = call float @llvm.fmuladd.f32(float %55, float %56, float %59)
%61 = load float*, float** %3
%62 = getelementptr inbounds float, float* %61, i64 1
store float %60, float* %62
%63 = load float*, float** %3
%64 = getelementptr inbounds float, float* %63, i64 5
%65 = load float, float* %64
%66 = load float, float* %6
%67 = load float, float* %9
%68 = load float, float* %7
%69 = fmul float %67, %68
%70 = fneg float %69
%71 = call float @llvm.fmuladd.f32(float %65, float %66, float %70)
%72 = load float*, float** %3
%73 = getelementptr inbounds float, float* %72, i64 5
store float %71, float* %73
%74 = load float*, float** %3
%75 = getelementptr inbounds float, float* %74, i64 6
%76 = load float, float* %75
%77 = load float, float* %7
%78 = load float, float* %10
%79 = load float, float* %6
%80 = fmul float %78, %79
%81 = call float @llvm.fmuladd.f32(float %76, float %77, float %80)
%82 = load float*, float** %3
%83 = getelementptr inbounds float, float* %82, i64 2
store float %81, float* %83
%84 = load float*, float** %3
%85 = getelementptr inbounds float, float* %84, i64 6
%86 = load float, float* %85
%87 = load float, float* %6
%88 = load float, float* %10
%89 = load float, float* %7
%90 = fmul float %88, %89
%91 = fneg float %90
%92 = call float @llvm.fmuladd.f32(float %86, float %87, float %91)
%93 = load float*, float** %3
%94 = getelementptr inbounds float, float* %93, i64 6
store float %92, float* %94
%95 = load float*, float** %3
%96 = getelementptr inbounds float, float* %95, i64 7
%97 = load float, float* %96
%98 = load float, float* %7
%99 = load float, float* %11
%100 = load float, float* %6
%101 = fmul float %99, %100
%102 = call float @llvm.fmuladd.f32(float %97, float %98, float %101)
%103 = load float*, float** %3
%104 = getelementptr inbounds float, float* %103, i64 3
store float %102, float* %104
%105 = load float*, float** %3
%106 = getelementptr inbounds float, float* %105, i64 7
%107 = load float, float* %106
%108 = load float, float* %6
%109 = load float, float* %11
%110 = load float, float* %7
%111 = fmul float %109, %110
%112 = fneg float %111
%113 = call float @llvm.fmuladd.f32(float %107, float %108, float %112)
%114 = load float*, float** %3
%115 = getelementptr inbounds float, float* %114, i64 7
store float %113, float* %115
ret void
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define void @mtxRotateZApply(float* nocapture %0, float %1) {
%3 = load float, float* @M_PI
%4 = fdiv float %3, 1.800000e+02
%5 = fmul float %4, %1
%6 = tail call float @cosf(float %5)
%7 = tail call float @sinf(float %5)
%8 = bitcast float* %0 to <4 x float>*
%9 = load <4 x float>, <4 x float>* %8
%10 = getelementptr inbounds float, float* %0, i64 4
%11 = bitcast float* %10 to <4 x float>*
%12 = load <4 x float>, <4 x float>* %11
%13 = insertelement <4 x float> poison, float %6, i64 0
%14 = shufflevector <4 x float> %13, <4 x float> poison, <4 x i32> zeroinitializer
%15 = fmul <4 x float> %14, %9
%16 = insertelement <4 x float> poison, float %7, i64 0
%17 = shufflevector <4 x float> %16, <4 x float> poison, <4 x i32> zeroinitializer
%18 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %12, <4 x float> %17, <4 x float> %15)
%19 = bitcast float* %0 to <4 x float>*
store <4 x float> %18, <4 x float>* %19
%20 = fneg <4 x float> %9
%21 = fmul <4 x float> %17, %20
%22 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %12, <4 x float> %14, <4 x float> %21)
%23 = bitcast float* %10 to <4 x float>*
store <4 x float> %22, <4 x float>* %23
ret void
}