#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 cosf(float);
float sinf(float);
float sqrtf(float);
int /*<<< orphan*/ tdMultiply(float *, float *, float *);
void tdRotateAA(float *f, float angle, float ix, float iy, float iz) {
  float ftmp[16];
  float c = cosf(angle * (3.141592653589 / 180.));
  float s = sinf(angle * (3.141592653589 / 180.));
  float absin = sqrtf(ix * ix + iy * iy + iz * iz);
  float x = ix / absin;
  float y = iy / absin;
  float z = iz / absin;
  ftmp[0] = x * x * (1 - c) + c;
  ftmp[1] = x * y * (1 - c) - z * s;
  ftmp[2] = x * z * (1 - c) + y * s;
  ftmp[3] = 0;
  ftmp[4] = y * x * (1 - c) + z * s;
  ftmp[5] = y * y * (1 - c) + c;
  ftmp[6] = y * z * (1 - c) - x * s;
  ftmp[7] = 0;
  ftmp[8] = x * z * (1 - c) - y * s;
  ftmp[9] = y * z * (1 - c) + x * s;
  ftmp[10] = z * z * (1 - c) + c;
  ftmp[11] = 0;
  ftmp[12] = 0;
  ftmp[13] = 0;
  ftmp[14] = 0;
  ftmp[15] = 1;
  tdMultiply(f, ftmp, f);
}


x86 assembly (clang, -O0):
<tdRotateAA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe94(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x64(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe71(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x68(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0x14(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrtf@plt>
movss  %xmm0,-0x6c(%rbp)
movss  -0x10(%rbp),%xmm0
divss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x14(%rbp),%xmm0
divss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x18(%rbp),%xmm0
divss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x70(%rbp),%xmm0
mulss  -0x70(%rbp),%xmm0
movss  0xde0(%rip),%xmm2
subss  -0x64(%rbp),%xmm2
movss  -0x64(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x70(%rbp),%xmm0
mulss  -0x74(%rbp),%xmm0
movss  0xdb7(%rip),%xmm2
subss  -0x64(%rbp),%xmm2
movss  -0x78(%rbp),%xmm1
mulss  -0x68(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x70(%rbp),%xmm0
mulss  -0x78(%rbp),%xmm0
movss  0xd7c(%rip),%xmm2
subss  -0x64(%rbp),%xmm2
movss  -0x74(%rbp),%xmm1
mulss  -0x68(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x74(%rbp),%xmm0
mulss  -0x70(%rbp),%xmm0
movss  0xd46(%rip),%xmm2
subss  -0x64(%rbp),%xmm2
movss  -0x78(%rbp),%xmm1
mulss  -0x68(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x74(%rbp),%xmm0
mulss  -0x74(%rbp),%xmm0
movss  0xd18(%rip),%xmm2
subss  -0x64(%rbp),%xmm2
movss  -0x64(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x74(%rbp),%xmm0
mulss  -0x78(%rbp),%xmm0
movss  0xcef(%rip),%xmm2
subss  -0x64(%rbp),%xmm2
movss  -0x70(%rbp),%xmm1
mulss  -0x68(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x70(%rbp),%xmm0
mulss  -0x78(%rbp),%xmm0
movss  0xcac(%rip),%xmm2
subss  -0x64(%rbp),%xmm2
movss  -0x74(%rbp),%xmm1
mulss  -0x68(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x74(%rbp),%xmm0
mulss  -0x78(%rbp),%xmm0
movss  0xc71(%rip),%xmm2
subss  -0x64(%rbp),%xmm2
movss  -0x70(%rbp),%xmm1
mulss  -0x68(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x78(%rbp),%xmm0
mulss  -0x78(%rbp),%xmm0
movss  0xc43(%rip),%xmm2
subss  -0x64(%rbp),%xmm2
movss  -0x64(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xc04(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1060 <tdMultiply@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdRotateAA>:
push   %rbx
sub    $0x60,%rsp
movss  %xmm3,0x18(%rsp)
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
mov    %rdi,%rbx
cvtss2sd %xmm0,%xmm0
mulsd  0xe9a(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
call   1040 <cosf@plt>
movss  %xmm0,0x1c(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm10
movss  0x14(%rsp),%xmm0
mulss  %xmm0,%xmm0
movss  0x10(%rsp),%xmm1
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x18(%rsp),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     11be <tdRotateAA+0x7e>
sqrtss %xmm0,%xmm0
jmp    11d1 <tdRotateAA+0x91>
movss  %xmm10,0xc(%rsp)
call   1050 <sqrtf@plt>
movss  0xc(%rsp),%xmm10
movss  0x10(%rsp),%xmm4
divss  %xmm0,%xmm4
movss  0x14(%rsp),%xmm7
divss  %xmm0,%xmm7
movss  0x18(%rsp),%xmm6
divss  %xmm0,%xmm6
movaps %xmm4,%xmm1
mulss  %xmm4,%xmm1
movss  0xe0a(%rip),%xmm0
movss  0x1c(%rsp),%xmm9
subss  %xmm9,%xmm0
mulss  %xmm0,%xmm1
addss  %xmm9,%xmm1
movss  %xmm1,0x20(%rsp)
movaps %xmm4,%xmm1
mulss  %xmm7,%xmm1
movaps %xmm10,%xmm2
mulss  %xmm6,%xmm2
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm3
subss  %xmm2,%xmm3
movss  %xmm3,0x24(%rsp)
movaps %xmm4,%xmm3
mulss  %xmm6,%xmm3
movaps %xmm10,%xmm8
mulss  %xmm7,%xmm8
mulss  %xmm0,%xmm3
movaps %xmm3,%xmm5
addss  %xmm8,%xmm5
movss  %xmm5,0x28(%rsp)
movl   $0x0,0x2c(%rsp)
addss  %xmm2,%xmm1
movss  %xmm1,0x30(%rsp)
movaps %xmm7,%xmm1
mulss  %xmm7,%xmm1
mulss  %xmm0,%xmm1
addss  %xmm9,%xmm1
movss  %xmm1,0x34(%rsp)
mulss  %xmm6,%xmm7
mulss  %xmm10,%xmm4
mulss  %xmm0,%xmm7
movaps %xmm7,%xmm1
subss  %xmm4,%xmm1
movss  %xmm1,0x38(%rsp)
movl   $0x0,0x3c(%rsp)
subss  %xmm8,%xmm3
movss  %xmm3,0x40(%rsp)
addss  %xmm4,%xmm7
movss  %xmm7,0x44(%rsp)
mulss  %xmm6,%xmm6
mulss  %xmm0,%xmm6
addss  %xmm9,%xmm6
movss  %xmm6,0x48(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x4c(%rsp)
movl   $0x3f800000,0x5c(%rsp)
3f
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
mov    %rbx,%rdx
call   1060 <tdMultiply@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @tdRotateAA(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca [16 x float]
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%18 = load float, float* %7
%19 = fpext float %18 to double
%20 = fmul double %19, 0x3F91DF46A2529843
%21 = fptrunc double %20 to float
%22 = call float @cosf(float %21)
store float %22, float* %12
%23 = load float, float* %7
%24 = fpext float %23 to double
%25 = fmul double %24, 0x3F91DF46A2529843
%26 = fptrunc double %25 to float
%27 = call float @sinf(float %26)
store float %27, float* %13
%28 = load float, float* %8
%29 = load float, float* %8
%30 = load float, float* %9
%31 = load float, float* %9
%32 = fmul float %30, %31
%33 = call float @llvm.fmuladd.f32(float %28, float %29, float %32)
%34 = load float, float* %10
%35 = load float, float* %10
%36 = call float @llvm.fmuladd.f32(float %34, float %35, float %33)
%37 = call float @sqrtf(float %36)
store float %37, float* %14
%38 = load float, float* %8
%39 = load float, float* %14
%40 = fdiv float %38, %39
store float %40, float* %15
%41 = load float, float* %9
%42 = load float, float* %14
%43 = fdiv float %41, %42
store float %43, float* %16
%44 = load float, float* %10
%45 = load float, float* %14
%46 = fdiv float %44, %45
store float %46, float* %17
%47 = load float, float* %15
%48 = load float, float* %15
%49 = fmul float %47, %48
%50 = load float, float* %12
%51 = fsub float 1.000000e+00, %50
%52 = load float, float* %12
%53 = call float @llvm.fmuladd.f32(float %49, float %51, float %52)
%54 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
store float %53, float* %54
%55 = load float, float* %15
%56 = load float, float* %16
%57 = fmul float %55, %56
%58 = load float, float* %12
%59 = fsub float 1.000000e+00, %58
%60 = load float, float* %17
%61 = load float, float* %13
%62 = fmul float %60, %61
%63 = fneg float %62
%64 = call float @llvm.fmuladd.f32(float %57, float %59, float %63)
%65 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 1
store float %64, float* %65
%66 = load float, float* %15
%67 = load float, float* %17
%68 = fmul float %66, %67
%69 = load float, float* %12
%70 = fsub float 1.000000e+00, %69
%71 = load float, float* %16
%72 = load float, float* %13
%73 = fmul float %71, %72
%74 = call float @llvm.fmuladd.f32(float %68, float %70, float %73)
%75 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 2
store float %74, float* %75
%76 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 3
store float 0.000000e+00, float* %76
%77 = load float, float* %16
%78 = load float, float* %15
%79 = fmul float %77, %78
%80 = load float, float* %12
%81 = fsub float 1.000000e+00, %80
%82 = load float, float* %17
%83 = load float, float* %13
%84 = fmul float %82, %83
%85 = call float @llvm.fmuladd.f32(float %79, float %81, float %84)
%86 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 4
store float %85, float* %86
%87 = load float, float* %16
%88 = load float, float* %16
%89 = fmul float %87, %88
%90 = load float, float* %12
%91 = fsub float 1.000000e+00, %90
%92 = load float, float* %12
%93 = call float @llvm.fmuladd.f32(float %89, float %91, float %92)
%94 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 5
store float %93, float* %94
%95 = load float, float* %16
%96 = load float, float* %17
%97 = fmul float %95, %96
%98 = load float, float* %12
%99 = fsub float 1.000000e+00, %98
%100 = load float, float* %15
%101 = load float, float* %13
%102 = fmul float %100, %101
%103 = fneg float %102
%104 = call float @llvm.fmuladd.f32(float %97, float %99, float %103)
%105 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 6
store float %104, float* %105
%106 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 7
store float 0.000000e+00, float* %106
%107 = load float, float* %15
%108 = load float, float* %17
%109 = fmul float %107, %108
%110 = load float, float* %12
%111 = fsub float 1.000000e+00, %110
%112 = load float, float* %16
%113 = load float, float* %13
%114 = fmul float %112, %113
%115 = fneg float %114
%116 = call float @llvm.fmuladd.f32(float %109, float %111, float %115)
%117 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 8
store float %116, float* %117
%118 = load float, float* %16
%119 = load float, float* %17
%120 = fmul float %118, %119
%121 = load float, float* %12
%122 = fsub float 1.000000e+00, %121
%123 = load float, float* %15
%124 = load float, float* %13
%125 = fmul float %123, %124
%126 = call float @llvm.fmuladd.f32(float %120, float %122, float %125)
%127 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 9
store float %126, float* %127
%128 = load float, float* %17
%129 = load float, float* %17
%130 = fmul float %128, %129
%131 = load float, float* %12
%132 = fsub float 1.000000e+00, %131
%133 = load float, float* %12
%134 = call float @llvm.fmuladd.f32(float %130, float %132, float %133)
%135 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 10
store float %134, float* %135
%136 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 11
store float 0.000000e+00, float* %136
%137 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 12
store float 0.000000e+00, float* %137
%138 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 13
store float 0.000000e+00, float* %138
%139 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 14
store float 0.000000e+00, float* %139
%140 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 15
store float 1.000000e+00, float* %140
%141 = load float*, float** %6
%142 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%143 = load float*, float** %6
%144 = call i32 @tdMultiply(float* %141, float* %142, float* %143)
ret void
}

LLVM IR (-O2):
define void @tdRotateAA(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca [16 x float]
%7 = bitcast [16 x float]* %6 to i8*
%8 = fpext float %1 to double
%9 = fmul double %8, 0x3F91DF46A2529843
%10 = fptrunc double %9 to float
%11 = tail call float @cosf(float %10)
%12 = tail call float @sinf(float %10)
%13 = fmul float %3, %3
%14 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %13)
%15 = tail call float @llvm.fmuladd.f32(float %4, float %4, float %14)
%16 = tail call float @sqrtf(float %15)
%17 = fdiv float %2, %16
%18 = fdiv float %3, %16
%19 = fdiv float %4, %16
%20 = fmul float %17, %17
%21 = fsub float 1.000000e+00, %11
%22 = tail call float @llvm.fmuladd.f32(float %20, float %21, float %11)
%23 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
store float %22, float* %23
%24 = fmul float %17, %18
%25 = fmul float %12, %19
%26 = fneg float %25
%27 = tail call float @llvm.fmuladd.f32(float %24, float %21, float %26)
%28 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 1
store float %27, float* %28
%29 = fmul float %17, %19
%30 = fmul float %12, %18
%31 = tail call float @llvm.fmuladd.f32(float %29, float %21, float %30)
%32 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 2
store float %31, float* %32
%33 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 3
store float 0.000000e+00, float* %33
%34 = tail call float @llvm.fmuladd.f32(float %24, float %21, float %25)
%35 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 4
store float %34, float* %35
%36 = fmul float %18, %18
%37 = tail call float @llvm.fmuladd.f32(float %36, float %21, float %11)
%38 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 5
store float %37, float* %38
%39 = fmul float %18, %19
%40 = fmul float %12, %17
%41 = fneg float %40
%42 = tail call float @llvm.fmuladd.f32(float %39, float %21, float %41)
%43 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 6
store float %42, float* %43
%44 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 7
store float 0.000000e+00, float* %44
%45 = fneg float %30
%46 = tail call float @llvm.fmuladd.f32(float %29, float %21, float %45)
%47 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 8
store float %46, float* %47
%48 = tail call float @llvm.fmuladd.f32(float %39, float %21, float %40)
%49 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 9
store float %48, float* %49
%50 = fmul float %19, %19
%51 = tail call float @llvm.fmuladd.f32(float %50, float %21, float %11)
%52 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 10
store float %51, float* %52
%53 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 11
%54 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 15
%55 = bitcast float* %53 to i8*
store float 1.000000e+00, float* %54
%56 = call i32 @tdMultiply(float* %0, float* %23, float* %0)
ret void
}