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  D83(%rip),%xmm0
  cvttsd2si %xmm0,%r12d
  cmp    %r13d,%r12d
  cmovg  %r13d,%r12d
  test   %r12d,%r12d
  jle    L81
  pxor   %xmm2,%xmm2
  movss  0xc(%rsp),%xmm7
  mov    %r12d,%r13d
  xor    %r15d,%r15d
  cvtss2sd 0xc(%rsp),%xmm2
  mulsd  D94(%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    L44
  nopl   0x0(%rax)
L49:
  movss  0x18(%rsp),%xmm5
  comiss %xmm0,%xmm5
  ja     L4
  movss  0xc(%rsp),%xmm6
  pxor   %xmm1,%xmm1
  comiss %xmm0,%xmm6
  ja     L87
L29:
  movss  %xmm1,(%rbx,%r15,4)
  add    $0x1,%r15
  cmp    %r13,%r15
  je     L36
L3:
  movss  0x0(%rbp),%xmm1
L44:
  pxor   %xmm0,%xmm0
  cvtsi2ss %r15d,%xmm0
  mulss  %xmm1,%xmm0
  comiss %xmm0,%xmm2
  jbe    L49
  mulss  D69(%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  D3(%rip),%xmm1
  movsd  %xmm0,0x10(%rsp)
  movaps %xmm1,%xmm0
  call   <sin@plt>
  movsd  D77(%rip),%xmm1
  movsd  0x10(%rsp),%xmm3
  movapd %xmm0,%xmm4
  movss  0x20(%rsp),%xmm2
  mulsd  %xmm1,%xmm3
  mulsd  D26(%rip),%xmm4
  subsd  %xmm3,%xmm1
  addsd  %xmm4,%xmm1
  cvtsd2ss %xmm1,%xmm1
  movss  %xmm1,(%rbx,%r15,4)
  add    $0x1,%r15
  cmp    %r13,%r15
  jne    L3
L36:
  mov    0x28(%rsp),%rax
  movss  0x0(%rbp),%xmm2
  pxor   %xmm0,%xmm0
  lea    0x4(%rbx,%rax,4),%rdx
  mov    %rbx,%rax
  nopl   0x0(%rax)
L59:
  movss  (%rax),%xmm1
  add    $0x4,%rax
  mulss  %xmm2,%xmm1
  addss  %xmm1,%xmm0
  cmp    %rdx,%rax
  jne    L59
  pxor   %xmm5,%xmm5
  comiss %xmm0,%xmm5
  jae    L81
  movss  (%r14),%xmm1
  divss  %xmm0,%xmm1
  nopl   0x0(%rax,%rax,1)
L33:
  movss  (%rbx),%xmm0
  add    $0x4,%rbx
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rbx)
  cmp    %rdx,%rbx
  jne    L33
  jmp    L1
  nopl   0x0(%rax,%rax,1)
L4:
  movaps %xmm0,%xmm3
  movss  %xmm2,0x1c(%rsp)
  mulss  D69(%rip),%xmm0
  subss  %xmm2,%xmm3
  mulss  D69(%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  D77(%rip),%xmm0
  mulsd  D103(%rip),%xmm3
  mulsd  %xmm1,%xmm0
  movsd  D49(%rip),%xmm1
  subsd  %xmm0,%xmm1
  addsd  %xmm3,%xmm1
  cvtsd2ss %xmm1,%xmm1
  jmp    L29
  nopl   0x0(%rax,%rax,1)
L87:
  subss  %xmm2,%xmm0
  mulss  D69(%rip),%xmm0
  movss  %xmm2,0x10(%rsp)
  divss  0x24(%rsp),%xmm0
  call   <cos@plt>
  pxor   %xmm1,%xmm1
  movss  0x10(%rsp),%xmm2
  mulsd  D103(%rip),%xmm0
  addsd  D103(%rip),%xmm0
  cvtsd2ss %xmm0,%xmm1
  jmp    L29
L81:
  xor    %r12d,%r12d
L1:
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: data_label: D83
type_infered: f64
name: read_data
arguments: data_label: D94
type_infered: f64
name: read_data
arguments: data_label: D69
type_infered: f32
name: read_data
arguments: data_label: D3
type_infered: byte[4]
name: read_data
arguments: data_label: D77
type_infered: f64
name: read_data
arguments: data_label: D26
type_infered: f64
name: read_data
arguments: data_label: D103
type_infered: f64
name: read_data
arguments: data_label: D49
type_infered: f64

tool: D83: 0.5

tool: D94: 0.13

tool: D69: 3.141592654

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

tool: D77: 0.7

tool: D26: 0.6

tool: D103: 0.3

tool: D49: 1

assistant: ```c
int gen_ucsb_stf(float *slip, float *t0, float *stf, int nt, float *dt) {
  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);
}
```