#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__ M_PI;
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)M_PI * 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)
mov    0x2e41(%rip),%rax
cvtsi2ssq (%rax),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xe4b(%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  0xe0e(%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  0xdca(%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  0xd27(%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  0xc77(%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)
mov    0x2e84(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ssq (%rax),%xmm1
movl   $0x3f800000,0x5c(%rsp)
3f
mulss  %xmm1,%xmm0
divss  0xe80(%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  0xe53(%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):
@M_PI = global i64 0
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 i64, i64* @M_PI
%24 = sitofp i64 %23 to float
%25 = load float, float* %5
%26 = fmul float %24, %25
%27 = fdiv float %26, 1.800000e+02
store float %27, float* %10
%28 = load float, float* %10
%29 = call i64 @sin(float %28)
%30 = sitofp i64 %29 to float
store float %30, float* %11
%31 = load float, float* %10
%32 = call i64 @cos(float %31)
%33 = sitofp i64 %32 to float
store float %33, float* %12
%34 = load float, float* %12
%35 = fsub float 1.000000e+00, %34
store float %35, float* %13
%36 = load float, float* %6
%37 = load float, float* %6
%38 = fmul float %36, %37
store float %38, float* %14
%39 = load float, float* %7
%40 = load float, float* %7
%41 = fmul float %39, %40
store float %41, float* %15
%42 = load float, float* %8
%43 = load float, float* %8
%44 = fmul float %42, %43
store float %44, float* %16
%45 = load float, float* %14
%46 = load float, float* %14
%47 = fsub float 1.000000e+00, %46
%48 = load float, float* %12
%49 = call float @llvm.fmuladd.f32(float %47, float %48, float %45)
%50 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
store float %49, float* %50
%51 = load float, float* %6
%52 = load float, float* %7
%53 = fmul float %51, %52
%54 = load float, float* %13
%55 = load float, float* %8
%56 = load float, float* %11
%57 = fmul float %55, %56
%58 = fneg float %57
%59 = call float @llvm.fmuladd.f32(float %53, float %54, float %58)
%60 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 4
store float %59, float* %60
%61 = load float, float* %6
%62 = load float, float* %8
%63 = fmul float %61, %62
%64 = load float, float* %13
%65 = load float, float* %7
%66 = load float, float* %11
%67 = fmul float %65, %66
%68 = call float @llvm.fmuladd.f32(float %63, float %64, float %67)
%69 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 8
store float %68, float* %69
%70 = load float, float* %6
%71 = load float, float* %7
%72 = fmul float %70, %71
%73 = load float, float* %13
%74 = load float, float* %8
%75 = load float, float* %11
%76 = fmul float %74, %75
%77 = call float @llvm.fmuladd.f32(float %72, float %73, float %76)
%78 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 1
store float %77, float* %78
%79 = load float, float* %15
%80 = load float, float* %15
%81 = fsub float 1.000000e+00, %80
%82 = load float, float* %12
%83 = call float @llvm.fmuladd.f32(float %81, float %82, float %79)
%84 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 5
store float %83, float* %84
%85 = load float, float* %7
%86 = load float, float* %8
%87 = fmul float %85, %86
%88 = load float, float* %13
%89 = load float, float* %6
%90 = load float, float* %11
%91 = fmul float %89, %90
%92 = fneg float %91
%93 = call float @llvm.fmuladd.f32(float %87, float %88, float %92)
%94 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 9
store float %93, float* %94
%95 = load float, float* %6
%96 = load float, float* %8
%97 = fmul float %95, %96
%98 = load float, float* %13
%99 = load float, float* %7
%100 = load float, float* %11
%101 = fmul float %99, %100
%102 = fneg float %101
%103 = call float @llvm.fmuladd.f32(float %97, float %98, float %102)
%104 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 2
store float %103, float* %104
%105 = load float, float* %7
%106 = load float, float* %8
%107 = fmul float %105, %106
%108 = load float, float* %13
%109 = load float, float* %6
%110 = load float, float* %11
%111 = fmul float %109, %110
%112 = call float @llvm.fmuladd.f32(float %107, float %108, float %111)
%113 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 6
store float %112, float* %113
%114 = load float, float* %16
%115 = load float, float* %16
%116 = fsub float 1.000000e+00, %115
%117 = load float, float* %12
%118 = call float @llvm.fmuladd.f32(float %116, float %117, float %114)
%119 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 10
store float %118, float* %119
%120 = getelementptr inbounds [16 x float], [16 x float]* %9, i64 0, i64 0
%121 = call i32 @gl_mult_matrixf(float* %120)
ret void
}

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