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

```asm
<vq>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,-0x18(%rsp)
  mov    %rdx,%rdi
  mov    %rsi,-0x10(%rsp)
  mov    %r8d,-0x28(%rsp)
  test   %r8d,%r8d
  jle    L95
  movslq %r9d,%r15
  lea    -0x1(%r9),%ebx
  movss  (%rcx),%xmm4
  mov    %rcx,%rdx
  lea    0x0(,%r15,4),%rax
  xor    %r12d,%r12d
  xor    %esi,%esi
  xor    %r11d,%r11d
  mov    %ebx,-0x20(%rsp)
  movss  D6(%rip),%xmm3
  lea    0x4(%rdi),%rcx
  mov    %rax,-0x30(%rsp)
  lea    -0x2(%r9),%eax
  mov    %eax,-0x24(%rsp)
  mov    %ebx,%eax
  and    $0xfffffffc,%ebx
  shr    $0x2,%eax
  mov    %ebx,%r14d
  lea    -0x1(%rax),%r10d
  lea    0x1(%rbx),%eax
  xor    %ebx,%ebx
  mov    %eax,-0x1c(%rsp)
  add    $0x1,%r10
  shl    $0x4,%r10
  nopl   0x0(%rax)
L64:
  movaps %xmm4,%xmm1
  subss  -0x4(%rcx),%xmm1
  mulss  %xmm1,%xmm1
  cmp    $0x1,%r9d
  jle    L90
  cmpl   $0x2,-0x24(%rsp)
  jbe    L40
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L31:
  movups 0x4(%rdx,%rax,1),%xmm0
  movups (%rcx,%rax,1),%xmm5
  add    $0x10,%rax
  subps  %xmm5,%xmm0
  mulps  %xmm0,%xmm0
  addss  %xmm0,%xmm1
  movaps %xmm0,%xmm2
  shufps $0x55,%xmm0,%xmm2
  addss  %xmm2,%xmm1
  movaps %xmm0,%xmm2
  unpckhps %xmm0,%xmm2
  shufps $0xff,%xmm0,%xmm0
  addss  %xmm2,%xmm1
  addss  %xmm0,%xmm1
  cmp    %rax,%r10
  jne    L31
  cmp    %r14d,-0x20(%rsp)
  je     L90
  mov    -0x1c(%rsp),%eax
  mov    %r14d,%r8d
L59:
  mov    %r9d,%r13d
  sub    %r8d,%r13d
  lea    -0x1(%r13),%ebp
  cmp    $0x2,%r13d
  je     L43
  movq   0x4(%rdx,%r8,4),%xmm0
  lea    0x1(%rbx,%r8,1),%r8
  movq   (%rdi,%r8,4),%xmm2
  mov    %ebp,%r8d
  and    $0xfffffffe,%r8d
  subps  %xmm2,%xmm0
  add    %r8d,%eax
  mulps  %xmm0,%xmm0
  addss  %xmm0,%xmm1
  shufps $0xe5,%xmm0,%xmm0
  addss  %xmm0,%xmm1
  cmp    %r8d,%ebp
  je     L90
L43:
  movslq %eax,%r8
  add    %esi,%eax
  cltq
  movss  (%rdx,%r8,4),%xmm0
  subss  (%rdi,%rax,4),%xmm0
  mulss  %xmm0,%xmm0
  addss  %xmm0,%xmm1
L90:
  comiss %xmm1,%xmm3
  minss  %xmm3,%xmm1
  cmova  %r11d,%r12d
  movaps %xmm1,%xmm3
  add    %r9d,%esi
  add    $0x1,%r11d
  add    %r15,%rbx
  add    -0x30(%rsp),%rcx
  cmp    %r11d,-0x28(%rsp)
  jne    L64
L155:
  test   %r9d,%r9d
  jle    L89
  mov    %r9d,%esi
  mov    -0x18(%rsp),%rbx
  imul   %r12d,%esi
  mov    %rbx,%rcx
  movslq %esi,%rdx
  lea    0x4(,%rdx,4),%rax
  lea    (%rdi,%rax,1),%r8
  sub    %r8,%rcx
  cmp    $0x8,%rcx
  jbe    L101
  lea    -0x1(%r9),%ecx
  cmp    $0x2,%ecx
  jbe    L101
  mov    %r9d,%edx
  lea    -0x4(%rdi,%rax,1),%rcx
  mov    %rbx,%r8
  xor    %eax,%eax
  shr    $0x2,%edx
  shl    $0x4,%rdx
  nopl   0x0(%rax)
L129:
  movups (%rcx,%rax,1),%xmm6
  movups %xmm6,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L129
  mov    %r9d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r9b
  je     L89
  lea    (%rsi,%rax,1),%edx
  mov    -0x18(%rsp),%rbx
  mov    %eax,%r8d
  movslq %edx,%rdx
  lea    0x0(,%r8,4),%rcx
  movss  (%rdi,%rdx,4),%xmm0
  lea    0x1(%rax),%edx
  movss  %xmm0,(%rbx,%r8,4)
  cmp    %edx,%r9d
  jle    L89
  add    %esi,%edx
  add    $0x2,%eax
  movslq %edx,%rdx
  movss  (%rdi,%rdx,4),%xmm0
  movss  %xmm0,0x4(%rbx,%rcx,1)
  cmp    %eax,%r9d
  jle    L89
  add    %esi,%eax
  cltq
  movss  (%rdi,%rax,4),%xmm0
  movss  %xmm0,0x8(%rbx,%rcx,1)
L89:
  mov    -0x10(%rsp),%rax
  mov    %r12d,(%rax)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L40:
  xor    %r8d,%r8d
  mov    $0x1,%eax
  jmp    L59
L101:
  mov    -0x18(%rsp),%rcx
  mov    %r9d,%r9d
  lea    (%rdi,%rdx,4),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax)
L5:
  movss  (%rdx,%rax,4),%xmm0
  movss  %xmm0,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %r9,%rax
  jne    L5
  jmp    L89
L95:
  xor    %r12d,%r12d
  jmp    L155
```

tool_calls: name: unpack_data
arguments: label: D6
type_infered: byte[4]

tool: {"D6": [0xc2,0xbd,0xf0,0x7c]}

assistant: ```c
void vq(float *Xq, int *index, const float *CB, float *X, int n_cb, int dim) {
  int i;
  int j;
  int pos;
  int minindex;
  float dist;
  float tmp;
  float mindist;
  pos = 0;
  mindist = 1.0e37f;
  minindex = 0;
  for (j = 0; j < n_cb; j++) {
    dist = X[0] - CB[pos];
    dist *= dist;
    for (i = 1; i < dim; i++) {
      tmp = X[i] - CB[pos + i];
      dist += tmp * tmp;
    }
    if (dist < mindist) {
      mindist = dist;
      minindex = j;
    }
    pos += dim;
  }
  for (i = 0; i < dim; i++)
    Xq[i] = CB[minindex * dim + i];
  *index = minindex;
}
```