user: What is the c source code of the assembly code below:

```asm
<cb2006_ampf>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  push   %rbx
  mov    %r9,%rbx
  sub    $0x258,%rsp
  mov    0x298(%rsp),%rax
  mov    0x290(%rsp),%rbp
  mov    %edx,0x34(%rsp)
  mov    %rdi,0x38(%rsp)
  mov    %rax,0x40(%rsp)
  mov    0x2a0(%rsp),%rax
  mov    %rsi,0x28(%rsp)
  mov    %rax,0x48(%rsp)
  mov    0x2a8(%rsp),%rax
  mov    %rax,0x50(%rsp)
  mov    0x2b0(%rsp),%rax
  mov    %rax,0x58(%rsp)
  mov    0x2b8(%rsp),%rax
  mov    %rax,0x60(%rsp)
  mov    0x2c0(%rsp),%rax
  mov    %rax,0x68(%rsp)
  mov    0x2c8(%rsp),%rax
  mov    %rax,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x248(%rsp)
  movabs $0x3c23d70a00000000,%rax
  mov    %rax,0x70(%rsp)
  movabs $0x3cf5c28f3ca3d70a,%rax
  mov    %rax,0x78(%rsp)
  movabs $0x3d99999a3d4ccccd,%rax
  mov    %rax,0x80(%rsp)
  movabs $0x3e19999a3dcccccd,%rax
  mov    %rax,0x88(%rsp)
  movabs $0x3e8000003e4ccccd,%rax
  mov    %rax,0x90(%rsp)
  movabs $0x3ecccccd3e99999a,%rax
  mov    %rax,0x98(%rsp)
  movabs $0x3f4000003f000000,%rax
  mov    %rax,0xa0(%rsp)
  movabs $0x3fc000003f800000,%rax
  mov    %rax,0xa8(%rsp)
  movabs $0x4040000040000000,%rax
  mov    %rax,0xb0(%rsp)
  movabs $0x40a0000040800000,%rax
  mov    %rax,0xb8(%rsp)
  movabs $0x4120000040f00000,%rax
  mov    %rax,0xc0(%rsp)
  movabs $0x3f9645a23f8d0e56,%rax
  mov    %rax,0xd8(%rsp)
  movabs $0x3fb810623fa2d0e5,%rax
  mov    %rax,0xe0(%rsp)
  movabs $0x3ff6c8b43fcd4fdf,%rax
  mov    %rax,0xe8(%rsp)
  movabs $0x401676c9400c6a7f,%rax
  mov    %rax,0xf0(%rsp)
  movabs $0x40259168401d70a4,%rax
  mov    %rax,0xf8(%rsp)
  movabs $0x400883124022d0e5,%rax
  mov    %rax,0x100(%rsp)
  movabs $0x3ecfdf3b3fc91687,%rax
  mov    %rax,0x108(%rsp)
  movabs $0xbf51eb85bee978d5,%rax
  mov    %rax,0x110(%rsp)
  add    $0x6872b0,%rax
  mov    %rax,0x118(%rsp)
  mov    %rax,0x120(%rsp)
  movabs $0x4463000044584000,%rax
  mov    %rax,0x138(%rsp)
  movabs $0x4487c0004483c000,%rax
  mov    %rax,0x140(%rsp)
  movabs $0x445b800044810000,%rax
  mov    %rax,0x148(%rsp)
  movabs $0x44238000443b0000,%rax
  mov    %rax,0x150(%rsp)
  movabs $0x43fb80004412c000,%rax
  mov    %rax,0x158(%rsp)
  movabs $0x43cd000043e48000,%rax
  mov    %rax,0x160(%rsp)
  movabs $0x43c8000043c80000,%rax
  mov    %rax,0x168(%rsp)
  mov    %rax,0x170(%rsp)
  mov    %rax,0x178(%rsp)
  mov    %rax,0x180(%rsp)
  movabs $0xbf97ced9bf97ced9,%rax
  mov    %rax,0x190(%rsp)
  movabs $0xbfa2f1aabf9c0831,%rax
  mov    %rax,0x198(%rsp)
  movabs $0xbfbc49babfac49ba,%rax
  mov    %rax,0x1a0(%rsp)
  movabs $0xbff72b02bfcfdf3b,%rax
  mov    %rax,0x1a8(%rsp)
  movabs $0xc018624ec00c0831,%rax
  mov    %rax,0x1b0(%rsp)
  movabs $0xc02a0c4ac02126e9,%rax
  movl   $0x3f876c8b,0xd4(%rsp)
  movl   $0x44584000,0x134(%rsp)
  mov    %rax,0x1b8(%rsp)
  movss  D155(%rip),%xmm0
  movabs $0xc019a9fcc02ad0e5,%rax
  mov    %rax,0x1c0(%rsp)
  movabs $0xbf833333bffa3d71,%rax
  mov    %rax,0x1c8(%rsp)
  mov    $0xbe991687,%eax
  mov    %rax,0x1d0(%rsp)
  movq   $0x0,0x1d8(%rsp)
  movq   $0x0,0x1e0(%rsp)
  call   <log@plt>
  movss  D97(%rip),%xmm1
  movss  D223(%rip),%xmm5
  mulss  %xmm0,%xmm1
  movss  (%rbx),%xmm0
  comiss %xmm0,%xmm5
  jbe    L118
  divss  %xmm5,%xmm0
  movss  %xmm1,0x8(%rsp)
  call   <log@plt>
  movss  0x0(%rbp),%xmm5
  movss  %xmm0,0x10(%rsp)
  movss  (%rbx),%xmm0
  divss  D223(%rip),%xmm0
  movss  %xmm5,(%rsp)
  call   <log@plt>
  movss  D143(%rip),%xmm5
  mulss  %xmm5,%xmm0
  movss  %xmm5,0x4(%rsp)
  call   <exp@plt>
  movss  D142(%rip),%xmm3
  mulss  %xmm3,%xmm0
  addss  0x0(%rbp),%xmm3
  addss  (%rsp),%xmm0
  divss  %xmm3,%xmm0
  call   <log@plt>
  movss  0x10(%rsp),%xmm2
  mulss  D32(%rip),%xmm0
  mulss  D20(%rip),%xmm2
  movss  0x8(%rsp),%xmm1
  addss  %xmm0,%xmm2
L255:
  subss  %xmm2,%xmm1
  movss  0x0(%rbp),%xmm5
  xor    %ebx,%ebx
  lea    0x70(%rsp),%r15
  lea    0x190(%rsp),%rbp
  lea    0x1f0(%rsp),%r14
  movss  %xmm5,(%rsp)
  movaps %xmm1,%xmm0
  call   <exp@plt>
  mulss  (%rsp),%xmm0
  movss  D180(%rip),%xmm5
  lea    0x1e8(%rsp),%rax
  mov    %rax,0x8(%rsp)
  movss  D223(%rip),%xmm3
  movl   $0x3f876c8b,(%rsp)
  movss  %xmm5,0x30(%rsp)
  movss  %xmm0,0x14(%rsp)
  jmp    L283
  nopw   0x0(%rax,%rax,1)
L47:
  movaps %xmm1,%xmm0
  movss  %xmm3,0x24(%rsp)
  call   <log@plt>
  mulss  (%rsp),%xmm0
  movss  0x24(%rsp),%xmm3
  movss  0x0(%rbp),%xmm5
  movss  %xmm5,0x20(%rsp)
  movss  %xmm0,0x10(%rsp)
  movss  0x0(%r13),%xmm0
  divss  %xmm3,%xmm0
  call   <log@plt>
  mulss  0x4(%rsp),%xmm0
  call   <exp@plt>
  mulss  D142(%rip),%xmm0
  movss  0x14(%rsp),%xmm4
  movss  D142(%rip),%xmm6
  addss  %xmm4,%xmm6
  addss  %xmm4,%xmm0
  divss  %xmm6,%xmm0
  call   <log@plt>
  movss  0x20(%rsp),%xmm1
  movss  0x24(%rsp),%xmm3
  mulss  %xmm0,%xmm1
  addss  0x10(%rsp),%xmm1
L151:
  movss  (%r12),%xmm0
  movss  %xmm3,0x10(%rsp)
  comiss %xmm0,%xmm3
  movaps %xmm0,%xmm2
  divss  %xmm3,%xmm2
  jbe    L36
  movaps %xmm2,%xmm0
  movss  %xmm1,0x24(%rsp)
  call   <log@plt>
  mulss  (%rsp),%xmm0
  movss  0x10(%rsp),%xmm3
  movss  0x0(%rbp),%xmm7
  movss  %xmm7,0x20(%rsp)
  movss  %xmm0,(%rsp)
  movss  (%r12),%xmm0
  divss  %xmm3,%xmm0
  call   <log@plt>
  mulss  0x4(%rsp),%xmm0
  call   <exp@plt>
  mulss  D142(%rip),%xmm0
  movss  0x14(%rsp),%xmm6
  movss  D142(%rip),%xmm2
  addss  %xmm6,%xmm2
  addss  %xmm6,%xmm0
  divss  %xmm2,%xmm0
  call   <log@plt>
  mulss  0x20(%rsp),%xmm0
  movss  0x24(%rsp),%xmm1
  addss  (%rsp),%xmm0
L161:
  subss  %xmm0,%xmm1
  movaps %xmm1,%xmm0
  call   <exp@plt>
  pxor   %xmm2,%xmm2
  mov    0x18(%rsp),%rax
  movsd  D11(%rip),%xmm1
  cvtss2sd (%r15,%rbx,1),%xmm2
  movss  %xmm0,(%r14,%rbx,1)
  divsd  %xmm2,%xmm1
  pxor   %xmm2,%xmm2
  cvtss2sd (%rax),%xmm2
  comisd %xmm1,%xmm2
  jb     L91
  movss  0x30(%rsp),%xmm5
  pxor   %xmm4,%xmm4
  comiss %xmm5,%xmm4
  ja     L193
  movss  %xmm5,(%r14,%rbx,1)
L91:
  add    $0x4,%rbp
  add    $0x4,%rbx
  cmp    %rbp,0x8(%rsp)
  je     L186
L68:
  movss  0xd0(%rsp,%rbx,1),%xmm7
  movss  0x130(%rsp,%rbx,1),%xmm3
  movss  %xmm7,(%rsp)
L283:
  movss  0x0(%r13),%xmm0
  comiss %xmm0,%xmm3
  movaps %xmm0,%xmm1
  divss  %xmm3,%xmm1
  ja     L47
  movss  0x4(%rsp),%xmm0
  mulss  0x0(%rbp),%xmm0
  movss  %xmm3,0x20(%rsp)
  addss  (%rsp),%xmm0
  movss  %xmm0,0x10(%rsp)
  movaps %xmm1,%xmm0
  call   <log@plt>
  movss  0x10(%rsp),%xmm1
  movss  0x20(%rsp),%xmm3
  mulss  %xmm0,%xmm1
  jmp    L151
  nopl   (%rax)
L36:
  movss  0x4(%rsp),%xmm0
  mulss  0x0(%rbp),%xmm0
  movss  %xmm1,0x10(%rsp)
  addss  (%rsp),%xmm0
  movss  %xmm0,(%rsp)
  movaps %xmm2,%xmm0
  call   <log@plt>
  movss  0x10(%rsp),%xmm1
  mulss  (%rsp),%xmm0
  jmp    L161
  nopl   0x0(%rax,%rax,1)
L193:
  movss  %xmm0,0x30(%rsp)
  add    $0x4,%rbp
  add    $0x4,%rbx
  cmp    %rbp,0x8(%rsp)
  jne    L68
L186:
  mov    0x34(%rsp),%eax
  mov    0x28(%rsp),%rsi
  pxor   %xmm0,%xmm0
  movss  D38(%rip),%xmm4
  movss  0x244(%rsp),%xmm6
  cvtsi2ss %eax,%xmm0
  mulss  (%rsi),%xmm0
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  movaps %xmm4,%xmm7
  add    %eax,%ecx
  sar    %ecx
  divss  %xmm0,%xmm7
  cmp    $0x3,%eax
  jle    L33
  movss  D41(%rip),%xmm2
  pxor   %xmm9,%xmm9
  mov    0x38(%rsp),%rsi
  movaps %xmm6,%xmm5
  mov    0x40(%rsp),%rdi
  mov    0x48(%rsp),%r8
  mov    $0x1,%eax
  mov    $0x15,%edx
  mov    0x50(%rsp),%r9
  mov    0x58(%rsp),%r10
  movaps %xmm9,%xmm3
  movaps %xmm2,%xmm8
  jmp    L119
L84:
  movaps %xmm8,%xmm3
  movaps %xmm1,%xmm6
  subss  %xmm2,%xmm6
  subss  %xmm5,%xmm3
  divss  %xmm6,%xmm3
  movaps %xmm5,%xmm6
  movaps %xmm8,%xmm5
  movaps %xmm2,%xmm8
  movaps %xmm1,%xmm2
L140:
  movss  (%rdi),%xmm10
  movaps %xmm4,%xmm1
  comiss %xmm0,%xmm10
  ja     L179
  movaps %xmm0,%xmm1
  movss  (%r8),%xmm11
  subss  %xmm8,%xmm1
  comiss %xmm0,%xmm11
  mulss  %xmm3,%xmm1
  addss  %xmm6,%xmm1
  jbe    L8
  subss  %xmm10,%xmm0
  cvtss2sd %xmm1,%xmm1
  subss  %xmm10,%xmm11
  subsd  D11(%rip),%xmm1
  cvtss2sd %xmm0,%xmm0
  cvtss2sd %xmm11,%xmm11
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  divsd  %xmm11,%xmm0
  addsd  D11(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm1
L179:
  movss  %xmm1,(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jle    L33
L119:
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  %xmm7,%xmm0
  comiss %xmm2,%xmm0
  jbe    L140
  xor    %r11d,%r11d
  test   %edx,%edx
  setg   %r11b
  sub    %r11d,%edx
  movslq %edx,%r11
  movss  0x70(%rsp,%r11,4),%xmm3
  ucomiss %xmm9,%xmm3
  jp     L225
  movss  D6(%rip),%xmm1
  je     L200
L225:
  movaps %xmm4,%xmm1
  divss  %xmm3,%xmm1
L200:
  movss  0x1f0(%rsp,%r11,4),%xmm8
  ucomiss %xmm2,%xmm1
  jp     L84
  jne    L84
  movaps %xmm5,%xmm6
  movaps %xmm9,%xmm3
  movaps %xmm8,%xmm5
  movaps %xmm2,%xmm8
  movaps %xmm1,%xmm2
  jmp    L140
  nopl   0x0(%rax)
L8:
  movss  (%r9),%xmm10
  comiss %xmm0,%xmm10
  ja     L179
  movss  (%r10),%xmm10
  comiss %xmm0,%xmm10
  ja     L179
  mov    0x60(%rsp),%rbx
  movss  (%rbx),%xmm10
  comiss %xmm0,%xmm10
  ja     L179
  mov    0x68(%rsp),%rbx
  movss  (%rbx),%xmm11
  comiss %xmm0,%xmm11
  jbe    L257
  cvtss2sd %xmm1,%xmm1
  subss  %xmm10,%xmm0
  subss  %xmm10,%xmm11
  movsd  D11(%rip),%xmm12
  subsd  %xmm1,%xmm12
  cvtss2sd %xmm0,%xmm0
  cvtss2sd %xmm11,%xmm11
  mulsd  %xmm12,%xmm0
  divsd  %xmm11,%xmm0
  addsd  %xmm0,%xmm1
  cvtsd2ss %xmm1,%xmm1
  movss  %xmm1,(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jg     L119
  xchg   %ax,%ax
L33:
  mov    0x248(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L142
  add    $0x258,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L118:
  movss  %xmm1,(%rsp)
  divss  D223(%rip),%xmm0
  call   <log@plt>
  movss  D97(%rip),%xmm2
  movss  (%rsp),%xmm1
  movss  D143(%rip),%xmm6
  mulss  %xmm0,%xmm2
  movss  %xmm6,0x4(%rsp)
  jmp    L255
L257:
  movaps %xmm4,%xmm1
  jmp    L179
L142:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D155
type: byte[4]
name: extract_symbolic_data
arguments: data_label: D97
type: byte[4]
name: extract_symbolic_data
arguments: data_label: D223
type: f32
name: extract_symbolic_data
arguments: data_label: D143
type: f32
name: extract_symbolic_data
arguments: data_label: D142
type: f32
name: extract_symbolic_data
arguments: data_label: D32
type: byte[4]
name: extract_symbolic_data
arguments: data_label: D20
type: f32
name: extract_symbolic_data
arguments: data_label: D180
type: byte[4]
name: extract_symbolic_data
arguments: data_label: D11
type: f64
name: extract_symbolic_data
arguments: data_label: D38
type: byte[4]
name: extract_symbolic_data
arguments: data_label: D41
type: f32
name: extract_symbolic_data
arguments: data_label: D6
type: f32

tool: {"D155": [0x4a,0xc6,0xa2,0x3f]}

tool: {"D97": [0x74,0xd6,0xae,0xbe]}

tool: D223: 865

tool: D143: 1.18

tool: D142: 1.88

tool: {"D32": [0xd9,0xce,0x97,0xbf]}

tool: D20: 1.058

tool: {"D180": [0x00,0x00,0x80,0xbf]}

tool: D11: 1

tool: {"D38": [0x00,0x00,0x80,0x3f]}

tool: D41: 0.1

tool: D6: 1000

assistant: ```c
void cb2006_ampf(float *ampf, float *dt, int n, float *vref, float *vsite, float *vpga, float *pga, float *fmin, float *fmidbot, float *fmid, float *fhigh, float *fhightop, float *fmax, float *flowcap) {
  float scon_c, scon_n, per[22], c10[22], c11[22], k1[22], k2[22], k3[22];
  float ampf0[22];
  float a_1100, fs_1100, fs_vpga, fs_vref, fsite;
  float df, ampv, afac, freq;
  float f0, f1, a0, a1, dadf, ampf_cap;
  int i, j;
  int nper = 22;
  scon_c = 1.88;
  scon_n = 1.18;
  per[0] = 0.0;
  per[1] = 0.01;
  per[2] = 0.02;
  per[3] = 0.03;
  per[4] = 0.05;
  per[5] = 0.075;
  per[6] = 0.10;
  per[7] = 0.15;
  per[8] = 0.20;
  per[9] = 0.25;
  per[10] = 0.30;
  per[11] = 0.40;
  per[12] = 0.50;
  per[13] = 0.75;
  per[14] = 1.00;
  per[15] = 1.50;
  per[16] = 2.00;
  per[17] = 3.00;
  per[18] = 4.00;
  per[19] = 5.00;
  per[20] = 7.50;
  per[21] = 10.0;
  c10[0] = 1.058;
  c10[1] = 1.058;
  c10[2] = 1.102;
  c10[3] = 1.174;
  c10[4] = 1.272;
  c10[5] = 1.438;
  c10[6] = 1.604;
  c10[7] = 1.928;
  c10[8] = 2.194;
  c10[9] = 2.351;
  c10[10] = 2.46;
  c10[11] = 2.587;
  c10[12] = 2.544;
  c10[13] = 2.133;
  c10[14] = 1.571;
  c10[15] = 0.406;
  c10[16] = -0.456;
  c10[17] = -0.82;
  c10[18] = -0.82;
  c10[19] = -0.82;
  c10[20] = -0.82;
  c10[21] = -0.82;
  c11[0] = 0.04;
  c11[1] = 0.04;
  c11[2] = 0.04;
  c11[3] = 0.04;
  c11[4] = 0.04;
  c11[5] = 0.04;
  c11[6] = 0.04;
  c11[7] = 0.04;
  c11[8] = 0.04;
  c11[9] = 0.04;
  c11[10] = 0.04;
  c11[11] = 0.04;
  c11[12] = 0.04;
  c11[13] = 0.077;
  c11[14] = 0.15;
  c11[15] = 0.253;
  c11[16] = 0.3;
  c11[17] = 0.3;
  c11[18] = 0.3;
  c11[19] = 0.3;
  c11[20] = 0.3;
  c11[21] = 0.3;
  k1[0] = 865.0;
  k1[1] = 865.0;
  k1[2] = 865.0;
  k1[3] = 908.0;
  k1[4] = 1054.0;
  k1[5] = 1086.0;
  k1[6] = 1032.0;
  k1[7] = 878.0;
  k1[8] = 748.0;
  k1[9] = 654.0;
  k1[10] = 587.0;
  k1[11] = 503.0;
  k1[12] = 457.0;
  k1[13] = 410.0;
  k1[14] = 400.0;
  k1[15] = 400.0;
  k1[16] = 400.0;
  k1[17] = 400.0;
  k1[18] = 400.0;
  k1[19] = 400.0;
  k1[20] = 400.0;
  k1[21] = 400.0;
  k2[0] = -1.186;
  k2[1] = -1.186;
  k2[2] = -1.219;
  k2[3] = -1.273;
  k2[4] = -1.346;
  k2[5] = -1.471;
  k2[6] = -1.624;
  k2[7] = -1.931;
  k2[8] = -2.188;
  k2[9] = -2.381;
  k2[10] = -2.518;
  k2[11] = -2.657;
  k2[12] = -2.669;
  k2[13] = -2.401;
  k2[14] = -1.955;
  k2[15] = -1.025;
  k2[16] = -0.299;
  k2[17] = 0.0;
  k2[18] = 0.0;
  k2[19] = 0.0;
  k2[20] = 0.0;
  k2[21] = 0.0;
  k3[0] = 1.839;
  k3[1] = 1.839;
  k3[2] = 1.84;
  k3[3] = 1.841;
  k3[4] = 1.843;
  k3[5] = 1.845;
  k3[6] = 1.847;
  k3[7] = 1.852;
  k3[8] = 1.856;
  k3[9] = 1.861;
  k3[10] = 1.865;
  k3[11] = 1.874;
  k3[12] = 1.883;
  k3[13] = 1.906;
  k3[14] = 1.929;
  k3[15] = 1.974;
  k3[16] = 2.019;
  k3[17] = 2.11;
  k3[18] = 2.2;
  k3[19] = 2.291;
  k3[20] = 2.517;
  k3[21] = 2.744;
  fs_1100 = (c10[0] + k2[0] * scon_n) * log(1100.0 / k1[0]);
  if ((*vpga) < k1[0]) {
    fs_vpga = c10[0] * log((*vpga) / k1[0]) + k2[0] * (log(((*pga) + scon_c * exp(scon_n * log((*vpga) / k1[0]))) / ((*pga) + scon_c)));
  } else
    fs_vpga = (c10[0] + k2[0] * scon_n) * log((*vpga) / k1[0]);
  a_1100 = (*pga) * exp(fs_1100 - fs_vpga);
  ampf_cap = -1.0;
  for (i = 0; i < nper; i++) {
    if ((*vsite) < k1[i]) {
      fsite = c10[i] * log((*vsite) / k1[i]) + k2[i] * (log((a_1100 + scon_c * exp(scon_n * log((*vsite) / k1[i]))) / (a_1100 + scon_c)));
    } else
      fsite = (c10[i] + k2[i] * scon_n) * log((*vsite) / k1[i]);
    if ((*vref) < k1[i]) {
      fs_vref = c10[i] * log((*vref) / k1[i]) + k2[i] * (log((a_1100 + scon_c * exp(scon_n * log((*vref) / k1[i]))) / (a_1100 + scon_c)));
    } else
      fs_vref = (c10[i] + k2[i] * scon_n) * log((*vref) / k1[i]);
    ampf0[i] = exp(fsite - fs_vref);
    if (1.0 / per[i] <= (*flowcap)) {
      if (ampf_cap < 0.0)
        ampf_cap = ampf0[i];
      else
        ampf0[i] = ampf_cap;
    }
  }
  j = nper - 1;
  f0 = 1.0 / per[j];
  a0 = ampf0[j];
  f1 = 1.0 / per[j];
  a1 = ampf0[j];
  dadf = 0.0;
  df = 1.0 / (n * (*dt));
  for (i = 1; i < n / 2; i++) {
    freq = i * df;
    if (freq > f1) {
      f0 = f1;
      a0 = a1;
      if (j > 0)
        j--;
      if (per[j] != 0.0)
        f1 = 1.0 / per[j];
      else
        f1 = 1000.0;
      a1 = ampf0[j];
      if (f1 != f0)
        dadf = (a1 - a0) / (f1 - f0);
      else
        dadf = 0.0;
    }
    ampv = a0 + dadf * (freq - f0);
    if (freq < *fmin)
      afac = 1.0;
    else if (freq < *fmidbot)
      afac = 1.0 + (freq - *fmin) * (ampv - 1.0) / (*fmidbot - *fmin);
    else if (freq < *fmid)
      afac = ampv;
    else if (freq < *fhigh)
      afac = ampv;
    else if (freq < *fhightop)
      afac = ampv;
    else if (freq < *fmax)
      afac = ampv + (freq - *fhightop) * (1.0 - ampv) / (*fmax - *fhightop);
    else
      afac = 1.0;
    ampf[i] = afac;
  }
}
```