#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 */
scalar_t__ cos(float);
int /*<<< orphan*/ gl_mult_matrixf(float *);
scalar_t__ sin(float);
void gl_rotatef(float angle, float x, float y, float z) {
  float mat[] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
  float angle_rad = (float)3.141592653589793 * angle / 180.f;
  float sina = (float)sin(angle_rad);
  float cosa = (float)cos(angle_rad);
  float one_minus_cosa = 1.f - cosa;
  float nxsq = x * x;
  float nysq = y * y;
  float nzsq = z * z;
  mat[0] = nxsq + (1.f - nxsq) * cosa;
  mat[4] = x * y * one_minus_cosa - z * sina;
  mat[8] = x * z * one_minus_cosa + y * sina;
  mat[1] = x * y * one_minus_cosa + z * sina;
  mat[5] = nysq + (1.f - nysq) * cosa;
  mat[9] = y * z * one_minus_cosa - x * sina;
  mat[2] = x * z * one_minus_cosa - y * sina;
  mat[6] = y * z * one_minus_cosa + x * sina;
  mat[10] = nzsq + (1.f - nzsq) * cosa;
  gl_mult_matrixf(mat);
}


x86 assembly (clang, -O0):
<gl_rotatef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movss  0xe8c(%rip),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  0xe7f(%rip),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  0xe72(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xe65(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe60(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xe4f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm0
call   1050 <sin@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x54(%rbp),%xmm0
call   1060 <cos@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  0xe12(%rip),%xmm0
subss  -0x5c(%rbp),%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x64(%rbp),%xmm1
movss  0xdce(%rip),%xmm0
subss  -0x64(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0x60(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
mulss  -0x58(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x60(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0x60(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
mulss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x68(%rbp),%xmm1
movss  0xd2b(%rip),%xmm0
subss  -0x68(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x60(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x58(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x60(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  -0x58(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x60(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x58(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x6c(%rbp),%xmm1
movss  0xc7b(%rip),%xmm0
subss  -0x6c(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <gl_mult_matrixf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_rotatef>:
sub    $0x68,%rsp
movss  %xmm3,0x1c(%rsp)
movss  %xmm2,0x18(%rsp)
movss  %xmm1,0x14(%rsp)
xorps  %xmm1,%xmm1
movaps %xmm1,0x50(%rsp)
movaps %xmm1,0x40(%rsp)
movaps %xmm1,0x30(%rsp)
movaps %xmm1,0x20(%rsp)
movl   $0x3f800000,0x5c(%rsp)
3f
mulss  0xe93(%rip),%xmm0
divss  0xe8f(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
call   1040 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1050 <cos@plt>
cvtsi2ss %rax,%xmm8
movss  0xe62(%rip),%xmm0
movaps %xmm0,%xmm3
subss  %xmm8,%xmm3
movss  0x14(%rsp),%xmm10
movaps %xmm10,%xmm5
mulss  %xmm10,%xmm5
movss  0x18(%rsp),%xmm2
movaps %xmm2,%xmm11
mulss  %xmm2,%xmm11
movss  0x1c(%rsp),%xmm4
movaps %xmm4,%xmm9
mulss  %xmm4,%xmm9
movaps %xmm0,%xmm6
subss  %xmm5,%xmm6
mulss  %xmm8,%xmm6
addss  %xmm5,%xmm6
movss  %xmm6,0x20(%rsp)
movaps %xmm10,%xmm5
mulss  %xmm2,%xmm5
movaps %xmm2,%xmm13
movss  0x10(%rsp),%xmm1
movaps %xmm1,%xmm6
mulss  %xmm4,%xmm6
mulss  %xmm3,%xmm5
movaps %xmm5,%xmm7
subss  %xmm6,%xmm7
movss  %xmm7,0x30(%rsp)
movaps %xmm10,%xmm2
mulss  %xmm4,%xmm2
movaps %xmm4,%xmm12
movaps %xmm1,%xmm14
mulss  %xmm13,%xmm14
mulss  %xmm3,%xmm2
movaps %xmm2,%xmm7
addss  %xmm14,%xmm7
movss  %xmm7,0x40(%rsp)
addss  %xmm6,%xmm5
movss  %xmm5,0x24(%rsp)
movaps %xmm0,%xmm5
subss  %xmm11,%xmm5
mulss  %xmm8,%xmm5
addss  %xmm11,%xmm5
movss  %xmm5,0x34(%rsp)
movaps %xmm13,%xmm4
mulss  %xmm12,%xmm4
movaps %xmm1,%xmm5
mulss  %xmm10,%xmm5
mulss  %xmm3,%xmm4
movaps %xmm4,%xmm3
subss  %xmm5,%xmm3
movss  %xmm3,0x44(%rsp)
subss  %xmm14,%xmm2
movss  %xmm2,0x28(%rsp)
addss  %xmm5,%xmm4
movss  %xmm4,0x38(%rsp)
subss  %xmm9,%xmm0
mulss  %xmm8,%xmm0
addss  %xmm9,%xmm0
movss  %xmm0,0x48(%rsp)
lea    0x20(%rsp),%rdi
call   1030 <gl_mult_matrixf@plt>
add    $0x68,%rsp
ret

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

LLVM IR (-O2):
define void @gl_rotatef(float %0, float %1, float %2, float %3) {
%5 = alloca [16 x float]
%6 = bitcast [16 x float]* %5 to i8*
%7 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%8 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 5
%9 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 10
%10 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 15
store float 1.000000e+00, float* %10
%11 = fmul float %0, 0x400921FB60000000
%12 = fdiv float %11, 1.800000e+02
%13 = tail call i64 @sin(float %12)
%14 = sitofp i64 %13 to float
%15 = tail call i64 @cos(float %12)
%16 = sitofp i64 %15 to float
%17 = fsub float 1.000000e+00, %16
%18 = fmul float %1, %1
%19 = fmul float %2, %2
%20 = fmul float %3, %3
%21 = fsub float 1.000000e+00, %18
%22 = tail call float @llvm.fmuladd.f32(float %21, float %16, float %18)
store float %22, float* %7
%23 = fmul float %1, %2
%24 = fmul float %14, %3
%25 = fneg float %24
%26 = tail call float @llvm.fmuladd.f32(float %23, float %17, float %25)
%27 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 4
store float %26, float* %27
%28 = fmul float %1, %3
%29 = fmul float %14, %2
%30 = tail call float @llvm.fmuladd.f32(float %28, float %17, float %29)
%31 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 8
store float %30, float* %31
%32 = tail call float @llvm.fmuladd.f32(float %23, float %17, float %24)
%33 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 1
store float %32, float* %33
%34 = fsub float 1.000000e+00, %19
%35 = tail call float @llvm.fmuladd.f32(float %34, float %16, float %19)
store float %35, float* %8
%36 = fmul float %2, %3
%37 = fmul float %14, %1
%38 = fneg float %37
%39 = tail call float @llvm.fmuladd.f32(float %36, float %17, float %38)
%40 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 9
store float %39, float* %40
%41 = fneg float %29
%42 = tail call float @llvm.fmuladd.f32(float %28, float %17, float %41)
%43 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 2
store float %42, float* %43
%44 = tail call float @llvm.fmuladd.f32(float %36, float %17, float %37)
%45 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 6
store float %44, float* %45
%46 = fsub float 1.000000e+00, %20
%47 = tail call float @llvm.fmuladd.f32(float %46, float %16, float %20)
store float %47, float* %9
%48 = call i32 @gl_mult_matrixf(float* %7)
ret void
}