#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 atan2(double, double);
double cos(int);
double pow(double, double);
double sin(int);
void fourier(double *t_sim, double *t_obs, int length, int harmonic_number) {
  int u, t;
  double fcos[366 * 2] = {0.0};
  double fsin[366 * 2] = {0.0};
  double fm[366 * 2] = {0.0};
  double fp[366 * 2] = {0.0};
  for (u = 0; u < harmonic_number; u++) {
    for (t = 0; t < length; t++) {
      fcos[u] = fcos[u] + t_obs[t] * cos(2 * 3.1415926 * u * t / length);
      fsin[u] = fsin[u] + t_obs[t] * sin(2 * 3.1415926 * u * t / length);
    }
    fcos[u] = fcos[u] / length;
    fsin[u] = fsin[u] / length;
    fm[u] = pow(pow(fcos[u], 2) + pow(fsin[u], 2), 0.5);
    fp[u] = atan2(fcos[u], fsin[u]);
  }
  for (t = 0; t < length; t++) {
    for (u = 0; u < harmonic_number; u++) {
      t_sim[t] =
          t_sim[t] + fm[u] * (cos((2 * 3.1415926 * u * t / length) - fp[u]) +
                              sin((2 * 3.1415926 * u * t / length) + fp[u]));
    }
  }
}


x86 assembly (clang, -O0):
<fourier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5be0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    -0x1700(%rbp),%rdi
xor    %esi,%esi
mov    $0x16e0,%edx
call   1040 <memset@plt>
lea    -0x2de0(%rbp),%rdi
xor    %esi,%esi
mov    $0x16e0,%edx
call   1040 <memset@plt>
lea    -0x44c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x16e0,%edx
call   1040 <memset@plt>
lea    -0x5ba0(%rbp),%rdi
xor    %esi,%esi
mov    $0x16e0,%edx
call   1040 <memset@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13ca <fourier+0x27a>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12e5 <fourier+0x195>
movslq -0x1c(%rbp),%rax
movsd  -0x1700(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x5bc0(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x5bb8(%rbp)
ff
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xdee(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <cos@plt>
movsd  -0x5bc0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x5bb8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x1c(%rbp),%rax
movsd  %xmm0,-0x1700(%rbp,%rax,8)
ff ff
movslq -0x1c(%rbp),%rax
movsd  -0x2de0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x5bb0(%rbp)
ff
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x5ba8(%rbp)
ff
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xd70(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sin@plt>
movsd  -0x5bb0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x5ba8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x1c(%rbp),%rax
movsd  %xmm0,-0x2de0(%rbp,%rax,8)
ff ff
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11cf <fourier+0x7f>
movslq -0x1c(%rbp),%rax
movsd  -0x1700(%rbp,%rax,8),%xmm0
ff ff
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
movslq -0x1c(%rbp),%rax
movsd  %xmm0,-0x1700(%rbp,%rax,8)
ff ff
movslq -0x1c(%rbp),%rax
movsd  -0x2de0(%rbp,%rax,8),%xmm0
ff ff
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
movslq -0x1c(%rbp),%rax
movsd  %xmm0,-0x2de0(%rbp,%rax,8)
ff ff
movslq -0x1c(%rbp),%rax
movsd  -0x1700(%rbp,%rax,8),%xmm0
ff ff
movsd  0xcd0(%rip),%xmm1
call   1070 <pow@plt>
movsd  %xmm0,-0x5bc8(%rbp)
ff
movslq -0x1c(%rbp),%rax
movsd  -0x2de0(%rbp,%rax,8),%xmm0
ff ff
movsd  0xcae(%rip),%xmm1
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x5bc8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  0xc8a(%rip),%xmm1
call   1070 <pow@plt>
movslq -0x1c(%rbp),%rax
movsd  %xmm0,-0x44c0(%rbp,%rax,8)
ff ff
movslq -0x1c(%rbp),%rax
movsd  -0x1700(%rbp,%rax,8),%xmm0
ff ff
movslq -0x1c(%rbp),%rax
movsd  -0x2de0(%rbp,%rax,8),%xmm1
ff ff
call   1030 <atan2@plt>
movslq -0x1c(%rbp),%rax
movsd  %xmm0,-0x5ba0(%rbp,%rax,8)
ff ff
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11bc <fourier+0x6c>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    14e9 <fourier+0x399>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    14d6 <fourier+0x386>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x5bd8(%rbp)
ff
movslq -0x1c(%rbp),%rax
movsd  -0x44c0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x5bd0(%rbp)
ff
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xbd9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
movslq -0x1c(%rbp),%rax
subsd  -0x5ba0(%rbp,%rax,8),%xmm0
ff ff
cvttsd2si %xmm0,%edi
call   1060 <cos@plt>
movsd  %xmm0,-0x5be0(%rbp)
ff
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xb98(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
movslq -0x1c(%rbp),%rax
addsd  -0x5ba0(%rbp,%rax,8),%xmm0
ff ff
cvttsd2si %xmm0,%edi
call   1050 <sin@plt>
movsd  -0x5be0(%rbp),%xmm2
ff
movsd  -0x5bd8(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0x5bd0(%rbp),%xmm0
ff
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13e4 <fourier+0x294>
jmp    14db <fourier+0x38b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13d1 <fourier+0x281>
add    $0x5be0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourier>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5bc8,%rsp
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %rsi,%rbp
mov    %rdi,%r12
lea    0x1720(%rsp),%rdi
mov    $0x16e0,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x40(%rsp),%rdi
mov    $0x16e0,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x44e0(%rsp),%rdi
mov    $0x16e0,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x2e00(%rsp),%rdi
mov    $0x16e0,%edx
xor    %esi,%esi
call   1040 <memset@plt>
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r15d,%r13d
mov    %ebx,0x18(%rsp)
mov    %ebx,%r14d
mov    %r15d,0x3c(%rsp)
test   %r15d,%r15d
jle    135a <fourier+0x20a>
xor    %r15d,%r15d
mov    %r12,0x20(%rsp)
jmp    1288 <fourier+0x138>
nopl   0x0(%rax,%rax,1)
movsd  0x1720(%rsp,%r15,8),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x40(%rsp,%r15,8),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  (%rsp),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
movsd  %xmm2,0x1720(%rsp,%r15,8)
divsd  %xmm1,%xmm0
movsd  %xmm0,0x40(%rsp,%r15,8)
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xdbb(%rip),%xmm1
call   1070 <pow@plt>
movsd  %xmm0,0x44e0(%rsp,%r15,8)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,0x2e00(%rsp,%r15,8)
add    $0x1,%r15
cmp    %r13,%r15
mov    0x20(%rsp),%r12
je     135a <fourier+0x20a>
cmpl   $0x0,0x18(%rsp)
jle    11f0 <fourier+0xa0>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
mulsd  0xd5d(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x1720(%rsp,%r15,8),%xmm0
movsd  %xmm0,(%rsp)
xor    %r12d,%r12d
movsd  0x10(%rsp),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x0(%rbp,%r12,8),%xmm0
movsd  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
mulsd  0x28(%rsp),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
call   1060 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x40(%rsp,%r15,8),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x0(%rbp,%r12,8),%xmm0
movsd  %xmm0,0x30(%rsp)
mov    %ebx,%edi
call   1050 <sin@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x30(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp,%r15,8)
add    $0x1,%r12
cmp    %r12,%r14
jne    12d0 <fourier+0x180>
jmp    120c <fourier+0xbc>
cmpl   $0x0,0x18(%rsp)
mov    0x3c(%rsp),%r15d
jle    1455 <fourier+0x305>
xor    %ebx,%ebx
movsd  0xc8c(%rip),%xmm0
jmp    138d <fourier+0x23d>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %r14,%rbx
je     1455 <fourier+0x305>
test   %r15d,%r15d
movsd  0x10(%rsp),%xmm1
jle    1380 <fourier+0x230>
xorps  %xmm2,%xmm2
cvtsi2sd %ebx,%xmm2
movsd  %xmm2,0x20(%rsp)
movsd  (%r12,%rbx,8),%xmm2
xor    %ebp,%ebp
nopl   (%rax)
movsd  %xmm2,(%rsp)
xorps  %xmm3,%xmm3
cvtsi2sd %ebp,%xmm3
movsd  0x44e0(%rsp,%rbp,8),%xmm2
movsd  %xmm2,0x8(%rsp)
mulsd  %xmm0,%xmm3
mulsd  0x20(%rsp),%xmm3
divsd  %xmm1,%xmm3
movsd  %xmm3,0x28(%rsp)
movsd  0x2e00(%rsp,%rbp,8),%xmm1
movsd  %xmm1,0x18(%rsp)
movapd %xmm3,%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <cos@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x28(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sin@plt>
movsd  (%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
addsd  0x30(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm2
movsd  0xbc3(%rip),%xmm0
movsd  %xmm2,(%r12,%rbx,8)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    13b0 <fourier+0x260>
jmp    1380 <fourier+0x230>
add    $0x5bc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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