#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 const);
double sqrt(int);
void dct2dDblRef(double (*data)[8]) {
  static const double PI = 3.14159265358979323;
  double output[8][8];
  short x, y, n, m;
  for (y = 0; y < 8; y++) {
    for (x = 0; x < 8; x++) {
      output[y][x] = 0.0;
      for (n = 0; n < 8; n++) {
        for (m = 0; m < 8; m++) {
          output[y][x] += data[n][m] * cos(PI * x * (2 * m + 1) / 16.0) *
                          cos(PI * y * (2 * n + 1) / 16.0);
        }
      }
    }
  }
  {
    for (y = 0; y < 8; y++) {
      for (x = 0; x < 8; x++) {
        if (x == 0)
          output[y][x] /= sqrt(2);
        if (y == 0)
          output[y][x] /= sqrt(2);
        data[y][x] = output[y][x];
      }
    }
  }
}


x86 assembly (clang, -O0):
<dct2dDblRef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0x214(%rbp)
movswl -0x214(%rbp),%eax
cmp    $0x8,%eax
jge    1318 <dct2dDblRef+0x1f8>
movw   $0x0,-0x212(%rbp)
movswl -0x212(%rbp),%eax
cmp    $0x8,%eax
jge    12fc <dct2dDblRef+0x1dc>
movswq -0x214(%rbp),%rcx
ff
lea    -0x210(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
movswq -0x212(%rbp),%rcx
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movw   $0x0,-0x216(%rbp)
movswl -0x216(%rbp),%eax
cmp    $0x8,%eax
jge    12e0 <dct2dDblRef+0x1c0>
movw   $0x0,-0x218(%rbp)
movswl -0x218(%rbp),%eax
cmp    $0x8,%eax
jge    12c4 <dct2dDblRef+0x1a4>
mov    -0x8(%rbp),%rax
movswq -0x216(%rbp),%rcx
ff
shl    $0x6,%rcx
add    %rcx,%rax
movswq -0x218(%rbp),%rcx
ff
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x228(%rbp)
ff
movswl -0x212(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xe14(%rip),%xmm0
mulsd  %xmm1,%xmm0
movswl -0x218(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdeb(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x228(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x220(%rbp)
ff
movswl -0x214(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xdc0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movswl -0x216(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd97(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x220(%rbp),%xmm0
ff
movswq -0x214(%rbp),%rcx
ff
lea    -0x210(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
movswq -0x212(%rbp),%rcx
ff
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x218(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x218(%rbp)
jmp    11a9 <dct2dDblRef+0x89>
jmp    12c9 <dct2dDblRef+0x1a9>
mov    -0x216(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x216(%rbp)
jmp    1190 <dct2dDblRef+0x70>
jmp    12e5 <dct2dDblRef+0x1c5>
mov    -0x212(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x212(%rbp)
jmp    1151 <dct2dDblRef+0x31>
jmp    1301 <dct2dDblRef+0x1e1>
mov    -0x214(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x214(%rbp)
jmp    1138 <dct2dDblRef+0x18>
movw   $0x0,-0x214(%rbp)
movswl -0x214(%rbp),%eax
cmp    $0x8,%eax
jge    1452 <dct2dDblRef+0x332>
movw   $0x0,-0x212(%rbp)
movswl -0x212(%rbp),%eax
cmp    $0x8,%eax
jge    1436 <dct2dDblRef+0x316>
movswl -0x212(%rbp),%eax
cmp    $0x0,%eax
jne    1393 <dct2dDblRef+0x273>
mov    $0x2,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movswq -0x214(%rbp),%rcx
ff
lea    -0x210(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
movswq -0x212(%rbp),%rcx
ff
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movswl -0x214(%rbp),%eax
cmp    $0x0,%eax
jne    13dc <dct2dDblRef+0x2bc>
mov    $0x2,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movswq -0x214(%rbp),%rcx
ff
lea    -0x210(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
movswq -0x212(%rbp),%rcx
ff
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movswq -0x214(%rbp),%rcx
ff
lea    -0x210(%rbp),%rax
shl    $0x6,%rcx
add    %rcx,%rax
movswq -0x212(%rbp),%rcx
ff
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movswq -0x214(%rbp),%rcx
ff
shl    $0x6,%rcx
add    %rcx,%rax
movswq -0x212(%rbp),%rcx
ff
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x212(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x212(%rbp)
jmp    133a <dct2dDblRef+0x21a>
jmp    143b <dct2dDblRef+0x31b>
mov    -0x214(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x214(%rbp)
jmp    1321 <dct2dDblRef+0x201>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dct2dDblRef>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x268,%rsp
mov    %rdi,%r13
xor    %r14d,%r14d
movsd  0xec9(%rip),%xmm0
nop
movswl %r14w,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xead(%rip),%xmm1
xor    %r15d,%r15d
movsd  %xmm1,0x18(%rsp)
nopl   0x0(%rax)
mov    %r14,%rax
shl    $0x6,%rax
add    %rsp,%rax
add    $0x60,%rax
lea    (%rax,%r15,8),%r12
movswl %r15w,%ecx
xorps  %xmm2,%xmm2
cvtsi2sd %ecx,%xmm2
movq   $0x0,(%rax,%r15,8)
mulsd  0xe73(%rip),%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x50(%rsp)
movapd %xmm2,%xmm3
mulsd  0xe69(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x48(%rsp)
movapd %xmm2,%xmm3
mulsd  0xe5b(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x40(%rsp)
movapd %xmm2,%xmm3
mulsd  0xe4d(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x38(%rsp)
movapd %xmm2,%xmm3
mulsd  0xe3f(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x30(%rsp)
movapd %xmm2,%xmm3
mulsd  0xe31(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x28(%rsp)
movapd %xmm2,%xmm3
mulsd  0xe23(%rip),%xmm3
mulsd  %xmm0,%xmm3
movsd  %xmm3,0x20(%rsp)
mulsd  0xe19(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x58(%rsp)
xorpd  %xmm2,%xmm2
mov    $0x1,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
movsd  %xmm2,0x8(%rsp)
xorps  %xmm2,%xmm2
cvtsi2sd %ebp,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
movsd  0x0(%r13,%rbx,2),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x50(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%r13,%rbx,2),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x48(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%r13,%rbx,2),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x40(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%r13,%rbx,2),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x38(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%r13,%rbx,2),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x30(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%r13,%rbx,2),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%r13,%rbx,2),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x38(%r13,%rbx,2),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x58(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <cos@plt>
movsd  0x18(%rsp),%xmm1
movapd %xmm0,%xmm2
movsd  0xbc4(%rip),%xmm0
mulsd  (%rsp),%xmm2
addsd  0x8(%rsp),%xmm2
add    $0x20,%rbx
add    $0x2,%ebp
cmp    $0x100,%rbx
jne    1240 <dct2dDblRef+0x120>
movsd  %xmm2,(%r12)
add    $0x1,%r15
cmp    $0x8,%r15
jne    1160 <dct2dDblRef+0x40>
add    $0x1,%r14
cmp    $0x8,%r14
jne    1140 <dct2dDblRef+0x20>
xor    %ebx,%ebx
jmp    15f9 <dct2dDblRef+0x4d9>
nopl   0x0(%rax)
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  0x60(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x60(%rsp)
movsd  0x60(%rsp,%rbx,1),%xmm0
movsd  %xmm0,0x0(%r13,%rbx,1)
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  0x68(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x68(%rsp)
movsd  0x68(%rsp,%rbx,1),%xmm0
movsd  %xmm0,0x8(%r13,%rbx,1)
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  0x70(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x70(%rsp)
movsd  0x70(%rsp,%rbx,1),%xmm0
movsd  %xmm0,0x10(%r13,%rbx,1)
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  0x78(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x78(%rsp)
movsd  0x78(%rsp,%rbx,1),%xmm0
movsd  %xmm0,0x18(%r13,%rbx,1)
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  0x80(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x80(%rsp)
movsd  0x80(%rsp,%rbx,1),%xmm0
movsd  %xmm0,0x20(%r13,%rbx,1)
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  0x88(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x88(%rsp)
movsd  0x88(%rsp,%rbx,1),%xmm0
movsd  %xmm0,0x28(%r13,%rbx,1)
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  0x90(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x90(%rsp)
movsd  0x90(%rsp,%rbx,1),%xmm0
movsd  %xmm0,0x30(%r13,%rbx,1)
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  0x98(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x98(%rsp)
movsd  0x98(%rsp,%rbx,1),%xmm0
movsd  %xmm0,0x38(%r13,%rbx,1)
add    $0x40,%rbx
cmp    $0x200,%rbx
je     1652 <dct2dDblRef+0x532>
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  0x60(%rsp,%rbx,1),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x60(%rsp,%rbx,1)
test   %rbx,%rbx
je     1490 <dct2dDblRef+0x370>
movaps 0x60(%rsp,%rbx,1),%xmm0
movups %xmm0,0x0(%r13,%rbx,1)
movaps 0x70(%rsp,%rbx,1),%xmm0
movups %xmm0,0x10(%r13,%rbx,1)
movaps 0x80(%rsp,%rbx,1),%xmm0
movups %xmm0,0x20(%r13,%rbx,1)
movsd  0x90(%rsp,%rbx,1),%xmm0
movsd  %xmm0,0x30(%r13,%rbx,1)
jmp    15dc <dct2dDblRef+0x4bc>
add    $0x268,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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