#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);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int const);
void interp1_table1_real_per_adj(double *r_ck, double *i_ck, const int K1,
                                 const double *r_h1, const int J1, const int L1,
                                 const double *p_tm, const int M,
                                 const double *r_fm, const double *i_fm) {
  int mm;
  (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;
  }
  for (mm = 0; mm < M; mm++) {
    int jj1;
    const double t1 = *p_tm++;
    const double fmr = *r_fm++;
    const double fmi = *i_fm++;
    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;
      r_ck[k1mod] += coef1r * fmr;
      i_ck[k1mod] += coef1r * fmi;
    }
  }
}


x86 assembly (clang, -O0):
<interp1_table1_real_per_adj>:
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    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x24(%rbp),%eax
imul   -0x28(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <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    1369 <interp1_table1_real_per_adj+0x249>
mov    0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x10(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x20(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x28(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0xdea(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1356 <interp1_table1_real_per_adj+0x236>
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   1040 <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  0xd71(%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   1040 <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
movsd  -0x48(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x88(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1234 <interp1_table1_real_per_adj+0x114>
jmp    135b <interp1_table1_real_per_adj+0x23b>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11b0 <interp1_table1_real_per_adj+0x90>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interp1_table1_real_per_adj>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9d,%r12d
mov    %r8d,%r14d
mov    %rcx,0x18(%rsp)
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdx,0x28(%rsp)
lea    0x0(,%rdx,8),%r13d
xor    %ebp,%ebp
xor    %esi,%esi
mov    %r13d,%edx
call   1030 <memset@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    %r13d,%edx
call   1030 <memset@plt>
mov    %r12d,%eax
mov    %r14d,0xc(%rsp)
imul   %r14d,%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
call   1040 <floor@plt>
cmpl   $0x0,0xb8(%rsp)
jle    1357 <interp1_table1_real_per_adj+0x237>
mov    0xc8(%rsp),%rcx
mov    0xc0(%rsp),%rdx
mov    0xb0(%rsp),%rsi
cltq
cvtsi2sdl 0xc(%rsp),%xmm0
mulsd  0xe4b(%rip),%xmm0
movsd  %xmm0,0x38(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    0x18(%rsp),%rdi
lea    (%rdi,%rax,8),%r13
xorps  %xmm0,%xmm0
cvtsi2sdl 0x28(%rsp),%xmm0
movsd  %xmm0,0x58(%rsp)
jmp    121f <interp1_table1_real_per_adj+0xff>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x40(%rsp),%rsi
add    $0x8,%rsi
mov    0x48(%rsp),%rdx
add    $0x8,%rdx
mov    0x50(%rsp),%rcx
add    $0x8,%rcx
mov    0x24(%rsp),%ebp
add    $0x1,%ebp
cmp    0xb8(%rsp),%ebp
je     1357 <interp1_table1_real_per_adj+0x237>
mov    %ebp,0x24(%rsp)
mov    %rsi,0x40(%rsp)
movsd  (%rsi),%xmm0
mov    %rdx,0x48(%rsp)
movsd  (%rdx),%xmm1
movsd  %xmm1,0x68(%rsp)
mov    %rcx,0x50(%rsp)
movsd  (%rcx),%xmm1
movsd  %xmm1,0x60(%rsp)
movsd  %xmm0,0x70(%rsp)
subsd  0x38(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <floor@plt>
cmpl   $0x0,0xc(%rsp)
mov    0x28(%rsp),%rbp
movsd  0x30(%rsp),%xmm1
jle    11f0 <interp1_table1_real_per_adj+0xd0>
add    $0x1,%eax
movslq %eax,%r14
mov    0xc(%rsp),%r12d
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x70(%rsp),%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
cvttsd2si %xmm2,%edi
call   1040 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
cltq
movsd  0xd42(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  0x8(%r13,%rax,8),%xmm1
mulsd  0x0(%r13,%rax,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
divsd  0x58(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <floor@plt>
movsd  0x30(%rsp),%xmm1
imul   %ebp,%eax
cltq
shl    $0x3,%rax
mov    %rbx,%rcx
sub    %rax,%rcx
movsd  0x10(%rsp),%xmm2
movapd %xmm2,%xmm0
mulsd  0x68(%rsp),%xmm0
addsd  (%rcx,%r14,8),%xmm0
movsd  %xmm0,(%rcx,%r14,8)
mov    %r15,%rcx
sub    %rax,%rcx
movapd %xmm2,%xmm0
mulsd  0x60(%rsp),%xmm0
addsd  (%rcx,%r14,8),%xmm0
movsd  %xmm0,(%rcx,%r14,8)
add    $0x1,%r14
add    $0xffffffff,%r12d
jne    1280 <interp1_table1_real_per_adj+0x160>
jmp    11f0 <interp1_table1_real_per_adj+0xd0>
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_adj(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 double*, double** %11
%36 = bitcast double* %35 to i8*
%37 = load i32, i32* %13
%38 = sext i32 %37 to i64
%39 = mul i64 %38, 8
%40 = trunc i64 %39 to i32
%41 = call i32 @memset(i8* %36, i32 0, i32 %40)
%42 = load double*, double** %12
%43 = bitcast double* %42 to i8*
%44 = load i32, i32* %13
%45 = sext i32 %44 to i64
%46 = mul i64 %45, 8
%47 = trunc i64 %46 to i32
%48 = call i32 @memset(i8* %43, i32 0, i32 %47)
%49 = load i32, i32* %15
%50 = load i32, i32* %16
%51 = mul nsw i32 %49, %50
%52 = sdiv i32 %51, 2
%53 = call i32 @floor(i32 %52)
store i32 %53, i32* %22
%54 = load i32, i32* %22
%55 = load double*, double** %14
%56 = sext i32 %54 to i64
%57 = getelementptr inbounds double, double* %55, i64 %56
store double* %57, double** %14
store i32 0, i32* %21
br label %58
58: ; preds = %147, %10
%59 = load i32, i32* %21
%60 = load i32, i32* %18
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %150
62: ; preds = %58
%63 = load double*, double** %17
%64 = getelementptr inbounds double, double* %63, i32 1
store double* %64, double** %17
%65 = load double, double* %63
store double %65, double* %24
%66 = load double*, double** %19
%67 = getelementptr inbounds double, double* %66, i32 1
store double* %67, double** %19
%68 = load double, double* %66
store double %68, double* %25
%69 = load double*, double** %20
%70 = getelementptr inbounds double, double* %69, i32 1
store double* %70, double** %20
%71 = load double, double* %69
store double %71, double* %26
%72 = load double, double* %24
%73 = load i32, i32* %15
%74 = sitofp i32 %73 to double
%75 = fdiv double %74, 2.000000e+00
%76 = fsub double %72, %75
%77 = fptosi double %76 to i32
%78 = call i32 @floor(i32 %77)
%79 = add nsw i32 1, %78
store i32 %79, i32* %27
store i32 0, i32* %23
br label %80
80: ; preds = %141, %62
%81 = load i32, i32* %23
%82 = load i32, i32* %15
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %146
84: ; preds = %80
%85 = load double, double* %24
%86 = load i32, i32* %27
%87 = sitofp i32 %86 to double
%88 = fsub double %85, %87
%89 = load i32, i32* %16
%90 = sitofp i32 %89 to double
%91 = fmul double %88, %90
store double %91, double* %28
%92 = load double, double* %28
%93 = fptosi double %92 to i32
%94 = call i32 @floor(i32 %93)
store i32 %94, i32* %29
%95 = load double, double* %28
%96 = load i32, i32* %29
%97 = sitofp i32 %96 to double
%98 = fsub double %95, %97
store double %98, double* %30
%99 = load double*, double** %14
%100 = load i32, i32* %29
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
store double* %102, double** %31
%103 = load double, double* %30
%104 = fsub double 1.000000e+00, %103
%105 = load double*, double** %31
%106 = load double, double* %105
%107 = load double, double* %30
%108 = load double*, double** %31
%109 = getelementptr inbounds double, double* %108, i64 1
%110 = load double, double* %109
%111 = fmul double %107, %110
%112 = call double @llvm.fmuladd.f64(double %104, double %106, double %111)
store double %112, double* %32
%113 = load i32, i32* %27
%114 = sitofp i32 %113 to double
%115 = load i32, i32* %13
%116 = sitofp i32 %115 to double
%117 = fdiv double %114, %116
%118 = fptosi double %117 to i32
%119 = call i32 @floor(i32 %118)
store i32 %119, i32* %33
%120 = load i32, i32* %27
%121 = load i32, i32* %13
%122 = load i32, i32* %33
%123 = mul nsw i32 %121, %122
%124 = sub nsw i32 %120, %123
store i32 %124, i32* %34
%125 = load double, double* %32
%126 = load double, double* %25
%127 = load double*, double** %11
%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 = call double @llvm.fmuladd.f64(double %125, double %126, double %131)
store double %132, double* %130
%133 = load double, double* %32
%134 = load double, double* %26
%135 = load double*, double** %12
%136 = load i32, i32* %34
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %135, i64 %137
%139 = load double, double* %138
%140 = call double @llvm.fmuladd.f64(double %133, double %134, double %139)
store double %140, double* %138
br label %141
141: ; preds = %84
%142 = load i32, i32* %23
%143 = add nsw i32 %142, 1
store i32 %143, i32* %23
%144 = load i32, i32* %27
%145 = add nsw i32 %144, 1
store i32 %145, i32* %27
br label %80
146: ; preds = %80
br label %147
147: ; preds = %146
%148 = load i32, i32* %21
%149 = add nsw i32 %148, 1
store i32 %149, i32* %21
br label %58
150: ; preds = %58
ret void
}

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