void idct(x, y, m, tab) double *x, *y, *tab;
int m;
{
  int n, n2, i;
  double *cp1, *cp2, *xp1, *xp2, *yp1, *yp2;
  double arg, delta_w;
  n = 1 << m;
  n2 = n >> 1;
  if ((int)(*tab) != n) {
    delta_w = 3.141592652598793 / (2 * n);
    cp1 = tab + n2;
    cp2 = cp1 + n2;
    arg = 0;
    for (i = 0; i < n2; i++) {
      *(cp1++) = (double)(cos(arg) - sin(arg)) * 0.707106781186547;
      *(cp2++) = (double)(cos(arg) + sin(arg)) * 0.707106781186547;
      arg += delta_w;
    }
  }
  *y = *x;
  *(y + n2) = *(x + n2);
  cp1 = tab + n2 + 1;
  cp2 = cp1 + n2;
  xp1 = x + 1;
  xp2 = x + (n - 1);
  yp1 = y + 1;
  yp2 = y + (n - 1);
  for (i = 1; i < n2; i++) {
    *(yp1++) = (*cp1) * (*xp1) + (*cp2) * (*xp2);
    *(yp2--) = (*cp2++) * (*xp1++) - (*cp1++) * (*xp2--);
  }
  hartley(y, m, tab);
  xp1 = x;
  xp2 = x + (n - 1);
  yp1 = y;
  yp2 = y + n2;
  for (i = 0; i < n2; i++) {
    *xp1 = *(yp1++);
    *xp2 = *(yp2++);
    xp1 += 2;
    xp2 -= 2;
  }
}


x86 assembly (clang, -O0):
<idct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cvttsd2si (%rax),%eax
cmp    -0x24(%rbp),%eax
je     1277 <idct+0x147>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe7d(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1272 <idct+0x142>
movsd  -0x68(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe0e(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x38(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xdca(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x40(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11c1 <idct+0x91>
jmp    1277 <idct+0x147>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    13ed <idct+0x2bd>
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x50(%rbp),%rax
mulsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x58(%rbp)
movsd  %xmm0,(%rax)
mov    -0x40(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x40(%rbp)
movsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x48(%rbp)
movsd  (%rax),%xmm2
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x38(%rbp)
movsd  (%rax),%xmm1
mov    -0x50(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x50(%rbp)
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x60(%rbp)
movsd  %xmm0,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    131a <idct+0x1ea>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1050 <hartley@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    14a9 <idct+0x379>
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x58(%rbp)
movsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x60(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x60(%rbp)
movsd  (%rax),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1441 <idct+0x311>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idct>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rcx,%r9
mov    %edx,%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1,%r12d
shl    %cl,%r12d
mov    %r12d,%r13d
sar    %r13d
cvttsd2si (%r9),%eax
movslq %r13d,%r8
cmp    %eax,%r12d
je     137a <idct+0x24a>
cmp    $0x2,%r12d
jl     137a <idct+0x24a>
mov    %ecx,0x18(%rsp)
mov    %r12,%rbp
lea    (%r9,%r8,8),%r12
lea    (%r12,%r8,8),%r15
cmp    $0x2,%r8d
mov    $0x1,%ecx
cmovge %r13d,%ecx
xorpd  %xmm0,%xmm0
cmp    $0x4,%ebp
mov    %rbp,0x28(%rsp)
mov    %r8,0x20(%rsp)
jl     1302 <idct+0x1d2>
mov    %r9,0x38(%rsp)
mov    %r13d,0x1c(%rsp)
lea    0x0(%rbp,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe3d(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %rcx,0x30(%rsp)
and    $0xfffffffe,%ecx
mov    %rcx,0x40(%rsp)
xorpd  %xmm0,%xmm0
xor    %ebp,%ebp
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xde7(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r12,%rbp,8)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
addsd  0x8(%rsp),%xmm0
mulsd  0xdb5(%rip),%xmm0
movsd  %xmm0,(%r15,%rbp,8)
movsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xd73(%rip),%xmm1
movsd  %xmm1,0x8(%r12,%rbp,8)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
addsd  0x8(%rsp),%xmm0
mulsd  0xd44(%rip),%xmm0
movsd  %xmm0,0x8(%r15,%rbp,8)
movsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0xfffffffffffffff0,%r13
add    $0x2,%rbp
cmp    %ebp,0x40(%rsp)
jne    11f0 <idct+0xc0>
sub    %r13,%r15
sub    %r13,%r12
mov    0x1c(%rsp),%r13d
mov    0x38(%rsp),%r9
mov    0x20(%rsp),%r8
mov    0x30(%rsp),%rcx
test   $0x1,%cl
je     1371 <idct+0x241>
movsd  %xmm0,(%rsp)
mov    %r9,%rbp
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xcd2(%rip),%xmm1
movsd  %xmm1,(%r12)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
mov    %rbp,%r9
mov    0x20(%rsp),%r8
addsd  0x10(%rsp),%xmm0
mulsd  0xc9c(%rip),%xmm0
movsd  %xmm0,(%r15)
mov    0x28(%rsp),%r12
mov    0x18(%rsp),%ecx
movsd  (%rbx),%xmm0
movsd  %xmm0,(%r14)
movsd  (%rbx,%r8,8),%xmm0
movsd  %xmm0,(%r14,%r8,8)
movslq %r12d,%r15
cmp    $0x4,%r12d
jl     140b <idct+0x2db>
lea    (%r9,%r8,8),%rax
add    $0x8,%rax
lea    -0x1(%r15),%rbp
lea    (%rax,%r8,8),%rdx
cmp    $0x3,%r13d
mov    $0x2,%esi
cmovge %r13d,%esi
add    $0xffffffffffffffff,%rsi
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movsd  (%rdx,%rdi,8),%xmm0
mulsd  (%rbx,%rbp,8),%xmm0
movsd  (%rax,%rdi,8),%xmm1
mulsd  0x8(%rbx,%rdi,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14,%rdi,8)
movsd  (%rbx,%rbp,8),%xmm0
mulsd  (%rax,%rdi,8),%xmm0
movsd  (%rdx,%rdi,8),%xmm1
mulsd  0x8(%rbx,%rdi,8),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rbp,8)
add    $0x1,%rdi
add    $0xffffffffffffffff,%rbp
cmp    %edi,%esi
jne    13c0 <idct+0x290>
mov    %r8,%rbp
mov    %r14,%rdi
mov    %ecx,%esi
mov    %r9,%rdx
xor    %eax,%eax
call   1050 <hartley@plt>
cmp    $0x2,%r12d
jl     1510 <idct+0x3e0>
lea    (%r14,%rbp,8),%rax
lea    (%rbx,%r15,8),%rcx
add    $0xfffffffffffffff8,%rcx
cmp    $0x2,%r13d
mov    $0x1,%edx
cmovge %r13d,%edx
lea    -0x1(%rdx),%esi
cmp    $0x3,%esi
jb     14d9 <idct+0x3a9>
mov    %edx,%edi
and    $0x7ffffffc,%edi
xor    %esi,%esi
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rbp,1),%xmm0
movsd  %xmm0,(%rbx,%rbp,2)
movsd  (%rax,%rbp,1),%xmm0
movsd  %xmm0,(%rcx,%rsi,1)
movsd  0x8(%r14,%rbp,1),%xmm0
movsd  %xmm0,0x10(%rbx,%rbp,2)
movsd  0x8(%rax,%rbp,1),%xmm0
movsd  %xmm0,-0x10(%rcx,%rsi,1)
movsd  0x10(%r14,%rbp,1),%xmm0
movsd  %xmm0,0x20(%rbx,%rbp,2)
movsd  0x10(%rax,%rbp,1),%xmm0
movsd  %xmm0,-0x20(%rcx,%rsi,1)
movsd  0x18(%r14,%rbp,1),%xmm0
movsd  %xmm0,0x30(%rbx,%rbp,2)
movsd  0x18(%rax,%rbp,1),%xmm0
movsd  %xmm0,-0x30(%rcx,%rsi,1)
add    $0x20,%rbp
add    $0xffffffffffffffc0,%rsi
add    $0xfffffffc,%edi
jne    1460 <idct+0x330>
add    %rbp,%rax
add    %rbp,%r14
add    %rsi,%rcx
sub    %rsi,%rbx
test   $0x3,%dl
je     1510 <idct+0x3e0>
and    $0x3,%edx
shl    $0x3,%rdx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rsi,1),%xmm0
movsd  %xmm0,(%rbx,%rsi,2)
movsd  (%rax,%rsi,1),%xmm0
movsd  %xmm0,(%rcx)
add    $0xfffffffffffffff0,%rcx
add    $0x8,%rsi
cmp    %esi,%edx
jne    14f0 <idct+0x3c0>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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