#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_table0_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 + 0.5);
      register double coef1r = r_h1[n1];
      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_table0_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
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    1322 <interp1_table0_real_per_adj+0x202>
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    130f <interp1_table0_real_per_adj+0x1ef>
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x54(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xda4(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <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   1040 <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
movsd  -0x48(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x78(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movslq -0x78(%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_table0_real_per_adj+0x114>
jmp    1314 <interp1_table0_real_per_adj+0x1f4>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11b0 <interp1_table0_real_per_adj+0x90>
add    $0x80,%rsp
pop    %rbp
ret

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

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