void interp1_table0_complex_per(const double *r_ck, const double *i_ck,
                                const int K1, const double *r_h1,
                                const double *i_h1, const int J1, const int L1,
                                const double *p_tm, const int M, double *r_fm,
                                double *i_fm) {
  int mm;
  {
    const int ncenter1 = floor(J1 * L1 / 2);
    r_h1 += ncenter1;
    i_h1 += ncenter1;
  }
  for (mm = 0; mm < M; mm++) {
    int jj1;
    const double t1 = *p_tm++;
    register double sum1r = 0;
    register double sum1i = 0;
    int k1 = 1 + floor(t1 - J1 / 2.);
    for (jj1 = 0; jj1 < J1; jj1++, k1++) {
      const double p1 = (t1 - k1) * L1;
      const int n1 = floor(p1 + 0.5);
      register const double coef1r = r_h1[n1];
      register const double coef1i = i_h1[n1];
      const int k1mod = ((k1) - (K1)*floor((k1) / (double)(K1)));
      sum1r += coef1r * r_ck[k1mod] - coef1i * i_ck[k1mod];
      sum1i += coef1r * i_ck[k1mod] + coef1i * r_ck[k1mod];
    }
    *r_fm++ = sum1r;
    *i_fm++ = sum1i;
  }
}


x86 assembly (clang, -O0):
<interp1_table0_complex_per>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
imul   0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
call   1030 <floor@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    13a7 <interp1_table0_complex_per+0x297>
mov    0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x18(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  0xe2e(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  0xe0e(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1369 <interp1_table0_complex_per+0x259>
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x54(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl 0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xddc(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
call   1030 <floor@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x64(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
cvtsi2sdl -0x54(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
cvtsi2sdl -0x54(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  -0x90(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x7c(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x78(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x78(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1204 <interp1_table0_complex_per+0xf4>
movsd  -0x48(%rbp),%xmm0
mov    0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x28(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mov    0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x30(%rbp)
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1194 <interp1_table0_complex_per+0x84>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp1_table0_complex_per>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
cmpl   $0x0,0xe0(%rsp)
jle    1343 <interp1_table0_complex_per+0x233>
mov    %r9d,%r13d
mov    0xf0(%rsp),%r10
mov    0xe8(%rsp),%r9
mov    0xd0(%rsp),%eax
cvtsi2sd %eax,%xmm1
mov    0xd8(%rsp),%rbx
imul   %r13d,%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
movslq %ebp,%rax
lea    (%rcx,%rax,8),%rcx
lea    (%r8,%rax,8),%rbp
cvtsi2sd %r13d,%xmm0
mulsd  0xe86(%rip),%xmm0
movsd  %xmm0,0x38(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movapd 0xe81(%rip),%xmm4
xorpd  %xmm0,%xmm4
xor    %eax,%eax
mov    %r13d,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
mov    %rsi,0x60(%rsp)
mov    %rdi,0x58(%rsp)
movapd %xmm4,0x80(%rsp)
movapd %xmm0,0x70(%rsp)
jmp    11ff <interp1_table0_complex_per+0xef>
nopl   0x0(%rax,%rax,1)
xorps  %xmm3,%xmm3
mov    0x40(%rsp),%rbx
add    $0x8,%rbx
mov    0x48(%rsp),%r9
movlps %xmm3,(%r9)
add    $0x8,%r9
mov    0x50(%rsp),%r10
movhps %xmm3,(%r10)
add    $0x8,%r10
mov    0xc(%rsp),%eax
add    $0x1,%eax
cmp    0xe0(%rsp),%eax
mov    0x8(%rsp),%r13d
je     1343 <interp1_table0_complex_per+0x233>
test   %r13d,%r13d
mov    %r10,0x50(%rsp)
mov    %r9,0x48(%rsp)
mov    %rbx,0x40(%rsp)
mov    %eax,0xc(%rsp)
jle    11c0 <interp1_table0_complex_per+0xb0>
movsd  (%rbx),%xmm2
movsd  %xmm2,0x68(%rsp)
movapd %xmm2,%xmm0
subsd  0x38(%rsp),%xmm0
mov    %rcx,%r12
mov    %rbp,%r14
call   1030 <floor@plt>
movsd  0xdc2(%rip),%xmm2
movsd  0x10(%rsp),%xmm1
addsd  0xdbc(%rip),%xmm0
cvttsd2si %xmm0,%r15d
xorps  %xmm3,%xmm3
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movaps %xmm3,0x20(%rsp)
xorps  %xmm3,%xmm3
cvtsi2sd %r15d,%xmm3
movsd  %xmm3,0x18(%rsp)
movsd  0x68(%rsp),%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
call   1030 <floor@plt>
cvttsd2si %xmm0,%eax
movslq %eax,%rbx
movsd  0x18(%rsp),%xmm0
divsd  0x70(%rsp),%xmm0
call   1030 <floor@plt>
movapd 0xd66(%rip),%xmm3
movapd 0x80(%rsp),%xmm4
mov    %r14,%rbp
mov    %r12,%rcx
mov    0x58(%rsp),%rdi
mov    0x60(%rsp),%rsi
mulsd  %xmm4,%xmm0
addsd  0x18(%rsp),%xmm0
cvttsd2si %xmm0,%eax
cltq
movsd  (%r14,%rbx,8),%xmm0
movsd  (%rsi,%rax,8),%xmm1
movapd %xmm1,%xmm2
unpcklpd %xmm0,%xmm2
xorpd  %xmm3,%xmm0
movsd  (%rdi,%rax,8),%xmm3
unpcklpd %xmm3,%xmm0
mulpd  %xmm2,%xmm0
movsd  (%r12,%rbx,8),%xmm2
unpcklpd %xmm2,%xmm2
unpcklpd %xmm1,%xmm3
movsd  0x10(%rsp),%xmm1
mulpd  %xmm2,%xmm3
movsd  0xce9(%rip),%xmm2
addpd  %xmm0,%xmm3
movapd 0x20(%rsp),%xmm0
addpd  %xmm3,%xmm0
movapd %xmm0,0x20(%rsp)
movaps 0x20(%rsp),%xmm3
add    $0x1,%r15d
add    $0xffffffff,%r13d
jne    1260 <interp1_table0_complex_per+0x150>
jmp    11c3 <interp1_table0_complex_per+0xb3>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @interp1_table0_complex_per(double* nocapture %0, double* nocapture %1, i32 %2, double* nocapture %3, double* nocapture %4, i32 %5, i32 %6, double* nocapture %7, i32 %8, double* nocapture writeonly %9, double* nocapture writeonly %10) {
%12 = mul nsw i32 %6, %5
%13 = sdiv i32 %12, 2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %3, i64 %14
%16 = getelementptr inbounds double, double* %4, i64 %14
%17 = icmp sgt i32 %8, 0
br i1 %17, label %18, label %84
18: ; preds = %11
%19 = sitofp i32 %5 to double
%20 = fmul double %19, 5.000000e-01
%21 = icmp sgt i32 %5, 0
%22 = sitofp i32 %6 to double
%23 = sitofp i32 %2 to double
%24 = fneg double %23
br label %25
25: ; preds = %18, %76
%26 = phi double* [ %7, %18 ], [ %30, %76 ]
%27 = phi double* [ %9, %18 ], [ %78, %76 ]
%28 = phi double* [ %10, %18 ], [ %80, %76 ]
%29 = phi i32 [ 0, %18 ], [ %82, %76 ]
%30 = getelementptr inbounds double, double* %26, i64 1
%31 = load double, double* %26
br i1 %21, label %32, label %76
32: ; preds = %25
%33 = fsub double %31, %20
%34 = tail call double @llvm.floor.f64(double %33)
%35 = fadd double %34, 1.000000e+00
%36 = fptosi double %35 to i32
br label %37
37: ; preds = %32, %37
%38 = phi i32 [ %74, %37 ], [ %36, %32 ]
%39 = phi i32 [ %73, %37 ], [ 0, %32 ]
%40 = phi <2 x double> [ %72, %37 ], [ zeroinitializer, %32 ]
%41 = sitofp i32 %38 to double
%42 = fsub double %31, %41
%43 = fmul double %42, %22
%44 = fadd double %43, 5.000000e-01
%45 = tail call double @llvm.floor.f64(double %44)
%46 = fptosi double %45 to i32
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %15, i64 %47
%49 = load double, double* %48
%50 = getelementptr inbounds double, double* %16, i64 %47
%51 = load double, double* %50
%52 = fdiv double %41, %23
%53 = tail call double @llvm.floor.f64(double %52)
%54 = tail call double @llvm.fmuladd.f64(double %24, double %53, double %41)
%55 = fptosi double %54 to i32
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %0, i64 %56
%58 = load double, double* %57
%59 = getelementptr inbounds double, double* %1, i64 %56
%60 = load double, double* %59
%61 = fneg double %51
%62 = insertelement <2 x double> poison, double %60, i64 0
%63 = insertelement <2 x double> %62, double %51, i64 1
%64 = insertelement <2 x double> poison, double %61, i64 0
%65 = insertelement <2 x double> %64, double %58, i64 1
%66 = fmul <2 x double> %63, %65
%67 = insertelement <2 x double> poison, double %49, i64 0
%68 = shufflevector <2 x double> %67, <2 x double> poison, <2 x i32> zeroinitializer
%69 = insertelement <2 x double> poison, double %58, i64 0
%70 = insertelement <2 x double> %69, double %60, i64 1
%71 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %68, <2 x double> %70, <2 x double> %66)
%72 = fadd <2 x double> %40, %71
%73 = add nuw nsw i32 %39, 1
%74 = add nsw i32 %38, 1
%75 = icmp eq i32 %73, %5
br i1 %75, label %76, label %37
76: ; preds = %37, %25
%77 = phi <2 x double> [ zeroinitializer, %25 ], [ %72, %37 ]
%78 = getelementptr inbounds double, double* %27, i64 1
%79 = extractelement <2 x double> %77, i64 0
store double %79, double* %27
%80 = getelementptr inbounds double, double* %28, i64 1
%81 = extractelement <2 x double> %77, i64 1
store double %81, double* %28
%82 = add nuw nsw i32 %29, 1
%83 = icmp eq i32 %82, %8
br i1 %83, label %84, label %25
84: ; preds = %76, %11
ret void
}