user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<distance_to_vslice>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x88,%rsp
  mov    %ecx,0x10(%rsp)
  lea    0x58(%rsp),%rdx
  lea    0x5c(%rsp),%rcx
  mov    %r8d,0x14(%rsp)
  lea    0x54(%rsp),%rsi
  sub    $0x8,%rsp
  mov    %r9,0x40(%rsp)
  movss  %xmm0,0x28(%rsp)
  movss  %xmm1,0x34(%rsp)
  movss  %xmm2,0x38(%rsp)
  movss  %xmm3,0x3c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x80(%rsp)
  xor    %eax,%eax
  lea    0x70(%rsp),%rax
  push   %rax
  lea    0x74(%rsp),%r9
  lea    0x70(%rsp),%r8
  call   <vis5d_get_sizePRIME@plt>
  pxor   %xmm7,%xmm7
  mov    $0x1,%r10d
  movss  D1(%rip),%xmm4
  cvtsi2ss %r12d,%xmm7
  movss  %xmm7,0x18(%rsp)
  pxor   %xmm7,%xmm7
  cvtsi2ss %ebp,%xmm7
  movss  %xmm7,0x1c(%rsp)
  pop    %rdx
  pop    %rcx
  lea    0x6c(%rsp),%rbp
  lea    0x74(%rsp),%r15
  mov    0x60(%rsp),%eax
  movss  %xmm4,0x4(%rsp)
  lea    0x70(%rsp),%r14
  lea    0x4c(%rsp),%r13
  mov    %r15,%r9
  lea    0x48(%rsp),%r12
  mov    %r13,%r15
  mov    %r14,%r13
  mov    %r12,%r14
  mov    %rbp,%r12
  mov    %ebx,%ebp
  mov    %r10d,%ebx
  lea    -0x1(%rbx),%r10d
  cmp    $0x3,%ebx
  je     L140
L95:
  cmp    $0x3,%r10d
  je     L145
  cmp    $0x1,%r10d
  je     L154
  mov    0x5c(%rsp),%edx
  pxor   %xmm2,%xmm2
  movss  0x2c(%rsp),%xmm1
  mov    %ebp,%edi
  movss  0x20(%rsp),%xmm0
  mov    0x10(%rsp),%esi
  mov    %r13,%r8
  mov    %r12,%rcx
  lea    -0x1(%rax,%rdx,1),%eax
  mov    0x14(%rsp),%edx
  mov    %r10d,0x28(%rsp)
  cvtsi2ss %eax,%xmm2
  mov    %r9,0x18(%rsp)
  call   <vis5d_gridPRIME_to_xyzPRIME@plt>
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <vis5d_project@plt>
  movss  0x48(%rsp),%xmm0
  movss  0x4c(%rsp),%xmm1
  subss  0x8(%rsp),%xmm0
  subss  0xc(%rsp),%xmm1
  movss  0x4(%rsp),%xmm7
  mov    0x18(%rsp),%r9
  mov    0x28(%rsp),%r10d
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  comiss %xmm0,%xmm7
  jbe    L55
L96:
  movss  %xmm0,0x4(%rsp)
L35:
  mov    0x38(%rsp),%rax
  mov    %r10d,(%rax)
L55:
  cmp    $0x4,%ebx
  je     L113
L173:
  add    $0x1,%ebx
  mov    0x60(%rsp),%eax
  lea    -0x1(%rbx),%r10d
  cmp    $0x3,%ebx
  jne    L95
L140:
  pxor   %xmm2,%xmm2
  movss  0x2c(%rsp),%xmm1
  movss  0x20(%rsp),%xmm0
  cvtsi2ss %eax,%xmm2
  jmp    L174
  nopw   0x0(%rax,%rax,1)
L145:
  pxor   %xmm2,%xmm2
  movss  0x34(%rsp),%xmm1
  mov    0x14(%rsp),%edx
  mov    %ebp,%edi
  cvtsi2ss %eax,%xmm2
  movss  0x30(%rsp),%xmm0
  mov    %r13,%r8
  mov    %r12,%rcx
  mov    0x10(%rsp),%esi
  mov    %r9,0x18(%rsp)
  mov    %r10d,0x28(%rsp)
  call   <vis5d_gridPRIME_to_xyzPRIME@plt>
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <vis5d_project@plt>
  movss  0x48(%rsp),%xmm0
  movss  0x4c(%rsp),%xmm1
  subss  0x8(%rsp),%xmm0
  subss  0xc(%rsp),%xmm1
  movss  0x4(%rsp),%xmm6
  mov    0x18(%rsp),%r9
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  comiss %xmm0,%xmm6
  ja     L56
L113:
  mov    %ebp,%ebx
  lea    0x50(%rsp),%rsi
  mov    %r12,%rbp
  mov    %r14,%r12
  mov    %ebx,%edi
  mov    %r13,%r14
  mov    %r15,%r13
  mov    %r9,%r15
  call   <vis5d_get_curved@plt>
  mov    0x50(%rsp),%eax
  test   %eax,%eax
  jne    L52
  movss  0x2c(%rsp),%xmm1
  movss  0x20(%rsp),%xmm3
  mov    %r15,%r9
  mov    $0x4,%r10d
  addss  0x34(%rsp),%xmm1
  addss  0x30(%rsp),%xmm3
  mov    %r13,%r15
  mov    %r14,%r13
  movss  D17(%rip),%xmm0
  mov    %r12,%r14
  mov    %rbp,%r12
  mov    %ebx,%ebp
  mulss  %xmm0,%xmm1
  mulss  %xmm0,%xmm3
L3:
  mov    %r10d,%ebx
  lea    0x1(%r10),%r10d
  mov    0x60(%rsp),%eax
  mov    %r10d,0x2c(%rsp)
  cmp    $0x4,%ebx
  je     L59
  pxor   %xmm2,%xmm2
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  movaps %xmm3,%xmm0
  cvtsi2ss %eax,%xmm2
  mov    %r13,%r8
  mov    %r12,%rcx
  mov    %ebp,%edi
  mov    %r9,0x20(%rsp)
  movss  %xmm1,0x28(%rsp)
  movss  %xmm3,0x18(%rsp)
  call   <vis5d_gridPRIME_to_xyzPRIME@plt>
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <vis5d_project@plt>
  movss  0x48(%rsp),%xmm0
  mov    0x20(%rsp),%r9
  subss  0x8(%rsp),%xmm0
  movss  0x4c(%rsp),%xmm2
  subss  0xc(%rsp),%xmm2
  movss  0x4(%rsp),%xmm4
  movss  0x18(%rsp),%xmm3
  movss  0x28(%rsp),%xmm1
  mulss  %xmm0,%xmm0
  mov    0x2c(%rsp),%r10d
  mulss  %xmm2,%xmm2
  addss  %xmm2,%xmm0
  comiss %xmm0,%xmm4
  ja     L75
L178:
  cmp    $0x6,%r10d
  jne    L3
L52:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  movss  0x4(%rsp),%xmm0
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L59:
  mov    0x5c(%rsp),%edx
  pxor   %xmm2,%xmm2
  mov    0x10(%rsp),%esi
  movaps %xmm3,%xmm0
  mov    %r13,%r8
  mov    %r12,%rcx
  mov    %ebp,%edi
  mov    %r9,0x20(%rsp)
  lea    -0x1(%rax,%rdx,1),%eax
  mov    0x14(%rsp),%edx
  movss  %xmm1,0x28(%rsp)
  cvtsi2ss %eax,%xmm2
  movss  %xmm3,0x18(%rsp)
  call   <vis5d_gridPRIME_to_xyzPRIME@plt>
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <vis5d_project@plt>
  movss  0x48(%rsp),%xmm0
  mov    0x20(%rsp),%r9
  subss  0x8(%rsp),%xmm0
  movss  0x4c(%rsp),%xmm2
  subss  0xc(%rsp),%xmm2
  movss  0x4(%rsp),%xmm7
  movss  0x18(%rsp),%xmm3
  movss  0x28(%rsp),%xmm1
  mulss  %xmm0,%xmm0
  mov    0x2c(%rsp),%r10d
  mulss  %xmm2,%xmm2
  addss  %xmm2,%xmm0
  comiss %xmm0,%xmm7
  jbe    L3
L75:
  mov    0x38(%rsp),%rax
  movss  %xmm0,0x4(%rsp)
  mov    %ebx,(%rax)
  jmp    L178
  nopl   0x0(%rax)
L154:
  mov    0x5c(%rsp),%edx
  pxor   %xmm2,%xmm2
  movss  0x34(%rsp),%xmm1
  movss  0x30(%rsp),%xmm0
  lea    -0x1(%rax,%rdx,1),%eax
  cvtsi2ss %eax,%xmm2
L174:
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%esi
  mov    %r13,%r8
  mov    %r12,%rcx
  mov    %ebp,%edi
  mov    %r10d,0x28(%rsp)
  mov    %r9,0x18(%rsp)
  call   <vis5d_gridPRIME_to_xyzPRIME@plt>
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %ebp,%edi
  call   <vis5d_project@plt>
  movss  0x48(%rsp),%xmm0
  movss  0x4c(%rsp),%xmm1
  subss  0x8(%rsp),%xmm0
  subss  0xc(%rsp),%xmm1
  movss  0x4(%rsp),%xmm6
  mov    0x18(%rsp),%r9
  mov    0x28(%rsp),%r10d
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  comiss %xmm0,%xmm6
  ja     L96
  jmp    L173
  nopl   (%rax)
L56:
  mov    0x28(%rsp),%r10d
  movss  %xmm0,0x4(%rsp)
  jmp    L35
L40:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D1
type: f32
name: unpack_data
arguments: tag: D17
type: byte[4]

tool: D1: 1000000

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

assistant: ```c
float distance_to_vslice(int index, int curx, int cury, int time, int var, float r1, float c1, float r2, float c2, int *corner) {
  float cx, cy;
  float px, py;
  float r, c, l;
  float dist, neardist, p[3];
  int i;
  int curved;
  int Nr, Nc, Nl, LowLev, MaxNlVar, WindNl, WindLow;
  vis5d_get_sizePRIME(index, &Nr, &Nc, &Nl, &LowLev, &WindNl, &WindLow);
  neardist = 1000000.0;
  cx = (float)curx;
  cy = (float)cury;
  for (i = 0; i < 4; i++) {
    switch (i) {
    case 0:
      r = r1;
      c = c1;
      l = (float)(Nl - 1 + LowLev);
      break;
    case 1:
      r = r2;
      c = c2;
      l = (float)(Nl - 1 + LowLev);
      break;
    case 2:
      r = r1;
      c = c1;
      l = (float)LowLev;
      break;
    case 3:
      r = r2;
      c = c2;
      l = (float)LowLev;
      break;
    }
    vis5d_gridPRIME_to_xyzPRIME(index, time, var, r, c, l, &p[0], &p[1], &p[2]);
    vis5d_project(index, p, &px, &py);
    dist = (px - cx) * (px - cx) + (py - cy) * (py - cy);
    if (dist < neardist) {
      neardist = dist;
      *corner = i;
    }
  }
  vis5d_get_curved(index, &curved);
  if (curved == 0) {
    for (i = 4; i < 6; i++) {
      c = (c1 + c2) / 2.0;
      r = (r1 + r2) / 2.0;
      if (i == 4) {
        l = (float)(Nl - 1 + LowLev);
      } else {
        l = (float)LowLev;
      }
      vis5d_gridPRIME_to_xyzPRIME(index, time, var, r, c, l, &p[0], &p[1], &p[2]);
      vis5d_project(index, p, &px, &py);
      dist = (px - cx) * (px - cx) + (py - cy) * (py - cy);
      if (dist < neardist) {
        neardist = dist;
        *corner = i;
      }
    }
  }
  return neardist;
}
```