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

```asm
<gen_ucsb_stf>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rsi,%r13
  mov    %ecx,%esi
  push   %r12
  mov    %rdi,%r12
  mov    %rdx,%rdi
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x28,%rsp
  call   <zapit@plt>
  movss  0x0(%r13),%xmm7
  movss  (%rbx),%xmm1
  movaps %xmm7,%xmm0
  movss  %xmm7,(%rsp)
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  D78(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  cmp    %ebp,%eax
  cmovle %eax,%ebp
  test   %ebp,%ebp
  jle    L215
  pxor   %xmm2,%xmm2
  lea    -0x1(%rbp),%eax
  mov    %ebp,%r13d
  xor    %r15d,%r15d
  cvtss2sd (%rsp),%xmm2
  mulsd  D22(%rip),%xmm2
  mov    %eax,0x1c(%rsp)
  mov    %ebp,%ebp
  cvtsd2ss %xmm2,%xmm2
  subss  %xmm2,%xmm7
  movss  %xmm7,0x18(%rsp)
  movaps %xmm2,%xmm7
  addss  %xmm2,%xmm7
  movss  %xmm7,0x4(%rsp)
  jmp    L148
  nopw   0x0(%rax,%rax,1)
L88:
  movss  0x4(%rsp),%xmm5
  comiss %xmm0,%xmm5
  ja     L170
  movss  (%rsp),%xmm6
  pxor   %xmm1,%xmm1
  comiss %xmm0,%xmm6
  ja     L214
L149:
  movss  %xmm1,(%r14,%r15,4)
  add    $0x1,%r15
  cmp    %r15,%rbp
  je     L241
L65:
  movss  (%rbx),%xmm1
L148:
  pxor   %xmm0,%xmm0
  cvtsi2ss %r15d,%xmm0
  mulss  %xmm1,%xmm0
  comiss %xmm0,%xmm2
  jbe    L88
  mulss  D94(%rip),%xmm0
  movss  %xmm2,0x14(%rsp)
  movaps %xmm0,%xmm1
  divss  %xmm2,%xmm1
  movaps %xmm1,%xmm0
  movss  %xmm1,0x10(%rsp)
  call   <cos@plt>
  movss  0x10(%rsp),%xmm1
  mulss  D72(%rip),%xmm1
  movsd  %xmm0,0x8(%rsp)
  movaps %xmm1,%xmm0
  call   <sin@plt>
  movsd  D95(%rip),%xmm1
  movsd  0x8(%rsp),%xmm3
  movapd %xmm0,%xmm4
  movss  0x14(%rsp),%xmm2
  mulsd  %xmm1,%xmm3
  mulsd  D75(%rip),%xmm4
  subsd  %xmm3,%xmm1
  addsd  %xmm4,%xmm1
  cvtsd2ss %xmm1,%xmm1
  movss  %xmm1,(%r14,%r15,4)
  add    $0x1,%r15
  cmp    %r15,%rbp
  jne    L65
L241:
  cmpl   $0x2,0x1c(%rsp)
  movss  (%rbx),%xmm4
  jbe    L159
  mov    %r13d,%ecx
  lea    0x10(%r14),%rsi
  movaps %xmm4,%xmm3
  mov    %r14,%rdx
  shr    $0x2,%ecx
  pxor   %xmm1,%xmm1
  shufps $0x0,%xmm3,%xmm3
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  add    %rsi,%rcx
  nopl   (%rax)
L47:
  movups (%rdx),%xmm0
  add    $0x10,%rdx
  mulps  %xmm3,%xmm0
  addss  %xmm0,%xmm1
  movaps %xmm0,%xmm2
  shufps $0x55,%xmm0,%xmm2
  addss  %xmm2,%xmm1
  movaps %xmm0,%xmm2
  unpckhps %xmm0,%xmm2
  shufps $0xff,%xmm0,%xmm0
  addss  %xmm2,%xmm1
  addss  %xmm0,%xmm1
  cmp    %rdx,%rcx
  jne    L47
  mov    %r13d,%edx
  and    $0xfffffffc,%edx
  cmp    %edx,%r13d
  je     L99
L224:
  movslq %edx,%rcx
  movss  (%r14,%rcx,4),%xmm0
  lea    0x0(,%rcx,4),%rsi
  lea    0x1(%rdx),%ecx
  mulss  %xmm4,%xmm0
  addss  %xmm0,%xmm1
  cmp    %r13d,%ecx
  jge    L199
  movss  0x4(%r14,%rsi,1),%xmm0
  add    $0x2,%edx
  mulss  %xmm4,%xmm0
  addss  %xmm0,%xmm1
  cmp    %edx,%r13d
  jle    L199
  mulss  0x8(%r14,%rsi,1),%xmm4
  addss  %xmm4,%xmm1
L199:
  pxor   %xmm5,%xmm5
  comiss %xmm1,%xmm5
  jae    L215
  movss  (%r12),%xmm2
  cmpl   $0x2,0x1c(%rsp)
  divss  %xmm1,%xmm2
  jbe    L63
  lea    0x10(%r14),%rsi
L94:
  mov    %r13d,%ecx
  movaps %xmm2,%xmm1
  mov    %r14,%rdx
  shr    $0x2,%ecx
  shufps $0x0,%xmm1,%xmm1
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  add    %rsi,%rcx
  nopw   0x0(%rax,%rax,1)
L38:
  movups (%rdx),%xmm0
  add    $0x10,%rdx
  mulps  %xmm1,%xmm0
  movups %xmm0,-0x10(%rdx)
  cmp    %rcx,%rdx
  jne    L38
  mov    %r13d,%ecx
  and    $0xfffffffc,%ecx
  mov    %ecx,%edx
  cmp    %r13d,%ecx
  je     L184
L67:
  mov    %r13d,%esi
  sub    %ecx,%esi
  cmp    $0x1,%esi
  je     L179
  lea    (%r14,%rcx,4),%rcx
  movaps %xmm2,%xmm1
  movq   (%rcx),%xmm0
  shufps $0xe0,%xmm1,%xmm1
  mulps  %xmm1,%xmm0
  movlps %xmm0,(%rcx)
  mov    %esi,%ecx
  and    $0xfffffffe,%ecx
  add    %ecx,%edx
  cmp    %ecx,%esi
  je     L184
L179:
  movslq %edx,%rdx
  lea    (%r14,%rdx,4),%rdx
  mulss  (%rdx),%xmm2
  movss  %xmm2,(%rdx)
  jmp    L184
  xchg   %ax,%ax
L170:
  movaps %xmm0,%xmm3
  movss  %xmm2,0x10(%rsp)
  mulss  D94(%rip),%xmm0
  subss  %xmm2,%xmm3
  mulss  D94(%rip),%xmm3
  divss  0x18(%rsp),%xmm3
  movss  %xmm3,0x14(%rsp)
  divss  %xmm2,%xmm0
  call   <cos@plt>
  movss  0x14(%rsp),%xmm3
  movsd  %xmm0,0x8(%rsp)
  movaps %xmm3,%xmm0
  call   <cos@plt>
  movsd  0x8(%rsp),%xmm1
  movss  0x10(%rsp),%xmm2
  movapd %xmm0,%xmm3
  movsd  D95(%rip),%xmm0
  mulsd  D105(%rip),%xmm3
  mulsd  %xmm1,%xmm0
  movsd  D19(%rip),%xmm1
  subsd  %xmm0,%xmm1
  addsd  %xmm3,%xmm1
  cvtsd2ss %xmm1,%xmm1
  jmp    L149
  nopl   0x0(%rax,%rax,1)
L214:
  subss  %xmm2,%xmm0
  mulss  D94(%rip),%xmm0
  movss  %xmm2,0x8(%rsp)
  divss  0x18(%rsp),%xmm0
  call   <cos@plt>
  pxor   %xmm1,%xmm1
  movss  0x8(%rsp),%xmm2
  mulsd  D105(%rip),%xmm0
  addsd  D105(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm1
  jmp    L149
  nopl   0x0(%rax,%rax,1)
L215:
  xor    %r13d,%r13d
L184:
  add    $0x28,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L99:
  pxor   %xmm5,%xmm5
  comiss %xmm1,%xmm5
  jae    L215
  movss  (%r12),%xmm2
  divss  %xmm1,%xmm2
  jmp    L94
L159:
  pxor   %xmm1,%xmm1
  xor    %edx,%edx
  jmp    L224
L63:
  xor    %ecx,%ecx
  xor    %edx,%edx
  jmp    L67
```

tool_calls: name: read_data
arguments: label: D78
datatype: f64
name: read_data
arguments: label: D22
datatype: f64
name: read_data
arguments: label: D94
datatype: f32
name: read_data
arguments: label: D72
datatype: byte[4]
name: read_data
arguments: label: D95
datatype: f64
name: read_data
arguments: label: D75
datatype: f64
name: read_data
arguments: label: D105
datatype: f64
name: read_data
arguments: label: D19
datatype: f64

tool: D78: 0.5

tool: D22: 0.13

tool: D94: 3.141592654

tool: {"D72": [0x00,0x00,0x00,0x3f]}

tool: D95: 0.7

tool: D75: 0.6

tool: D105: 0.3

tool: D19: 1

assistant: ```c
int gen_ucsb_stf(float *slip, float *t0, float *stf, int nt, float *dt, float *z0) {
  int it, nstf;
  float tau, tau1, tau2, tau1x2, arg1, arg2;
  float sum, t, alpha;
  float pi = 3.141592654;
  zapit(stf, nt);
  tau = (*t0);
  tau1 = 0.13 * tau;
  tau2 = tau - tau1;
  tau1x2 = 2.0 * tau1;
  nstf = (int)((tau) / (*dt) + 0.5);
  if (nstf > nt)
    nstf = nt;
  if (nstf == 0)
    return (0);
  for (it = 0; it < nstf; it++) {
    t = it * (*dt);
    alpha = 0.0;
    if (t < tau1) {
      arg1 = pi * t / tau1;
      arg2 = 0.5 * arg1;
      alpha = 0.7 - 0.7 * cos(arg1) + 0.6 * sin(arg2);
    } else if (t < tau1x2) {
      arg1 = pi * t / tau1;
      arg2 = pi * (t - tau1) / tau2;
      alpha = 1.0 - 0.7 * cos(arg1) + 0.3 * cos(arg2);
    } else if (t < tau) {
      arg1 = pi * (t - tau1) / tau2;
      alpha = 0.3 + 0.3 * cos(arg1);
    }
    stf[it] = alpha;
  }
  sum = 0.0;
  for (it = 0; it < nstf; it++)
    sum = sum + (*dt) * stf[it];
  if (sum <= 0.0)
    return (0);
  sum = (*slip) / sum;
  for (it = 0; it < nstf; it++)
    stf[it] = stf[it] * sum;
  return (nstf);
}
```