#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 M_PI;
double cos(int);
double *malloc(int);
int rand();
double sin(int);
int sqrt(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
double *heighway(int n_iter) {
  int i;
  int test;
  double *points = malloc(2 * n_iter * sizeof(double));
  points[0] = 0.0;
  points[1] = 0.0;
  srand(time(NULL));
  for (i = 2; i < (2 * n_iter); i += 2) {
    test = rand() % 2;
    if (test) {
      points[i] =
          1 / sqrt(2) *
          (cos(M_PI / 4) * points[i - 2] - sin(M_PI / 4) * points[i - 1]);
      points[i + 1] =
          1 / sqrt(2) *
          (sin(M_PI / 4) * points[i - 2] + cos(M_PI / 4) * points[i - 1]);
    } else {
      points[i] = 1 / sqrt(2) *
                      (cos(3 * M_PI / 4) * points[i - 2] -
                       sin(3 * M_PI / 4) * points[i - 1]) +
                  1;
      points[i + 1] = 1 / sqrt(2) *
                      (sin(3 * M_PI / 4) * points[i - 2] +
                       cos(3 * M_PI / 4) * points[i - 1]);
    }
  }
  return points;
}


x86 assembly (clang, -O0):
<heighway>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    14e8 <heighway+0x378>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     135d <heighway+0x1ed>
mov    $0x2,%edi
call   1080 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    0x2dd4(%rip),%rax
mov    (%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1070 <cos@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    0x2da0(%rip),%rax
mov    (%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm3
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    $0x2,%edi
call   1080 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2d17(%rip),%rax
mov    (%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2ce3(%rip),%rax
mov    (%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1070 <cos@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm3
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14d5 <heighway+0x365>
mov    $0x2,%edi
call   1080 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x2c67(%rip),%rax
imul   $0x3,(%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1070 <cos@plt>
movsd  %xmm0,-0x78(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x2c32(%rip),%rax
imul   $0x3,(%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm3
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbe9(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    $0x2,%edi
call   1080 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    0x2b9c(%rip),%rax
imul   $0x3,(%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <sin@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x2b67(%rip),%rax
imul   $0x3,(%rax),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1070 <cos@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm3
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14da <heighway+0x36a>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    11c3 <heighway+0x53>
mov    -0x18(%rbp),%rax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heighway>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
shl    $0x4,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
xorps  %xmm0,%xmm0
movups %xmm0,(%rax)
xor    %ebp,%ebp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
cmp    $0x2,%ebx
jl     13bc <heighway+0x24c>
add    %ebx,%ebx
movslq %ebx,%r12
xorps  %xmm0,%xmm0
mov    $0x1,%ebx
mov    0x2e2a(%rip),%r15
jmp    12ea <heighway+0x17a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rax,2),%edi
add    $0x3,%edi
test   %ecx,%ecx
cmovns %ecx,%edi
sar    $0x2,%edi
call   1070 <cos@plt>
movsd  %xmm0,0x8(%rsp)
mov    (%r15),%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rax,2),%edi
add    $0x3,%edi
test   %ecx,%ecx
cmovns %ecx,%edi
sar    $0x2,%edi
call   1040 <sin@plt>
movsd  (%r14,%rbx,8),%xmm1
movsd  %xmm1,0x20(%rsp)
mulsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xdca(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  %xmm0,0x8(%r14,%rbx,8)
mov    $0x2,%edi
call   1080 <sqrt@plt>
xor    %ecx,%ecx
mov    %eax,%r13d
lea    0x1(%r13),%eax
cmp    $0x3,%eax
cmovae %ecx,%r13d
mov    (%r15),%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rax,2),%edi
add    $0x3,%edi
test   %ecx,%ecx
cmovns %ecx,%edi
sar    $0x2,%edi
call   1040 <sin@plt>
movsd  %xmm0,0x18(%rsp)
mov    (%r15),%eax
lea    (%rax,%rax,2),%eax
movsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,(%rsp)
lea    0x3(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x2,%edi
call   1070 <cos@plt>
mulsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  %xmm0,%xmm1
mulsd  (%rsp),%xmm1
movsd  %xmm1,0x10(%r14,%rbx,8)
lea    0x2(%rbx),%rax
add    $0x3,%rbx
movsd  0x8(%rsp),%xmm0
cmp    %r12,%rbx
mov    %rax,%rbx
mov    $0x0,%ebp
jge    13bc <heighway+0x24c>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
mov    %eax,%r13d
mov    $0x2,%edi
call   1080 <sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    (%r15),%eax
test   $0x1,%r13b
movsd  %xmm0,(%rsp)
je     11d0 <heighway+0x60>
lea    0x3(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x2,%edi
call   1070 <cos@plt>
movsd  %xmm0,0x8(%rsp)
mov    (%r15),%eax
lea    0x3(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x2,%edi
call   1040 <sin@plt>
movsd  (%r14,%rbx,8),%xmm1
movsd  %xmm1,0x20(%rsp)
mulsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  (%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm1,0x8(%r14,%rbx,8)
mov    $0x2,%edi
call   1080 <sqrt@plt>
xor    %ecx,%ecx
mov    %eax,%r13d
lea    0x1(%r13),%eax
cmp    $0x3,%eax
cmovae %ecx,%r13d
mov    (%r15),%eax
lea    0x3(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x2,%edi
call   1040 <sin@plt>
movsd  %xmm0,0x18(%rsp)
mov    (%r15),%eax
jmp    128c <heighway+0x11c>
mov    %r14,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double* @heighway(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 2, %6
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 8
%10 = trunc i64 %9 to i32
%11 = call double* @malloc(i32 %10)
store double* %11, double** %5
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 0
store double 0.000000e+00, double* %13
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 1
store double 0.000000e+00, double* %15
%16 = call i32 @time(i32* null)
%17 = call i32 @srand(i32 %16)
store i32 2, i32* %3
br label %18
18: ; preds = %151, %1
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = mul nsw i32 2, %20
%22 = icmp slt i32 %19, %21
br i1 %22, label %23, label %154
23: ; preds = %18
%24 = call i32 (...) @rand()
%25 = srem i32 %24, 2
store i32 %25, i32* %4
%26 = load i32, i32* %4
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %87
28: ; preds = %23
%29 = call i32 @sqrt(i32 2)
%30 = sdiv i32 1, %29
%31 = sitofp i32 %30 to double
%32 = load i32, i32* @M_PI
%33 = sdiv i32 %32, 4
%34 = call double @cos(i32 %33)
%35 = load double*, double** %5
%36 = load i32, i32* %3
%37 = sub nsw i32 %36, 2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %35, i64 %38
%40 = load double, double* %39
%41 = load i32, i32* @M_PI
%42 = sdiv i32 %41, 4
%43 = call double @sin(i32 %42)
%44 = load double*, double** %5
%45 = load i32, i32* %3
%46 = sub nsw i32 %45, 1
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %44, i64 %47
%49 = load double, double* %48
%50 = fmul double %43, %49
%51 = fneg double %50
%52 = call double @llvm.fmuladd.f64(double %34, double %40, double %51)
%53 = fmul double %31, %52
%54 = load double*, double** %5
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
store double %53, double* %57
%58 = call i32 @sqrt(i32 2)
%59 = sdiv i32 1, %58
%60 = sitofp i32 %59 to double
%61 = load i32, i32* @M_PI
%62 = sdiv i32 %61, 4
%63 = call double @sin(i32 %62)
%64 = load double*, double** %5
%65 = load i32, i32* %3
%66 = sub nsw i32 %65, 2
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %64, i64 %67
%69 = load double, double* %68
%70 = load i32, i32* @M_PI
%71 = sdiv i32 %70, 4
%72 = call double @cos(i32 %71)
%73 = load double*, double** %5
%74 = load i32, i32* %3
%75 = sub nsw i32 %74, 1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %73, i64 %76
%78 = load double, double* %77
%79 = fmul double %72, %78
%80 = call double @llvm.fmuladd.f64(double %63, double %69, double %79)
%81 = fmul double %60, %80
%82 = load double*, double** %5
%83 = load i32, i32* %3
%84 = add nsw i32 %83, 1
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %82, i64 %85
store double %81, double* %86
br label %150
87: ; preds = %23
%88 = call i32 @sqrt(i32 2)
%89 = sdiv i32 1, %88
%90 = sitofp i32 %89 to double
%91 = load i32, i32* @M_PI
%92 = mul nsw i32 3, %91
%93 = sdiv i32 %92, 4
%94 = call double @cos(i32 %93)
%95 = load double*, double** %5
%96 = load i32, i32* %3
%97 = sub nsw i32 %96, 2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %95, i64 %98
%100 = load double, double* %99
%101 = load i32, i32* @M_PI
%102 = mul nsw i32 3, %101
%103 = sdiv i32 %102, 4
%104 = call double @sin(i32 %103)
%105 = load double*, double** %5
%106 = load i32, i32* %3
%107 = sub nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %105, i64 %108
%110 = load double, double* %109
%111 = fmul double %104, %110
%112 = fneg double %111
%113 = call double @llvm.fmuladd.f64(double %94, double %100, double %112)
%114 = call double @llvm.fmuladd.f64(double %90, double %113, double 1.000000e+00)
%115 = load double*, double** %5
%116 = load i32, i32* %3
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %115, i64 %117
store double %114, double* %118
%119 = call i32 @sqrt(i32 2)
%120 = sdiv i32 1, %119
%121 = sitofp i32 %120 to double
%122 = load i32, i32* @M_PI
%123 = mul nsw i32 3, %122
%124 = sdiv i32 %123, 4
%125 = call double @sin(i32 %124)
%126 = load double*, double** %5
%127 = load i32, i32* %3
%128 = sub nsw i32 %127, 2
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %126, i64 %129
%131 = load double, double* %130
%132 = load i32, i32* @M_PI
%133 = mul nsw i32 3, %132
%134 = sdiv i32 %133, 4
%135 = call double @cos(i32 %134)
%136 = load double*, double** %5
%137 = load i32, i32* %3
%138 = sub nsw i32 %137, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %136, i64 %139
%141 = load double, double* %140
%142 = fmul double %135, %141
%143 = call double @llvm.fmuladd.f64(double %125, double %131, double %142)
%144 = fmul double %121, %143
%145 = load double*, double** %5
%146 = load i32, i32* %3
%147 = add nsw i32 %146, 1
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double, double* %145, i64 %148
store double %144, double* %149
br label %150
150: ; preds = %87, %28
br label %151
151: ; preds = %150
%152 = load i32, i32* %3
%153 = add nsw i32 %152, 2
store i32 %153, i32* %3
br label %18
154: ; preds = %18
%155 = load double*, double** %5
ret double* %155
}

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