#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 mp_mul_rcsqu(int n, double *a) {
  int i, i0, j, k;
  double ec, w1r, w1i, wkr, wki, wdr, wdi, ss;
  double xr, xi, yr, yi, ajr, aji, akr, aki;
  ec = 2 * ((double)1.570796326794896619231321691639751442098584) / n;
  wkr = 0;
  wki = 0;
  wdi = cos(ec);
  wdr = sin(ec);
  wdi *= wdr;
  wdr *= wdr;
  w1r = 1 - 2 * wdr;
  w1i = 2 * wdi;
  ss = 2 * w1i;
  i = n >> 1;
  xr = a[i];
  xi = a[i + 1];
  a[i] = xr * xr - xi * xi;
  a[i + 1] = 2 * xr * xi;
  for (;;) {
    i0 = i - 4 * 64;
    if (i0 < 2) {
      i0 = 2;
    }
    for (j = i - 2; j >= i0; j -= 2) {
      k = n - j;
      xr = wkr + ss * wdi;
      xi = wki + ss * (((double)0.5) - wdr);
      wkr = wdr;
      wki = wdi;
      wdr = xr;
      wdi = xi;
      xr = a[j] - a[k];
      xi = a[j + 1] + a[k + 1];
      yr = wkr * xr - wki * xi;
      yi = wkr * xi + wki * xr;
      xr = a[j] - yr;
      xi = a[j + 1] - yi;
      yr = a[k] + yr;
      yi = a[k + 1] - yi;
      ajr = xr * xr - xi * xi;
      aji = 2 * xr * xi;
      akr = yr * yr - yi * yi;
      aki = 2 * yr * yi;
      xr = ajr - akr;
      xi = aji + aki;
      yr = wkr * xr + wki * xi;
      yi = wkr * xi - wki * xr;
      a[j] = ajr - yr;
      a[j + 1] = aji - yi;
      a[k] = akr + yr;
      a[k + 1] = aki - yi;
    }
    if (i0 == 2) {
      break;
    }
    wkr = ((double)0.5) * sin(ec * i0);
    wki = ((double)0.5) * cos(ec * i0);
    wdr = ((double)0.5) - (wkr * w1r - wki * w1i);
    wdi = wkr * w1i + wki * w1r;
    wkr = ((double)0.5) - wkr;
    i = i0;
  }
}


x86 assembly (clang, -O0):
<mp_mul_rcsqu>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed1(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xe63(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe4a(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe38(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xdb4(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
sub    $0x100,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    1284 <mp_mul_rcsqu+0x164>
movl   $0x2,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     15be <mp_mul_rcsqu+0x49e>
mov    -0x4(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  0xd48(%rip),%xmm2
subsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xbac(%rip),%xmm0
mulsd  -0x68(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xb57(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x68(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    128d <mp_mul_rcsqu+0x16d>
cmpl   $0x2,-0x18(%rbp)
jne    15cd <mp_mul_rcsqu+0x4ad>
jmp    169d <mp_mul_rcsqu+0x57d>
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xa2d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xa06(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x9c2(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0x990(%rip),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1268 <mp_mul_rcsqu+0x148>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_mul_rcsqu>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
cvtsi2sd %edi,%xmm1
movsd  0xec5(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm12
mulsd  %xmm0,%xmm12
mulsd  %xmm0,%xmm0
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe8d(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm2,0x28(%rsp)
movapd %xmm12,%xmm1
addsd  %xmm12,%xmm1
movsd  %xmm1,0x20(%rsp)
movapd %xmm1,%xmm13
addsd  %xmm1,%xmm13
movslq %ebp,%rax
sar    %ebp
movslq %ebp,%rcx
movsd  (%rbx,%rcx,8),%xmm1
movsd  0x8(%rbx,%rcx,8),%xmm2
movapd %xmm1,%xmm3
addsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm3
subsd  %xmm2,%xmm3
movsd  %xmm3,(%rbx,%rcx,8)
movsd  %xmm1,0x8(%rbx,%rcx,8)
lea    0x18(%rbx,%rax,8),%r14
xorpd  %xmm10,%xmm10
movsd  0xe28(%rip),%xmm14
xorpd  %xmm4,%xmm4
movsd  %xmm13,0x18(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x103,%ebp
mov    $0x102,%eax
cmovge %ebp,%eax
lea    -0x100(%rax),%r15d
add    $0xffffff02,%eax
cmp    %eax,%ebp
jl     136b <mp_mul_rcsqu+0x24b>
movslq %ebp,%rsi
lea    -0x2(%rsi),%rax
mov    %r15d,%ecx
shl    $0x3,%rsi
mov    %r14,%rdx
sub    %rsi,%rdx
cs nopw 0x0(%rax,%rax,1)
movapd %xmm13,%xmm8
mulsd  %xmm12,%xmm8
addsd  %xmm4,%xmm8
movapd %xmm14,%xmm9
subsd  %xmm0,%xmm9
mulsd  %xmm13,%xmm9
addsd  %xmm10,%xmm9
movsd  (%rbx,%rax,8),%xmm6
movsd  0x8(%rbx,%rax,8),%xmm2
movsd  -0x8(%rdx),%xmm10
movsd  (%rdx),%xmm1
movapd %xmm6,%xmm4
subsd  %xmm10,%xmm4
movapd %xmm2,%xmm7
addsd  %xmm1,%xmm7
movapd %xmm0,%xmm3
mulsd  %xmm7,%xmm3
mulsd  %xmm12,%xmm7
movapd %xmm0,%xmm5
mulsd  %xmm4,%xmm5
subsd  %xmm7,%xmm5
mulsd  %xmm12,%xmm4
addsd  %xmm3,%xmm4
subsd  %xmm5,%xmm6
subsd  %xmm4,%xmm2
addsd  %xmm10,%xmm5
subsd  %xmm4,%xmm1
movapd %xmm6,%xmm3
addsd  %xmm6,%xmm6
mulsd  %xmm2,%xmm6
mulsd  %xmm2,%xmm2
mulsd  %xmm3,%xmm3
subsd  %xmm2,%xmm3
movapd %xmm5,%xmm11
addsd  %xmm5,%xmm5
mulsd  %xmm1,%xmm5
mulsd  %xmm1,%xmm1
mulsd  %xmm11,%xmm11
subsd  %xmm1,%xmm11
movapd %xmm3,%xmm2
subsd  %xmm11,%xmm2
movapd %xmm6,%xmm4
addsd  %xmm5,%xmm4
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm12,%xmm2
movapd %xmm12,%xmm10
movapd %xmm12,%xmm7
mulsd  %xmm4,%xmm7
addsd  %xmm7,%xmm1
mulsd  %xmm0,%xmm4
subsd  %xmm2,%xmm4
subsd  %xmm1,%xmm3
movsd  %xmm3,(%rbx,%rax,8)
subsd  %xmm4,%xmm6
movsd  %xmm6,0x8(%rbx,%rax,8)
addsd  %xmm11,%xmm1
movsd  %xmm1,-0x8(%rdx)
subsd  %xmm4,%xmm5
movsd  %xmm5,(%rdx)
add    $0xfffffffffffffffe,%rax
add    $0x10,%rdx
movapd %xmm0,%xmm4
movapd %xmm8,%xmm0
movapd %xmm9,%xmm12
cmp    %rcx,%rax
jge    1240 <mp_mul_rcsqu+0x120>
cmp    $0x2,%r15d
je     1418 <mp_mul_rcsqu+0x2f8>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
call   1030 <sin@plt>
mulsd  0xc7a(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0xc60(%rip),%xmm14
movsd  0x18(%rsp),%xmm13
movsd  0x8(%rsp),%xmm12
movapd %xmm0,%xmm10
mulsd  %xmm14,%xmm10
movsd  0x20(%rsp),%xmm3
movapd %xmm3,%xmm0
mulsd  %xmm10,%xmm0
movapd %xmm12,%xmm1
movsd  0x28(%rsp),%xmm2
mulsd  %xmm2,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm14,%xmm0
subsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm10,%xmm1
movapd %xmm14,%xmm4
subsd  %xmm12,%xmm4
mulsd  %xmm3,%xmm12
addsd  %xmm1,%xmm12
mov    %r15d,%ebp
jmp    1200 <mp_mul_rcsqu+0xe0>
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @mp_mul_rcsqu(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%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
store i32 %0, i32* %3
store double* %1, double** %4
%25 = load i32, i32* %3
%26 = sitofp i32 %25 to double
%27 = fdiv double 0x400921FB54442D18, %26
store double %27, double* %9
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
%28 = load double, double* %9
%29 = call double @cos(double %28)
store double %29, double* %15
%30 = load double, double* %9
%31 = call double @sin(double %30)
store double %31, double* %14
%32 = load double, double* %14
%33 = load double, double* %15
%34 = fmul double %33, %32
store double %34, double* %15
%35 = load double, double* %14
%36 = load double, double* %14
%37 = fmul double %36, %35
store double %37, double* %14
%38 = load double, double* %14
%39 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %38, double 1.000000e+00)
store double %39, double* %10
%40 = load double, double* %15
%41 = fmul double 2.000000e+00, %40
store double %41, double* %11
%42 = load double, double* %11
%43 = fmul double 2.000000e+00, %42
store double %43, double* %16
%44 = load i32, i32* %3
%45 = ashr i32 %44, 1
store i32 %45, i32* %5
%46 = load double*, double** %4
%47 = load i32, i32* %5
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %46, i64 %48
%50 = load double, double* %49
store double %50, double* %17
%51 = load double*, double** %4
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %51, i64 %54
%56 = load double, double* %55
store double %56, double* %18
%57 = load double, double* %17
%58 = load double, double* %17
%59 = load double, double* %18
%60 = load double, double* %18
%61 = fmul double %59, %60
%62 = fneg double %61
%63 = call double @llvm.fmuladd.f64(double %57, double %58, double %62)
%64 = load double*, double** %4
%65 = load i32, i32* %5
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
store double %63, double* %67
%68 = load double, double* %17
%69 = fmul double 2.000000e+00, %68
%70 = load double, double* %18
%71 = fmul double %69, %70
%72 = load double*, double** %4
%73 = load i32, i32* %5
%74 = add nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %72, i64 %75
store double %71, double* %76
br label %77
77: ; preds = %252, %2
%78 = load i32, i32* %5
%79 = sub nsw i32 %78, 256
store i32 %79, i32* %6
%80 = load i32, i32* %6
%81 = icmp slt i32 %80, 2
br i1 %81, label %82, label %83
82: ; preds = %77
store i32 2, i32* %6
br label %83
83: ; preds = %82, %77
%84 = load i32, i32* %5
%85 = sub nsw i32 %84, 2
store i32 %85, i32* %7
br label %86
86: ; preds = %245, %83
%87 = load i32, i32* %7
%88 = load i32, i32* %6
%89 = icmp sge i32 %87, %88
br i1 %89, label %90, label %248
90: ; preds = %86
%91 = load i32, i32* %3
%92 = load i32, i32* %7
%93 = sub nsw i32 %91, %92
store i32 %93, i32* %8
%94 = load double, double* %12
%95 = load double, double* %16
%96 = load double, double* %15
%97 = call double @llvm.fmuladd.f64(double %95, double %96, double %94)
store double %97, double* %17
%98 = load double, double* %13
%99 = load double, double* %16
%100 = load double, double* %14
%101 = fsub double 5.000000e-01, %100
%102 = call double @llvm.fmuladd.f64(double %99, double %101, double %98)
store double %102, double* %18
%103 = load double, double* %14
store double %103, double* %12
%104 = load double, double* %15
store double %104, double* %13
%105 = load double, double* %17
store double %105, double* %14
%106 = load double, double* %18
store double %106, double* %15
%107 = load double*, double** %4
%108 = load i32, i32* %7
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %107, i64 %109
%111 = load double, double* %110
%112 = load double*, double** %4
%113 = load i32, i32* %8
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %112, i64 %114
%116 = load double, double* %115
%117 = fsub double %111, %116
store double %117, double* %17
%118 = load double*, double** %4
%119 = load i32, i32* %7
%120 = add nsw i32 %119, 1
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds double, double* %118, i64 %121
%123 = load double, double* %122
%124 = load double*, double** %4
%125 = load i32, i32* %8
%126 = add nsw i32 %125, 1
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %124, i64 %127
%129 = load double, double* %128
%130 = fadd double %123, %129
store double %130, double* %18
%131 = load double, double* %12
%132 = load double, double* %17
%133 = load double, double* %13
%134 = load double, double* %18
%135 = fmul double %133, %134
%136 = fneg double %135
%137 = call double @llvm.fmuladd.f64(double %131, double %132, double %136)
store double %137, double* %19
%138 = load double, double* %12
%139 = load double, double* %18
%140 = load double, double* %13
%141 = load double, double* %17
%142 = fmul double %140, %141
%143 = call double @llvm.fmuladd.f64(double %138, double %139, double %142)
store double %143, double* %20
%144 = load double*, double** %4
%145 = load i32, i32* %7
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %144, i64 %146
%148 = load double, double* %147
%149 = load double, double* %19
%150 = fsub double %148, %149
store double %150, double* %17
%151 = load double*, double** %4
%152 = load i32, i32* %7
%153 = add nsw i32 %152, 1
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %151, i64 %154
%156 = load double, double* %155
%157 = load double, double* %20
%158 = fsub double %156, %157
store double %158, double* %18
%159 = load double*, double** %4
%160 = load i32, i32* %8
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %159, i64 %161
%163 = load double, double* %162
%164 = load double, double* %19
%165 = fadd double %163, %164
store double %165, double* %19
%166 = load double*, double** %4
%167 = load i32, i32* %8
%168 = add nsw i32 %167, 1
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %166, i64 %169
%171 = load double, double* %170
%172 = load double, double* %20
%173 = fsub double %171, %172
store double %173, double* %20
%174 = load double, double* %17
%175 = load double, double* %17
%176 = load double, double* %18
%177 = load double, double* %18
%178 = fmul double %176, %177
%179 = fneg double %178
%180 = call double @llvm.fmuladd.f64(double %174, double %175, double %179)
store double %180, double* %21
%181 = load double, double* %17
%182 = fmul double 2.000000e+00, %181
%183 = load double, double* %18
%184 = fmul double %182, %183
store double %184, double* %22
%185 = load double, double* %19
%186 = load double, double* %19
%187 = load double, double* %20
%188 = load double, double* %20
%189 = fmul double %187, %188
%190 = fneg double %189
%191 = call double @llvm.fmuladd.f64(double %185, double %186, double %190)
store double %191, double* %23
%192 = load double, double* %19
%193 = fmul double 2.000000e+00, %192
%194 = load double, double* %20
%195 = fmul double %193, %194
store double %195, double* %24
%196 = load double, double* %21
%197 = load double, double* %23
%198 = fsub double %196, %197
store double %198, double* %17
%199 = load double, double* %22
%200 = load double, double* %24
%201 = fadd double %199, %200
store double %201, double* %18
%202 = load double, double* %12
%203 = load double, double* %17
%204 = load double, double* %13
%205 = load double, double* %18
%206 = fmul double %204, %205
%207 = call double @llvm.fmuladd.f64(double %202, double %203, double %206)
store double %207, double* %19
%208 = load double, double* %12
%209 = load double, double* %18
%210 = load double, double* %13
%211 = load double, double* %17
%212 = fmul double %210, %211
%213 = fneg double %212
%214 = call double @llvm.fmuladd.f64(double %208, double %209, double %213)
store double %214, double* %20
%215 = load double, double* %21
%216 = load double, double* %19
%217 = fsub double %215, %216
%218 = load double*, double** %4
%219 = load i32, i32* %7
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds double, double* %218, i64 %220
store double %217, double* %221
%222 = load double, double* %22
%223 = load double, double* %20
%224 = fsub double %222, %223
%225 = load double*, double** %4
%226 = load i32, i32* %7
%227 = add nsw i32 %226, 1
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double, double* %225, i64 %228
store double %224, double* %229
%230 = load double, double* %23
%231 = load double, double* %19
%232 = fadd double %230, %231
%233 = load double*, double** %4
%234 = load i32, i32* %8
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds double, double* %233, i64 %235
store double %232, double* %236
%237 = load double, double* %24
%238 = load double, double* %20
%239 = fsub double %237, %238
%240 = load double*, double** %4
%241 = load i32, i32* %8
%242 = add nsw i32 %241, 1
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds double, double* %240, i64 %243
store double %239, double* %244
br label %245
245: ; preds = %90
%246 = load i32, i32* %7
%247 = sub nsw i32 %246, 2
store i32 %247, i32* %7
br label %86
248: ; preds = %86
%249 = load i32, i32* %6
%250 = icmp eq i32 %249, 2
br i1 %250, label %251, label %252
251: ; preds = %248
br label %282
252: ; preds = %248
%253 = load double, double* %9
%254 = load i32, i32* %6
%255 = sitofp i32 %254 to double
%256 = fmul double %253, %255
%257 = call double @sin(double %256)
%258 = fmul double 5.000000e-01, %257
store double %258, double* %12
%259 = load double, double* %9
%260 = load i32, i32* %6
%261 = sitofp i32 %260 to double
%262 = fmul double %259, %261
%263 = call double @cos(double %262)
%264 = fmul double 5.000000e-01, %263
store double %264, double* %13
%265 = load double, double* %12
%266 = load double, double* %10
%267 = load double, double* %13
%268 = load double, double* %11
%269 = fmul double %267, %268
%270 = fneg double %269
%271 = call double @llvm.fmuladd.f64(double %265, double %266, double %270)
%272 = fsub double 5.000000e-01, %271
store double %272, double* %14
%273 = load double, double* %12
%274 = load double, double* %11
%275 = load double, double* %13
%276 = load double, double* %10
%277 = fmul double %275, %276
%278 = call double @llvm.fmuladd.f64(double %273, double %274, double %277)
store double %278, double* %15
%279 = load double, double* %12
%280 = fsub double 5.000000e-01, %279
store double %280, double* %12
%281 = load i32, i32* %6
store i32 %281, i32* %5
br label %77
282: ; preds = %251
ret void
}

LLVM IR (-O2):
define void @mp_mul_rcsqu(i32 %0, double* nocapture %1) {
%3 = sitofp i32 %0 to double
%4 = fdiv double 0x400921FB54442D18, %3
%5 = tail call double @cos(double %4)
%6 = tail call double @sin(double %4)
%7 = fmul double %5, %6
%8 = fmul double %6, %6
%9 = tail call double @llvm.fmuladd.f64(double %8, double -2.000000e+00, double 1.000000e+00)
%10 = fmul double %7, 2.000000e+00
%11 = fmul double %10, 2.000000e+00
%12 = ashr i32 %0, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %1, i64 %13
%15 = load double, double* %14
%16 = add nsw i32 %12, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %1, i64 %17
%19 = load double, double* %18
%20 = fneg double %19
%21 = fmul double %19, %20
%22 = tail call double @llvm.fmuladd.f64(double %15, double %15, double %21)
store double %22, double* %14
%23 = fmul double %15, 2.000000e+00
%24 = fmul double %23, %19
store double %24, double* %18
%25 = sext i32 %0 to i64
br label %26
26: ; preds = %98, %2
%27 = phi double [ %7, %2 ], [ %110, %98 ]
%28 = phi double [ %8, %2 ], [ %108, %98 ]
%29 = phi double [ 0.000000e+00, %2 ], [ %104, %98 ]
%30 = phi double [ 0.000000e+00, %2 ], [ %111, %98 ]
%31 = phi i32 [ %12, %2 ], [ %34, %98 ]
%32 = icmp sgt i32 %31, 258
%33 = select i1 %32, i32 %31, i32 258
%34 = add nsw i32 %33, -256
%35 = add nsw i32 %33, -254
%36 = icmp slt i32 %31, %35
br i1 %36, label %96, label %37
37: ; preds = %26
%38 = sext i32 %31 to i64
%39 = add nsw i64 %38, -2
%40 = zext i32 %34 to i64
br label %41
41: ; preds = %37, %41
%42 = phi i64 [ %38, %37 ], [ %48, %41 ]
%43 = phi i64 [ %39, %37 ], [ %94, %41 ]
%44 = phi double [ %30, %37 ], [ %46, %41 ]
%45 = phi double [ %29, %37 ], [ %47, %41 ]
%46 = phi double [ %28, %37 ], [ %50, %41 ]
%47 = phi double [ %27, %37 ], [ %52, %41 ]
%48 = add nsw i64 %42, -2
%49 = sub nsw i64 %25, %43
%50 = tail call double @llvm.fmuladd.f64(double %11, double %47, double %44)
%51 = fsub double 5.000000e-01, %46
%52 = tail call double @llvm.fmuladd.f64(double %11, double %51, double %45)
%53 = getelementptr inbounds double, double* %1, i64 %43
%54 = load double, double* %53
%55 = getelementptr inbounds double, double* %1, i64 %49
%56 = load double, double* %55
%57 = fsub double %54, %56
%58 = add nsw i64 %42, -1
%59 = getelementptr inbounds double, double* %1, i64 %58
%60 = load double, double* %59
%61 = add nsw i64 %49, 1
%62 = getelementptr inbounds double, double* %1, i64 %61
%63 = load double, double* %62
%64 = fadd double %60, %63
%65 = fneg double %47
%66 = fmul double %64, %65
%67 = tail call double @llvm.fmuladd.f64(double %46, double %57, double %66)
%68 = fmul double %47, %57
%69 = tail call double @llvm.fmuladd.f64(double %46, double %64, double %68)
%70 = fsub double %54, %67
%71 = fsub double %60, %69
%72 = fadd double %56, %67
%73 = fsub double %63, %69
%74 = fneg double %71
%75 = fmul double %71, %74
%76 = tail call double @llvm.fmuladd.f64(double %70, double %70, double %75)
%77 = fmul double %70, 2.000000e+00
%78 = fmul double %71, %77
%79 = fneg double %73
%80 = fmul double %73, %79
%81 = tail call double @llvm.fmuladd.f64(double %72, double %72, double %80)
%82 = fmul double %72, 2.000000e+00
%83 = fmul double %73, %82
%84 = fsub double %76, %81
%85 = fadd double %78, %83
%86 = fmul double %47, %85
%87 = tail call double @llvm.fmuladd.f64(double %46, double %84, double %86)
%88 = fmul double %84, %65
%89 = tail call double @llvm.fmuladd.f64(double %46, double %85, double %88)
%90 = fsub double %76, %87
store double %90, double* %53
%91 = fsub double %78, %89
store double %91, double* %59
%92 = fadd double %81, %87
store double %92, double* %55
%93 = fsub double %83, %89
store double %93, double* %62
%94 = add nsw i64 %43, -2
%95 = icmp slt i64 %94, %40
br i1 %95, label %96, label %41
96: ; preds = %41, %26
%97 = icmp eq i32 %34, 2
br i1 %97, label %112, label %98
98: ; preds = %96
%99 = sitofp i32 %34 to double
%100 = fmul double %4, %99
%101 = tail call double @sin(double %100)
%102 = fmul double %101, 5.000000e-01
%103 = tail call double @cos(double %100)
%104 = fmul double %103, 5.000000e-01
%105 = fneg double %104
%106 = fmul double %10, %105
%107 = tail call double @llvm.fmuladd.f64(double %102, double %9, double %106)
%108 = fsub double 5.000000e-01, %107
%109 = fmul double %9, %104
%110 = tail call double @llvm.fmuladd.f64(double %102, double %10, double %109)
%111 = fsub double 5.000000e-01, %102
br label %26
112: ; preds = %96
ret void
}