#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_table0_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 + 0.5);
      register double coef1r = r_h1[n1];
      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_table0_real_per>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%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    12f3 <interp1_table0_real_per+0x1e3>
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    12b5 <interp1_table0_real_per+0x1a5>
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x54(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdfe(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
mov    %eax,-0x64(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
cvtsi2sdl -0x54(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
mov    %eax,-0x74(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x74(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x78(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x78(%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_table0_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_table0_real_per+0x66>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp1_table0_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    12e6 <interp1_table0_real_per+0x1d6>
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,0x38(%rsp)
cvtsi2sd %esi,%xmm1
cvtsi2sd %r15d,%xmm2
xor    %eax,%eax
mov    %r13d,0xc(%rsp)
movsd  %xmm1,0x50(%rsp)
movsd  %xmm2,0x48(%rsp)
jmp    11e7 <interp1_table0_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
movlpd %xmm0,(%rcx)
add    $0x8,%rcx
movhpd %xmm0,(%r14)
add    $0x8,%r14
add    $0x1,%eax
cmp    0xb8(%rsp),%eax
je     12e6 <interp1_table0_real_per+0x1d6>
mov    %eax,0x8(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rdx,0x10(%rsp)
movsd  (%rdx),%xmm0
movsd  %xmm0,0x58(%rsp)
subsd  0x38(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
test   %r13d,%r13d
jle    11b0 <interp1_table0_real_per+0xa0>
mov    %r14,0x40(%rsp)
add    $0x1,%eax
movslq %eax,%r14
xorpd  %xmm1,%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm1,0x60(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x58(%rsp),%xmm0
subsd  %xmm1,%xmm0
mulsd  0x50(%rsp),%xmm0
addsd  0xda4(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
cltq
movsd  0x20(%rsp),%xmm0
divsd  0x48(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movsd  (%r12,%rax,8),%xmm0
movaps %xmm0,0x20(%rsp)
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  (%rcx,%r14,8),%xmm0
movhpd (%rdx,%r14,8),%xmm0
mulpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
addpd  %xmm2,%xmm1
add    $0x1,%r14
add    $0xffffffff,%r13d
jne    1230 <interp1_table0_real_per+0x120>
addpd  %xmm2,%xmm0
mov    0xc(%rsp),%r13d
mov    0x40(%rsp),%r14
jmp    11b4 <interp1_table0_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_table0_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 i32
%32 = 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
%33 = load i32, i32* %15
%34 = load i32, i32* %16
%35 = mul nsw i32 %33, %34
%36 = sdiv i32 %35, 2
%37 = call i32 @floor(i32 %36)
store i32 %37, i32* %22
%38 = load i32, i32* %22
%39 = load double*, double** %14
%40 = sext i32 %38 to i64
%41 = getelementptr inbounds double, double* %39, i64 %40
store double* %41, double** %14
store i32 0, i32* %21
br label %42
42: ; preds = %119, %10
%43 = load i32, i32* %21
%44 = load i32, i32* %18
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %122
46: ; preds = %42
%47 = load double*, double** %17
%48 = getelementptr inbounds double, double* %47, i32 1
store double* %48, double** %17
%49 = load double, double* %47
store double %49, double* %24
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
%50 = load double, double* %24
%51 = load i32, i32* %15
%52 = sitofp i32 %51 to double
%53 = fdiv double %52, 2.000000e+00
%54 = fsub double %50, %53
%55 = fptosi double %54 to i32
%56 = call i32 @floor(i32 %55)
%57 = add nsw i32 1, %56
store i32 %57, i32* %27
store i32 0, i32* %23
br label %58
58: ; preds = %107, %46
%59 = load i32, i32* %23
%60 = load i32, i32* %15
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %112
62: ; preds = %58
%63 = load double, double* %24
%64 = load i32, i32* %27
%65 = sitofp i32 %64 to double
%66 = fsub double %63, %65
%67 = load i32, i32* %16
%68 = sitofp i32 %67 to double
%69 = fmul double %66, %68
store double %69, double* %28
%70 = load double, double* %28
%71 = fadd double %70, 5.000000e-01
%72 = fptosi double %71 to i32
%73 = call i32 @floor(i32 %72)
store i32 %73, i32* %29
%74 = load double*, double** %14
%75 = load i32, i32* %29
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds double, double* %74, i64 %76
%78 = load double, double* %77
store double %78, double* %30
%79 = load i32, i32* %27
%80 = sitofp i32 %79 to double
%81 = load i32, i32* %13
%82 = sitofp i32 %81 to double
%83 = fdiv double %80, %82
%84 = fptosi double %83 to i32
%85 = call i32 @floor(i32 %84)
store i32 %85, i32* %31
%86 = load i32, i32* %27
%87 = load i32, i32* %13
%88 = load i32, i32* %31
%89 = mul nsw i32 %87, %88
%90 = sub nsw i32 %86, %89
store i32 %90, i32* %32
%91 = load double, double* %30
%92 = load double*, double** %11
%93 = load i32, i32* %32
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double, double* %92, i64 %94
%96 = load double, double* %95
%97 = load double, double* %25
%98 = call double @llvm.fmuladd.f64(double %91, double %96, double %97)
store double %98, double* %25
%99 = load double, double* %30
%100 = load double*, double** %12
%101 = load i32, i32* %32
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %100, i64 %102
%104 = load double, double* %103
%105 = load double, double* %26
%106 = call double @llvm.fmuladd.f64(double %99, double %104, double %105)
store double %106, double* %26
br label %107
107: ; preds = %62
%108 = load i32, i32* %23
%109 = add nsw i32 %108, 1
store i32 %109, i32* %23
%110 = load i32, i32* %27
%111 = add nsw i32 %110, 1
store i32 %111, i32* %27
br label %58
112: ; preds = %58
%113 = load double, double* %25
%114 = load double*, double** %19
%115 = getelementptr inbounds double, double* %114, i32 1
store double* %115, double** %19
store double %113, double* %114
%116 = load double, double* %26
%117 = load double*, double** %20
%118 = getelementptr inbounds double, double* %117, i32 1
store double* %118, double** %20
store double %116, double* %117
br label %119
119: ; preds = %112
%120 = load i32, i32* %21
%121 = add nsw i32 %120, 1
store i32 %121, i32* %21
br label %42
122: ; preds = %42
ret void
}

LLVM IR (-O2):
define void @interp1_table0_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 %74
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, %66
%24 = phi double* [ %6, %17 ], [ %28, %66 ]
%25 = phi double* [ %8, %17 ], [ %68, %66 ]
%26 = phi double* [ %9, %17 ], [ %70, %66 ]
%27 = phi i32 [ 0, %17 ], [ %72, %66 ]
%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 %66
33: ; preds = %23, %33
%34 = phi i32 [ %37, %33 ], [ %32, %23 ]
%35 = phi i32 [ %62, %33 ], [ 0, %23 ]
%36 = phi <2 x double> [ %61, %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 = fadd double %40, 5.000000e-01
%42 = fptosi double %41 to i32
%43 = tail call i32 @floor(i32 %42)
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %15, i64 %44
%46 = load double, double* %45
%47 = fdiv double %38, %22
%48 = fptosi double %47 to i32
%49 = tail call i32 @floor(i32 %48)
%50 = mul nsw i32 %49, %2
%51 = sub nsw i32 %37, %50
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %0, i64 %52
%54 = load double, double* %53
%55 = getelementptr inbounds double, double* %1, i64 %52
%56 = load double, double* %55
%57 = insertelement <2 x double> poison, double %46, i64 0
%58 = shufflevector <2 x double> %57, <2 x double> poison, <2 x i32> zeroinitializer
%59 = insertelement <2 x double> poison, double %54, i64 0
%60 = insertelement <2 x double> %59, double %56, i64 1
%61 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %58, <2 x double> %60, <2 x double> %36)
%62 = add nuw nsw i32 %35, 1
%63 = icmp eq i32 %62, %4
br i1 %63, label %64, label %33
64: ; preds = %33
%65 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %58, <2 x double> %60, <2 x double> %36)
br label %66
66: ; preds = %64, %23
%67 = phi <2 x double> [ zeroinitializer, %23 ], [ %65, %64 ]
%68 = getelementptr inbounds double, double* %25, i64 1
%69 = extractelement <2 x double> %67, i64 0
store double %69, double* %25
%70 = getelementptr inbounds double, double* %26, i64 1
%71 = extractelement <2 x double> %67, i64 1
store double %71, double* %26
%72 = add nuw nsw i32 %27, 1
%73 = icmp eq i32 %72, %7
br i1 %73, label %74, label %23
74: ; preds = %66, %10
ret void
}