#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) {
  (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 (int mm = 0; mm < M; mm++) {
    const double t1 = *p_tm++;
    const double fmr = *r_fm++;
    const double fmi = *i_fm++;
    int k1 = 1 + floor(t1 - J1 / 2.);
    for (int 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    $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    -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
cvtsi2sd %eax,%xmm0
movsd  0xe72(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <floor@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1364 <interp1_table1_real_per_adj+0x244>
mov    0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x10(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x20(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,0x28(%rbp)
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0xde0(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1351 <interp1_table1_real_per_adj+0x231>
movsd  -0x38(%rbp),%xmm0
cvtsi2sdl -0x4c(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
cvttsd2si -0x58(%rbp),%edi
call   1040 <floor@plt>
mov    %eax,-0x5c(%rbp)
movsd  -0x58(%rbp),%xmm0
cvtsi2sdl -0x5c(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
movsd  0xd67(%rip),%xmm0
subsd  -0x68(%rbp),%xmm0
mov    -0x70(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x68(%rbp),%xmm1
mov    -0x70(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
cvtsi2sdl -0x4c(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <floor@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x7c(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x80(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x80(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    123e <interp1_table1_real_per_adj+0x11e>
jmp    1356 <interp1_table1_real_per_adj+0x236>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11ba <interp1_table1_real_per_adj+0x9a>
add    $0x80,%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
cvtsi2sd %eax,%xmm0
mulsd  0xe83(%rip),%xmm0
cvttsd2si %xmm0,%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
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
mulsd  0xe41(%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>
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 double
%24 = alloca double
%25 = alloca double
%26 = alloca i32
%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 = sitofp i32 %51 to double
%53 = fdiv double %52, 2.000000e+00
%54 = fptosi double %53 to i32
%55 = call i32 @floor(i32 %54)
store i32 %55, i32* %21
%56 = load i32, i32* %21
%57 = load double*, double** %14
%58 = sext i32 %56 to i64
%59 = getelementptr inbounds double, double* %57, i64 %58
store double* %59, double** %14
store i32 0, i32* %22
br label %60
60: ; preds = %149, %10
%61 = load i32, i32* %22
%62 = load i32, i32* %18
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %152
64: ; preds = %60
%65 = load double*, double** %17
%66 = getelementptr inbounds double, double* %65, i32 1
store double* %66, double** %17
%67 = load double, double* %65
store double %67, double* %23
%68 = load double*, double** %19
%69 = getelementptr inbounds double, double* %68, i32 1
store double* %69, double** %19
%70 = load double, double* %68
store double %70, double* %24
%71 = load double*, double** %20
%72 = getelementptr inbounds double, double* %71, i32 1
store double* %72, double** %20
%73 = load double, double* %71
store double %73, double* %25
%74 = load double, double* %23
%75 = load i32, i32* %15
%76 = sitofp i32 %75 to double
%77 = fdiv double %76, 2.000000e+00
%78 = fsub double %74, %77
%79 = fptosi double %78 to i32
%80 = call i32 @floor(i32 %79)
%81 = add nsw i32 1, %80
store i32 %81, i32* %26
store i32 0, i32* %27
br label %82
82: ; preds = %143, %64
%83 = load i32, i32* %27
%84 = load i32, i32* %15
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %148
86: ; preds = %82
%87 = load double, double* %23
%88 = load i32, i32* %26
%89 = sitofp i32 %88 to double
%90 = fsub double %87, %89
%91 = load i32, i32* %16
%92 = sitofp i32 %91 to double
%93 = fmul double %90, %92
store double %93, double* %28
%94 = load double, double* %28
%95 = fptosi double %94 to i32
%96 = call i32 @floor(i32 %95)
store i32 %96, i32* %29
%97 = load double, double* %28
%98 = load i32, i32* %29
%99 = sitofp i32 %98 to double
%100 = fsub double %97, %99
store double %100, double* %30
%101 = load double*, double** %14
%102 = load i32, i32* %29
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds double, double* %101, i64 %103
store double* %104, double** %31
%105 = load double, double* %30
%106 = fsub double 1.000000e+00, %105
%107 = load double*, double** %31
%108 = load double, double* %107
%109 = load double, double* %30
%110 = load double*, double** %31
%111 = getelementptr inbounds double, double* %110, i64 1
%112 = load double, double* %111
%113 = fmul double %109, %112
%114 = call double @llvm.fmuladd.f64(double %106, double %108, double %113)
store double %114, double* %32
%115 = load i32, i32* %26
%116 = sitofp i32 %115 to double
%117 = load i32, i32* %13
%118 = sitofp i32 %117 to double
%119 = fdiv double %116, %118
%120 = fptosi double %119 to i32
%121 = call i32 @floor(i32 %120)
store i32 %121, i32* %33
%122 = load i32, i32* %26
%123 = load i32, i32* %13
%124 = load i32, i32* %33
%125 = mul nsw i32 %123, %124
%126 = sub nsw i32 %122, %125
store i32 %126, i32* %34
%127 = load double, double* %32
%128 = load double, double* %24
%129 = load double*, double** %11
%130 = load i32, i32* %34
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds double, double* %129, i64 %131
%133 = load double, double* %132
%134 = call double @llvm.fmuladd.f64(double %127, double %128, double %133)
store double %134, double* %132
%135 = load double, double* %32
%136 = load double, double* %25
%137 = load double*, double** %12
%138 = load i32, i32* %34
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %137, i64 %139
%141 = load double, double* %140
%142 = call double @llvm.fmuladd.f64(double %135, double %136, double %141)
store double %142, double* %140
br label %143
143: ; preds = %86
%144 = load i32, i32* %27
%145 = add nsw i32 %144, 1
store i32 %145, i32* %27
%146 = load i32, i32* %26
%147 = add nsw i32 %146, 1
store i32 %147, i32* %26
br label %82
148: ; preds = %82
br label %149
149: ; preds = %148
%150 = load i32, i32* %22
%151 = add nsw i32 %150, 1
store i32 %151, i32* %22
br label %60
152: ; preds = %60
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 = sitofp i32 %16 to double
%18 = fmul double %17, 5.000000e-01
%19 = fptosi double %18 to i32
%20 = tail call i32 @floor(i32 %19)
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %3, i64 %21
%23 = icmp sgt i32 %7, 0
br i1 %23, label %24, label %30
24: ; preds = %10
%25 = sitofp i32 %4 to double
%26 = fmul double %25, 5.000000e-01
%27 = icmp sgt i32 %4, 0
%28 = sitofp i32 %5 to double
%29 = sitofp i32 %2 to double
br label %31
30: ; preds = %45, %10
ret void
31: ; preds = %24, %45
%32 = phi double* [ %6, %24 ], [ %36, %45 ]
%33 = phi double* [ %8, %24 ], [ %38, %45 ]
%34 = phi double* [ %9, %24 ], [ %40, %45 ]
%35 = phi i32 [ 0, %24 ], [ %46, %45 ]
%36 = getelementptr inbounds double, double* %32, i64 1
%37 = load double, double* %32
%38 = getelementptr inbounds double, double* %33, i64 1
%39 = load double, double* %33
%40 = getelementptr inbounds double, double* %34, i64 1
%41 = load double, double* %34
%42 = fsub double %37, %26
%43 = fptosi double %42 to i32
%44 = tail call i32 @floor(i32 %43)
br i1 %27, label %48, label %45
45: ; preds = %48, %31
%46 = add nuw nsw i32 %35, 1
%47 = icmp eq i32 %46, %7
br i1 %47, label %30, label %31
48: ; preds = %31, %48
%49 = phi i32 [ %51, %48 ], [ %44, %31 ]
%50 = phi i32 [ %79, %48 ], [ 0, %31 ]
%51 = add nsw i32 %49, 1
%52 = sitofp i32 %51 to double
%53 = fsub double %37, %52
%54 = fmul double %53, %28
%55 = fptosi double %54 to i32
%56 = tail call i32 @floor(i32 %55)
%57 = sitofp i32 %56 to double
%58 = fsub double %54, %57
%59 = sext i32 %56 to i64
%60 = getelementptr inbounds double, double* %22, i64 %59
%61 = fsub double 1.000000e+00, %58
%62 = load double, double* %60
%63 = getelementptr inbounds double, double* %60, i64 1
%64 = load double, double* %63
%65 = fmul double %58, %64
%66 = tail call double @llvm.fmuladd.f64(double %61, double %62, double %65)
%67 = fdiv double %52, %29
%68 = fptosi double %67 to i32
%69 = tail call i32 @floor(i32 %68)
%70 = mul nsw i32 %69, %2
%71 = sub nsw i32 %51, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %0, i64 %72
%74 = load double, double* %73
%75 = tail call double @llvm.fmuladd.f64(double %66, double %39, double %74)
store double %75, double* %73
%76 = getelementptr inbounds double, double* %1, i64 %72
%77 = load double, double* %76
%78 = tail call double @llvm.fmuladd.f64(double %66, double %41, double %77)
store double %78, double* %76
%79 = add nuw nsw i32 %50, 1
%80 = icmp eq i32 %79, %4
br i1 %80, label %45, label %48
}