#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
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    12fd <interp1_table0_real_per+0x1ed>
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    12bf <interp1_table0_real_per+0x1af>
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x54(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdf4(%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    11e4 <interp1_table0_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_table0_real_per+0x70>
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
cvtsi2sd %eax,%xmm0
mulsd  0xebd(%rip),%xmm0
cvttsd2si %xmm0,%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
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
mulsd  0xe75(%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>
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 = sitofp i32 %35 to double
%37 = fdiv double %36, 2.000000e+00
%38 = fptosi double %37 to i32
%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 = %121, %10
%45 = load i32, i32* %21
%46 = load i32, i32* %18
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %124
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 = %109, %48
%61 = load i32, i32* %23
%62 = load i32, i32* %15
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %114
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 = fadd double %72, 5.000000e-01
%74 = fptosi double %73 to i32
%75 = call i32 @floor(i32 %74)
store i32 %75, i32* %29
%76 = load double*, double** %14
%77 = load i32, i32* %29
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %76, i64 %78
%80 = load double, double* %79
store double %80, double* %30
%81 = load i32, i32* %27
%82 = sitofp i32 %81 to double
%83 = load i32, i32* %13
%84 = sitofp i32 %83 to double
%85 = fdiv double %82, %84
%86 = fptosi double %85 to i32
%87 = call i32 @floor(i32 %86)
store i32 %87, i32* %31
%88 = load i32, i32* %27
%89 = load i32, i32* %13
%90 = load i32, i32* %31
%91 = mul nsw i32 %89, %90
%92 = sub nsw i32 %88, %91
store i32 %92, i32* %32
%93 = load double, double* %30
%94 = load double*, double** %11
%95 = load i32, i32* %32
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
%98 = load double, double* %97
%99 = load double, double* %25
%100 = call double @llvm.fmuladd.f64(double %93, double %98, double %99)
store double %100, double* %25
%101 = load double, double* %30
%102 = load double*, double** %12
%103 = load i32, i32* %32
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %102, i64 %104
%106 = load double, double* %105
%107 = load double, double* %26
%108 = call double @llvm.fmuladd.f64(double %101, double %106, double %107)
store double %108, double* %26
br label %109
109: ; preds = %64
%110 = load i32, i32* %23
%111 = add nsw i32 %110, 1
store i32 %111, i32* %23
%112 = load i32, i32* %27
%113 = add nsw i32 %112, 1
store i32 %113, i32* %27
br label %60
114: ; preds = %60
%115 = load double, double* %25
%116 = load double*, double** %19
%117 = getelementptr inbounds double, double* %116, i32 1
store double* %117, double** %19
store double %115, double* %116
%118 = load double, double* %26
%119 = load double*, double** %20
%120 = getelementptr inbounds double, double* %119, i32 1
store double* %120, double** %20
store double %118, double* %119
br label %121
121: ; preds = %114
%122 = load i32, i32* %21
%123 = add nsw i32 %122, 1
store i32 %123, i32* %21
br label %44
124: ; preds = %44
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 = 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 %76
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, %68
%26 = phi double* [ %6, %19 ], [ %30, %68 ]
%27 = phi double* [ %8, %19 ], [ %70, %68 ]
%28 = phi double* [ %9, %19 ], [ %72, %68 ]
%29 = phi i32 [ 0, %19 ], [ %74, %68 ]
%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 %68
35: ; preds = %25, %35
%36 = phi i32 [ %39, %35 ], [ %34, %25 ]
%37 = phi i32 [ %64, %35 ], [ 0, %25 ]
%38 = phi <2 x double> [ %63, %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 = fadd double %42, 5.000000e-01
%44 = fptosi double %43 to i32
%45 = tail call i32 @floor(i32 %44)
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %17, i64 %46
%48 = load double, double* %47
%49 = fdiv double %40, %24
%50 = fptosi double %49 to i32
%51 = tail call i32 @floor(i32 %50)
%52 = mul nsw i32 %51, %2
%53 = sub nsw i32 %39, %52
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double, double* %0, i64 %54
%56 = load double, double* %55
%57 = getelementptr inbounds double, double* %1, i64 %54
%58 = load double, double* %57
%59 = insertelement <2 x double> poison, double %48, i64 0
%60 = shufflevector <2 x double> %59, <2 x double> poison, <2 x i32> zeroinitializer
%61 = insertelement <2 x double> poison, double %56, i64 0
%62 = insertelement <2 x double> %61, double %58, i64 1
%63 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %60, <2 x double> %62, <2 x double> %38)
%64 = add nuw nsw i32 %37, 1
%65 = icmp eq i32 %64, %4
br i1 %65, label %66, label %35
66: ; preds = %35
%67 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %60, <2 x double> %62, <2 x double> %38)
br label %68
68: ; preds = %66, %25
%69 = phi <2 x double> [ zeroinitializer, %25 ], [ %67, %66 ]
%70 = getelementptr inbounds double, double* %27, i64 1
%71 = extractelement <2 x double> %69, i64 0
store double %71, double* %27
%72 = getelementptr inbounds double, double* %28, i64 1
%73 = extractelement <2 x double> %69, i64 1
store double %73, double* %28
%74 = add nuw nsw i32 %29, 1
%75 = icmp eq i32 %74, %7
br i1 %75, label %76, label %25
76: ; preds = %68, %10
ret void
}