user: 请从给定的汇编指令推导出C源代码:

```asm
<distance_to_hclip>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,%r12d
  mov    %esi,%ebp
  mov    %edx,%ebx
  movss  %xmm0,0x1c(%rsp)
  mov    %r8,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  lea    0x3c(%rsp),%rcx
  lea    0x38(%rsp),%rdx
  lea    0x34(%rsp),%rsi
  sub    $0x8,%rsp
  lea    0x50(%rsp),%rax
  push   %rax
  lea    0x54(%rsp),%r9
  lea    0x50(%rsp),%r8
  call   <vis5d_get_sizePRIME@plt>
  pxor   %xmm6,%xmm6
  cvtsi2ss %ebp,%xmm6
  movss  %xmm6,0x24(%rsp)
  pxor   %xmm7,%xmm7
  cvtsi2ss %ebx,%xmm7
  movss  %xmm7,0x28(%rsp)
  add    $0x10,%rsp
  mov    $0x1,%ebp
  movss  D8(%rip),%xmm6
  movss  %xmm6,0xc(%rsp)
  jmp    L119
L141:
  cmp    $0x3,%ebx
  jne    L51
  lea    0x4c(%rsp),%r13
  lea    0x54(%rsp),%r9
  lea    0x50(%rsp),%r8
  mov    %r13,%rcx
  movss  0x1c(%rsp),%xmm2
  pxor   %xmm1,%xmm1
  movaps %xmm1,%xmm0
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %r12d,%edi
  call   <vis5d_gridPRIME_to_xyzPRIME@plt>
  lea    0x30(%rsp),%rcx
  lea    0x2c(%rsp),%rdx
  mov    %r13,%rsi
  mov    %r12d,%edi
  call   <vis5d_project@plt>
  movss  0x2c(%rsp),%xmm0
  subss  0x14(%rsp),%xmm0
  movss  0x30(%rsp),%xmm1
  subss  0x18(%rsp),%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  movss  0xc(%rsp),%xmm3
  comiss %xmm0,%xmm3
  jae    L142
L46:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L138
  movss  0xc(%rsp),%xmm0
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L101:
  mov    0x38(%rsp),%eax
  sub    $0x1,%eax
  pxor   %xmm7,%xmm7
  cvtsi2ss %eax,%xmm7
  movss  %xmm7,0x10(%rsp)
  mov    D7(%rip),%r14d
L144:
  lea    0x4c(%rsp),%r13
  lea    0x54(%rsp),%r9
  lea    0x50(%rsp),%r8
  mov    %r13,%rcx
  movss  0x1c(%rsp),%xmm2
  movss  0x10(%rsp),%xmm1
  movd   %r14d,%xmm0
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %r12d,%edi
  call   <vis5d_gridPRIME_to_xyzPRIME@plt>
  lea    0x30(%rsp),%rcx
  lea    0x2c(%rsp),%rdx
  mov    %r13,%rsi
  mov    %r12d,%edi
  call   <vis5d_project@plt>
  movss  0x2c(%rsp),%xmm0
  subss  0x14(%rsp),%xmm0
  movss  0x30(%rsp),%xmm1
  subss  0x18(%rsp),%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  movss  0xc(%rsp),%xmm5
  comiss %xmm0,%xmm5
  jb     L89
L112:
  mov    %ebx,(%r15)
  movss  %xmm0,0xc(%rsp)
L131:
  cmp    $0x3,%ebp
  jg     L46
L89:
  add    $0x1,%ebp
L119:
  lea    -0x1(%rbp),%ebx
  cmp    $0x3,%ebp
  je     L28
  cmp    $0x2,%ebx
  jg     L141
  test   %ebx,%ebx
  je     L101
  cmp    $0x1,%ebx
  jne    L51
  mov    0x34(%rsp),%eax
  sub    $0x1,%eax
  pxor   %xmm7,%xmm7
  cvtsi2ss %eax,%xmm7
  movd   %xmm7,%r14d
  mov    0x38(%rsp),%eax
  sub    $0x1,%eax
  pxor   %xmm2,%xmm2
  cvtsi2ss %eax,%xmm2
  movss  %xmm2,0x10(%rsp)
  jmp    L144
L28:
  mov    0x34(%rsp),%eax
  sub    $0x1,%eax
  pxor   %xmm6,%xmm6
  cvtsi2ss %eax,%xmm6
  movd   %xmm6,%r14d
  pxor   %xmm3,%xmm3
  movss  %xmm3,0x10(%rsp)
  jmp    L144
L51:
  lea    0x4c(%rsp),%r13
  lea    0x54(%rsp),%r9
  lea    0x50(%rsp),%r8
  mov    %r13,%rcx
  movss  0x1c(%rsp),%xmm2
  movss  0x10(%rsp),%xmm1
  movd   %r14d,%xmm0
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %r12d,%edi
  call   <vis5d_gridPRIME_to_xyzPRIME@plt>
  lea    0x30(%rsp),%rcx
  lea    0x2c(%rsp),%rdx
  mov    %r13,%rsi
  mov    %r12d,%edi
  call   <vis5d_project@plt>
  movss  0x2c(%rsp),%xmm0
  subss  0x14(%rsp),%xmm0
  movss  0x30(%rsp),%xmm1
  subss  0x18(%rsp),%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  movss  0xc(%rsp),%xmm7
  comiss %xmm0,%xmm7
  jae    L112
  jmp    L131
L142:
  pxor   %xmm4,%xmm4
  movss  %xmm4,0x10(%rsp)
  movd   %xmm4,%r14d
  jmp    L112
L138:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D8
type: f32
name: disassemble_data
arguments: tag: D7
type: f32

tool: D8: 1000000

tool: D7: 0

assistant: ```c
float distance_to_hclip(int index, int curx, int cury, int num, float level, int *corner) {
  float cx, cy, px, py;
  float dist, neardist, p[3];
  float r, c;
  int i;
  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 = 0.0;
      c = (float)(Nc - 1);
      break;
    case 1:
      r = (float)(Nr - 1);
      c = (float)(Nc - 1);
      break;
    case 2:
      r = (float)(Nr - 1);
      c = 0.0;
      break;
    case 3:
      r = 0.0;
      c = 0.0;
      break;
    }
    vis5d_gridPRIME_to_xyzPRIME(index, 0, 0, r, c, level, &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;
}
```