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

```asm
<gen_ucsb_stf>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  mov    %rdx,%rdi
  push   %r13
  mov    %ecx,%r13d
  push   %r12
  mov    %rsi,%r12
  mov    %ecx,%esi
  push   %rbp
  mov    %r8,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x38,%rsp
  call   <zapit@plt>
  movss  (%r12),%xmm7
  movss  0x0(%rbp),%xmm1
  movaps %xmm7,%xmm0
  movss  %xmm7,0xc(%rsp)
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  D28(%rip),%xmm0
  cvttsd2si %xmm0,%r12d
  cmp    %r13d,%r12d
  cmovg  %r13d,%r12d
  test   %r12d,%r12d
  jle    L42
  pxor   %xmm2,%xmm2
  movss  0xc(%rsp),%xmm7
  mov    %r12d,%r13d
  xor    %r15d,%r15d
  cvtss2sd 0xc(%rsp),%xmm2
  mulsd  D79(%rip),%xmm2
  lea    -0x1(%r12),%eax
  mov    %rax,0x28(%rsp)
  cvtsd2ss %xmm2,%xmm2
  subss  %xmm2,%xmm7
  movss  %xmm7,0x24(%rsp)
  movaps %xmm2,%xmm7
  addss  %xmm2,%xmm7
  movss  %xmm7,0x18(%rsp)
  jmp    L22
  nopl   0x0(%rax)
L54:
  movss  0x18(%rsp),%xmm5
  comiss %xmm0,%xmm5
  ja     L66
  movss  0xc(%rsp),%xmm6
  pxor   %xmm1,%xmm1
  comiss %xmm0,%xmm6
  ja     L110
L124:
  movss  %xmm1,(%rbx,%r15,4)
  add    $0x1,%r15
  cmp    %r13,%r15
  je     L109
L96:
  movss  0x0(%rbp),%xmm1
L22:
  pxor   %xmm0,%xmm0
  cvtsi2ss %r15d,%xmm0
  mulss  %xmm1,%xmm0
  comiss %xmm0,%xmm2
  jbe    L54
  mulss  D106(%rip),%xmm0
  movss  %xmm2,0x20(%rsp)
  movaps %xmm0,%xmm1
  divss  %xmm2,%xmm1
  movaps %xmm1,%xmm0
  movss  %xmm1,0x1c(%rsp)
  call   <cos@plt>
  movss  0x1c(%rsp),%xmm1
  mulss  D87(%rip),%xmm1
  movsd  %xmm0,0x10(%rsp)
  movaps %xmm1,%xmm0
  call   <sin@plt>
  movsd  D11(%rip),%xmm1
  movsd  0x10(%rsp),%xmm3
  movapd %xmm0,%xmm4
  movss  0x20(%rsp),%xmm2
  mulsd  %xmm1,%xmm3
  mulsd  D85(%rip),%xmm4
  subsd  %xmm3,%xmm1
  addsd  %xmm4,%xmm1
  cvtsd2ss %xmm1,%xmm1
  movss  %xmm1,(%rbx,%r15,4)
  add    $0x1,%r15
  cmp    %r13,%r15
  jne    L96
L109:
  mov    0x28(%rsp),%rax
  movss  0x0(%rbp),%xmm2
  pxor   %xmm0,%xmm0
  lea    0x4(%rbx,%rax,4),%rdx
  mov    %rbx,%rax
  nopl   0x0(%rax)
L30:
  movss  (%rax),%xmm1
  add    $0x4,%rax
  mulss  %xmm2,%xmm1
  addss  %xmm1,%xmm0
  cmp    %rdx,%rax
  jne    L30
  pxor   %xmm5,%xmm5
  comiss %xmm0,%xmm5
  jae    L42
  movss  (%r14),%xmm1
  divss  %xmm0,%xmm1
  nopl   0x0(%rax,%rax,1)
L101:
  movss  (%rbx),%xmm0
  add    $0x4,%rbx
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rbx)
  cmp    %rdx,%rbx
  jne    L101
  jmp    L82
  nopl   0x0(%rax,%rax,1)
L66:
  movaps %xmm0,%xmm3
  movss  %xmm2,0x1c(%rsp)
  mulss  D106(%rip),%xmm0
  subss  %xmm2,%xmm3
  mulss  D106(%rip),%xmm3
  divss  0x24(%rsp),%xmm3
  movss  %xmm3,0x20(%rsp)
  divss  %xmm2,%xmm0
  call   <cos@plt>
  movss  0x20(%rsp),%xmm3
  movsd  %xmm0,0x10(%rsp)
  movaps %xmm3,%xmm0
  call   <cos@plt>
  movsd  0x10(%rsp),%xmm1
  movss  0x1c(%rsp),%xmm2
  movapd %xmm0,%xmm3
  movsd  D11(%rip),%xmm0
  mulsd  D127(%rip),%xmm3
  mulsd  %xmm1,%xmm0
  movsd  D125(%rip),%xmm1
  subsd  %xmm0,%xmm1
  addsd  %xmm3,%xmm1
  cvtsd2ss %xmm1,%xmm1
  jmp    L124
  nopl   0x0(%rax,%rax,1)
L110:
  subss  %xmm2,%xmm0
  mulss  D106(%rip),%xmm0
  movss  %xmm2,0x10(%rsp)
  divss  0x24(%rsp),%xmm0
  call   <cos@plt>
  pxor   %xmm1,%xmm1
  movss  0x10(%rsp),%xmm2
  mulsd  D127(%rip),%xmm0
  addsd  D127(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm1
  jmp    L124
L42:
  xor    %r12d,%r12d
L82:
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D28
type_infered: f64
name: retrieve_data
arguments: data_label: D79
type_infered: f64
name: retrieve_data
arguments: data_label: D106
type_infered: f32
name: retrieve_data
arguments: data_label: D87
type_infered: byte[4]
name: retrieve_data
arguments: data_label: D11
type_infered: f64
name: retrieve_data
arguments: data_label: D85
type_infered: f64
name: retrieve_data
arguments: data_label: D127
type_infered: f64
name: retrieve_data
arguments: data_label: D125
type_infered: f64

tool: D28: 0.5

tool: D79: 0.13

tool: D106: 3.141592654

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

tool: D11: 0.7

tool: D85: 0.6

tool: D127: 0.3

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