void interp1_table0_complex_per_adj(double *r_ck, 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,
                                    const double *r_fm, const double *i_fm) {
  (void)memset((void *)r_ck, 0, K1 * sizeof(*r_ck));
  (void)memset((void *)i_ck, 0, K1 * sizeof(*i_ck));
  {
    const int ncenter1 = floor(J1 * L1 / 2.);
    r_h1 += ncenter1;
    i_h1 += ncenter1;
  }
  for (int mm = 0; mm < M; mm++) {
    const double t1 = *p_tm++;
    const double fmr = *r_fm++;
    const double fmi = *i_fm++;
    int k1 = 1 + floor(t1 - J1 / 2.);
    for (int 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)));
      r_ck[k1mod] += coef1r * fmr + coef1i * fmi;
      i_ck[k1mod] += coef1r * fmi - coef1i * fmr;
    }
  }
}


x86 assembly (clang, -O0):
<interp1_table0_complex_per_adj>:
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    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rdx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x2c(%rbp),%eax
imul   0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe73(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <floor@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    13c6 <interp1_table0_complex_per_adj+0x2a6>
mov    0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x18(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x28(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x30(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x2c(%rbp),%xmm1
movsd  0xdcc(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
call   1040 <floor@plt>
movaps %xmm0,%xmm1
movsd  0xdbc(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13b3 <interp1_table0_complex_per_adj+0x293>
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x54(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl 0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xd82(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
call   1040 <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   1040 <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
movsd  -0x48(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x7c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x7c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    125e <interp1_table0_complex_per_adj+0x13e>
jmp    13b8 <interp1_table0_complex_per_adj+0x298>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ce <interp1_table0_complex_per_adj+0xae>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp1_table0_complex_per_adj>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9d,%r15d
mov    %r8,0x10(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0xd0(%rsp),%r14d
mov    %edx,0x18(%rsp)
movslq %edx,%r12
shl    $0x3,%r12
xor    %r13d,%r13d
xor    %esi,%esi
mov    %r12,%rdx
call   1030 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r12,%rdx
call   1030 <memset@plt>
mov    %r15d,0xc(%rsp)
imul   %r15d,%r14d
cvtsi2sd %r14d,%xmm0
mulsd  0xe79(%rip),%xmm0
call   1040 <floor@plt>
cmpl   $0x0,0xe0(%rsp)
jle    13a0 <interp1_table0_complex_per_adj+0x280>
mov    0xf0(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    0xe8(%rsp),%rax
mov    %rax,0x38(%rsp)
cvttsd2si %xmm0,%eax
mov    0xd8(%rsp),%rcx
mov    %rcx,0x30(%rsp)
cltq
mov    0x20(%rsp),%rcx
lea    (%rcx,%rax,8),%r15
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%r12
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
mulsd  0xe16(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
cvtsi2sdl 0xd0(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl 0x18(%rsp),%xmm0
movapd 0xe06(%rip),%xmm2
movapd %xmm0,0x80(%rsp)
xorpd  %xmm0,%xmm2
movsd  %xmm1,0x48(%rsp)
movapd %xmm2,0x70(%rsp)
jmp    1259 <interp1_table0_complex_per_adj+0x139>
cs nopw 0x0(%rax,%rax,1)
nop
addq   $0x8,0x30(%rsp)
addq   $0x8,0x38(%rsp)
addq   $0x8,0x40(%rsp)
mov    0x2c(%rsp),%r13d
add    $0x1,%r13d
cmp    0xe0(%rsp),%r13d
je     13a0 <interp1_table0_complex_per_adj+0x280>
mov    %r13d,0x2c(%rsp)
cmpl   $0x0,0xc(%rsp)
jle    1230 <interp1_table0_complex_per_adj+0x110>
mov    0x30(%rsp),%rax
movsd  (%rax),%xmm0
mov    0x38(%rsp),%rax
movsd  (%rax),%xmm3
movsd  %xmm3,0x60(%rsp)
mov    0x40(%rsp),%rax
movsd  (%rax),%xmm3
movsd  %xmm3,0x58(%rsp)
movsd  %xmm0,0x68(%rsp)
subsd  0x50(%rsp),%xmm0
call   1040 <floor@plt>
movsd  0xd5b(%rip),%xmm3
movsd  0x48(%rsp),%xmm1
addsd  0xd55(%rip),%xmm0
cvttsd2si %xmm0,%r13d
mov    0xc(%rsp),%r14d
nopl   (%rax)
xorps  %xmm2,%xmm2
cvtsi2sd %r13d,%xmm2
movsd  %xmm2,0x10(%rsp)
movsd  0x68(%rsp),%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
call   1040 <floor@plt>
cvttsd2si %xmm0,%eax
cltq
movsd  (%r15,%rax,8),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%r12,%rax,8),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  0x80(%rsp),%xmm0
call   1040 <floor@plt>
movsd  0xce1(%rip),%xmm3
movapd 0x70(%rsp),%xmm2
mulsd  %xmm2,%xmm0
addsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%eax
movsd  0x58(%rsp),%xmm5
movapd %xmm5,%xmm0
movsd  0x18(%rsp),%xmm6
mulsd  %xmm6,%xmm0
movsd  0x20(%rsp),%xmm7
movapd %xmm7,%xmm1
movsd  0x60(%rsp),%xmm4
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
cltq
addsd  0x0(%rbp,%rax,8),%xmm1
movsd  %xmm1,0x0(%rbp,%rax,8)
movsd  0x48(%rsp),%xmm1
mulsd  %xmm4,%xmm6
movapd %xmm7,%xmm0
mulsd  %xmm5,%xmm0
subsd  %xmm6,%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%r13d
add    $0xffffffff,%r14d
jne    12c0 <interp1_table0_complex_per_adj+0x1a0>
jmp    1230 <interp1_table0_complex_per_adj+0x110>
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_adj(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 double
%26 = alloca double
%27 = alloca double
%28 = alloca i32
%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 double*, double** %12
%36 = bitcast double* %35 to i8*
%37 = load i32, i32* %14
%38 = sext i32 %37 to i64
%39 = mul i64 %38, 8
%40 = load double*, double** %13
%41 = bitcast double* %40 to i8*
%42 = load i32, i32* %14
%43 = sext i32 %42 to i64
%44 = mul i64 %43, 8
%45 = load i32, i32* %17
%46 = load i32, i32* %18
%47 = mul nsw i32 %45, %46
%48 = sitofp i32 %47 to double
%49 = fdiv double %48, 2.000000e+00
%50 = call double @llvm.floor.f64(double %49)
%51 = fptosi double %50 to i32
store i32 %51, i32* %23
%52 = load i32, i32* %23
%53 = load double*, double** %15
%54 = sext i32 %52 to i64
%55 = getelementptr inbounds double, double* %53, i64 %54
store double* %55, double** %15
%56 = load i32, i32* %23
%57 = load double*, double** %16
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds double, double* %57, i64 %58
store double* %59, double** %16
store i32 0, i32* %24
br label %60
60: ; preds = %152, %11
%61 = load i32, i32* %24
%62 = load i32, i32* %20
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %155
64: ; preds = %60
%65 = load double*, double** %19
%66 = getelementptr inbounds double, double* %65, i32 1
store double* %66, double** %19
%67 = load double, double* %65
store double %67, double* %25
%68 = load double*, double** %21
%69 = getelementptr inbounds double, double* %68, i32 1
store double* %69, double** %21
%70 = load double, double* %68
store double %70, double* %26
%71 = load double*, double** %22
%72 = getelementptr inbounds double, double* %71, i32 1
store double* %72, double** %22
%73 = load double, double* %71
store double %73, double* %27
%74 = load double, double* %25
%75 = load i32, i32* %17
%76 = sitofp i32 %75 to double
%77 = fdiv double %76, 2.000000e+00
%78 = fsub double %74, %77
%79 = call double @llvm.floor.f64(double %78)
%80 = fadd double 1.000000e+00, %79
%81 = fptosi double %80 to i32
store i32 %81, i32* %28
store i32 0, i32* %29
br label %82
82: ; preds = %146, %64
%83 = load i32, i32* %29
%84 = load i32, i32* %17
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %151
86: ; preds = %82
%87 = load double, double* %25
%88 = load i32, i32* %28
%89 = sitofp i32 %88 to double
%90 = fsub double %87, %89
%91 = load i32, i32* %18
%92 = sitofp i32 %91 to double
%93 = fmul double %90, %92
store double %93, double* %30
%94 = load double, double* %30
%95 = fadd double %94, 5.000000e-01
%96 = call double @llvm.floor.f64(double %95)
%97 = fptosi double %96 to i32
store i32 %97, i32* %31
%98 = load double*, double** %15
%99 = load i32, i32* %31
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %98, i64 %100
%102 = load double, double* %101
store double %102, double* %32
%103 = load double*, double** %16
%104 = load i32, i32* %31
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %103, i64 %105
%107 = load double, double* %106
store double %107, double* %33
%108 = load i32, i32* %28
%109 = sitofp i32 %108 to double
%110 = load i32, i32* %14
%111 = sitofp i32 %110 to double
%112 = load i32, i32* %28
%113 = sitofp i32 %112 to double
%114 = load i32, i32* %14
%115 = sitofp i32 %114 to double
%116 = fdiv double %113, %115
%117 = call double @llvm.floor.f64(double %116)
%118 = fneg double %111
%119 = call double @llvm.fmuladd.f64(double %118, double %117, double %109)
%120 = fptosi double %119 to i32
store i32 %120, i32* %34
%121 = load double, double* %32
%122 = load double, double* %26
%123 = load double, double* %33
%124 = load double, double* %27
%125 = fmul double %123, %124
%126 = call double @llvm.fmuladd.f64(double %121, double %122, double %125)
%127 = load double*, double** %12
%128 = load i32, i32* %34
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %127, i64 %129
%131 = load double, double* %130
%132 = fadd double %131, %126
store double %132, double* %130
%133 = load double, double* %32
%134 = load double, double* %27
%135 = load double, double* %33
%136 = load double, double* %26
%137 = fmul double %135, %136
%138 = fneg double %137
%139 = call double @llvm.fmuladd.f64(double %133, double %134, double %138)
%140 = load double*, double** %13
%141 = load i32, i32* %34
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %140, i64 %142
%144 = load double, double* %143
%145 = fadd double %144, %139
store double %145, double* %143
br label %146
146: ; preds = %86
%147 = load i32, i32* %29
%148 = add nsw i32 %147, 1
store i32 %148, i32* %29
%149 = load i32, i32* %28
%150 = add nsw i32 %149, 1
store i32 %150, i32* %28
br label %82
151: ; preds = %82
br label %152
152: ; preds = %151
%153 = load i32, i32* %24
%154 = add nsw i32 %153, 1
store i32 %154, i32* %24
br label %60
155: ; preds = %60
ret void
}

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