float *rotate(int Xrot_in, int Yrot_in, int Zrot_in, int NumOfCoords,
              float *Coords) {
  int i;
  float cx, cy, cz, sx, sy, sz;
  static float *tempCoords;
  tempCoords = malloc(sizeof(float[3]) * NumOfCoords);
  cx = cos(((float)Xrot_in) / 180 *
           3.14159265358979323846264338327950288419716939937510);
  cy = cos(((float)Yrot_in) / 180 *
           3.14159265358979323846264338327950288419716939937510);
  cz = cos(((float)Zrot_in) / 180 *
           3.14159265358979323846264338327950288419716939937510);
  sx = sin(((float)Xrot_in) / 180 *
           3.14159265358979323846264338327950288419716939937510);
  sy = sin(((float)Yrot_in) / 180 *
           3.14159265358979323846264338327950288419716939937510);
  sz = sin(((float)Zrot_in) / 180 *
           3.14159265358979323846264338327950288419716939937510);
  for (i = 0; i < NumOfCoords; i++) {
    *(tempCoords + 3 * i) = (cy * cz) * (*(Coords + 3 * i)) +
                            (cz * sy * sx - cx * sz) * (*(Coords + 3 * i + 1)) +
                            (sx * sz + cx * sy * cz) * (*(Coords + 3 * i + 2));
    *(tempCoords + 3 * i + 1) =
        (cy * sz) * (*(Coords + 3 * i)) +
        (cx * cz + sx * sy * sz) * (*(Coords + 3 * i + 1)) +
        (cx * sy * sz - sx * cz) * (*(Coords + 3 * i + 2));
    *(tempCoords + 3 * i + 2) = -(sy) * (*(Coords + 3 * i)) +
                                (sx * cy) * (*(Coords + 3 * i + 1)) +
                                (cx * cy) * (*(Coords + 3 * i + 2));
  }
  return tempCoords;
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
movslq -0x10(%rbp),%rax
imul   $0xc,%rax,%rdi
call   1040 <malloc@plt>
mov    %rax,0x2ee4(%rip)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xe9f(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe87(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xe70(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe58(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xe41(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe29(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xe12(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfa(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xde3(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdcb(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xdb4(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd9c(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1470 <rotate+0x340>
movss  -0x24(%rbp),%xmm1
mulss  -0x28(%rbp),%xmm1
mov    -0x18(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm2
movss  -0x28(%rbp),%xmm0
mulss  -0x30(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm4
movss  -0x20(%rbp),%xmm3
mulss  -0x34(%rbp),%xmm3
movd   %xmm3,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm3
mulss  %xmm4,%xmm0
addss  %xmm3,%xmm0
mov    -0x18(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
mulss  0x4(%rax,%rcx,4),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
movss  -0x34(%rbp),%xmm3
movss  -0x20(%rbp),%xmm2
mulss  -0x30(%rbp),%xmm2
mulss  -0x28(%rbp),%xmm2
mulss  %xmm3,%xmm0
addss  %xmm2,%xmm0
mov    -0x18(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  0x8(%rax,%rcx,4),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    0x2d15(%rip),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x24(%rbp),%xmm1
mulss  -0x34(%rbp),%xmm1
mov    -0x18(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm2
movss  -0x20(%rbp),%xmm0
movss  -0x28(%rbp),%xmm4
movss  -0x2c(%rbp),%xmm3
mulss  -0x30(%rbp),%xmm3
mulss  -0x34(%rbp),%xmm3
mulss  %xmm4,%xmm0
addss  %xmm3,%xmm0
mov    -0x18(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
mulss  0x4(%rax,%rcx,4),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
mulss  -0x30(%rbp),%xmm0
movss  -0x34(%rbp),%xmm3
movss  -0x2c(%rbp),%xmm2
mulss  -0x28(%rbp),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm0
addss  %xmm2,%xmm0
mov    -0x18(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  0x8(%rax,%rcx,4),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    0x2c67(%rip),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  %xmm0,0x4(%rax,%rcx,4)
movss  -0x30(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mov    -0x18(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm2
movss  -0x2c(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
mov    -0x18(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
mulss  0x4(%rax,%rcx,4),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
mov    -0x18(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  0x8(%rax,%rcx,4),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    0x2beb(%rip),%rax
imul   $0x3,-0x1c(%rbp),%ecx
movslq %ecx,%rcx
movss  %xmm0,0x8(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    127d <rotate+0x14d>
mov    0x2bc9(%rip),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r8,%rbx
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%r12d
mov    %edi,%ebp
movslq %ecx,%r13
lea    0x0(,%r13,4),%rax
lea    (%rax,%rax,2),%rdi
call   1040 <malloc@plt>
mov    %rax,0x2ed6(%rip)
cvtsi2ss %ebp,%xmm0
divss  0xe8a(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe86(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1050 <cos@plt>
cvtsi2ss %r12d,%xmm1
movsd  %xmm0,0x40(%rsp)
divss  0xe60(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xe59(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1050 <cos@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %r15d,%xmm1
movsd  %xmm0,0x30(%rsp)
divss  0xe31(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xe2a(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
call   1050 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x50(%rsp),%xmm0
call   1030 <sin@plt>
test   %r13d,%r13d
jle    13c8 <rotate+0x298>
movsd  0x40(%rsp),%xmm1
cvtsd2ss %xmm1,%xmm10
movsd  0x30(%rsp),%xmm1
cvtsd2ss %xmm1,%xmm1
movsd  0x20(%rsp),%xmm2
cvtsd2ss %xmm2,%xmm3
movsd  0x10(%rsp),%xmm2
cvtsd2ss %xmm2,%xmm14
movsd  (%rsp),%xmm2
cvtsd2ss %xmm2,%xmm9
cvtsd2ss %xmm0,%xmm11
movaps %xmm1,%xmm8
mulss  %xmm3,%xmm8
movaps %xmm3,%xmm4
mulss  %xmm9,%xmm4
movaps %xmm10,%xmm0
mulss  %xmm11,%xmm0
mulss  %xmm14,%xmm4
subss  %xmm0,%xmm4
movaps %xmm10,%xmm5
mulss  %xmm9,%xmm5
movaps %xmm5,%xmm0
mulss  %xmm3,%xmm0
movaps %xmm14,%xmm15
mulss  %xmm11,%xmm15
addss  %xmm0,%xmm15
mov    0x2d9c(%rip),%rax
movaps %xmm14,%xmm12
movaps %xmm10,%xmm7
mulss  %xmm3,%xmm7
mulss  %xmm14,%xmm3
mulss  %xmm1,%xmm14
mulss  %xmm1,%xmm10
movaps %xmm1,%xmm0
mulss  %xmm11,%xmm0
mulss  %xmm9,%xmm12
mulss  %xmm11,%xmm12
addss  %xmm12,%xmm7
mulss  %xmm11,%xmm5
subss  %xmm3,%xmm5
xorps  0xd29(%rip),%xmm9
mov    %r14d,%ecx
cmp    $0x4,%r14d
jb     1315 <rotate+0x1e5>
lea    0x0(,%rcx,4),%rsi
lea    (%rsi,%rsi,2),%rdx
lea    (%rbx,%rdx,1),%rdi
cmp    %rdi,%rax
jae    13d4 <rotate+0x2a4>
add    %rax,%rdx
cmp    %rbx,%rdx
jbe    13d4 <rotate+0x2a4>
xor    %edx,%edx
lea    (%rdx,%rdx,2),%rsi
lea    0x8(,%rsi,4),%rsi
sub    %rdx,%rcx
cs nopw 0x0(%rax,%rax,1)
movss  -0x4(%rbx,%rsi,1),%xmm1
mulss  %xmm4,%xmm1
movss  -0x8(%rbx,%rsi,1),%xmm2
mulss  %xmm8,%xmm2
addss  %xmm1,%xmm2
movss  (%rbx,%rsi,1),%xmm1
mulss  %xmm15,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,-0x8(%rax,%rsi,1)
movss  -0x4(%rbx,%rsi,1),%xmm1
mulss  %xmm7,%xmm1
movss  -0x8(%rbx,%rsi,1),%xmm2
mulss  %xmm0,%xmm2
addss  %xmm1,%xmm2
movss  (%rbx,%rsi,1),%xmm1
mulss  %xmm5,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,-0x4(%rax,%rsi,1)
movss  -0x4(%rbx,%rsi,1),%xmm1
mulss  %xmm14,%xmm1
movss  -0x8(%rbx,%rsi,1),%xmm2
mulss  %xmm9,%xmm2
addss  %xmm1,%xmm2
movss  (%rbx,%rsi,1),%xmm1
mulss  %xmm10,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,(%rax,%rsi,1)
add    $0xc,%rsi
add    $0xffffffffffffffff,%rcx
jne    1330 <rotate+0x200>
jmp    1554 <rotate+0x424>
mov    0x2c71(%rip),%rax
jmp    1554 <rotate+0x424>
mov    %ecx,%edx
and    $0xfffffffc,%edx
movaps %xmm4,%xmm1
shufps $0x0,%xmm4,%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm8,%xmm1
shufps $0x0,%xmm8,%xmm1
movaps %xmm1,(%rsp)
movaps %xmm15,%xmm1
shufps $0x0,%xmm15,%xmm1
movaps %xmm1,0x50(%rsp)
movaps %xmm7,%xmm1
shufps $0x0,%xmm7,%xmm1
movaps %xmm1,0x40(%rsp)
movaps %xmm0,%xmm1
shufps $0x0,%xmm0,%xmm1
movaps %xmm1,0x30(%rsp)
movaps %xmm5,%xmm1
shufps $0x0,%xmm5,%xmm1
movaps %xmm1,0x20(%rsp)
movaps %xmm14,%xmm1
shufps $0x0,%xmm14,%xmm1
movaps %xmm1,0x80(%rsp)
movaps %xmm9,%xmm1
shufps $0x0,%xmm9,%xmm1
movaps %xmm1,0x70(%rsp)
movaps %xmm10,%xmm1
shufps $0x0,%xmm10,%xmm1
movaps %xmm1,0x60(%rsp)
and    $0xfffffffffffffff0,%rsi
lea    (%rsi,%rsi,2),%rsi
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movups (%rbx,%rdi,1),%xmm1
movups 0x10(%rbx,%rdi,1),%xmm11
movups 0x20(%rbx,%rdi,1),%xmm6
movaps %xmm6,%xmm3
shufps $0xe5,%xmm11,%xmm3
movaps %xmm6,%xmm2
shufps $0xf6,%xmm11,%xmm2
movaps %xmm1,%xmm13
shufps $0x1,%xmm11,%xmm13
shufps $0x21,%xmm1,%xmm11
shufps $0x2c,%xmm3,%xmm1
shufps $0x28,%xmm2,%xmm13
shufps $0xc2,%xmm6,%xmm11
movaps 0x10(%rsp),%xmm2
mulps  %xmm13,%xmm2
movaps (%rsp),%xmm3
mulps  %xmm1,%xmm3
addps  %xmm2,%xmm3
movaps 0x50(%rsp),%xmm12
mulps  %xmm11,%xmm12
addps  %xmm3,%xmm12
movaps 0x40(%rsp),%xmm2
mulps  %xmm13,%xmm2
movaps 0x30(%rsp),%xmm3
mulps  %xmm1,%xmm3
addps  %xmm2,%xmm3
movaps 0x20(%rsp),%xmm2
mulps  %xmm11,%xmm2
addps  %xmm3,%xmm2
mulps  0x80(%rsp),%xmm13
mulps  0x70(%rsp),%xmm1
addps  %xmm13,%xmm1
mulps  0x60(%rsp),%xmm11
addps  %xmm1,%xmm11
movaps %xmm11,%xmm1
shufps $0xd4,%xmm12,%xmm1
movaps %xmm2,%xmm3
movlhps %xmm12,%xmm3
shufps $0x82,%xmm1,%xmm3
movaps %xmm12,%xmm1
unpckhpd %xmm2,%xmm1
movaps %xmm11,%xmm6
shufps $0x11,%xmm2,%xmm6
shufps $0x82,%xmm1,%xmm6
shufps $0xff,%xmm11,%xmm2
shufps $0x23,%xmm11,%xmm12
shufps $0x82,%xmm2,%xmm12
movups %xmm12,0x20(%rax,%rdi,1)
movups %xmm6,0x10(%rax,%rdi,1)
movups %xmm3,(%rax,%rdi,1)
add    $0x30,%rdi
cmp    %rdi,%rsi
jne    1460 <rotate+0x330>
cmp    %rcx,%rdx
jne    1317 <rotate+0x1e7>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@rotate.tempCoords = internal global float* null
define float* @rotate(i32 %0, i32 %1, i32 %2, i32 %3, float* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float*
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store float* %4, float** %10
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = mul i64 12, %19
%21 = call i8* @malloc(i64 %20)
%22 = bitcast i8* %21 to float*
store float* %22, float** @rotate.tempCoords
%23 = load i32, i32* %6
%24 = sitofp i32 %23 to float
%25 = fdiv float %24, 1.800000e+02
%26 = fpext float %25 to double
%27 = fmul double %26, 0x400921FB54442D18
%28 = call double @cos(double %27)
%29 = fptrunc double %28 to float
store float %29, float* %12
%30 = load i32, i32* %7
%31 = sitofp i32 %30 to float
%32 = fdiv float %31, 1.800000e+02
%33 = fpext float %32 to double
%34 = fmul double %33, 0x400921FB54442D18
%35 = call double @cos(double %34)
%36 = fptrunc double %35 to float
store float %36, float* %13
%37 = load i32, i32* %8
%38 = sitofp i32 %37 to float
%39 = fdiv float %38, 1.800000e+02
%40 = fpext float %39 to double
%41 = fmul double %40, 0x400921FB54442D18
%42 = call double @cos(double %41)
%43 = fptrunc double %42 to float
store float %43, float* %14
%44 = load i32, i32* %6
%45 = sitofp i32 %44 to float
%46 = fdiv float %45, 1.800000e+02
%47 = fpext float %46 to double
%48 = fmul double %47, 0x400921FB54442D18
%49 = call double @sin(double %48)
%50 = fptrunc double %49 to float
store float %50, float* %15
%51 = load i32, i32* %7
%52 = sitofp i32 %51 to float
%53 = fdiv float %52, 1.800000e+02
%54 = fpext float %53 to double
%55 = fmul double %54, 0x400921FB54442D18
%56 = call double @sin(double %55)
%57 = fptrunc double %56 to float
store float %57, float* %16
%58 = load i32, i32* %8
%59 = sitofp i32 %58 to float
%60 = fdiv float %59, 1.800000e+02
%61 = fpext float %60 to double
%62 = fmul double %61, 0x400921FB54442D18
%63 = call double @sin(double %62)
%64 = fptrunc double %63 to float
store float %64, float* %17
store i32 0, i32* %11
br label %65
65: ; preds = %204, %5
%66 = load i32, i32* %11
%67 = load i32, i32* %9
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %207
69: ; preds = %65
%70 = load float, float* %13
%71 = load float, float* %14
%72 = fmul float %70, %71
%73 = load float*, float** %10
%74 = load i32, i32* %11
%75 = mul nsw i32 3, %74
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds float, float* %73, i64 %76
%78 = load float, float* %77
%79 = load float, float* %14
%80 = load float, float* %16
%81 = fmul float %79, %80
%82 = load float, float* %15
%83 = load float, float* %12
%84 = load float, float* %17
%85 = fmul float %83, %84
%86 = fneg float %85
%87 = call float @llvm.fmuladd.f32(float %81, float %82, float %86)
%88 = load float*, float** %10
%89 = load i32, i32* %11
%90 = mul nsw i32 3, %89
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds float, float* %88, i64 %91
%93 = getelementptr inbounds float, float* %92, i64 1
%94 = load float, float* %93
%95 = fmul float %87, %94
%96 = call float @llvm.fmuladd.f32(float %72, float %78, float %95)
%97 = load float, float* %15
%98 = load float, float* %17
%99 = load float, float* %12
%100 = load float, float* %16
%101 = fmul float %99, %100
%102 = load float, float* %14
%103 = fmul float %101, %102
%104 = call float @llvm.fmuladd.f32(float %97, float %98, float %103)
%105 = load float*, float** %10
%106 = load i32, i32* %11
%107 = mul nsw i32 3, %106
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds float, float* %105, i64 %108
%110 = getelementptr inbounds float, float* %109, i64 2
%111 = load float, float* %110
%112 = call float @llvm.fmuladd.f32(float %104, float %111, float %96)
%113 = load float*, float** @rotate.tempCoords
%114 = load i32, i32* %11
%115 = mul nsw i32 3, %114
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds float, float* %113, i64 %116
store float %112, float* %117
%118 = load float, float* %13
%119 = load float, float* %17
%120 = fmul float %118, %119
%121 = load float*, float** %10
%122 = load i32, i32* %11
%123 = mul nsw i32 3, %122
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds float, float* %121, i64 %124
%126 = load float, float* %125
%127 = load float, float* %12
%128 = load float, float* %14
%129 = load float, float* %15
%130 = load float, float* %16
%131 = fmul float %129, %130
%132 = load float, float* %17
%133 = fmul float %131, %132
%134 = call float @llvm.fmuladd.f32(float %127, float %128, float %133)
%135 = load float*, float** %10
%136 = load i32, i32* %11
%137 = mul nsw i32 3, %136
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds float, float* %135, i64 %138
%140 = getelementptr inbounds float, float* %139, i64 1
%141 = load float, float* %140
%142 = fmul float %134, %141
%143 = call float @llvm.fmuladd.f32(float %120, float %126, float %142)
%144 = load float, float* %12
%145 = load float, float* %16
%146 = fmul float %144, %145
%147 = load float, float* %17
%148 = load float, float* %15
%149 = load float, float* %14
%150 = fmul float %148, %149
%151 = fneg float %150
%152 = call float @llvm.fmuladd.f32(float %146, float %147, float %151)
%153 = load float*, float** %10
%154 = load i32, i32* %11
%155 = mul nsw i32 3, %154
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds float, float* %153, i64 %156
%158 = getelementptr inbounds float, float* %157, i64 2
%159 = load float, float* %158
%160 = call float @llvm.fmuladd.f32(float %152, float %159, float %143)
%161 = load float*, float** @rotate.tempCoords
%162 = load i32, i32* %11
%163 = mul nsw i32 3, %162
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds float, float* %161, i64 %164
%166 = getelementptr inbounds float, float* %165, i64 1
store float %160, float* %166
%167 = load float, float* %16
%168 = fneg float %167
%169 = load float*, float** %10
%170 = load i32, i32* %11
%171 = mul nsw i32 3, %170
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds float, float* %169, i64 %172
%174 = load float, float* %173
%175 = load float, float* %15
%176 = load float, float* %13
%177 = fmul float %175, %176
%178 = load float*, float** %10
%179 = load i32, i32* %11
%180 = mul nsw i32 3, %179
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds float, float* %178, i64 %181
%183 = getelementptr inbounds float, float* %182, i64 1
%184 = load float, float* %183
%185 = fmul float %177, %184
%186 = call float @llvm.fmuladd.f32(float %168, float %174, float %185)
%187 = load float, float* %12
%188 = load float, float* %13
%189 = fmul float %187, %188
%190 = load float*, float** %10
%191 = load i32, i32* %11
%192 = mul nsw i32 3, %191
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds float, float* %190, i64 %193
%195 = getelementptr inbounds float, float* %194, i64 2
%196 = load float, float* %195
%197 = call float @llvm.fmuladd.f32(float %189, float %196, float %186)
%198 = load float*, float** @rotate.tempCoords
%199 = load i32, i32* %11
%200 = mul nsw i32 3, %199
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds float, float* %198, i64 %201
%203 = getelementptr inbounds float, float* %202, i64 2
store float %197, float* %203
br label %204
204: ; preds = %69
%205 = load i32, i32* %11
%206 = add nsw i32 %205, 1
store i32 %206, i32* %11
br label %65
207: ; preds = %65
%208 = load float*, float** @rotate.tempCoords
ret float* %208
}

LLVM IR (-O2):
@rotate.tempCoords = internal unnamed_addr global float* null
define float* @rotate(i32 %0, i32 %1, i32 %2, i32 %3, float* nocapture %4) {
%6 = sext i32 %3 to i64
%7 = mul nsw i64 %6, 12
%8 = tail call i8* @malloc(i64 %7)
store i8* %8, i8** bitcast (float** @rotate.tempCoords to i8**)
%9 = sitofp i32 %0 to float
%10 = fdiv float %9, 1.800000e+02
%11 = fpext float %10 to double
%12 = fmul double %11, 0x400921FB54442D18
%13 = tail call double @cos(double %12)
%14 = fptrunc double %13 to float
%15 = sitofp i32 %1 to float
%16 = fdiv float %15, 1.800000e+02
%17 = fpext float %16 to double
%18 = fmul double %17, 0x400921FB54442D18
%19 = tail call double @cos(double %18)
%20 = fptrunc double %19 to float
%21 = sitofp i32 %2 to float
%22 = fdiv float %21, 1.800000e+02
%23 = fpext float %22 to double
%24 = fmul double %23, 0x400921FB54442D18
%25 = tail call double @cos(double %24)
%26 = fptrunc double %25 to float
%27 = tail call double @sin(double %12)
%28 = fptrunc double %27 to float
%29 = tail call double @sin(double %18)
%30 = fptrunc double %29 to float
%31 = tail call double @sin(double %24)
%32 = fptrunc double %31 to float
%33 = icmp sgt i32 %3, 0
br i1 %33, label %36, label %34
34: ; preds = %5
%35 = load float*, float** @rotate.tempCoords
br label %153
36: ; preds = %5
%37 = fmul float %20, %26
%38 = fmul float %26, %30
%39 = fneg float %14
%40 = fmul float %39, %32
%41 = tail call float @llvm.fmuladd.f32(float %38, float %28, float %40)
%42 = fmul float %14, %30
%43 = fmul float %42, %26
%44 = tail call float @llvm.fmuladd.f32(float %28, float %32, float %43)
%45 = load float*, float** @rotate.tempCoords
%46 = fmul float %20, %32
%47 = fmul float %28, %30
%48 = fmul float %47, %32
%49 = tail call float @llvm.fmuladd.f32(float %14, float %26, float %48)
%50 = fneg float %28
%51 = fmul float %26, %50
%52 = tail call float @llvm.fmuladd.f32(float %42, float %32, float %51)
%53 = fneg float %30
%54 = fmul float %20, %28
%55 = fmul float %14, %20
%56 = zext i32 %3 to i64
%57 = icmp ult i32 %3, 4
br i1 %57, label %122, label %58
58: ; preds = %36
%59 = mul nuw nsw i64 %56, 3
%60 = getelementptr float, float* %45, i64 %59
%61 = getelementptr float, float* %4, i64 %59
%62 = icmp ult float* %45, %61
%63 = icmp ugt float* %60, %4
%64 = and i1 %62, %63
br i1 %64, label %122, label %65
65: ; preds = %58
%66 = and i64 %56, 4294967292
%67 = insertelement <4 x float> poison, float %41, i64 0
%68 = shufflevector <4 x float> %67, <4 x float> poison, <4 x i32> zeroinitializer
%69 = insertelement <4 x float> poison, float %37, i64 0
%70 = shufflevector <4 x float> %69, <4 x float> poison, <4 x i32> zeroinitializer
%71 = insertelement <4 x float> poison, float %44, i64 0
%72 = shufflevector <4 x float> %71, <4 x float> poison, <4 x i32> zeroinitializer
%73 = insertelement <4 x float> poison, float %49, i64 0
%74 = shufflevector <4 x float> %73, <4 x float> poison, <4 x i32> zeroinitializer
%75 = insertelement <4 x float> poison, float %46, i64 0
%76 = shufflevector <4 x float> %75, <4 x float> poison, <4 x i32> zeroinitializer
%77 = insertelement <4 x float> poison, float %52, i64 0
%78 = shufflevector <4 x float> %77, <4 x float> poison, <4 x i32> zeroinitializer
%79 = insertelement <4 x float> poison, float %54, i64 0
%80 = shufflevector <4 x float> %79, <4 x float> poison, <4 x i32> zeroinitializer
%81 = insertelement <4 x float> poison, float %53, i64 0
%82 = shufflevector <4 x float> %81, <4 x float> poison, <4 x i32> zeroinitializer
%83 = insertelement <4 x float> poison, float %55, i64 0
%84 = shufflevector <4 x float> %83, <4 x float> poison, <4 x i32> zeroinitializer
br label %85
85: ; preds = %85, %65
%86 = phi i64 [ 0, %65 ], [ %118, %85 ]
%87 = mul nuw nsw i64 %86, 3
%88 = getelementptr inbounds float, float* %4, i64 %87
%89 = bitcast float* %88 to <12 x float>*
%90 = load <12 x float>, <12 x float>* %89
%91 = shufflevector <12 x float> %90, <12 x float> poison, <4 x i32> <i32 0, i32 3, i32 6, i32 9>
%92 = shufflevector <12 x float> %90, <12 x float> poison, <4 x i32> <i32 1, i32 4, i32 7, i32 10>
%93 = shufflevector <12 x float> %90, <12 x float> poison, <4 x i32> <i32 2, i32 5, i32 8, i32 11>
%94 = fmul <4 x float> %68, %92
%95 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %70, <4 x float> %91, <4 x float> %94)
%96 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %72, <4 x float> %93, <4 x float> %95)
%97 = bitcast float* %88 to <12 x float>*
%98 = load <12 x float>, <12 x float>* %97
%99 = shufflevector <12 x float> %98, <12 x float> poison, <4 x i32> <i32 0, i32 3, i32 6, i32 9>
%100 = shufflevector <12 x float> %98, <12 x float> poison, <4 x i32> <i32 1, i32 4, i32 7, i32 10>
%101 = shufflevector <12 x float> %98, <12 x float> poison, <4 x i32> <i32 2, i32 5, i32 8, i32 11>
%102 = fmul <4 x float> %74, %100
%103 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %76, <4 x float> %99, <4 x float> %102)
%104 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %78, <4 x float> %101, <4 x float> %103)
%105 = bitcast float* %88 to <12 x float>*
%106 = load <12 x float>, <12 x float>* %105
%107 = shufflevector <12 x float> %106, <12 x float> poison, <4 x i32> <i32 0, i32 3, i32 6, i32 9>
%108 = shufflevector <12 x float> %106, <12 x float> poison, <4 x i32> <i32 1, i32 4, i32 7, i32 10>
%109 = shufflevector <12 x float> %106, <12 x float> poison, <4 x i32> <i32 2, i32 5, i32 8, i32 11>
%110 = fmul <4 x float> %80, %108
%111 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %82, <4 x float> %107, <4 x float> %110)
%112 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %84, <4 x float> %109, <4 x float> %111)
%113 = getelementptr inbounds float, float* %45, i64 %87
%114 = bitcast float* %113 to <12 x float>*
%115 = shufflevector <4 x float> %96, <4 x float> %104, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%116 = shufflevector <4 x float> %112, <4 x float> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
%117 = shufflevector <8 x float> %115, <8 x float> %116, <12 x i32> <i32 0, i32 4, i32 8, i32 1, i32 5, i32 9, i32 2, i32 6, i32 10, i32 3, i32 7, i32 11>
store <12 x float> %117, <12 x float>* %114
%118 = add nuw i64 %86, 4
%119 = icmp eq i64 %118, %66
br i1 %119, label %120, label %85
120: ; preds = %85
%121 = icmp eq i64 %66, %56
br i1 %121, label %153, label %122
122: ; preds = %58, %36, %120
%123 = phi i64 [ 0, %58 ], [ 0, %36 ], [ %66, %120 ]
br label %124
124: ; preds = %122, %124
%125 = phi i64 [ %151, %124 ], [ %123, %122 ]
%126 = mul nuw nsw i64 %125, 3
%127 = getelementptr inbounds float, float* %4, i64 %126
%128 = load float, float* %127
%129 = getelementptr inbounds float, float* %127, i64 1
%130 = load float, float* %129
%131 = fmul float %41, %130
%132 = tail call float @llvm.fmuladd.f32(float %37, float %128, float %131)
%133 = getelementptr inbounds float, float* %127, i64 2
%134 = load float, float* %133
%135 = tail call float @llvm.fmuladd.f32(float %44, float %134, float %132)
%136 = getelementptr inbounds float, float* %45, i64 %126
store float %135, float* %136
%137 = load float, float* %127
%138 = load float, float* %129
%139 = fmul float %49, %138
%140 = tail call float @llvm.fmuladd.f32(float %46, float %137, float %139)
%141 = load float, float* %133
%142 = tail call float @llvm.fmuladd.f32(float %52, float %141, float %140)
%143 = getelementptr inbounds float, float* %136, i64 1
store float %142, float* %143
%144 = load float, float* %127
%145 = load float, float* %129
%146 = fmul float %54, %145
%147 = tail call float @llvm.fmuladd.f32(float %53, float %144, float %146)
%148 = load float, float* %133
%149 = tail call float @llvm.fmuladd.f32(float %55, float %148, float %147)
%150 = getelementptr inbounds float, float* %136, i64 2
store float %149, float* %150
%151 = add nuw nsw i64 %125, 1
%152 = icmp eq i64 %151, %56
br i1 %152, label %153, label %124
153: ; preds = %124, %120, %34
%154 = phi float* [ %35, %34 ], [ %45, %120 ], [ %45, %124 ]
ret float* %154
}