#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 DCT_cosine(int, int);
int sqrt(int);
double spatial_to_frequency(int block_matrix[8][8], int x, int y) {
  int u, v;
  double F, cosine_x_result, cosine_y_result, Cu, Cv;
  F = 0;
  for (u = 0; u < 8; u++) {
    for (v = 0; v < 8; v++) {
      Cu = 1;
      Cv = 1;
      if (u == 0) {
        Cu = (1 / (sqrt(2)));
      }
      if (v == 0) {
        Cv = (1 / (sqrt(2)));
      }
      cosine_x_result = DCT_cosine(x, u);
      cosine_y_result = DCT_cosine(y, v);
      F += Cu * Cv * block_matrix[u][v] * cosine_x_result * cosine_y_result;
    }
  }
  F = (0.25) * F;
  return F;
}


x86 assembly (clang, -O0):
<spatial_to_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1247 <spatial_to_frequency+0x127>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    1234 <spatial_to_frequency+0x114>
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    119d <spatial_to_frequency+0x7d>
mov    $0x2,%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    11c4 <spatial_to_frequency+0xa4>
mov    $0x2,%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1152 <spatial_to_frequency+0x32>
jmp    1239 <spatial_to_frequency+0x119>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <spatial_to_frequency+0x21>
movsd  0xdb1(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spatial_to_frequency>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
add    $0x1c,%rbx
xorpd  %xmm1,%xmm1
xor    %r13d,%r13d
movsd  0xeb3(%rip),%xmm0
xor    %ebp,%ebp
jmp    12cf <spatial_to_frequency+0x1af>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movsd  0xe0(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xc8(%rsp),%xmm1
movsd  0xd8(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xd0(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  0xc0(%rsp),%xmm1
mulsd  0xa8(%rsp),%xmm1
movsd  0xb8(%rsp),%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xb0(%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  0xa0(%rsp),%xmm0
mulsd  0x88(%rsp),%xmm0
movsd  0x98(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x90(%rsp),%xmm1
addsd  %xmm2,%xmm1
movsd  0x80(%rsp),%xmm0
mulsd  0x68(%rsp),%xmm0
movsd  0x78(%rsp),%xmm2
mulsd  %xmm0,%xmm2
mulsd  0x70(%rsp),%xmm2
addsd  %xmm1,%xmm2
movsd  0x60(%rsp),%xmm0
mulsd  0x48(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x50(%rsp),%xmm1
addsd  %xmm2,%xmm1
movsd  0x40(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
movsd  0x38(%rsp),%xmm2
mulsd  %xmm0,%xmm2
mulsd  0x30(%rsp),%xmm2
addsd  %xmm1,%xmm2
movsd  0x20(%rsp),%xmm0
mulsd  %xmm4,%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
mov    $0x7,%esi
call   1040 <DCT_cosine@plt>
xorps  %xmm1,%xmm1
cvtsi2sdl (%rbx),%xmm1
mulsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
add    $0x1,%rbp
add    $0x20,%rbx
cmp    $0x8,%rbp
movsd  0xd37(%rip),%xmm0
je     15e3 <spatial_to_frequency+0x4c3>
movsd  %xmm1,0x8(%rsp)
movapd %xmm0,%xmm1
test   %rbp,%rbp
jne    12f9 <spatial_to_frequency+0x1d9>
mov    $0x2,%edi
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %r13d,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0xe0(%rsp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
mov    %eax,%r12d
lea    0x1(%r12),%eax
cmp    $0x3,%eax
cmovae %r13d,%r12d
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0xd8(%rsp)
mov    %r14d,%edi
xor    %esi,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0xd0(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl -0x1c(%rbx),%xmm0
movsd  %xmm0,0xc8(%rsp)
movsd  0xca6(%rip),%xmm0
test   %rbp,%rbp
jne    137a <spatial_to_frequency+0x25a>
mov    $0x2,%edi
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %r13d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0xc0(%rsp)
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0xb8(%rsp)
mov    %r14d,%edi
mov    $0x1,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0xb0(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl -0x18(%rbx),%xmm0
movsd  %xmm0,0xa8(%rsp)
movsd  0xc3b(%rip),%xmm0
test   %rbp,%rbp
jne    13e5 <spatial_to_frequency+0x2c5>
mov    $0x2,%edi
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %r13d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0xa0(%rsp)
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x98(%rsp)
mov    %r14d,%edi
mov    $0x2,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x90(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl -0x14(%rbx),%xmm0
movsd  %xmm0,0x88(%rsp)
movsd  0xbd0(%rip),%xmm0
test   %rbp,%rbp
jne    1450 <spatial_to_frequency+0x330>
mov    $0x2,%edi
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %r13d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x80(%rsp)
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x78(%rsp)
mov    %r14d,%edi
mov    $0x3,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x70(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl -0x10(%rbx),%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  0xb6e(%rip),%xmm0
test   %rbp,%rbp
jne    14b2 <spatial_to_frequency+0x392>
mov    $0x2,%edi
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %r13d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x60(%rsp)
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x58(%rsp)
mov    %r14d,%edi
mov    $0x4,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x50(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl -0xc(%rbx),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  0xb0f(%rip),%xmm0
test   %rbp,%rbp
jne    1511 <spatial_to_frequency+0x3f1>
mov    $0x2,%edi
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %r13d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x40(%rsp)
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x38(%rsp)
mov    %r14d,%edi
mov    $0x5,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl -0x8(%rbx),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0xab0(%rip),%xmm0
test   %rbp,%rbp
jne    1570 <spatial_to_frequency+0x450>
mov    $0x2,%edi
call   1030 <sqrt@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %r13d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %r15d,%edi
mov    %ebp,%esi
call   1040 <DCT_cosine@plt>
movsd  %xmm0,0x10(%rsp)
mov    %r14d,%edi
mov    $0x6,%esi
call   1040 <DCT_cosine@plt>
movapd %xmm0,%xmm3
cvtsi2sdl -0x4(%rbx),%xmm4
movsd  0xa5c(%rip),%xmm0
test   %rbp,%rbp
jne    1160 <spatial_to_frequency+0x40>
mov    $0x2,%edi
movsd  %xmm3,(%rsp)
movsd  %xmm4,0x18(%rsp)
call   1030 <sqrt@plt>
movsd  0x18(%rsp),%xmm4
movsd  (%rsp),%xmm3
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %r13d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    1160 <spatial_to_frequency+0x40>
mulsd  0xa1d(%rip),%xmm1
movapd %xmm1,%xmm0
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @spatial_to_frequency([8 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [8 x i32]*
%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
store [8 x i32]* %0, [8 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store double 0.000000e+00, double* %9
store i32 0, i32* %7
br label %14
14: ; preds = %64, %3
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 8
br i1 %16, label %17, label %67
17: ; preds = %14
store i32 0, i32* %8
br label %18
18: ; preds = %60, %17
%19 = load i32, i32* %8
%20 = icmp slt i32 %19, 8
br i1 %20, label %21, label %63
21: ; preds = %18
store double 1.000000e+00, double* %12
store double 1.000000e+00, double* %13
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = call i32 @sqrt(i32 2)
%26 = sdiv i32 1, %25
%27 = sitofp i32 %26 to double
store double %27, double* %12
br label %28
28: ; preds = %24, %21
%29 = load i32, i32* %8
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = call i32 @sqrt(i32 2)
%33 = sdiv i32 1, %32
%34 = sitofp i32 %33 to double
store double %34, double* %13
br label %35
35: ; preds = %31, %28
%36 = load i32, i32* %5
%37 = load i32, i32* %7
%38 = call double @DCT_cosine(i32 %36, i32 %37)
store double %38, double* %10
%39 = load i32, i32* %6
%40 = load i32, i32* %8
%41 = call double @DCT_cosine(i32 %39, i32 %40)
store double %41, double* %11
%42 = load double, double* %12
%43 = load double, double* %13
%44 = fmul double %42, %43
%45 = load [8 x i32]*, [8 x i32]** %4
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [8 x i32], [8 x i32]* %45, i64 %47
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [8 x i32], [8 x i32]* %48, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = sitofp i32 %52 to double
%54 = fmul double %44, %53
%55 = load double, double* %10
%56 = fmul double %54, %55
%57 = load double, double* %11
%58 = load double, double* %9
%59 = call double @llvm.fmuladd.f64(double %56, double %57, double %58)
store double %59, double* %9
br label %60
60: ; preds = %35
%61 = load i32, i32* %8
%62 = add nsw i32 %61, 1
store i32 %62, i32* %8
br label %18
63: ; preds = %18
br label %64
64: ; preds = %63
%65 = load i32, i32* %7
%66 = add nsw i32 %65, 1
store i32 %66, i32* %7
br label %14
67: ; preds = %14
%68 = load double, double* %9
%69 = fmul double 2.500000e-01, %68
store double %69, double* %9
%70 = load double, double* %9
ret double %70
}

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