user: Translate the below assembly code into C programming language:

```asm
<distance_to_hclip>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %esi,-0x58(%rbp)
  mov    %edx,-0x5c(%rbp)
  mov    %ecx,-0x60(%rbp)
  movss  %xmm0,-0x64(%rbp)
  mov    %r8,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x38(%rbp),%r9
  lea    -0x3c(%rbp),%r8
  lea    -0x40(%rbp),%rcx
  lea    -0x44(%rbp),%rdx
  lea    -0x48(%rbp),%rsi
  mov    -0x54(%rbp),%eax
  sub    $0x8,%rsp
  lea    -0x34(%rbp),%rdi
  push   %rdi
  mov    %eax,%edi
  call   <vis5d_get_sizePRIME@plt>
  add    $0x10,%rsp
  movss  D6(%rip),%xmm0
  movss  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x58(%rbp),%xmm0
  movss  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x5c(%rbp),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L122
L33:
  cmpl   $0x3,-0x24(%rbp)
  je     L49
  cmpl   $0x3,-0x24(%rbp)
  jg     L62
  cmpl   $0x2,-0x24(%rbp)
  je     L14
  cmpl   $0x2,-0x24(%rbp)
  jg     L62
  cmpl   $0x0,-0x24(%rbp)
  je     L75
  cmpl   $0x1,-0x24(%rbp)
  je     L2
  jmp    L62
L75:
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,-0x28(%rbp)
  jmp    L62
L2:
  mov    -0x48(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,-0x28(%rbp)
  jmp    L62
L14:
  mov    -0x48(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x28(%rbp)
  jmp    L62
L49:
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x28(%rbp)
  nop
L62:
  lea    -0x14(%rbp),%rax
  lea    0x8(%rax),%rdi
  lea    -0x14(%rbp),%rax
  lea    0x4(%rax),%rsi
  lea    -0x14(%rbp),%rcx
  movss  -0x64(%rbp),%xmm1
  movss  -0x28(%rbp),%xmm0
  mov    -0x2c(%rbp),%edx
  mov    -0x54(%rbp),%eax
  mov    %rdi,%r9
  mov    %rsi,%r8
  movaps %xmm1,%xmm2
  movaps %xmm0,%xmm1
  movd   %edx,%xmm0
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <vis5d_gridPRIME_to_xyzPRIME@plt>
  lea    -0x4c(%rbp),%rcx
  lea    -0x50(%rbp),%rdx
  lea    -0x14(%rbp),%rsi
  mov    -0x54(%rbp),%eax
  mov    %eax,%edi
  call   <vis5d_project@plt>
  movss  -0x50(%rbp),%xmm0
  movaps %xmm0,%xmm1
  subss  -0x20(%rbp),%xmm1
  movss  -0x50(%rbp),%xmm0
  subss  -0x20(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  movss  -0x4c(%rbp),%xmm0
  movaps %xmm0,%xmm2
  subss  -0x1c(%rbp),%xmm2
  movss  -0x4c(%rbp),%xmm0
  subss  -0x1c(%rbp),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  -0x30(%rbp),%xmm0
  comiss -0x18(%rbp),%xmm0
  jb     L121
  movss  -0x18(%rbp),%xmm0
  movss  %xmm0,-0x30(%rbp)
  mov    -0x70(%rbp),%rax
  mov    -0x24(%rbp),%edx
  mov    %edx,(%rax)
L121:
  addl   $0x1,-0x24(%rbp)
L122:
  cmpl   $0x3,-0x24(%rbp)
  jle    L33
  movss  -0x30(%rbp),%xmm0
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L104
  call   <__stack_chk_fail@plt>
L104:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D6
datatype: f32

tool: D6: 1000000

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;
}
```