#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int floor(int const);
void interp1_table1_real_per(const double *r_ck, const double *i_ck,
                             const int K1, const double *r_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;
  }
  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);
      const double alf1 = p1 - n1;
      register const double *ph1 = r_h1 + n1;
      register double coef1r = (1 - alf1) * *ph1 + alf1 * *(ph1 + 1);
      const int wrap1 = floor(k1 / (double)K1);
      const int k1mod = k1 - K1 * wrap1;
      sum1r += coef1r * r_ck[k1mod];
      sum1i += coef1r * i_ck[k1mod];
    }
    *r_fm++ = sum1r;
    *i_fm++ = sum1i;
  }
}


x86 assembly (clang, -O0):
<interp1_table1_real_per>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x28(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <floor@plt>
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)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    133a <interp1_table1_real_per+0x22a>
mov    0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x10(%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 -0x24(%rbp),%xmm1
movsd  0xe44(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12fc <interp1_table1_real_per+0x1ec>
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x54(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
cvttsd2si -0x60(%rbp),%edi
call   1030 <floor@plt>
mov    %eax,-0x64(%rbp)
movsd  -0x60(%rbp),%xmm0
cvtsi2sdl -0x64(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x64(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
movsd  0xdcb(%rip),%xmm0
subsd  -0x70(%rbp),%xmm0
mov    -0x78(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x70(%rbp),%xmm1
mov    -0x78(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
cvtsi2sdl -0x54(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
mov    %eax,-0x84(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x84(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x88(%rbp)
movsd  -0x80(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11da <interp1_table1_real_per+0xca>
movsd  -0x48(%rbp),%xmm0
mov    0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x20(%rbp)
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mov    0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x28(%rbp)
movsd  %xmm0,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1176 <interp1_table1_real_per+0x66>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp1_table1_real_per>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9d,%r14d
mov    %r8d,%r13d
mov    %rcx,%r12
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %r9d,%eax
imul   %r8d,%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
call   1030 <floor@plt>
cmpl   $0x0,0xb8(%rsp)
jle    130d <interp1_table1_real_per+0x1fd>
mov    %r14d,%esi
mov    0xc8(%rsp),%r14
mov    0xc0(%rsp),%rcx
mov    0xb0(%rsp),%rdx
cltq
lea    (%r12,%rax,8),%r12
cvtsi2sd %r13d,%xmm0
mulsd  0xe7f(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
cvtsi2sd %esi,%xmm1
cvtsi2sd %r15d,%xmm2
xor    %eax,%eax
mov    %r13d,0xc(%rsp)
movsd  %xmm1,0x48(%rsp)
movsd  %xmm2,0x40(%rsp)
jmp    11e7 <interp1_table1_real_per+0xd7>
cs nopw 0x0(%rax,%rax,1)
nop
xorpd  %xmm0,%xmm0
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%rdx
mov    0x8(%rsp),%eax
add    $0x8,%rdx
movhpd %xmm0,(%rcx)
add    $0x8,%rcx
movlpd %xmm0,(%r14)
add    $0x8,%r14
add    $0x1,%eax
cmp    0xb8(%rsp),%eax
je     130d <interp1_table1_real_per+0x1fd>
mov    %eax,0x8(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rdx,0x10(%rsp)
movsd  (%rdx),%xmm0
movsd  %xmm0,0x50(%rsp)
subsd  0x30(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
test   %r13d,%r13d
jle    11b0 <interp1_table1_real_per+0xa0>
mov    %r14,0x38(%rsp)
add    $0x1,%eax
movslq %eax,%r14
xorpd  %xmm1,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm1,0x60(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
movsd  %xmm0,0x58(%rsp)
movsd  0x50(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x48(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
cvttsd2si %xmm1,%edi
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
cltq
movsd  0xd8a(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  0x8(%r12,%rax,8),%xmm1
mulsd  (%r12,%rax,8),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0x58(%rsp),%xmm0
divsd  0x40(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
movapd 0x60(%rsp),%xmm2
imul   %r15d,%eax
cltq
shl    $0x3,%rax
mov    %rbp,%rcx
sub    %rax,%rcx
mov    %rbx,%rdx
sub    %rax,%rdx
movapd 0x20(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
movsd  (%rdx,%r14,8),%xmm0
movhpd (%rcx,%r14,8),%xmm0
mulpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
addpd  %xmm2,%xmm1
add    $0x1,%r14
add    $0xffffffff,%r13d
jne    1230 <interp1_table1_real_per+0x120>
addpd  %xmm2,%xmm0
mov    0xc(%rsp),%r13d
mov    0x38(%rsp),%r14
jmp    11b4 <interp1_table1_real_per+0xa4>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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