user: Converte this assembly snippet into its equivalent C code:

```asm
<cb2006_ampf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x370,%rsp
  mov    %rdi,-0x2f8(%rbp)
  mov    %rsi,-0x300(%rbp)
  mov    %edx,-0x304(%rbp)
  mov    %rcx,-0x310(%rbp)
  mov    %r8,-0x318(%rbp)
  mov    %r9,-0x320(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x328(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0x330(%rbp)
  mov    0x20(%rbp),%rax
  mov    %rax,-0x338(%rbp)
  mov    0x28(%rbp),%rax
  mov    %rax,-0x340(%rbp)
  mov    0x30(%rbp),%rax
  mov    %rax,-0x348(%rbp)
  mov    0x38(%rbp),%rax
  mov    %rax,-0x350(%rbp)
  mov    0x40(%rbp),%rax
  mov    %rax,-0x358(%rbp)
  mov    0x48(%rbp),%rax
  mov    %rax,-0x360(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x16,-0x2c0(%rbp)
  movss  D748(%rip),%xmm0
  movss  %xmm0,-0x2bc(%rbp)
  movss  D488(%rip),%xmm0
  movss  %xmm0,-0x2b8(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x2a0(%rbp)
  movss  D829(%rip),%xmm0
  movss  %xmm0,-0x29c(%rbp)
  movss  D1200(%rip),%xmm0
  movss  %xmm0,-0x298(%rbp)
  movss  D774(%rip),%xmm0
  movss  %xmm0,-0x294(%rbp)
  movss  D1106(%rip),%xmm0
  movss  %xmm0,-0x290(%rbp)
  movss  D437(%rip),%xmm0
  movss  %xmm0,-0x28c(%rbp)
  movss  D323(%rip),%xmm0
  movss  %xmm0,-0x288(%rbp)
  movss  D124(%rip),%xmm0
  movss  %xmm0,-0x284(%rbp)
  movss  D3(%rip),%xmm0
  movss  %xmm0,-0x280(%rbp)
  movss  D1275(%rip),%xmm0
  movss  %xmm0,-0x27c(%rbp)
  movss  D250(%rip),%xmm0
  movss  %xmm0,-0x278(%rbp)
  movss  D1095(%rip),%xmm0
  movss  %xmm0,-0x274(%rbp)
  movss  D493(%rip),%xmm0
  movss  %xmm0,-0x270(%rbp)
  movss  D80(%rip),%xmm0
  movss  %xmm0,-0x26c(%rbp)
  movss  D1077(%rip),%xmm0
  movss  %xmm0,-0x268(%rbp)
  movss  D159(%rip),%xmm0
  movss  %xmm0,-0x264(%rbp)
  movss  D809(%rip),%xmm0
  movss  %xmm0,-0x260(%rbp)
  movss  D1395(%rip),%xmm0
  movss  %xmm0,-0x25c(%rbp)
  movss  D586(%rip),%xmm0
  movss  %xmm0,-0x258(%rbp)
  movss  D259(%rip),%xmm0
  movss  %xmm0,-0x254(%rbp)
  movss  D425(%rip),%xmm0
  movss  %xmm0,-0x250(%rbp)
  movss  D768(%rip),%xmm0
  movss  %xmm0,-0x24c(%rbp)
  movss  D505(%rip),%xmm0
  movss  %xmm0,-0x240(%rbp)
  movss  D505(%rip),%xmm0
  movss  %xmm0,-0x23c(%rbp)
  movss  D222(%rip),%xmm0
  movss  %xmm0,-0x238(%rbp)
  movss  D476(%rip),%xmm0
  movss  %xmm0,-0x234(%rbp)
  movss  D1353(%rip),%xmm0
  movss  %xmm0,-0x230(%rbp)
  movss  D964(%rip),%xmm0
  movss  %xmm0,-0x22c(%rbp)
  movss  D517(%rip),%xmm0
  movss  %xmm0,-0x228(%rbp)
  movss  D1262(%rip),%xmm0
  movss  %xmm0,-0x224(%rbp)
  movss  D1090(%rip),%xmm0
  movss  %xmm0,-0x220(%rbp)
  movss  D296(%rip),%xmm0
  movss  %xmm0,-0x21c(%rbp)
  movss  D562(%rip),%xmm0
  movss  %xmm0,-0x218(%rbp)
  movss  D935(%rip),%xmm0
  movss  %xmm0,-0x214(%rbp)
  movss  D72(%rip),%xmm0
  movss  %xmm0,-0x210(%rbp)
  movss  D1081(%rip),%xmm0
  movss  %xmm0,-0x20c(%rbp)
  movss  D942(%rip),%xmm0
  movss  %xmm0,-0x208(%rbp)
  movss  D1401(%rip),%xmm0
  movss  %xmm0,-0x204(%rbp)
  movss  D1030(%rip),%xmm0
  movss  %xmm0,-0x200(%rbp)
  movss  D629(%rip),%xmm0
  movss  %xmm0,-0x1fc(%rbp)
  movss  D629(%rip),%xmm0
  movss  %xmm0,-0x1f8(%rbp)
  movss  D629(%rip),%xmm0
  movss  %xmm0,-0x1f4(%rbp)
  movss  D629(%rip),%xmm0
  movss  %xmm0,-0x1f0(%rbp)
  movss  D629(%rip),%xmm0
  movss  %xmm0,-0x1ec(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1e0(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1dc(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1d8(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1d4(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1d0(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1cc(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1c8(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1c4(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1c0(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1bc(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1b8(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1b4(%rbp)
  movss  D949(%rip),%xmm0
  movss  %xmm0,-0x1b0(%rbp)
  movss  D1212(%rip),%xmm0
  movss  %xmm0,-0x1ac(%rbp)
  movss  D124(%rip),%xmm0
  movss  %xmm0,-0x1a8(%rbp)
  movss  D206(%rip),%xmm0
  movss  %xmm0,-0x1a4(%rbp)
  movss  D250(%rip),%xmm0
  movss  %xmm0,-0x1a0(%rbp)
  movss  D250(%rip),%xmm0
  movss  %xmm0,-0x19c(%rbp)
  movss  D250(%rip),%xmm0
  movss  %xmm0,-0x198(%rbp)
  movss  D250(%rip),%xmm0
  movss  %xmm0,-0x194(%rbp)
  movss  D250(%rip),%xmm0
  movss  %xmm0,-0x190(%rbp)
  movss  D250(%rip),%xmm0
  movss  %xmm0,-0x18c(%rbp)
  movss  D1359(%rip),%xmm0
  movss  %xmm0,-0x180(%rbp)
  movss  D1359(%rip),%xmm0
  movss  %xmm0,-0x17c(%rbp)
  movss  D1359(%rip),%xmm0
  movss  %xmm0,-0x178(%rbp)
  movss  D1088(%rip),%xmm0
  movss  %xmm0,-0x174(%rbp)
  movss  D555(%rip),%xmm0
  movss  %xmm0,-0x170(%rbp)
  movss  D62(%rip),%xmm0
  movss  %xmm0,-0x16c(%rbp)
  movss  D129(%rip),%xmm0
  movss  %xmm0,-0x168(%rbp)
  movss  D1197(%rip),%xmm0
  movss  %xmm0,-0x164(%rbp)
  movss  D715(%rip),%xmm0
  movss  %xmm0,-0x160(%rbp)
  movss  D83(%rip),%xmm0
  movss  %xmm0,-0x15c(%rbp)
  movss  D1290(%rip),%xmm0
  movss  %xmm0,-0x158(%rbp)
  movss  D714(%rip),%xmm0
  movss  %xmm0,-0x154(%rbp)
  movss  D1055(%rip),%xmm0
  movss  %xmm0,-0x150(%rbp)
  movss  D187(%rip),%xmm0
  movss  %xmm0,-0x14c(%rbp)
  movss  D1215(%rip),%xmm0
  movss  %xmm0,-0x148(%rbp)
  movss  D1215(%rip),%xmm0
  movss  %xmm0,-0x144(%rbp)
  movss  D1215(%rip),%xmm0
  movss  %xmm0,-0x140(%rbp)
  movss  D1215(%rip),%xmm0
  movss  %xmm0,-0x13c(%rbp)
  movss  D1215(%rip),%xmm0
  movss  %xmm0,-0x138(%rbp)
  movss  D1215(%rip),%xmm0
  movss  %xmm0,-0x134(%rbp)
  movss  D1215(%rip),%xmm0
  movss  %xmm0,-0x130(%rbp)
  movss  D1215(%rip),%xmm0
  movss  %xmm0,-0x12c(%rbp)
  movss  D95(%rip),%xmm0
  movss  %xmm0,-0x120(%rbp)
  movss  D95(%rip),%xmm0
  movss  %xmm0,-0x11c(%rbp)
  movss  D91(%rip),%xmm0
  movss  %xmm0,-0x118(%rbp)
  movss  D1226(%rip),%xmm0
  movss  %xmm0,-0x114(%rbp)
  movss  D191(%rip),%xmm0
  movss  %xmm0,-0x110(%rbp)
  movss  D904(%rip),%xmm0
  movss  %xmm0,-0x10c(%rbp)
  movss  D1381(%rip),%xmm0
  movss  %xmm0,-0x108(%rbp)
  movss  D438(%rip),%xmm0
  movss  %xmm0,-0x104(%rbp)
  movss  D79(%rip),%xmm0
  movss  %xmm0,-0x100(%rbp)
  movss  D145(%rip),%xmm0
  movss  %xmm0,-0xfc(%rbp)
  movss  D665(%rip),%xmm0
  movss  %xmm0,-0xf8(%rbp)
  movss  D339(%rip),%xmm0
  movss  %xmm0,-0xf4(%rbp)
  movss  D293(%rip),%xmm0
  movss  %xmm0,-0xf0(%rbp)
  movss  D299(%rip),%xmm0
  movss  %xmm0,-0xec(%rbp)
  movss  D762(%rip),%xmm0
  movss  %xmm0,-0xe8(%rbp)
  movss  D518(%rip),%xmm0
  movss  %xmm0,-0xe4(%rbp)
  movss  D722(%rip),%xmm0
  movss  %xmm0,-0xe0(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xdc(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xd8(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xd4(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xd0(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xcc(%rbp)
  movss  D966(%rip),%xmm0
  movss  %xmm0,-0xc0(%rbp)
  movss  D966(%rip),%xmm0
  movss  %xmm0,-0xbc(%rbp)
  movss  D1020(%rip),%xmm0
  movss  %xmm0,-0xb8(%rbp)
  movss  D557(%rip),%xmm0
  movss  %xmm0,-0xb4(%rbp)
  movss  D475(%rip),%xmm0
  movss  %xmm0,-0xb0(%rbp)
  movss  D749(%rip),%xmm0
  movss  %xmm0,-0xac(%rbp)
  movss  D1191(%rip),%xmm0
  movss  %xmm0,-0xa8(%rbp)
  movss  D185(%rip),%xmm0
  movss  %xmm0,-0xa4(%rbp)
  movss  D550(%rip),%xmm0
  movss  %xmm0,-0xa0(%rbp)
  movss  D114(%rip),%xmm0
  movss  %xmm0,-0x9c(%rbp)
  movss  D336(%rip),%xmm0
  movss  %xmm0,-0x98(%rbp)
  movss  D306(%rip),%xmm0
  movss  %xmm0,-0x94(%rbp)
  movss  D447(%rip),%xmm0
  movss  %xmm0,-0x90(%rbp)
  movss  D1(%rip),%xmm0
  movss  %xmm0,-0x8c(%rbp)
  movss  D1132(%rip),%xmm0
  movss  %xmm0,-0x88(%rbp)
  movss  D1051(%rip),%xmm0
  movss  %xmm0,-0x84(%rbp)
  movss  D895(%rip),%xmm0
  movss  %xmm0,-0x80(%rbp)
  movss  D11(%rip),%xmm0
  movss  %xmm0,-0x7c(%rbp)
  movss  D1284(%rip),%xmm0
  movss  %xmm0,-0x78(%rbp)
  movss  D1306(%rip),%xmm0
  movss  %xmm0,-0x74(%rbp)
  movss  D706(%rip),%xmm0
  movss  %xmm0,-0x70(%rbp)
  movss  D603(%rip),%xmm0
  movss  %xmm0,-0x6c(%rbp)
  movss  -0x240(%rbp),%xmm1
  movss  -0x120(%rbp),%xmm0
  mulss  -0x2b8(%rbp),%xmm0
  addss  %xmm0,%xmm1
  movss  %xmm1,-0x308(%rbp)
  movss  -0x180(%rbp),%xmm1
  movss  D726(%rip),%xmm0
  divss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x2b4(%rbp)
  mov    -0x320(%rbp),%rax
  movss  (%rax),%xmm1
  movss  -0x180(%rbp),%xmm0
  comiss %xmm1,%xmm0
  jbe    L325
  movss  -0x240(%rbp),%xmm4
  movss  %xmm4,-0x308(%rbp)
  mov    -0x320(%rbp),%rax
  movss  (%rax),%xmm0
  movss  -0x180(%rbp),%xmm1
  divss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x308(%rbp)
  movss  -0x120(%rbp),%xmm6
  movss  %xmm6,-0x364(%rbp)
  mov    -0x328(%rbp),%rax
  movss  (%rax),%xmm7
  movss  %xmm7,-0x368(%rbp)
  mov    -0x320(%rbp),%rax
  movss  (%rax),%xmm0
  movss  -0x180(%rbp),%xmm1
  movaps %xmm0,%xmm5
  divss  %xmm1,%xmm5
  movd   %xmm5,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm6
  mulss  -0x2b8(%rbp),%xmm6
  movd   %xmm6,%eax
  movd   %eax,%xmm0
  call   <exp@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm7
  mulss  -0x2bc(%rbp),%xmm7
  movaps %xmm7,%xmm0
  addss  -0x368(%rbp),%xmm0
  mov    -0x328(%rbp),%rax
  movss  (%rax),%xmm1
  addss  -0x2bc(%rbp),%xmm1
  movaps %xmm0,%xmm5
  divss  %xmm1,%xmm5
  movd   %xmm5,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x364(%rbp),%xmm0
  addss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x2f0(%rbp)
  jmp    L333
L325:
  movss  -0x240(%rbp),%xmm1
  movss  -0x120(%rbp),%xmm0
  mulss  -0x2b8(%rbp),%xmm0
  addss  %xmm0,%xmm1
  movss  %xmm1,-0x308(%rbp)
  mov    -0x320(%rbp),%rax
  movss  (%rax),%xmm0
  movss  -0x180(%rbp),%xmm1
  divss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x2f0(%rbp)
L333:
  mov    -0x328(%rbp),%rax
  movss  (%rax),%xmm2
  movss  %xmm2,-0x308(%rbp)
  movss  -0x2b4(%rbp),%xmm0
  subss  -0x2f0(%rbp),%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <exp@plt>
  mulss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x2b0(%rbp)
  movss  D1085(%rip),%xmm0
  movss  %xmm0,-0x2cc(%rbp)
  movl   $0x0,-0x2c8(%rbp)
  jmp    L225
L114:
  mov    -0x318(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x180(%rbp,%rax,4),%xmm0
  comiss %xmm1,%xmm0
  jbe    L328
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x240(%rbp,%rax,4),%xmm3
  movss  %xmm3,-0x308(%rbp)
  mov    -0x318(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x180(%rbp,%rax,4),%xmm1
  divss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x308(%rbp)
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x120(%rbp,%rax,4),%xmm5
  movss  %xmm5,-0x364(%rbp)
  mov    -0x318(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x180(%rbp,%rax,4),%xmm1
  movaps %xmm0,%xmm6
  divss  %xmm1,%xmm6
  movd   %xmm6,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm7
  mulss  -0x2b8(%rbp),%xmm7
  movd   %xmm7,%eax
  movd   %eax,%xmm0
  call   <exp@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm3
  mulss  -0x2bc(%rbp),%xmm3
  movaps %xmm3,%xmm0
  addss  -0x2b0(%rbp),%xmm0
  movss  -0x2b0(%rbp),%xmm1
  addss  -0x2bc(%rbp),%xmm1
  movaps %xmm0,%xmm5
  divss  %xmm1,%xmm5
  movd   %xmm5,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x364(%rbp),%xmm0
  addss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x2e8(%rbp)
  jmp    L89
L328:
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x240(%rbp,%rax,4),%xmm1
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x120(%rbp,%rax,4),%xmm0
  mulss  -0x2b8(%rbp),%xmm0
  addss  %xmm0,%xmm1
  movss  %xmm1,-0x308(%rbp)
  mov    -0x318(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x180(%rbp,%rax,4),%xmm1
  divss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x2e8(%rbp)
L89:
  mov    -0x310(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x180(%rbp,%rax,4),%xmm0
  comiss %xmm1,%xmm0
  jbe    L338
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x240(%rbp,%rax,4),%xmm4
  movss  %xmm4,-0x308(%rbp)
  mov    -0x310(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x180(%rbp,%rax,4),%xmm1
  divss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x308(%rbp)
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x120(%rbp,%rax,4),%xmm6
  movss  %xmm6,-0x364(%rbp)
  mov    -0x310(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x180(%rbp,%rax,4),%xmm1
  movaps %xmm0,%xmm6
  divss  %xmm1,%xmm6
  movd   %xmm6,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm7
  mulss  -0x2b8(%rbp),%xmm7
  movd   %xmm7,%eax
  movd   %eax,%xmm0
  call   <exp@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm3
  mulss  -0x2bc(%rbp),%xmm3
  movaps %xmm3,%xmm0
  addss  -0x2b0(%rbp),%xmm0
  movss  -0x2b0(%rbp),%xmm1
  addss  -0x2bc(%rbp),%xmm1
  movaps %xmm0,%xmm5
  divss  %xmm1,%xmm5
  movd   %xmm5,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x364(%rbp),%xmm0
  addss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x2ec(%rbp)
  jmp    L320
L338:
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x240(%rbp,%rax,4),%xmm1
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x120(%rbp,%rax,4),%xmm0
  mulss  -0x2b8(%rbp),%xmm0
  addss  %xmm0,%xmm1
  movss  %xmm1,-0x308(%rbp)
  mov    -0x310(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x180(%rbp,%rax,4),%xmm1
  divss  %xmm1,%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <log@plt>
  mulss  -0x308(%rbp),%xmm0
  movss  %xmm0,-0x2ec(%rbp)
L320:
  movss  -0x2e8(%rbp),%xmm0
  subss  -0x2ec(%rbp),%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <exp@plt>
  movd   %xmm0,%eax
  mov    -0x2c8(%rbp),%edx
  movslq %edx,%rdx
  mov    %eax,-0x60(%rbp,%rdx,4)
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x2a0(%rbp,%rax,4),%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  movsd  D1094(%rip),%xmm0
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  mov    -0x360(%rbp),%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jb     L237
  pxor   %xmm0,%xmm0
  comiss -0x2cc(%rbp),%xmm0
  jbe    L12
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x60(%rbp,%rax,4),%xmm0
  movss  %xmm0,-0x2cc(%rbp)
  jmp    L237
L12:
  mov    -0x2c8(%rbp),%eax
  cltq
  movss  -0x2cc(%rbp),%xmm0
  movss  %xmm0,-0x60(%rbp,%rax,4)
L237:
  addl   $0x1,-0x2c8(%rbp)
L225:
  mov    -0x2c8(%rbp),%eax
  cmp    -0x2c0(%rbp),%eax
  jl     L114
  mov    -0x2c0(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x2c4(%rbp)
  mov    -0x2c4(%rbp),%eax
  cltq
  movss  -0x2a0(%rbp,%rax,4),%xmm1
  movss  D1077(%rip),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x2e0(%rbp)
  mov    -0x2c4(%rbp),%eax
  cltq
  movss  -0x60(%rbp,%rax,4),%xmm0
  movss  %xmm0,-0x2d8(%rbp)
  mov    -0x2c4(%rbp),%eax
  cltq
  movss  -0x2a0(%rbp,%rax,4),%xmm1
  movss  D1077(%rip),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x2dc(%rbp)
  mov    -0x2c4(%rbp),%eax
  cltq
  movss  -0x60(%rbp,%rax,4),%xmm0
  movss  %xmm0,-0x2d4(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x2d0(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x304(%rbp),%xmm1
  mov    -0x300(%rbp),%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm1
  movss  D1077(%rip),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x2ac(%rbp)
  movl   $0x1,-0x2c8(%rbp)
  jmp    L84
L58:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x2c8(%rbp),%xmm0
  movss  -0x2ac(%rbp),%xmm1
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x2a8(%rbp)
  movss  -0x2a8(%rbp),%xmm0
  comiss -0x2dc(%rbp),%xmm0
  jbe    L93
  movss  -0x2dc(%rbp),%xmm0
  movss  %xmm0,-0x2e0(%rbp)
  movss  -0x2d4(%rbp),%xmm0
  movss  %xmm0,-0x2d8(%rbp)
  cmpl   $0x0,-0x2c4(%rbp)
  jle    L117
  subl   $0x1,-0x2c4(%rbp)
L117:
  mov    -0x2c4(%rbp),%eax
  cltq
  movss  -0x2a0(%rbp,%rax,4),%xmm0
  pxor   %xmm1,%xmm1
  ucomiss %xmm1,%xmm0
  jp     L274
  pxor   %xmm1,%xmm1
  ucomiss %xmm1,%xmm0
  je     L9
L274:
  mov    -0x2c4(%rbp),%eax
  cltq
  movss  -0x2a0(%rbp,%rax,4),%xmm1
  movss  D1077(%rip),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x2dc(%rbp)
  jmp    L79
L9:
  movss  D1216(%rip),%xmm0
  movss  %xmm0,-0x2dc(%rbp)
L79:
  mov    -0x2c4(%rbp),%eax
  cltq
  movss  -0x60(%rbp,%rax,4),%xmm0
  movss  %xmm0,-0x2d4(%rbp)
  movss  -0x2dc(%rbp),%xmm0
  ucomiss -0x2e0(%rbp),%xmm0
  jp     L216
  movss  -0x2dc(%rbp),%xmm0
  ucomiss -0x2e0(%rbp),%xmm0
  je     L298
L216:
  movss  -0x2d4(%rbp),%xmm0
  subss  -0x2d8(%rbp),%xmm0
  movss  -0x2dc(%rbp),%xmm1
  subss  -0x2e0(%rbp),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x2d0(%rbp)
  jmp    L93
L298:
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x2d0(%rbp)
L93:
  movss  -0x2a8(%rbp),%xmm0
  subss  -0x2e0(%rbp),%xmm0
  mulss  -0x2d0(%rbp),%xmm0
  movss  -0x2d8(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x2a4(%rbp)
  mov    -0x330(%rbp),%rax
  movss  (%rax),%xmm0
  comiss -0x2a8(%rbp),%xmm0
  jbe    L230
  movss  D1077(%rip),%xmm0
  movss  %xmm0,-0x2e4(%rbp)
  jmp    L285
L230:
  mov    -0x338(%rbp),%rax
  movss  (%rax),%xmm0
  comiss -0x2a8(%rbp),%xmm0
  jbe    L20
  mov    -0x330(%rbp),%rax
  movss  (%rax),%xmm1
  movss  -0x2a8(%rbp),%xmm0
  subss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtss2sd -0x2a4(%rbp),%xmm0
  movsd  D1094(%rip),%xmm2
  subsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x338(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x330(%rbp),%rax
  movss  (%rax),%xmm2
  subss  %xmm2,%xmm1
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D1094(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x2e4(%rbp)
  jmp    L285
L20:
  mov    -0x340(%rbp),%rax
  movss  (%rax),%xmm0
  comiss -0x2a8(%rbp),%xmm0
  jbe    L50
  movss  -0x2a4(%rbp),%xmm0
  movss  %xmm0,-0x2e4(%rbp)
  jmp    L285
L50:
  mov    -0x348(%rbp),%rax
  movss  (%rax),%xmm0
  comiss -0x2a8(%rbp),%xmm0
  jbe    L304
  movss  -0x2a4(%rbp),%xmm0
  movss  %xmm0,-0x2e4(%rbp)
  jmp    L285
L304:
  mov    -0x350(%rbp),%rax
  movss  (%rax),%xmm0
  comiss -0x2a8(%rbp),%xmm0
  jbe    L337
  movss  -0x2a4(%rbp),%xmm0
  movss  %xmm0,-0x2e4(%rbp)
  jmp    L285
L337:
  mov    -0x358(%rbp),%rax
  movss  (%rax),%xmm0
  comiss -0x2a8(%rbp),%xmm0
  jbe    L166
  pxor   %xmm2,%xmm2
  cvtss2sd -0x2a4(%rbp),%xmm2
  mov    -0x350(%rbp),%rax
  movss  (%rax),%xmm1
  movss  -0x2a8(%rbp),%xmm0
  subss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  pxor   %xmm3,%xmm3
  cvtss2sd -0x2a4(%rbp),%xmm3
  movsd  D1094(%rip),%xmm0
  subsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x358(%rbp),%rax
  movss  (%rax),%xmm1
  mov    -0x350(%rbp),%rax
  movss  (%rax),%xmm3
  subss  %xmm3,%xmm1
  cvtss2sd %xmm1,%xmm1
  divsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x2e4(%rbp)
  jmp    L285
L166:
  movss  D1077(%rip),%xmm0
  movss  %xmm0,-0x2e4(%rbp)
L285:
  mov    -0x2c8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x2f8(%rbp),%rax
  add    %rdx,%rax
  movss  -0x2e4(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x2c8(%rbp)
L84:
  mov    -0x304(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x2c8(%rbp)
  jl     L58
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L45
  call   <__stack_chk_fail@plt>
L45:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D748
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D488
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D829
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1200
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D774
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1106
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D437
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D323
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D124
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D3
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1275
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D250
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1095
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D493
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D80
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1077
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D159
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D809
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1395
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D586
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D259
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D425
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D768
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D505
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D222
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D476
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1353
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D964
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D517
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1262
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1090
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D296
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D562
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D935
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D72
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1081
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D942
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1401
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1030
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D629
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D949
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1212
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D206
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1359
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1088
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D555
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D62
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D129
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1197
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D715
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D83
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1290
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D714
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1055
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D187
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1215
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D95
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D91
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D1226
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D191
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D904
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D1381
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D438
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D79
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D145
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D665
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D339
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D293
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D299
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D762
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D518
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D722
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D966
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1020
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D557
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D475
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D749
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1191
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D185
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D550
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D114
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D336
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D306
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D447
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1132
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1051
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D895
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D11
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1284
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1306
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D706
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D603
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D726
type_infered: f32
name: extract_symbolic_data
arguments: data_tag: D1085
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_tag: D1094
type_infered: f32[2]
name: extract_symbolic_data
arguments: data_tag: D1216
type_infered: f32

tool: D748: 1.88

tool: D488: 1.18

tool: D829: 0.01

tool: D1200: 0.02

tool: D774: 0.03

tool: D1106: 0.05

tool: D437: 0.075

tool: D323: 0.1

tool: D124: 0.15

tool: D3: 0.2

tool: D1275: 0.25

tool: D250: 0.3

tool: D1095: 0.4

tool: D493: 0.5

tool: D80: 0.75

tool: D1077: 1

tool: D159: 1.5

tool: D809: 2

tool: D1395: 3

tool: D586: 4

tool: D259: 5

tool: D425: 7.5

tool: D768: 10

tool: D505: 1.058

tool: D222: 1.102

tool: D476: 1.174

tool: D1353: 1.272

tool: D964: 1.438

tool: D517: 1.604

tool: D1262: 1.928

tool: D1090: 2.194

tool: D296: 2.351

tool: D562: 2.46

tool: D935: 2.587

tool: D72: 2.544

tool: D1081: 2.133

tool: D942: 1.571

tool: D1401: 0.406

tool: {"D1030": [0xd5,0x78,0xe9,0xbe]}

tool: {"D629": [0x85,0xeb,0x51,0xbf]}

tool: D949: 0.04

tool: D1212: 0.077

tool: D206: 0.253

tool: D1359: 865

tool: D1088: 908

tool: D555: 1054

tool: D62: 1086

tool: D129: 1032

tool: D1197: 878

tool: D715: 748

tool: D83: 654

tool: D1290: 587

tool: D714: 503

tool: D1055: 457

tool: D187: 410

tool: D1215: 400

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

tool: {"D91": [0x31,0x08,0x9c,0xbf]}

tool: {"D1226": [0xaa,0xf1,0xa2,0xbf]}

tool: {"D191": [0xba,0x49,0xac,0xbf]}

tool: {"D904": [0xba,0x49,0xbc,0xbf]}

tool: {"D1381": [0x3b,0xdf,0xcf,0xbf]}

tool: {"D438": [0x02,0x2b,0xf7,0xbf]}

tool: {"D79": [0x31,0x08,0x0c,0xc0]}

tool: {"D145": [0x4e,0x62,0x18,0xc0]}

tool: {"D665": [0xe9,0x26,0x21,0xc0]}

tool: {"D339": [0x4a,0x0c,0x2a,0xc0]}

tool: {"D293": [0xe5,0xd0,0x2a,0xc0]}

tool: {"D299": [0xfc,0xa9,0x19,0xc0]}

tool: {"D762": [0x71,0x3d,0xfa,0xbf]}

tool: {"D518": [0x33,0x33,0x83,0xbf]}

tool: {"D722": [0x87,0x16,0x99,0xbe]}

tool: D966: 1.839

tool: D1020: 1.84

tool: D557: 1.841

tool: D475: 1.843

tool: D749: 1.845

tool: D1191: 1.847

tool: D185: 1.852

tool: D550: 1.856

tool: D114: 1.861

tool: D336: 1.865

tool: D306: 1.874

tool: D447: 1.883

tool: D1: 1.906

tool: D1132: 1.929

tool: D1051: 1.974

tool: D895: 2.019

tool: D11: 2.11

tool: D1284: 2.2

tool: D1306: 2.291

tool: D706: 2.517

tool: D603: 2.744

tool: D726: 1100

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

tool: {"D1094": [0.0,1.875]}

tool: D1216: 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;
  }
}
```