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    L54
  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  D3(%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)
L146:
  movaps %xmm4,%xmm1
  subss  -0x4(%rcx),%xmm1
  mulss  %xmm1,%xmm1
  cmp    $0x1,%r9d
  jle    L50
  cmpl   $0x2,-0x24(%rsp)
  jbe    L156
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L170:
  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    L170
  cmp    %r14d,-0x20(%rsp)
  je     L50
  mov    -0x1c(%rsp),%eax
  mov    %r14d,%r8d
L166:
  mov    %r9d,%r13d
  sub    %r8d,%r13d
  lea    -0x1(%r13),%ebp
  cmp    $0x2,%r13d
  je     L150
  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     L50
L150:
  movslq %eax,%r8
  add    %esi,%eax
  cltq
  movss  (%rdx,%r8,4),%xmm0
  subss  (%rdi,%rax,4),%xmm0
  mulss  %xmm0,%xmm0
  addss  %xmm0,%xmm1
L50:
  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    L146
L176:
  test   %r9d,%r9d
  jle    L167
  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    L34
  lea    -0x1(%r9),%ecx
  cmp    $0x2,%ecx
  jbe    L34
  mov    %r9d,%edx
  lea    -0x4(%rdi,%rax,1),%rcx
  mov    %rbx,%r8
  xor    %eax,%eax
  shr    $0x2,%edx
  shl    $0x4,%rdx
  nopl   0x0(%rax)
L142:
  movups (%rcx,%rax,1),%xmm6
  movups %xmm6,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L142
  mov    %r9d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r9b
  je     L167
  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    L167
  add    %esi,%edx
  add    $0x2,%eax
  movslq %edx,%rdx
  movss  (%rdi,%rdx,4),%xmm0
  movss  %xmm0,0x4(%rbx,%rcx,1)
  cmp    %eax,%r9d
  jle    L167
  add    %esi,%eax
  cltq
  movss  (%rdi,%rax,4),%xmm0
  movss  %xmm0,0x8(%rbx,%rcx,1)
L167:
  mov    -0x10(%rsp),%rax
  mov    %r12d,(%rax)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L156:
  xor    %r8d,%r8d
  mov    $0x1,%eax
  jmp    L166
L34:
  mov    -0x18(%rsp),%rcx
  mov    %r9d,%r9d
  lea    (%rdi,%rdx,4),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax)
L85:
  movss  (%rdx,%rax,4),%xmm0
  movss  %xmm0,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %r9,%rax
  jne    L85
  jmp    L167
L54:
  xor    %r12d,%r12d
  jmp    L176
```

tool_calls: name: parse_data
arguments: data_tag: D3
type_infered: f32

tool: D3: 1e+37

assistant: ```c
void vq(float *Xq, int *index, const float *CB, float *X, int n_cb, int dim) {
  int i, j;
  int pos, minindex;
  float dist, tmp, mindist;
  pos = 0;
  mindist = (float)1.0e37;
  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;
}
```