#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 */
double cos(double);
double sin(double);
void rotate3d(double **yvecs, int nmyvtxs, double theta, double phi,
              double gamma2) {
  double temp1, temp2;
  double ctheta, stheta;
  double cphi, sphi;
  double cgamma, sgamma;
  double onemcg;
  double a1, a2, a3;
  double b1, b2, b3;
  double c1, c2, c3;
  int i;
  stheta = sin(theta);
  ctheta = cos(theta);
  sphi = sin(phi);
  cphi = cos(phi);
  sgamma = sin(gamma2);
  cgamma = cos(gamma2);
  onemcg = 1.0 - cgamma;
  a1 = cgamma + cphi * ctheta * onemcg * cphi * ctheta;
  a2 = sgamma * sphi + cphi * stheta * onemcg * cphi * ctheta;
  a3 = -sgamma * cphi * stheta + sphi * onemcg * cphi * ctheta;
  b1 = -sgamma * sphi + cphi * ctheta * onemcg * cphi * stheta;
  b2 = cgamma + cphi * stheta * onemcg * cphi * stheta;
  b3 = sgamma * cphi * ctheta + sphi * onemcg * cphi * stheta;
  c1 = sgamma * cphi * stheta + cphi * ctheta * onemcg * sphi;
  c2 = -sgamma * cphi * ctheta + cphi * stheta * onemcg * sphi;
  c3 = cgamma + sphi * onemcg * sphi;
  for (i = 1; i <= nmyvtxs; i++) {
    temp1 = yvecs[1][i];
    temp2 = yvecs[2][i];
    yvecs[1][i] = a1 * temp1 + b1 * temp2 + c1 * yvecs[3][i];
    yvecs[2][i] = a2 * temp1 + b2 * temp2 + c2 * yvecs[3][i];
    yvecs[3][i] = a3 * temp1 + b3 * temp2 + c3 * yvecs[3][i];
  }
}


x86 assembly (clang, -O0):
<rotate3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  0xe5d(%rip),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movl   $0x1,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1505 <rotate3d+0x3e5>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0xbc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
movslq -0xbc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x30(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0xbc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
movslq -0xbc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    13a8 <rotate3d+0x288>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate3d>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <sin@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x30(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movapd 0x30(%rsp),%xmm3
test   %ebx,%ebx
jle    14f6 <rotate3d+0x3d6>
movsd  0xe51(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm11
movapd %xmm11,%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm3,%xmm8
mulsd  %xmm2,%xmm8
movapd %xmm8,%xmm15
movsd  0x50(%rsp),%xmm12
movapd %xmm12,%xmm10
mulsd  %xmm3,%xmm10
mulsd  %xmm1,%xmm10
movapd %xmm3,%xmm4
mulsd  %xmm10,%xmm4
movapd %xmm11,%xmm13
mulsd  %xmm4,%xmm13
movapd 0xe09(%rip),%xmm6
movapd (%rsp),%xmm9
xorpd  %xmm9,%xmm6
mulsd  %xmm3,%xmm6
movsd  %xmm0,0x10(%rsp)
movsd  0x40(%rsp),%xmm0
mulsd  %xmm0,%xmm1
movapd %xmm3,%xmm5
mulsd  %xmm1,%xmm5
movapd %xmm11,%xmm7
mulsd  %xmm5,%xmm7
movapd %xmm6,%xmm14
mulsd  %xmm12,%xmm14
addsd  %xmm7,%xmm14
movapd %xmm9,%xmm7
mulsd  %xmm0,%xmm7
addsd  %xmm7,%xmm13
mulsd  %xmm12,%xmm8
subsd  %xmm7,%xmm8
mulsd  %xmm9,%xmm3
mulsd  %xmm12,%xmm5
movapd %xmm3,%xmm9
mulsd  %xmm11,%xmm9
addsd  %xmm5,%xmm9
mulsd  %xmm12,%xmm4
mulsd  %xmm12,%xmm3
mulsd  %xmm0,%xmm2
addsd  %xmm2,%xmm3
mulsd  %xmm11,%xmm15
mulsd  %xmm11,%xmm6
mulsd  %xmm0,%xmm10
addsd  %xmm10,%xmm6
mulsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm15
addsd  %xmm0,%xmm4
addsd  %xmm0,%xmm1
mov    0x8(%r14),%rax
mov    0x10(%r14),%rcx
mov    0x18(%r14),%rdx
mov    %ebx,%r8d
lea    0x1(%r8),%rsi
mov    $0x1,%edi
cmp    $0x2,%ebx
jb     1470 <rotate3d+0x350>
lea    0x8(%rax),%rbp
lea    (%rax,%rsi,8),%r9
lea    0x8(%rcx),%r11
lea    (%rcx,%rsi,8),%r14
lea    0x8(%rdx),%r15
lea    (%rdx,%rsi,8),%rbx
cmp    %r14,%rbp
setb   %r12b
cmp    %r9,%r11
setb   %r13b
cmp    %rbx,%rbp
setb   %bpl
cmp    %r9,%r15
setb   %r10b
cmp    %rbx,%r11
setb   %r9b
cmp    %r14,%r15
setb   %r11b
test   %r13b,%r12b
jne    1470 <rotate3d+0x350>
and    %r10b,%bpl
jne    1470 <rotate3d+0x350>
and    %r11b,%r9b
jne    1470 <rotate3d+0x350>
mov    %r8d,%r9d
and    $0xfffffffe,%r9d
mov    %r8,%rdi
or     $0x1,%rdi
movapd %xmm8,%xmm0
unpcklpd %xmm8,%xmm0
movapd %xmm0,0x10(%rsp)
movapd %xmm15,%xmm0
unpcklpd %xmm15,%xmm0
movapd %xmm0,(%rsp)
movapd %xmm3,0x30(%rsp)
unpcklpd %xmm3,%xmm3
movapd %xmm3,0x20(%rsp)
movapd %xmm4,%xmm0
unpcklpd %xmm4,%xmm0
movapd %xmm0,0x50(%rsp)
movapd %xmm13,%xmm0
unpcklpd %xmm13,%xmm0
movapd %xmm0,0x40(%rsp)
movapd %xmm6,%xmm0
unpcklpd %xmm6,%xmm0
movapd %xmm0,0x60(%rsp)
movapd %xmm9,%xmm2
unpcklpd %xmm9,%xmm2
movapd %xmm14,%xmm7
unpcklpd %xmm14,%xmm7
movapd %xmm1,%xmm3
unpcklpd %xmm1,%xmm3
xor    %ebx,%ebx
nopl   0x0(%rax)
movupd 0x8(%rax,%rbx,8),%xmm10
movupd 0x8(%rcx,%rbx,8),%xmm11
movapd 0x10(%rsp),%xmm12
mulpd  %xmm11,%xmm12
movapd (%rsp),%xmm5
mulpd  %xmm10,%xmm5
addpd  %xmm12,%xmm5
movupd 0x8(%rdx,%rbx,8),%xmm0
mulpd  0x20(%rsp),%xmm0
addpd  %xmm5,%xmm0
movupd %xmm0,0x8(%rax,%rbx,8)
movapd 0x50(%rsp),%xmm0
mulpd  %xmm11,%xmm0
movapd 0x40(%rsp),%xmm5
mulpd  %xmm10,%xmm5
addpd  %xmm0,%xmm5
movupd 0x8(%rdx,%rbx,8),%xmm0
mulpd  0x60(%rsp),%xmm0
addpd  %xmm5,%xmm0
movupd %xmm0,0x8(%rcx,%rbx,8)
mulpd  %xmm2,%xmm11
mulpd  %xmm7,%xmm10
addpd  %xmm11,%xmm10
movupd 0x8(%rdx,%rbx,8),%xmm0
mulpd  %xmm3,%xmm0
addpd  %xmm10,%xmm0
movupd %xmm0,0x8(%rdx,%rbx,8)
add    $0x2,%rbx
cmp    %rbx,%r9
jne    13c0 <rotate3d+0x2a0>
cmp    %r9,%r8
movapd 0x30(%rsp),%xmm3
je     14f6 <rotate3d+0x3d6>
nop
movsd  (%rax,%rdi,8),%xmm0
movsd  (%rcx,%rdi,8),%xmm5
movapd %xmm8,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm15,%xmm7
mulsd  %xmm0,%xmm7
addsd  %xmm2,%xmm7
movsd  (%rdx,%rdi,8),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm7,%xmm2
movsd  %xmm2,(%rax,%rdi,8)
movapd %xmm4,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm13,%xmm7
mulsd  %xmm0,%xmm7
addsd  %xmm2,%xmm7
movsd  (%rdx,%rdi,8),%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm7,%xmm2
movsd  %xmm2,(%rcx,%rdi,8)
mulsd  %xmm9,%xmm5
mulsd  %xmm14,%xmm0
addsd  %xmm5,%xmm0
movsd  (%rdx,%rdi,8),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx,%rdi,8)
add    $0x1,%rdi
cmp    %rdi,%rsi
jne    1470 <rotate3d+0x350>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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