#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);
int scg_rotate(int nV, double *Vertex, double rot_x, double rot_y,
               double rot_z) {
  int i;
  if (rot_x != 0 || rot_y != 0 || rot_z != 0) {
    double r11, r12, r13, r21, r22, r23, r31, r32, r33, v1, v2, v3;
    r11 = cos(rot_y) * cos(rot_z);
    r12 = -cos(rot_x) * sin(rot_z) + sin(rot_x) * sin(rot_y) * cos(rot_z);
    r13 = sin(rot_x) * sin(rot_z) + cos(rot_x) * sin(rot_y) * cos(rot_z);
    r21 = cos(rot_y) * sin(rot_z);
    r22 = cos(rot_x) * cos(rot_z) + sin(rot_x) * sin(rot_y) * sin(rot_z);
    r23 = -sin(rot_x) * cos(rot_z) + cos(rot_x) * sin(rot_y) * sin(rot_z);
    r31 = -sin(rot_y);
    r32 = sin(rot_x) * cos(rot_y);
    r33 = cos(rot_x) * cos(rot_y);
    for (i = 0; i < nV; i++) {
      v1 = Vertex[i * 3];
      v2 = Vertex[i * 3 + 1];
      v3 = Vertex[i * 3 + 2];
      Vertex[i * 3] = r11 * v1 + r12 * v2 + r13 * v3;
      Vertex[i * 3 + 1] = r21 * v1 + r22 * v2 + r23 * v3;
      Vertex[i * 3 + 2] = r31 * v1 + r32 * v2 + r33 * v3;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<scg_rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118e <scg_rotate+0x6e>
jp     118e <scg_rotate+0x6e>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118e <scg_rotate+0x6e>
jp     118e <scg_rotate+0x6e>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118e <scg_rotate+0x6e>
jp     118e <scg_rotate+0x6e>
jmp    1619 <scg_rotate+0x4f9>
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x130(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x128(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x120(%rbp),%xmm1
ff
movsd  -0x118(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x110(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x100(%rbp),%xmm1
ff
movsd  -0xf8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0xe8(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0xd8(%rbp),%xmm1
ff
movsd  -0xd0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xb0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1614 <scg_rotate+0x4f4>
mov    -0x10(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x10(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x38(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
imul   $0x3,-0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    14dd <scg_rotate+0x3bd>
jmp    1619 <scg_rotate+0x4f9>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scg_rotate>:
push   %rbp
push   %rbx
sub    $0x1d8,%rsp
movapd %xmm0,%xmm3
mov    %rsi,%rbx
mov    %edi,%ebp
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jne    1156 <scg_rotate+0x36>
jp     1156 <scg_rotate+0x36>
ucomisd %xmm0,%xmm1
jne    1156 <scg_rotate+0x36>
jp     1156 <scg_rotate+0x36>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jne    1156 <scg_rotate+0x36>
jnp    1684 <scg_rotate+0x564>
movapd %xmm1,%xmm0
movsd  %xmm1,0x8(%rsp)
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x10(%rsp)
call   1040 <cos@plt>
movapd %xmm0,0x190(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x1c0(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x1b0(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x50(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x170(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x160(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x180(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x1a0(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x40(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x150(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x130(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x140(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0xf0(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0xd0(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x120(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x110(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0xc0(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0xb0(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0xa0(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x100(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0xe0(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x90(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x80(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x70(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x68(%rsp)
movsd  0x20(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movapd 0x20(%rsp),%xmm7
movapd 0x30(%rsp),%xmm6
movapd 0x10(%rsp),%xmm5
movapd 0x40(%rsp),%xmm13
movapd 0x50(%rsp),%xmm11
movapd 0x1c0(%rsp),%xmm15
test   %ebp,%ebp
jle    1684 <scg_rotate+0x564>
movapd 0x190(%rsp),%xmm1
unpcklpd 0xf0(%rsp),%xmm1
unpcklpd 0xd0(%rsp),%xmm15
mulpd  %xmm1,%xmm15
movapd 0x170(%rsp),%xmm1
unpcklpd 0xc0(%rsp),%xmm1
movapd 0x160(%rsp),%xmm2
unpcklpd 0xb0(%rsp),%xmm2
mulpd  %xmm1,%xmm2
movapd 0x180(%rsp),%xmm3
unpcklpd 0xa0(%rsp),%xmm3
mulpd  %xmm2,%xmm3
movapd 0xbf5(%rip),%xmm1
movapd 0x1b0(%rsp),%xmm2
xorpd  %xmm1,%xmm2
unpcklpd 0x120(%rsp),%xmm2
unpcklpd 0x110(%rsp),%xmm11
mulpd  %xmm2,%xmm11
addpd  %xmm3,%xmm11
movapd 0x130(%rsp),%xmm3
unpcklpd 0x90(%rsp),%xmm3
movapd 0x150(%rsp),%xmm2
unpcklpd 0x80(%rsp),%xmm2
mulpd  %xmm3,%xmm2
movapd 0x140(%rsp),%xmm3
unpcklpd 0x70(%rsp),%xmm3
mulpd  %xmm2,%xmm3
movapd 0x100(%rsp),%xmm4
xorpd  %xmm1,%xmm4
movapd 0x1a0(%rsp),%xmm2
unpcklpd %xmm4,%xmm2
unpcklpd 0xe0(%rsp),%xmm13
mulpd  %xmm2,%xmm13
addpd  %xmm3,%xmm13
xorpd  %xmm1,%xmm5
mulsd  0x68(%rsp),%xmm6
mulsd  %xmm0,%xmm7
mov    %ebp,%eax
cmp    $0x1,%ebp
jne    14ba <scg_rotate+0x39a>
xor    %ecx,%ecx
jmp    160c <scg_rotate+0x4ec>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
movapd %xmm11,%xmm8
unpcklpd %xmm11,%xmm8
movapd %xmm15,%xmm9
unpcklpd %xmm15,%xmm9
movapd %xmm13,%xmm10
unpcklpd %xmm13,%xmm10
movapd %xmm11,0x50(%rsp)
unpckhpd %xmm11,%xmm11
movapd %xmm15,%xmm12
unpckhpd %xmm15,%xmm12
movapd %xmm13,0x40(%rsp)
unpckhpd %xmm13,%xmm13
movapd %xmm6,0x30(%rsp)
movapd %xmm6,%xmm14
unpcklpd %xmm6,%xmm14
movapd %xmm5,0x10(%rsp)
movapd %xmm7,%xmm0
movapd %xmm5,%xmm7
unpcklpd %xmm5,%xmm7
movapd %xmm0,0x20(%rsp)
unpcklpd %xmm0,%xmm0
mov    %rcx,%rdx
mov    %rbx,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movupd (%rsi),%xmm3
movupd 0x10(%rsi),%xmm4
movupd 0x20(%rsi),%xmm1
movapd %xmm4,%xmm2
movsd  %xmm3,%xmm2
shufpd $0x1,%xmm1,%xmm3
movsd  %xmm4,%xmm1
movapd %xmm8,%xmm4
mulpd  %xmm3,%xmm4
movapd %xmm9,%xmm5
mulpd  %xmm2,%xmm5
addpd  %xmm4,%xmm5
movapd %xmm10,%xmm4
mulpd  %xmm1,%xmm4
addpd  %xmm5,%xmm4
movapd %xmm11,%xmm5
mulpd  %xmm3,%xmm5
movapd %xmm12,%xmm6
mulpd  %xmm2,%xmm6
addpd  %xmm5,%xmm6
movapd %xmm13,%xmm5
mulpd  %xmm1,%xmm5
addpd  %xmm6,%xmm5
mulpd  %xmm14,%xmm3
mulpd  %xmm7,%xmm2
addpd  %xmm3,%xmm2
mulpd  %xmm0,%xmm1
addpd  %xmm2,%xmm1
movapd %xmm5,%xmm2
unpckhpd %xmm1,%xmm2
shufpd $0x2,%xmm4,%xmm1
unpcklpd %xmm5,%xmm4
movupd %xmm4,(%rsi)
movupd %xmm1,0x10(%rsi)
movupd %xmm2,0x20(%rsi)
add    $0x30,%rsi
add    $0xfffffffffffffffe,%rdx
jne    1540 <scg_rotate+0x420>
cmp    %rax,%rcx
movapd 0x50(%rsp),%xmm11
movapd 0x40(%rsp),%xmm13
movapd 0x10(%rsp),%xmm5
movapd 0x30(%rsp),%xmm6
movapd 0x20(%rsp),%xmm7
je     1684 <scg_rotate+0x564>
lea    (%rcx,%rcx,2),%rdx
lea    (%rbx,%rdx,8),%rdx
add    $0x10,%rdx
sub    %rcx,%rax
nopl   0x0(%rax,%rax,1)
movsd  -0x10(%rdx),%xmm0
movsd  -0x8(%rdx),%xmm1
movsd  (%rdx),%xmm2
movapd %xmm6,%xmm3
mulsd  %xmm1,%xmm3
unpcklpd %xmm1,%xmm1
mulpd  %xmm11,%xmm1
movapd %xmm5,%xmm4
mulsd  %xmm0,%xmm4
unpcklpd %xmm0,%xmm0
mulpd  %xmm15,%xmm0
addpd  %xmm1,%xmm0
movapd %xmm7,%xmm1
mulsd  %xmm2,%xmm1
unpcklpd %xmm2,%xmm2
mulpd  %xmm13,%xmm2
addpd  %xmm0,%xmm2
movupd %xmm2,-0x10(%rdx)
addsd  %xmm3,%xmm4
addsd  %xmm1,%xmm4
movsd  %xmm4,(%rdx)
add    $0x18,%rdx
add    $0xffffffffffffffff,%rax
jne    1620 <scg_rotate+0x500>
xor    %eax,%eax
add    $0x1d8,%rsp
pop    %rbx
pop    %rbp
ret

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

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