#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 */
int LinearADR_Sine(int *, double *, int, double, double *, double *);
double cos(double);
double sin(double);
int LinearADR_Sine_r(int *iwork, double *rwork, int nPoints, double t,
                     double *x, double *u, double *r) {
  int i, j, iret;
  double omega[3] = {rwork[0], rwork[1], rwork[2]};
  double omega0 = rwork[3];
  double b[3] = {rwork[4], rwork[5], rwork[6]};
  double a[3][3] = {{rwork[7], rwork[8], rwork[9]},
                    {rwork[10], rwork[11], rwork[12]},
                    {rwork[13], rwork[14], rwork[15]}};
  double c = rwork[16];
  double Y, D, E;
  double MM[3];
  iret = LinearADR_Sine(iwork, rwork, nPoints, t, x, u);
  for (j = 0; j < 3; j++) {
    MM[j] = a[j][0] * omega[0] + a[j][1] * omega[1] + a[j][2] * omega[2];
  }
  E = -(MM[0] * omega[0] + MM[1] * omega[1] + MM[2] * omega[2]) - c;
  D = -(b[0] * omega[0] + b[1] * omega[1] + b[2] * omega[2]);
  for (i = 0; i < nPoints; i++) {
    Y = omega[0] * x[i * 3 + 0] + omega[1] * x[i * 3 + 1] +
        omega[2] * x[i * 3 + 2] + omega0;
    r[i] = c * u[i] + D * cos(Y) + E * sin(Y);
  }
  return iret;
}


x86 assembly (clang, -O0):
<LinearADR_Sine_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x40(%rax),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x48(%rax),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x50(%rax),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x58(%rax),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x70(%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x78(%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  0x80(%rax),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
movsd  -0x20(%rbp),%xmm0
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <LinearADR_Sine@plt>
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x40(%rbp)
cmpl   $0x3,-0x40(%rbp)
jge    1314 <LinearADR_Sine_r+0x1e4>
movslq -0x40(%rbp),%rcx
lea    -0xd0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm1
movsd  -0x60(%rbp),%xmm2
movslq -0x40(%rbp),%rcx
lea    -0xd0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movslq -0x40(%rbp),%rcx
lea    -0xd0(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x40(%rbp),%rax
movsd  %xmm0,-0x110(%rbp,%rax,8)
ff ff
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    128c <LinearADR_Sine_r+0x15c>
movsd  -0x110(%rbp),%xmm1
ff
movsd  -0x60(%rbp),%xmm2
movsd  -0x108(%rbp),%xmm0
ff
mulsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
subsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x80(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    14fb <LinearADR_Sine_r+0x3cb>
movsd  -0x60(%rbp),%xmm1
mov    -0x28(%rbp),%rax
imul   $0x3,-0x3c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x58(%rbp),%xmm0
mov    -0x28(%rbp),%rax
imul   $0x3,-0x3c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
imul   $0x3,-0x3c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
call   1050 <cos@plt>
movsd  -0x138(%rbp),%xmm1
ff
movsd  -0x130(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x128(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
call   1040 <sin@plt>
movsd  -0x120(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x118(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13c6 <LinearADR_Sine_r+0x296>
mov    -0x44(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LinearADR_Sine_r>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
mov    %edx,%ebp
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
movsd  0x10(%rsi),%xmm3
movsd  0x40(%rsi),%xmm4
mulsd  %xmm2,%xmm4
movsd  %xmm4,0x88(%rsp)
movsd  0x38(%rsi),%xmm4
mulsd  %xmm1,%xmm4
movsd  %xmm4,0x78(%rsp)
movsd  0x48(%rsi),%xmm4
mulsd  %xmm3,%xmm4
movsd  %xmm4,0x8(%rsp)
movsd  0x58(%rsi),%xmm4
mulsd  %xmm2,%xmm4
movsd  %xmm4,0x68(%rsp)
movsd  0x50(%rsi),%xmm4
mulsd  %xmm1,%xmm4
movsd  %xmm4,0x60(%rsp)
movsd  0x60(%rsi),%xmm4
mulsd  %xmm3,%xmm4
movsd  %xmm4,(%rsp)
movsd  0x70(%rsi),%xmm4
mulsd  %xmm2,%xmm4
movsd  %xmm4,0x58(%rsp)
movsd  0x68(%rsi),%xmm4
mulsd  %xmm1,%xmm4
movsd  %xmm4,0x50(%rsp)
movsd  0x78(%rsi),%xmm4
mulsd  %xmm3,%xmm4
movapd %xmm4,0x40(%rsp)
movsd  0x28(%rsi),%xmm4
movsd  %xmm2,0x20(%rsp)
mulsd  %xmm2,%xmm4
movsd  %xmm4,0x80(%rsp)
movsd  0x20(%rsi),%xmm2
movsd  %xmm1,0x28(%rsp)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x70(%rsp)
movsd  0x30(%rsi),%xmm1
movsd  %xmm3,0x18(%rsp)
mulsd  %xmm3,%xmm1
movapd %xmm1,0x30(%rsp)
movsd  0x18(%rsi),%xmm1
movsd  %xmm1,0x90(%rsp)
movsd  0x80(%rsi),%xmm1
movsd  %xmm1,0x10(%rsp)
call   1030 <LinearADR_Sine@plt>
mov    %eax,%r12d
test   %ebp,%ebp
jle    138a <LinearADR_Sine_r+0x25a>
movsd  0x78(%rsp),%xmm1
addsd  0x88(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  0x60(%rsp),%xmm1
addsd  0x68(%rsp),%xmm1
movsd  (%rsp),%xmm2
addsd  %xmm1,%xmm2
movsd  0x50(%rsp),%xmm3
addsd  0x58(%rsp),%xmm3
movapd 0x40(%rsp),%xmm1
addsd  %xmm3,%xmm1
mulsd  0x20(%rsp),%xmm2
mulsd  0x28(%rsp),%xmm0
addsd  %xmm2,%xmm0
mulsd  0x18(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd 0xd49(%rip),%xmm0
xorpd  %xmm0,%xmm1
subsd  0x10(%rsp),%xmm1
movapd %xmm1,0x40(%rsp)
movsd  0x70(%rsp),%xmm2
addsd  0x80(%rsp),%xmm2
movapd 0x30(%rsp),%xmm1
addsd  %xmm2,%xmm1
xorpd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
mov    %ebp,%r13d
add    $0x10,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  -0x8(%rbx),%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  -0x10(%rbx),%xmm1
mulsd  0x28(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  (%rbx),%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  %xmm1,%xmm0
addsd  0x90(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r15,%rbp,8),%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,(%rsp)
call   1050 <cos@plt>
mulsd  0x30(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x40(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%r14,%rbp,8)
add    $0x1,%rbp
add    $0x18,%rbx
cmp    %rbp,%r13
jne    1300 <LinearADR_Sine_r+0x1d0>
mov    %r12d,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @LinearADR_Sine_r(i32* %0, double* %1, i32 %2, double %3, double* %4, double* %5, double* nocapture writeonly %6) {
%8 = load double, double* %1
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 3
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 4
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %1, i64 5
%18 = load double, double* %17
%19 = getelementptr inbounds double, double* %1, i64 6
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %1, i64 7
%22 = load double, double* %21
%23 = getelementptr inbounds double, double* %1, i64 8
%24 = load double, double* %23
%25 = getelementptr inbounds double, double* %1, i64 9
%26 = load double, double* %25
%27 = getelementptr inbounds double, double* %1, i64 10
%28 = load double, double* %27
%29 = getelementptr inbounds double, double* %1, i64 11
%30 = load double, double* %29
%31 = getelementptr inbounds double, double* %1, i64 12
%32 = load double, double* %31
%33 = getelementptr inbounds double, double* %1, i64 13
%34 = load double, double* %33
%35 = getelementptr inbounds double, double* %1, i64 14
%36 = load double, double* %35
%37 = getelementptr inbounds double, double* %1, i64 15
%38 = load double, double* %37
%39 = getelementptr inbounds double, double* %1, i64 16
%40 = load double, double* %39
%41 = tail call i32 @LinearADR_Sine(i32* %0, double* %1, i32 %2, double %3, double* %4, double* %5)
%42 = fmul double %10, %24
%43 = tail call double @llvm.fmuladd.f64(double %22, double %8, double %42)
%44 = tail call double @llvm.fmuladd.f64(double %26, double %12, double %43)
%45 = fmul double %10, %30
%46 = tail call double @llvm.fmuladd.f64(double %28, double %8, double %45)
%47 = tail call double @llvm.fmuladd.f64(double %32, double %12, double %46)
%48 = fmul double %10, %36
%49 = tail call double @llvm.fmuladd.f64(double %34, double %8, double %48)
%50 = tail call double @llvm.fmuladd.f64(double %38, double %12, double %49)
%51 = fmul double %10, %47
%52 = tail call double @llvm.fmuladd.f64(double %44, double %8, double %51)
%53 = tail call double @llvm.fmuladd.f64(double %50, double %12, double %52)
%54 = fneg double %53
%55 = fsub double %54, %40
%56 = fmul double %10, %18
%57 = tail call double @llvm.fmuladd.f64(double %16, double %8, double %56)
%58 = tail call double @llvm.fmuladd.f64(double %20, double %12, double %57)
%59 = fneg double %58
%60 = icmp sgt i32 %2, 0
br i1 %60, label %61, label %88
61: ; preds = %7
%62 = zext i32 %2 to i64
br label %63
63: ; preds = %61, %63
%64 = phi i64 [ 0, %61 ], [ %86, %63 ]
%65 = mul nuw nsw i64 %64, 3
%66 = getelementptr inbounds double, double* %4, i64 %65
%67 = load double, double* %66
%68 = add nuw nsw i64 %65, 1
%69 = getelementptr inbounds double, double* %4, i64 %68
%70 = load double, double* %69
%71 = fmul double %10, %70
%72 = tail call double @llvm.fmuladd.f64(double %8, double %67, double %71)
%73 = add nuw nsw i64 %65, 2
%74 = getelementptr inbounds double, double* %4, i64 %73
%75 = load double, double* %74
%76 = tail call double @llvm.fmuladd.f64(double %12, double %75, double %72)
%77 = fadd double %14, %76
%78 = getelementptr inbounds double, double* %5, i64 %64
%79 = load double, double* %78
%80 = tail call double @cos(double %77)
%81 = fmul double %80, %59
%82 = tail call double @llvm.fmuladd.f64(double %40, double %79, double %81)
%83 = tail call double @sin(double %77)
%84 = tail call double @llvm.fmuladd.f64(double %55, double %83, double %82)
%85 = getelementptr inbounds double, double* %6, i64 %64
store double %84, double* %85
%86 = add nuw nsw i64 %64, 1
%87 = icmp eq i64 %86, %62
br i1 %87, label %88, label %63
88: ; preds = %63, %7
ret i32 %41
}