user: Please show me the C implementation that matches the assembly code listed below:

```asm
<C_advect_velocity>:
  endbr64
  push   %r15
  mov    %r9d,%eax
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    0xc0(%rsp),%esi
  mov    %rdx,0x70(%rsp)
  mov    %rcx,0x78(%rsp)
  imul   %esi,%eax
  mov    %eax,0x6c(%rsp)
  test   %r9d,%r9d
  jle    L22
  movl   $0x0,0x68(%rsp)
  mov    %rdi,%r15
  movapd %xmm0,%xmm8
  movapd %xmm1,%xmm9
  movl   $0x0,0x5c(%rsp)
  pxor   %xmm5,%xmm5
  pxor   %xmm10,%xmm10
  nopw   0x0(%rax,%rax,1)
L37:
  test   %esi,%esi
  jle    L54
  movslq 0x68(%rsp),%rdx
  movslq 0x6c(%rsp),%rax
  pxor   %xmm7,%xmm7
  xor    %ebx,%ebx
  cvtsi2sdl 0x5c(%rsp),%xmm7
  movsd  D15(%rip),%xmm6
  lea    -0x1(%rsi),%r11d
  lea    (%rax,%rdx,1),%rcx
  mov    %rax,0x60(%rsp)
  mov    0x78(%rsp),%rax
  lea    0x0(,%rdx,8),%r13
  lea    0x0(,%rcx,8),%r12
  lea    (%rax,%rdx,4),%r10
  lea    (%rax,%rcx,4),%rcx
  mov    0x70(%rsp),%rax
  add    %rax,%rdx
  mov    %rcx,%rax
  jmp    L109
  nopl   0x0(%rax,%rax,1)
L101:
  pxor   %xmm3,%xmm3
  pxor   %xmm4,%xmm4
  cvtsi2sd %r9d,%xmm3
  cvtss2sd %xmm1,%xmm4
  subsd  %xmm6,%xmm3
  comisd %xmm3,%xmm4
  jae    L20
  cvttss2si %xmm1,%ebp
  pxor   %xmm1,%xmm1
  pxor   %xmm3,%xmm3
  pxor   %xmm11,%xmm11
  cvtsi2sd %ebp,%xmm1
  subsd  %xmm1,%xmm4
  cvtsd2ss %xmm4,%xmm3
  cvtss2sd %xmm3,%xmm11
L135:
  comiss %xmm0,%xmm5
  ja     L57
L44:
  pxor   %xmm4,%xmm4
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm4
  cvtss2sd %xmm0,%xmm1
  subsd  %xmm6,%xmm4
  comisd %xmm4,%xmm1
  jae    L91
  cvttss2si %xmm0,%edi
  pxor   %xmm0,%xmm0
  cvtsi2sd %edi,%xmm0
  subsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsd2ss %xmm1,%xmm1
  cvtss2sd %xmm1,%xmm0
L80:
  mov    %ebp,(%r10,%rbx,4)
  mov    %edi,(%rax,%rbx,4)
  movsd  %xmm11,(%r8,%r13,1)
  movsd  %xmm0,(%r8,%r12,1)
  cmpb   $0x0,(%rdx,%rbx,1)
  je     L26
  movsd  (%r14,%r13,1),%xmm0
  movsd  %xmm0,(%r15,%r13,1)
  movsd  (%r14,%r12,1),%xmm0
L23:
  movsd  %xmm0,(%r15,%r12,1)
  lea    0x1(%rbx),%rdi
  add    $0x8,%r13
  add    $0x8,%r12
  cmp    %r11,%rbx
  je     L54
  mov    %rdi,%rbx
L109:
  movsd  (%r14,%r13,1),%xmm0
  movsd  (%r14,%r12,1),%xmm3
  movapd %xmm7,%xmm1
  mulsd  %xmm2,%xmm0
  mulsd  %xmm2,%xmm3
  divsd  %xmm8,%xmm0
  divsd  %xmm9,%xmm3
  subsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  cvtsd2ss %xmm1,%xmm1
  comiss %xmm1,%xmm5
  subsd  %xmm3,%xmm0
  cvtsd2ss %xmm0,%xmm0
  jbe    L101
  xor    %ebp,%ebp
  comiss %xmm0,%xmm5
  movapd %xmm10,%xmm11
  movaps %xmm5,%xmm3
  jbe    L44
L57:
  movapd %xmm10,%xmm0
  movaps %xmm5,%xmm1
  xor    %edi,%edi
  jmp    L80
  cs nopw 0x0(%rax,%rax,1)
L26:
  imul   %esi,%ebp
  movaps %xmm3,%xmm0
  mov    %rdx,0x50(%rsp)
  mov    %r9d,0x58(%rsp)
  mov    %r8,0x40(%rsp)
  add    %edi,%ebp
  mov    %r11,0x30(%rsp)
  movslq %ebp,%rbp
  mov    %r10,0x28(%rsp)
  lea    (%r14,%rbp,8),%rdi
  mov    %rax,0x20(%rsp)
  movsd  %xmm2,0x48(%rsp)
  movsd  %xmm7,0x38(%rsp)
  movsd  %xmm9,0x18(%rsp)
  movsd  %xmm8,0x10(%rsp)
  mov    %esi,0xc0(%rsp)
  movss  %xmm1,0xc(%rsp)
  movss  %xmm3,0x8(%rsp)
  call   <advect_sample@plt>
  movss  0x8(%rsp),%xmm3
  add    0x60(%rsp),%rbp
  movss  0xc(%rsp),%xmm1
  mov    0xc0(%rsp),%esi
  movsd  %xmm0,(%r15,%r13,1)
  lea    (%r14,%rbp,8),%rdi
  movaps %xmm3,%xmm0
  call   <advect_sample@plt>
  mov    D15(%rip),%rax
  pxor   %xmm5,%xmm5
  mov    0xc0(%rsp),%esi
  mov    0x28(%rsp),%r10
  mov    0x30(%rsp),%r11
  pxor   %xmm10,%xmm10
  movq   %rax,%xmm6
  mov    0x40(%rsp),%r8
  mov    0x20(%rsp),%rax
  movsd  0x10(%rsp),%xmm8
  movsd  0x18(%rsp),%xmm9
  movsd  0x38(%rsp),%xmm7
  mov    0x58(%rsp),%r9d
  movsd  0x48(%rsp),%xmm2
  mov    0x50(%rsp),%rdx
  jmp    L23
  nopw   0x0(%rax,%rax,1)
L20:
  cvtsd2ss %xmm3,%xmm3
  cvttss2si %xmm3,%ebp
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm3,%xmm3
  pxor   %xmm11,%xmm11
  cvtsi2sd %ebp,%xmm1
  subsd  %xmm1,%xmm3
  cvtsd2ss %xmm3,%xmm3
  cvtss2sd %xmm3,%xmm11
  jmp    L135
  nopl   0x0(%rax,%rax,1)
L91:
  cvtsd2ss %xmm4,%xmm4
  cvttss2si %xmm4,%edi
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm4,%xmm1
  cvtsi2sd %edi,%xmm0
  subsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsd2ss %xmm1,%xmm1
  cvtss2sd %xmm1,%xmm0
  jmp    L80
  nopl   (%rax)
L54:
  addl   $0x1,0x5c(%rsp)
  mov    0x5c(%rsp),%eax
  add    %esi,0x68(%rsp)
  cmp    %eax,%r9d
  jne    L37
L22:
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: label: D15
type_guessed: f64

tool: D15: 1.01

assistant: ```c
void C_advect_velocity(double *v, const double *const v0, const unsigned char *bound, int *advect_indexes, double *advect_lerps, const int Nx, const int Ny, const double dx, const double dy, const double dt) {
  int x, y, idx, xi, yi, iidx;
  int vyidx = Nx * Ny;
  float xa, ya, s, t;
#pragma omp for schedule(auto)
  for (x = 0; x < Nx; ++x) {
    for (y = 0; y < Ny; ++y) {
      idx = y + x * Ny;
      xa = (double)x - dt * v0[0 + idx] / dx;
      ya = (double)y - dt * v0[vyidx + idx] / dy;
      xa = xa < 0.0 ? 0.0 : (xa >= Nx - 1.01) ? (Nx - 1.01) : xa;
      ya = ya < 0.0 ? 0.0 : (ya >= Ny - 1.01) ? (Ny - 1.01) : ya;
      xi = (int)xa;
      yi = (int)ya;
      s = xa - (double)xi;
      t = ya - (double)yi;
      advect_indexes[0 + idx] = xi;
      advect_indexes[vyidx + idx] = yi;
      advect_lerps[0 + idx] = s;
      advect_lerps[vyidx + idx] = t;
      if (!bound[idx]) {
        iidx = yi + xi * Ny;
        v[0 + idx] = advect_sample(v0 + iidx, Ny, s, t);
        v[vyidx + idx] = advect_sample(v0 + vyidx + iidx, Ny, s, t);
      } else {
        v[0 + idx] = v0[0 + idx];
        v[vyidx + idx] = v0[vyidx + idx];
      }
    }
  }
}
```