#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 cos(float);
float glmRadf(float);
float sin(float);
void glmGenerateRotationMatrixFromAngles4fDeg(float matrix[16], float a1,
                                              float a2, float a3) {
  float sr, sp, sy, cr, cp, cy;
  a1 = glmRadf(a1);
  a2 = glmRadf(a2);
  a3 = glmRadf(a3);
  sy = sin(a3);
  cy = cos(a3);
  sp = sin(a2);
  cp = cos(a2);
  sr = sin(a1);
  cr = cos(a1);
  matrix[0] = cp * cy;
  matrix[1] = cp * sy;
  matrix[2] = -sp;
  matrix[3] = 0;
  matrix[4] = sr * sp * cy + cr * -sy;
  matrix[5] = sr * sp * sy + cr * cy;
  matrix[6] = sr * cp;
  matrix[7] = 0;
  matrix[8] = (cr * sp * cy + -sr * -sy);
  matrix[9] = (cr * sp * sy + -sr * cy);
  matrix[10] = cr * cp;
  matrix[11] = 0;
  matrix[12] = 0.0;
  matrix[13] = 0.0;
  matrix[14] = 0.0;
  matrix[15] = 1;
}


x86 assembly (clang, -O0):
<glmGenerateRotationMatrixFromAngles4fDeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <glmRadf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <glmRadf@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <glmRadf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <sin@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
call   1050 <cos@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
call   1050 <cos@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <sin@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <cos@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x28(%rbp),%xmm0
mulss  -0x2c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x28(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
movss  -0x18(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x24(%rbp),%xmm1
movss  -0x20(%rbp),%xmm3
movd   %xmm3,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
movss  -0x18(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm2
movss  -0x24(%rbp),%xmm1
mulss  -0x2c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
movss  -0x18(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rax)
movss  -0x24(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  -0x20(%rbp),%xmm3
movd   %xmm3,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x20(%rax)
movss  -0x24(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  -0x2c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x24(%rax)
movss  -0x24(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x2c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x34(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
movss  0xc90(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateRotationMatrixFromAngles4fDeg>:
push   %rbx
sub    $0x30,%rsp
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
mov    %rdi,%rbx
call   1030 <glmRadf@plt>
movss  %xmm0,0x14(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <glmRadf@plt>
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <glmRadf@plt>
movss  %xmm0,0x20(%rsp)
call   1040 <sin@plt>
movss  %xmm0,0x10(%rsp)
movss  0x20(%rsp),%xmm0
call   1050 <cos@plt>
movss  %xmm0,0x1c(%rsp)
movss  0xc(%rsp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm0
call   1050 <cos@plt>
movss  %xmm0,0x18(%rsp)
movss  0x14(%rsp),%xmm0
call   1040 <sin@plt>
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm0
call   1050 <cos@plt>
movss  0x1c(%rsp),%xmm5
movaps %xmm5,%xmm1
movss  0x18(%rsp),%xmm8
mulss  %xmm8,%xmm1
movss  %xmm1,(%rbx)
movss  0x10(%rsp),%xmm4
movaps %xmm4,%xmm1
mulss  %xmm8,%xmm1
movss  %xmm1,0x4(%rbx)
movaps 0xe03(%rip),%xmm1
movaps 0x20(%rsp),%xmm7
xorps  %xmm7,%xmm1
movss  %xmm1,0x8(%rbx)
movaps %xmm7,%xmm1
movss  0xc(%rsp),%xmm9
mulss  %xmm9,%xmm1
movaps %xmm5,%xmm2
mulss  %xmm0,%xmm2
movaps %xmm8,%xmm3
mulss  %xmm0,%xmm7
mulss  %xmm0,%xmm8
mulss  %xmm4,%xmm0
movaps %xmm4,%xmm6
movaps %xmm1,%xmm4
mulss  %xmm5,%xmm4
subss  %xmm0,%xmm4
movl   $0x0,0xc(%rbx)
movss  %xmm4,0x10(%rbx)
movaps %xmm6,%xmm4
mulss  %xmm6,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,0x14(%rbx)
mulss  %xmm9,%xmm3
movss  %xmm3,0x18(%rbx)
movl   $0x0,0x1c(%rbx)
movaps %xmm4,%xmm0
mulss  %xmm9,%xmm0
movaps %xmm7,%xmm2
movaps %xmm7,%xmm1
mulss  %xmm5,%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x20(%rbx)
movaps %xmm5,%xmm0
mulss  %xmm9,%xmm0
mulss  %xmm4,%xmm2
subss  %xmm0,%xmm2
movss  %xmm2,0x24(%rbx)
movss  %xmm8,0x28(%rbx)
xorps  %xmm0,%xmm0
movups %xmm0,0x2c(%rbx)
movl   $0x3f800000,0x3c(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @glmGenerateRotationMatrixFromAngles4fDeg(float* nocapture writeonly %0, float %1, float %2, float %3) {
%5 = tail call float @glmRadf(float %1)
%6 = tail call float @glmRadf(float %2)
%7 = tail call float @glmRadf(float %3)
%8 = tail call float @sin(float %7)
%9 = tail call float @cos(float %7)
%10 = tail call float @sin(float %6)
%11 = tail call float @cos(float %6)
%12 = tail call float @sin(float %5)
%13 = tail call float @cos(float %5)
%14 = fmul float %9, %11
store float %14, float* %0
%15 = fmul float %8, %11
%16 = getelementptr inbounds float, float* %0, i64 1
store float %15, float* %16
%17 = fneg float %10
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
%19 = getelementptr inbounds float, float* %0, i64 3
store float 0.000000e+00, float* %19
%20 = fmul float %10, %12
%21 = fneg float %8
%22 = fmul float %13, %21
%23 = tail call float @llvm.fmuladd.f32(float %20, float %9, float %22)
%24 = getelementptr inbounds float, float* %0, i64 4
store float %23, float* %24
%25 = fmul float %9, %13
%26 = tail call float @llvm.fmuladd.f32(float %20, float %8, float %25)
%27 = getelementptr inbounds float, float* %0, i64 5
store float %26, float* %27
%28 = fmul float %11, %12
%29 = getelementptr inbounds float, float* %0, i64 6
store float %28, float* %29
%30 = getelementptr inbounds float, float* %0, i64 7
store float 0.000000e+00, float* %30
%31 = fmul float %10, %13
%32 = fneg float %12
%33 = fmul float %8, %12
%34 = tail call float @llvm.fmuladd.f32(float %31, float %9, float %33)
%35 = getelementptr inbounds float, float* %0, i64 8
store float %34, float* %35
%36 = fmul float %9, %32
%37 = tail call float @llvm.fmuladd.f32(float %31, float %8, float %36)
%38 = getelementptr inbounds float, float* %0, i64 9
store float %37, float* %38
%39 = fmul float %11, %13
%40 = getelementptr inbounds float, float* %0, i64 10
store float %39, float* %40
%41 = getelementptr inbounds float, float* %0, i64 11
%42 = getelementptr inbounds float, float* %0, i64 15
%43 = bitcast float* %41 to i8*
store float 1.000000e+00, float* %42
ret void
}