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
cvtsi2sd %eax,%xmm0
movsd  0xea9(%rip),%xmm1
divsd  %xmm1,%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    13ab <interp1_table0_complex_per+0x29b>
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  0xe22(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  0xe12(%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    136d <interp1_table0_complex_per+0x25d>
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x54(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl 0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdd8(%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    1208 <interp1_table0_complex_per+0xf8>
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    1198 <interp1_table0_complex_per+0x88>
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    $0x88,%rsp
mov    %r9d,%r12d
mov    %r8,%rbx
mov    %rcx,0x10(%rsp)
mov    %edx,%r15d
mov    %rsi,%r13
mov    %rdi,%rbp
mov    0xc0(%rsp),%r14d
mov    %r14d,%eax
imul   %r9d,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xeb0(%rip),%xmm0
call   1030 <floor@plt>
cmpl   $0x0,0xd0(%rsp)
jle    135c <interp1_table0_complex_per+0x24c>
mov    0xe0(%rsp),%rcx
mov    0xd8(%rsp),%rdx
mov    %rbx,%rsi
mov    0xc8(%rsp),%rbx
cvttsd2si %xmm0,%eax
cltq
mov    0x10(%rsp),%rdi
lea    (%rdi,%rax,8),%rdi
lea    (%rsi,%rax,8),%rsi
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
mulsd  0xe5f(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
cvtsi2sd %r14d,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
movapd 0xe54(%rip),%xmm4
xorpd  %xmm0,%xmm4
xor    %eax,%eax
mov    %r12d,0x8(%rsp)
movsd  %xmm1,0x20(%rsp)
movapd %xmm4,0x70(%rsp)
movapd %xmm0,0x60(%rsp)
mov    %rbp,0x50(%rsp)
jmp    1223 <interp1_table0_complex_per+0x113>
xorps  %xmm3,%xmm3
mov    %r13,%rbp
mov    0x38(%rsp),%rbx
add    $0x8,%rbx
mov    0x40(%rsp),%rdx
movlps %xmm3,(%rdx)
add    $0x8,%rdx
mov    0x48(%rsp),%rcx
movhps %xmm3,(%rcx)
add    $0x8,%rcx
mov    0xc(%rsp),%eax
add    $0x1,%eax
cmp    0xd0(%rsp),%eax
mov    0x8(%rsp),%r12d
mov    %rbp,%r13
je     135c <interp1_table0_complex_per+0x24c>
test   %r12d,%r12d
mov    %rcx,0x48(%rsp)
mov    %rdx,0x40(%rsp)
mov    %rbx,0x38(%rsp)
mov    %eax,0xc(%rsp)
jle    11e0 <interp1_table0_complex_per+0xd0>
movsd  (%rbx),%xmm2
movsd  %xmm2,0x58(%rsp)
movapd %xmm2,%xmm0
subsd  0x30(%rsp),%xmm0
mov    %rdi,%r15
mov    %rsi,%r14
call   1030 <floor@plt>
movsd  0xd9e(%rip),%xmm2
movsd  0x20(%rsp),%xmm1
addsd  0xd98(%rip),%xmm0
mov    %r13,%rbp
cvttsd2si %xmm0,%r13d
xorps  %xmm3,%xmm3
nopl   0x0(%rax,%rax,1)
movaps %xmm3,0x10(%rsp)
xorps  %xmm3,%xmm3
cvtsi2sd %r13d,%xmm3
movsd  %xmm3,0x28(%rsp)
movsd  0x58(%rsp),%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
call   1030 <floor@plt>
cvttsd2si %xmm0,%eax
movslq %eax,%rbx
movsd  0x28(%rsp),%xmm0
divsd  0x60(%rsp),%xmm0
call   1030 <floor@plt>
movapd 0xd46(%rip),%xmm3
movapd 0x70(%rsp),%xmm4
mov    %r14,%rsi
mov    %r15,%rdi
mulsd  %xmm4,%xmm0
addsd  0x28(%rsp),%xmm0
cvttsd2si %xmm0,%eax
cltq
movsd  (%r14,%rbx,8),%xmm0
movsd  0x0(%rbp,%rax,8),%xmm1
movapd %xmm1,%xmm2
unpcklpd %xmm0,%xmm2
xorpd  %xmm3,%xmm0
mov    0x50(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm3
unpcklpd %xmm3,%xmm0
mulpd  %xmm2,%xmm0
movsd  (%r15,%rbx,8),%xmm2
unpcklpd %xmm2,%xmm2
unpcklpd %xmm1,%xmm3
movsd  0x20(%rsp),%xmm1
mulpd  %xmm2,%xmm3
movsd  0xcd0(%rip),%xmm2
addpd  %xmm0,%xmm3
movapd 0x10(%rsp),%xmm0
addpd  %xmm3,%xmm0
movapd %xmm0,0x10(%rsp)
movaps 0x10(%rsp),%xmm3
add    $0x1,%r13d
add    $0xffffffff,%r12d
jne    1280 <interp1_table0_complex_per+0x170>
jmp    11e6 <interp1_table0_complex_per+0xd6>
add    $0x88,%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 = sitofp i32 %37 to double
%39 = fdiv double %38, 2.000000e+00
%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 = sitofp i32 %12 to double
%14 = fmul double %13, 5.000000e-01
%15 = tail call double @llvm.floor.f64(double %14)
%16 = fptosi double %15 to i32
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %3, i64 %17
%19 = getelementptr inbounds double, double* %4, i64 %17
%20 = icmp sgt i32 %8, 0
br i1 %20, label %21, label %87
21: ; preds = %11
%22 = sitofp i32 %5 to double
%23 = fmul double %22, 5.000000e-01
%24 = icmp sgt i32 %5, 0
%25 = sitofp i32 %6 to double
%26 = sitofp i32 %2 to double
%27 = fneg double %26
br label %28
28: ; preds = %21, %79
%29 = phi double* [ %7, %21 ], [ %33, %79 ]
%30 = phi double* [ %9, %21 ], [ %81, %79 ]
%31 = phi double* [ %10, %21 ], [ %83, %79 ]
%32 = phi i32 [ 0, %21 ], [ %85, %79 ]
%33 = getelementptr inbounds double, double* %29, i64 1
%34 = load double, double* %29
br i1 %24, label %35, label %79
35: ; preds = %28
%36 = fsub double %34, %23
%37 = tail call double @llvm.floor.f64(double %36)
%38 = fadd double %37, 1.000000e+00
%39 = fptosi double %38 to i32
br label %40
40: ; preds = %35, %40
%41 = phi i32 [ %77, %40 ], [ %39, %35 ]
%42 = phi i32 [ %76, %40 ], [ 0, %35 ]
%43 = phi <2 x double> [ %75, %40 ], [ zeroinitializer, %35 ]
%44 = sitofp i32 %41 to double
%45 = fsub double %34, %44
%46 = fmul double %45, %25
%47 = fadd double %46, 5.000000e-01
%48 = tail call double @llvm.floor.f64(double %47)
%49 = fptosi double %48 to i32
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %18, i64 %50
%52 = load double, double* %51
%53 = getelementptr inbounds double, double* %19, i64 %50
%54 = load double, double* %53
%55 = fdiv double %44, %26
%56 = tail call double @llvm.floor.f64(double %55)
%57 = tail call double @llvm.fmuladd.f64(double %27, double %56, double %44)
%58 = fptosi double %57 to i32
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %0, i64 %59
%61 = load double, double* %60
%62 = getelementptr inbounds double, double* %1, i64 %59
%63 = load double, double* %62
%64 = fneg double %54
%65 = insertelement <2 x double> poison, double %63, i64 0
%66 = insertelement <2 x double> %65, double %54, i64 1
%67 = insertelement <2 x double> poison, double %64, i64 0
%68 = insertelement <2 x double> %67, double %61, i64 1
%69 = fmul <2 x double> %66, %68
%70 = insertelement <2 x double> poison, double %52, i64 0
%71 = shufflevector <2 x double> %70, <2 x double> poison, <2 x i32> zeroinitializer
%72 = insertelement <2 x double> poison, double %61, i64 0
%73 = insertelement <2 x double> %72, double %63, i64 1
%74 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %71, <2 x double> %73, <2 x double> %69)
%75 = fadd <2 x double> %43, %74
%76 = add nuw nsw i32 %42, 1
%77 = add nsw i32 %41, 1
%78 = icmp eq i32 %76, %5
br i1 %78, label %79, label %40
79: ; preds = %40, %28
%80 = phi <2 x double> [ zeroinitializer, %28 ], [ %75, %40 ]
%81 = getelementptr inbounds double, double* %30, i64 1
%82 = extractelement <2 x double> %80, i64 0
store double %82, double* %30
%83 = getelementptr inbounds double, double* %31, i64 1
%84 = extractelement <2 x double> %80, i64 1
store double %84, double* %31
%85 = add nuw nsw i32 %32, 1
%86 = icmp eq i32 %85, %8
br i1 %86, label %87, label %28
87: ; preds = %79, %11
ret void
}