#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
cvtsi2sd %eax,%xmm0
movsd  0xeac(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%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    1344 <interp1_table1_real_per+0x234>
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  0xe3a(%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    1306 <interp1_table1_real_per+0x1f6>
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  0xdc1(%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    11e4 <interp1_table1_real_per+0xd4>
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    1180 <interp1_table1_real_per+0x70>
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
cvtsi2sd %eax,%xmm0
mulsd  0xebd(%rip),%xmm0
cvttsd2si %xmm0,%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
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
mulsd  0xe75(%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>
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 = sitofp i32 %37 to double
%39 = fdiv double %38, 2.000000e+00
%40 = fptosi double %39 to i32
%41 = call i32 @floor(i32 %40)
store i32 %41, i32* %22
%42 = load i32, i32* %22
%43 = load double*, double** %14
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds double, double* %43, i64 %44
store double* %45, double** %14
store i32 0, i32* %21
br label %46
46: ; preds = %135, %10
%47 = load i32, i32* %21
%48 = load i32, i32* %18
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %138
50: ; preds = %46
%51 = load double*, double** %17
%52 = getelementptr inbounds double, double* %51, i32 1
store double* %52, double** %17
%53 = load double, double* %51
store double %53, double* %24
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
%54 = load double, double* %24
%55 = load i32, i32* %15
%56 = sitofp i32 %55 to double
%57 = fdiv double %56, 2.000000e+00
%58 = fsub double %54, %57
%59 = fptosi double %58 to i32
%60 = call i32 @floor(i32 %59)
%61 = add nsw i32 1, %60
store i32 %61, i32* %27
store i32 0, i32* %23
br label %62
62: ; preds = %123, %50
%63 = load i32, i32* %23
%64 = load i32, i32* %15
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %128
66: ; preds = %62
%67 = load double, double* %24
%68 = load i32, i32* %27
%69 = sitofp i32 %68 to double
%70 = fsub double %67, %69
%71 = load i32, i32* %16
%72 = sitofp i32 %71 to double
%73 = fmul double %70, %72
store double %73, double* %28
%74 = load double, double* %28
%75 = fptosi double %74 to i32
%76 = call i32 @floor(i32 %75)
store i32 %76, i32* %29
%77 = load double, double* %28
%78 = load i32, i32* %29
%79 = sitofp i32 %78 to double
%80 = fsub double %77, %79
store double %80, double* %30
%81 = load double*, double** %14
%82 = load i32, i32* %29
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
store double* %84, double** %31
%85 = load double, double* %30
%86 = fsub double 1.000000e+00, %85
%87 = load double*, double** %31
%88 = load double, double* %87
%89 = load double, double* %30
%90 = load double*, double** %31
%91 = getelementptr inbounds double, double* %90, i64 1
%92 = load double, double* %91
%93 = fmul double %89, %92
%94 = call double @llvm.fmuladd.f64(double %86, double %88, double %93)
store double %94, double* %32
%95 = load i32, i32* %27
%96 = sitofp i32 %95 to double
%97 = load i32, i32* %13
%98 = sitofp i32 %97 to double
%99 = fdiv double %96, %98
%100 = fptosi double %99 to i32
%101 = call i32 @floor(i32 %100)
store i32 %101, i32* %33
%102 = load i32, i32* %27
%103 = load i32, i32* %13
%104 = load i32, i32* %33
%105 = mul nsw i32 %103, %104
%106 = sub nsw i32 %102, %105
store i32 %106, i32* %34
%107 = load double, double* %32
%108 = load double*, double** %11
%109 = load i32, i32* %34
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
%112 = load double, double* %111
%113 = load double, double* %25
%114 = call double @llvm.fmuladd.f64(double %107, double %112, double %113)
store double %114, double* %25
%115 = load double, double* %32
%116 = load double*, double** %12
%117 = load i32, i32* %34
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %116, i64 %118
%120 = load double, double* %119
%121 = load double, double* %26
%122 = call double @llvm.fmuladd.f64(double %115, double %120, double %121)
store double %122, double* %26
br label %123
123: ; preds = %66
%124 = load i32, i32* %23
%125 = add nsw i32 %124, 1
store i32 %125, i32* %23
%126 = load i32, i32* %27
%127 = add nsw i32 %126, 1
store i32 %127, i32* %27
br label %62
128: ; preds = %62
%129 = load double, double* %25
%130 = load double*, double** %19
%131 = getelementptr inbounds double, double* %130, i32 1
store double* %131, double** %19
store double %129, double* %130
%132 = load double, double* %26
%133 = load double*, double** %20
%134 = getelementptr inbounds double, double* %133, i32 1
store double* %134, double** %20
store double %132, double* %133
br label %135
135: ; preds = %128
%136 = load i32, i32* %21
%137 = add nsw i32 %136, 1
store i32 %137, i32* %21
br label %46
138: ; preds = %46
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 = sitofp i32 %11 to double
%13 = fmul double %12, 5.000000e-01
%14 = fptosi double %13 to i32
%15 = tail call i32 @floor(i32 %14)
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %3, i64 %16
%18 = icmp sgt i32 %7, 0
br i1 %18, label %19, label %82
19: ; preds = %10
%20 = sitofp i32 %4 to double
%21 = fmul double %20, 5.000000e-01
%22 = icmp sgt i32 %4, 0
%23 = sitofp i32 %5 to double
%24 = sitofp i32 %2 to double
br label %25
25: ; preds = %19, %74
%26 = phi double* [ %6, %19 ], [ %30, %74 ]
%27 = phi double* [ %8, %19 ], [ %76, %74 ]
%28 = phi double* [ %9, %19 ], [ %78, %74 ]
%29 = phi i32 [ 0, %19 ], [ %80, %74 ]
%30 = getelementptr inbounds double, double* %26, i64 1
%31 = load double, double* %26
%32 = fsub double %31, %21
%33 = fptosi double %32 to i32
%34 = tail call i32 @floor(i32 %33)
br i1 %22, label %35, label %74
35: ; preds = %25, %35
%36 = phi i32 [ %39, %35 ], [ %34, %25 ]
%37 = phi i32 [ %70, %35 ], [ 0, %25 ]
%38 = phi <2 x double> [ %69, %35 ], [ zeroinitializer, %25 ]
%39 = add nsw i32 %36, 1
%40 = sitofp i32 %39 to double
%41 = fsub double %31, %40
%42 = fmul double %41, %23
%43 = fptosi double %42 to i32
%44 = tail call i32 @floor(i32 %43)
%45 = sitofp i32 %44 to double
%46 = fsub double %42, %45
%47 = sext i32 %44 to i64
%48 = getelementptr inbounds double, double* %17, i64 %47
%49 = fsub double 1.000000e+00, %46
%50 = load double, double* %48
%51 = getelementptr inbounds double, double* %48, i64 1
%52 = load double, double* %51
%53 = fmul double %46, %52
%54 = tail call double @llvm.fmuladd.f64(double %49, double %50, double %53)
%55 = fdiv double %40, %24
%56 = fptosi double %55 to i32
%57 = tail call i32 @floor(i32 %56)
%58 = mul nsw i32 %57, %2
%59 = sub nsw i32 %39, %58
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %0, i64 %60
%62 = load double, double* %61
%63 = getelementptr inbounds double, double* %1, i64 %60
%64 = load double, double* %63
%65 = insertelement <2 x double> poison, double %54, i64 0
%66 = shufflevector <2 x double> %65, <2 x double> poison, <2 x i32> zeroinitializer
%67 = insertelement <2 x double> poison, double %64, i64 0
%68 = insertelement <2 x double> %67, double %62, i64 1
%69 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %66, <2 x double> %68, <2 x double> %38)
%70 = add nuw nsw i32 %37, 1
%71 = icmp eq i32 %70, %4
br i1 %71, label %72, label %35
72: ; preds = %35
%73 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %66, <2 x double> %68, <2 x double> %38)
br label %74
74: ; preds = %72, %25
%75 = phi <2 x double> [ zeroinitializer, %25 ], [ %73, %72 ]
%76 = getelementptr inbounds double, double* %27, i64 1
%77 = extractelement <2 x double> %75, i64 1
store double %77, double* %27
%78 = getelementptr inbounds double, double* %28, i64 1
%79 = extractelement <2 x double> %75, i64 0
store double %79, double* %28
%80 = add nuw nsw i32 %29, 1
%81 = icmp eq i32 %80, %7
br i1 %81, label %82, label %25
82: ; preds = %74, %10
ret void
}