void calc_complex_kernel(DEL_If_Re, DEL_If_Im, k0) float DEL_If_Re[5],
    DEL_If_Im[5], k0;
{
  DEL_If_Re[0] = -cos(2 * k0) / 12.0;
  DEL_If_Re[1] = 8.0 * cos(k0) / 12.0;
  DEL_If_Re[2] = 0.0;
  DEL_If_Re[3] = -8.0 * cos(k0) / 12.0;
  DEL_If_Re[4] = cos(2.0 * k0) / 12.0;
  DEL_If_Im[0] = sin(2 * k0) / 12.0;
  DEL_If_Im[1] = -8.0 * sin(k0) / 12.0;
  DEL_If_Im[2] = 0.0;
  DEL_If_Im[3] = -8.0 * sin(k0) / 12.0;
  DEL_If_Im[4] = sin(2.0 * k0) / 12.0;
}


x86 assembly (clang, -O0):
<calc_complex_kernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
cvtsd2ss %xmm0,%xmm0
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  0xedf(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1040 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe92(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe81(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe5d(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe37(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe1b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe01(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  0xde8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
movss  0xdef(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
movsd  0xdb9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xda0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd84(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xd5e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd42(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd28(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  0xd0f(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x10(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_complex_kernel>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rsp)
addss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
call   1040 <cos@plt>
divsd  0xeaf(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rbx)
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rsp)
call   1040 <cos@plt>
mulsd  0xe94(%rip),%xmm0
divsd  0xe94(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rbx)
movl   $0x0,0x8(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0xe7a(%rip),%xmm0
divsd  0xe6a(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rbx)
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
divsd  0xe45(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rbx)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
divsd  0xe29(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0xe16(%rip),%xmm0
divsd  0xe06(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%r14)
movl   $0x0,0x8(%r14)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0xdea(%rip),%xmm0
divsd  0xdda(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%r14)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
divsd  0xdbd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @calc_complex_kernel(float* %0, float* %1, double %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float
%7 = fptrunc double %2 to float
store float* %0, float** %4
store float* %1, float** %5
store float %7, float* %6
%8 = load float, float* %6
%9 = fmul float 2.000000e+00, %8
%10 = fpext float %9 to double
%11 = call double @cos(double %10)
%12 = fneg double %11
%13 = fdiv double %12, 1.200000e+01
%14 = fptrunc double %13 to float
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 0
store float %14, float* %16
%17 = load float, float* %6
%18 = fpext float %17 to double
%19 = call double @cos(double %18)
%20 = fmul double 8.000000e+00, %19
%21 = fdiv double %20, 1.200000e+01
%22 = fptrunc double %21 to float
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
store float 0.000000e+00, float* %26
%27 = load float, float* %6
%28 = fpext float %27 to double
%29 = call double @cos(double %28)
%30 = fmul double -8.000000e+00, %29
%31 = fdiv double %30, 1.200000e+01
%32 = fptrunc double %31 to float
%33 = load float*, float** %4
%34 = getelementptr inbounds float, float* %33, i64 3
store float %32, float* %34
%35 = load float, float* %6
%36 = fpext float %35 to double
%37 = fmul double 2.000000e+00, %36
%38 = call double @cos(double %37)
%39 = fdiv double %38, 1.200000e+01
%40 = fptrunc double %39 to float
%41 = load float*, float** %4
%42 = getelementptr inbounds float, float* %41, i64 4
store float %40, float* %42
%43 = load float, float* %6
%44 = fmul float 2.000000e+00, %43
%45 = fpext float %44 to double
%46 = call double @sin(double %45)
%47 = fdiv double %46, 1.200000e+01
%48 = fptrunc double %47 to float
%49 = load float*, float** %5
%50 = getelementptr inbounds float, float* %49, i64 0
store float %48, float* %50
%51 = load float, float* %6
%52 = fpext float %51 to double
%53 = call double @sin(double %52)
%54 = fmul double -8.000000e+00, %53
%55 = fdiv double %54, 1.200000e+01
%56 = fptrunc double %55 to float
%57 = load float*, float** %5
%58 = getelementptr inbounds float, float* %57, i64 1
store float %56, float* %58
%59 = load float*, float** %5
%60 = getelementptr inbounds float, float* %59, i64 2
store float 0.000000e+00, float* %60
%61 = load float, float* %6
%62 = fpext float %61 to double
%63 = call double @sin(double %62)
%64 = fmul double -8.000000e+00, %63
%65 = fdiv double %64, 1.200000e+01
%66 = fptrunc double %65 to float
%67 = load float*, float** %5
%68 = getelementptr inbounds float, float* %67, i64 3
store float %66, float* %68
%69 = load float, float* %6
%70 = fpext float %69 to double
%71 = fmul double 2.000000e+00, %70
%72 = call double @sin(double %71)
%73 = fdiv double %72, 1.200000e+01
%74 = fptrunc double %73 to float
%75 = load float*, float** %5
%76 = getelementptr inbounds float, float* %75, i64 4
store float %74, float* %76
ret void
}

LLVM IR (-O2):
define void @calc_complex_kernel(float* nocapture writeonly %0, float* nocapture writeonly %1, double %2) {
%4 = fptrunc double %2 to float
%5 = fmul float %4, 2.000000e+00
%6 = fpext float %5 to double
%7 = tail call double @cos(double %6)
%8 = fdiv double %7, -1.200000e+01
%9 = fptrunc double %8 to float
store float %9, float* %0
%10 = fpext float %4 to double
%11 = tail call double @cos(double %10)
%12 = fmul double %11, 8.000000e+00
%13 = fdiv double %12, 1.200000e+01
%14 = fptrunc double %13 to float
%15 = getelementptr inbounds float, float* %0, i64 1
store float %14, float* %15
%16 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %16
%17 = tail call double @cos(double %10)
%18 = fmul double %17, -8.000000e+00
%19 = fdiv double %18, 1.200000e+01
%20 = fptrunc double %19 to float
%21 = getelementptr inbounds float, float* %0, i64 3
store float %20, float* %21
%22 = fmul double %10, 2.000000e+00
%23 = tail call double @cos(double %22)
%24 = fdiv double %23, 1.200000e+01
%25 = fptrunc double %24 to float
%26 = getelementptr inbounds float, float* %0, i64 4
store float %25, float* %26
%27 = tail call double @sin(double %6)
%28 = fdiv double %27, 1.200000e+01
%29 = fptrunc double %28 to float
store float %29, float* %1
%30 = tail call double @sin(double %10)
%31 = fmul double %30, -8.000000e+00
%32 = fdiv double %31, 1.200000e+01
%33 = fptrunc double %32 to float
%34 = getelementptr inbounds float, float* %1, i64 1
store float %33, float* %34
%35 = getelementptr inbounds float, float* %1, i64 2
store float 0.000000e+00, float* %35
%36 = tail call double @sin(double %10)
%37 = fmul double %36, -8.000000e+00
%38 = fdiv double %37, 1.200000e+01
%39 = fptrunc double %38 to float
%40 = getelementptr inbounds float, float* %1, i64 3
store float %39, float* %40
%41 = tail call double @sin(double %22)
%42 = fdiv double %41, 1.200000e+01
%43 = fptrunc double %42 to float
%44 = getelementptr inbounds float, float* %1, i64 4
store float %43, float* %44
ret void
}