user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rsi,0x68(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  cmp    $0x5,%edi
  je     L33
  mov    (%rsi),%rsi
  lea    D108(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L33:
  mov    0x68(%rsp),%rax
  lea    D79(%rip),%rsi
  mov    0x8(%rax),%rdi
  call   <fopen@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L120
L153:
  mov    0x68(%rsp),%r15
  mov    0x10(%r15),%rdi
  call   <atol@plt>
  mov    0x18(%r15),%rdi
  mov    %rax,%rbx
  call   <atol@plt>
  mov    %rbx,%rsi
  lea    D13(%rip),%rdi
  mov    %rax,%r12
  mov    %rax,%rdx
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12d,%r13d
  lea    0x0(,%rbx,4),%edi
  call   <malloc@plt>
  imul   %ebx,%r13d
  mov    %rax,%rbp
  shl    $0x2,%r13d
  mov    %r13d,%edi
  call   <malloc@plt>
  mov    %r13d,%edi
  mov    %rax,%r15
  mov    %rax,0x18(%rsp)
  call   <malloc@plt>
  lea    0x0(,%r12,8),%edi
  mov    %rax,0x8(%rsp)
  call   <malloc@plt>
  test   %r15,%r15
  mov    %rax,%r13
  sete   %al
  cmpq   $0x0,0x8(%rsp)
  sete   %dl
  or     %dl,%al
  jne    L193
  test   %rbp,%rbp
  je     L193
L61:
  xor    %r15d,%r15d
  jmp    L247
  nopl   0x0(%rax,%rax,1)
L211:
  add    $0x1,%r15
L247:
  mov    %r14,%rcx
  mov    %rbx,%rdx
  mov    $0x4,%esi
  mov    %rbp,%rdi
  call   <fread@plt>
  cmp    %rbx,%rax
  je     L211
  mov    %r15,%rsi
  lea    D114(%rip),%rdi
  xor    %eax,%eax
  mov    %r15,0x10(%rsp)
  call   <printf@plt>
  mov    %r14,%rdi
  call   <rewind@plt>
  mov    %rbx,%rdx
  mov    0x18(%rsp),%r15
  mov    %r14,%rcx
  imul   %r12,%rdx
  mov    $0x4,%esi
  mov    %r15,%rdi
  call   <fread@plt>
  pxor   %xmm5,%xmm5
  lea    0x0(,%rbx,4),%rax
  sub    0x8(%rsp),%r15
  cvtsi2ssq 0x10(%rsp),%xmm5
  mov    %rax,0x48(%rsp)
  lea    0x74(%rsp),%rax
  movss  D73(%rip),%xmm4
  movq   $0x1,0x28(%rsp)
  mov    %rax,0x20(%rsp)
  mov    %r15,0x60(%rsp)
  mov    %r14,0x40(%rsp)
  mov    %rbp,0x58(%rsp)
  movss  %xmm4,0x30(%rsp)
  movss  %xmm5,0x54(%rsp)
  nopl   0x0(%rax)
L190:
  mov    0x8(%rsp),%rdi
  xor    %r15d,%r15d
  test   %r12,%r12
  jle    L39
  mov    0x48(%rsp),%r14
  mov    %r13,0x38(%rsp)
  mov    %r13,%rbp
  mov    %rdi,%r13
  nopl   (%rax)
L251:
  mov    %r13,%rdi
  mov    %rbx,%rsi
  add    $0x1,%r15
  add    %r14,%r13
  call   <zero@plt>
  add    $0x8,%rbp
  movq   $0x0,-0x8(%rbp)
  cmp    %r15,%r12
  jne    L251
  mov    0x38(%rsp),%r13
L39:
  mov    0x40(%rsp),%rdi
  movl   $0x0,0x74(%rsp)
  xor    %r15d,%r15d
  call   <rewind@plt>
  cmpq   $0x0,0x10(%rsp)
  je     L235
  mov    %r15,%r14
  mov    0x58(%rsp),%rbp
  mov    0x40(%rsp),%r15
  nopw   0x0(%rax,%rax,1)
L161:
  mov    %r15,%rcx
  mov    %rbx,%rdx
  mov    $0x4,%esi
  mov    %rbp,%rdi
  call   <fread@plt>
  mov    0x20(%rsp),%r8
  mov    %r12,%rcx
  mov    %rbx,%rdx
  mov    0x18(%rsp),%rdi
  mov    %rbp,%rsi
  add    $0x1,%r14
  call   <quantise@plt>
  mov    0x8(%rsp),%rcx
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  addq   $0x1,0x0(%r13,%rax,8)
  imul   %rbx,%rax
  lea    (%rcx,%rax,4),%rdi
  call   <acc@plt>
  cmp    %r14,0x10(%rsp)
  jne    L161
L235:
  movss  0x30(%rsp),%xmm1
  movss  0x74(%rsp),%xmm2
  pxor   %xmm0,%xmm0
  divss  0x54(%rsp),%xmm2
  mov    0x28(%rsp),%r15
  mov    $0x2,%eax
  movss  %xmm2,0x38(%rsp)
  lea    D0(%rip),%rdi
  subss  %xmm2,%xmm1
  cvtss2sd %xmm2,%xmm0
  mov    %r15,%rsi
  divss  %xmm2,%xmm1
  cvtss2sd %xmm1,%xmm1
  movsd  %xmm1,0x30(%rsp)
  call   <printf@plt>
  mov    %r15,%rax
  movsd  0x30(%rsp),%xmm1
  movss  0x38(%rsp),%xmm2
  add    $0x1,%rax
  comisd D38(%rip),%xmm1
  mov    %rax,0x28(%rsp)
  ja     L49
  mov    0x68(%rsp),%rax
  lea    D56(%rip),%rsi
  mov    0x20(%rax),%rdi
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L14
L28:
  mov    %r12,%rcx
  mov    %rbx,%rdx
  lea    D113(%rip),%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  xor    %r15d,%r15d
  call   <fprintf@plt>
  xor    %eax,%eax
  test   %r12,%r12
  jle    L215
  mov    %r12,0x8(%rsp)
  mov    %rax,%rbp
  nopw   0x0(%rax,%rax,1)
L189:
  mov    0x18(%rsp),%rax
  xor    %r14d,%r14d
  lea    (%rax,%rbp,4),%r12
  test   %rbx,%rbx
  jle    L236
  nopl   0x0(%rax)
L0:
  pxor   %xmm0,%xmm0
  mov    %r13,%rdi
  mov    $0x1,%eax
  add    $0x1,%r14
  lea    D83(%rip),%rsi
  cvtss2sd (%r12),%xmm0
  add    $0x4,%r12
  call   <fprintf@plt>
  cmp    %r14,%rbx
  jne    L0
L236:
  mov    %r13,%rsi
  mov    $0xa,%edi
  add    $0x1,%r15
  add    %rbx,%rbp
  call   <fputc@plt>
  cmp    %r15,0x8(%rsp)
  jne    L189
L215:
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L93
  add    $0x88,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L193:
  lea    D100(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L61
  nopl   0x0(%rax)
L49:
  test   %r12,%r12
  jle    L29
  mov    0x8(%rsp),%r9
  mov    %r13,%r8
  xor    %ecx,%ecx
  mov    %r13,0x30(%rsp)
  mov    0x48(%rsp),%rbp
  mov    %r12,%r13
  mov    %rcx,%r14
  mov    %rbx,%r12
  movss  %xmm2,0x38(%rsp)
  mov    %r9,%rbx
  mov    %r8,%r15
  jmp    L100
  nopl   0x0(%rax)
L151:
  add    $0x1,%r14
  add    $0x8,%r15
  add    %rbp,%rbx
  cmp    %r14,%r13
  je     L64
L100:
  mov    (%r15),%rdx
  test   %rdx,%rdx
  je     L151
  mov    %rbx,%rdi
  mov    %r12,%rsi
  add    $0x1,%r14
  add    $0x8,%r15
  call   <norm@plt>
  mov    0x60(%rsp),%rax
  mov    %rbx,%rsi
  mov    %rbp,%rdx
  lea    (%rax,%rbx,1),%rdi
  add    %rbp,%rbx
  call   <memcpy@plt>
  cmp    %r14,%r13
  jne    L100
L64:
  mov    %r12,%rbx
  movss  0x38(%rsp),%xmm2
  mov    %r13,%r12
  mov    0x30(%rsp),%r13
L29:
  movss  %xmm2,0x30(%rsp)
  jmp    L190
L120:
  mov    0x68(%rsp),%rax
  lea    D41(%rip),%rdi
  mov    0x8(%rax),%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L153
L14:
  mov    0x68(%rsp),%rax
  lea    D97(%rip),%rdi
  mov    0x20(%rax),%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L28
L93:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D108
type_infered: string
name: read_data
arguments: label: D79
type_infered: string
name: read_data
arguments: label: D13
type_infered: string
name: read_data
arguments: label: D114
type_infered: string
name: read_data
arguments: label: D73
type_infered: f32
name: read_data
arguments: label: D0
type_infered: string
name: read_data
arguments: label: D38
type_infered: f64
name: read_data
arguments: label: D56
type_infered: string
name: read_data
arguments: label: D113
type_infered: string
name: read_data
arguments: label: D83
type_infered: string
name: read_data
arguments: label: D100
type_infered: string
name: read_data
arguments: label: D41
type_infered: string
name: read_data
arguments: label: D97
type_infered: string

tool: D108: usage: %s TrainFile K(dimension) M(codebook size) VQFile


tool: D79: rb

tool: D13: dimension K=%ld  number of entries M=%ld


tool: D114: J=%ld entries in training set


tool: D73: 1e+32

tool: D0:   Iteration %ld, Dn = %f, Delta = %e


tool: D38: 0.01

tool: D56: wt

tool: D113: %ld %ld


tool: D83: %f  

tool: D100: Error in malloc.

tool: D41: Error opening training database file: %s


tool: D97: Error opening VQ file: %s


assistant: ```c
int main(int argc, char *argv[]) {
  long k, m;
  float *vec;
  float *cb;
  float *cent;
  long *n;
  long J;
  long i, j;
  long ind;
  float se;
  float Dn, Dn_1;
  float delta;
  FILE *ftrain;
  FILE *fvq;
  int ret;
  if (argc != 5) {
    printf("usage: %s TrainFile K(dimension) M(codebook size) VQFile\n", argv[0]);
    exit(1);
  }
  ftrain = fopen(argv[1], "rb");
  if (ftrain == NULL) {
    printf("Error opening training database file: %s\n", argv[1]);
    exit(1);
  }
  k = atol(argv[2]);
  m = atol(argv[3]);
  printf("dimension K=%ld  number of entries M=%ld\n", k, m);
  vec = (float *)malloc(sizeof(float) * k);
  cb = (float *)malloc(sizeof(float) * k * m);
  cent = (float *)malloc(sizeof(float) * k * m);
  n = (long *)malloc(sizeof(long) * m);
  if (cb == NULL || cb == NULL || cent == NULL || vec == NULL) {
    printf("Error in malloc.\n");
    exit(1);
  }
  J = 0;
  while (fread(vec, sizeof(float), k, ftrain) == (size_t)k)
    J++;
  printf("J=%ld entries in training set\n", J);
  rewind(ftrain);
  ret = fread(cb, sizeof(float), k * m, ftrain);
  Dn = 1E32;
  j = 1;
  do {
    Dn_1 = Dn;
    for (i = 0; i < m; i++) {
      zero(&cent[i * k], k);
      n[i] = 0;
    }
    se = 0.0;
    rewind(ftrain);
    for (i = 0; i < J; i++) {
      ret = fread(vec, sizeof(float), k, ftrain);
      ind = quantise(cb, vec, k, m, &se);
      n[ind]++;
      acc(&cent[ind * k], vec, k);
    }
    Dn = se / J;
    delta = (Dn_1 - Dn) / Dn;
    printf("\r  Iteration %ld, Dn = %f, Delta = %e\n", j, Dn, delta);
    j++;
    if (delta > 0.01)
      for (i = 0; i < m; i++) {
        if (n[i] != 0) {
          norm(&cent[i * k], k, n[i]);
          memcpy(&cb[i * k], &cent[i * k], k * sizeof(float));
        }
      }
  } while (delta > 0.01);
  fvq = fopen(argv[4], "wt");
  if (fvq == NULL) {
    printf("Error opening VQ file: %s\n", argv[4]);
    exit(1);
  }
  fprintf(fvq, "%ld %ld\n", k, m);
  for (j = 0; j < m; j++) {
    for (i = 0; i < k; i++)
      fprintf(fvq, "%f  ", cb[j * k + i]);
    fprintf(fvq, "\n");
  }
  fclose(fvq);
  return 0;
}
```