void create_dct_matrix(filter) double filter[16][32];
{
  register int i, k;
  for (i = 0; i < 16; i++)
    for (k = 0; k < 32; k++) {
      if ((filter[i][k] = 1e9 * cos((double)((2 * i + 1) * k *
                                             3.14159265358979 / 64))) >= 0)
        modf(filter[i][k] + 0.5, &filter[i][k]);
      else
        modf(filter[i][k] - 0.5, &filter[i][k]);
      filter[i][k] *= 1e-9;
      filter[i][k] /= (double)32768;
    }
}


x86 assembly (clang, -O0):
<create_dct_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    12a6 <create_dct_matrix+0x186>
movl   $0x0,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jge    1293 <create_dct_matrix+0x173>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
imul   -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xea9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe79(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11f4 <create_dct_matrix+0xd4>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  0xe4d(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x8,%rax
add    %rax,%rdi
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <modf@plt>
jmp    1237 <create_dct_matrix+0x117>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe04(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x8,%rax
add    %rax,%rdi
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <modf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  0xdd6(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xda4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <create_dct_matrix+0x24>
jmp    1298 <create_dct_matrix+0x178>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <create_dct_matrix+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_dct_matrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r13
mov    $0x1,%r12d
xor    %r14d,%r14d
movsd  0xec1(%rip),%xmm1
movsd  0xec1(%rip),%xmm2
lea    0xee2(%rip),%r15
xchg   %ax,%ax
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
call   1040 <cos@plt>
mulsd  0xe94(%rip),%xmm0
xor    %eax,%eax
ucomisd 0xea2(%rip),%xmm0
setb   %al
mov    %r13,%rdi
add    %rbp,%rdi
movsd  %xmm0,0x0(%r13,%rbp,1)
addsd  (%r15,%rax,8),%xmm0
call   1030 <modf@plt>
movsd  0xe6f(%rip),%xmm3
movsd  0xe57(%rip),%xmm2
movsd  0xe47(%rip),%xmm1
movsd  0x0(%r13,%rbp,1),%xmm0
mulsd  %xmm3,%xmm0
movsd  0xe54(%rip),%xmm3
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x0(%r13,%rbp,1)
add    %r12d,%ebx
add    $0x8,%rbp
cmp    $0x100,%rbp
jne    1160 <create_dct_matrix+0x40>
add    $0x1,%r14
add    $0x2,%r12d
add    $0x100,%r13
cmp    $0x10,%r14
jne    1150 <create_dct_matrix+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @create_dct_matrix([32 x double]* %0) {
%2 = alloca [32 x double]*
%3 = alloca i32
%4 = alloca i32
store [32 x double]* %0, [32 x double]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %90, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %93
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %86, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 32
br i1 %11, label %12, label %89
12: ; preds = %9
%13 = load i32, i32* %3
%14 = mul nsw i32 2, %13
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = sitofp i32 %17 to double
%19 = fmul double %18, 0x400921FB54442D11
%20 = fdiv double %19, 6.400000e+01
%21 = call double @cos(double %20)
%22 = fmul double 1.000000e+09, %21
%23 = load [32 x double]*, [32 x double]** %2
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [32 x double], [32 x double]* %23, i64 %25
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [32 x double], [32 x double]* %26, i64 0, i64 %28
store double %22, double* %29
%30 = fcmp oge double %22, 0.000000e+00
br i1 %30, label %31, label %49
31: ; preds = %12
%32 = load [32 x double]*, [32 x double]** %2
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [32 x double], [32 x double]* %32, i64 %34
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [32 x double], [32 x double]* %35, i64 0, i64 %37
%39 = load double, double* %38
%40 = fadd double %39, 5.000000e-01
%41 = load [32 x double]*, [32 x double]** %2
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [32 x double], [32 x double]* %41, i64 %43
%45 = load i32, i32* %4
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [32 x double], [32 x double]* %44, i64 0, i64 %46
%48 = call double @modf(double %40, double* %47)
br label %67
49: ; preds = %12
%50 = load [32 x double]*, [32 x double]** %2
%51 = load i32, i32* %3
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [32 x double], [32 x double]* %50, i64 %52
%54 = load i32, i32* %4
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [32 x double], [32 x double]* %53, i64 0, i64 %55
%57 = load double, double* %56
%58 = fsub double %57, 5.000000e-01
%59 = load [32 x double]*, [32 x double]** %2
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [32 x double], [32 x double]* %59, i64 %61
%63 = load i32, i32* %4
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [32 x double], [32 x double]* %62, i64 0, i64 %64
%66 = call double @modf(double %58, double* %65)
br label %67
67: ; preds = %49, %31
%68 = load [32 x double]*, [32 x double]** %2
%69 = load i32, i32* %3
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [32 x double], [32 x double]* %68, i64 %70
%72 = load i32, i32* %4
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [32 x double], [32 x double]* %71, i64 0, i64 %73
%75 = load double, double* %74
%76 = fmul double %75, 1.000000e-09
store double %76, double* %74
%77 = load [32 x double]*, [32 x double]** %2
%78 = load i32, i32* %3
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [32 x double], [32 x double]* %77, i64 %79
%81 = load i32, i32* %4
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [32 x double], [32 x double]* %80, i64 0, i64 %82
%84 = load double, double* %83
%85 = fdiv double %84, 3.276800e+04
store double %85, double* %83
br label %86
86: ; preds = %67
%87 = load i32, i32* %4
%88 = add nsw i32 %87, 1
store i32 %88, i32* %4
br label %9
89: ; preds = %9
br label %90
90: ; preds = %89
%91 = load i32, i32* %3
%92 = add nsw i32 %91, 1
store i32 %92, i32* %3
br label %5
93: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @create_dct_matrix([32 x double]* nocapture %0) {
br label %2
2: ; preds = %1, %25
%3 = phi i64 [ 0, %1 ], [ %26, %25 ]
%4 = shl nuw nsw i64 %3, 1
%5 = or i64 %4, 1
br label %6
6: ; preds = %2, %6
%7 = phi i64 [ 0, %2 ], [ %23, %6 ]
%8 = mul nuw nsw i64 %7, %5
%9 = trunc i64 %8 to i32
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 0x400921FB54442D11
%12 = fmul double %11, 1.562500e-02
%13 = tail call double @cos(double %12)
%14 = fmul double %13, 1.000000e+09
%15 = getelementptr inbounds [32 x double], [32 x double]* %0, i64 %3, i64 %7
store double %14, double* %15
%16 = fcmp ult double %14, 0.000000e+00
%17 = select i1 %16, double -5.000000e-01, double 5.000000e-01
%18 = fadd double %14, %17
%19 = tail call double @modf(double %18, double* %15)
%20 = load double, double* %15
%21 = fmul double %20, 1.000000e-09
%22 = fmul double %21, 0x3F00000000000000
store double %22, double* %15
%23 = add nuw nsw i64 %7, 1
%24 = icmp eq i64 %23, 32
br i1 %24, label %25, label %6
25: ; preds = %6
%26 = add nuw nsw i64 %3, 1
%27 = icmp eq i64 %26, 16
br i1 %27, label %28, label %2
28: ; preds = %25
ret void
}