user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mergecb>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    $0x1,%r12d
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,0x60(%rsp)
  mov    %rdx,0x48(%rsp)
  mov    %ecx,0x68(%rsp)
  mov    %r8d,0x34(%rsp)
  movss  %xmm0,0x6c(%rsp)
  cmp    $0x1,%r8d
  je     L227
  mov    %rsi,%r15
  mov    %r8d,%edi
  mov    $0x4,%esi
  mov    %ecx,%ebx
  mov    %r9d,%r14d
  call   <calloc@plt>
  mov    %rax,0x50(%rsp)
  test   %ebx,%ebx
  jle    L380
  mov    0x68(%rsp),%esi
  mov    0x48(%rsp),%rcx
  lea    -0x1(%rsi),%edx
  mov    0x50(%rsp),%rsi
  mov    %rcx,%rax
  lea    0x1(%rcx,%rdx,1),%rcx
  nopw   0x0(%rax,%rax,1)
L24:
  movzbl (%rax),%edx
  add    $0x1,%rax
  addl   $0x1,(%rsi,%rdx,4)
  cmp    %rcx,%rax
  jne    L24
L380:
  mov    0x34(%rsp),%ebx
  mov    %ebx,%esi
  mov    %ebx,%edi
  call   <fmatrix@plt>
  mov    %rax,0x58(%rsp)
  cmp    $0x1,%ebx
  jle    L53
  mov    0x34(%rsp),%ecx
  add    $0x8,%rax
  mov    $0x1,%r12d
  mov    %rax,0x20(%rsp)
  lea    -0x2(%rcx),%eax
  add    $0x2,%rax
  mov    %rax,0x38(%rsp)
  lea    -0x1(%rcx),%eax
  mov    %eax,0x40(%rsp)
  mov    %r15,%rax
  mov    %r12,%r15
  mov    %rax,%r12
  nopw   0x0(%rax,%rax,1)
L170:
  cmp    %r15d,0x34(%rsp)
  jle    L146
  mov    0x20(%rsp),%rax
  lea    0x0(,%r15,4),%r13
  mov    0x40(%rsp),%ebp
  lea    -0x8(%rax),%rcx
  sub    %r15d,%ebp
  mov    -0x8(%rax),%rbx
  mov    %rcx,0x18(%rsp)
  lea    -0x4(%r13),%rcx
  mov    %rcx,0x8(%rsp)
  lea    0x1(%r15),%rcx
  add    %rcx,%rbp
  mov    %rcx,0x28(%rsp)
  lea    0x0(,%rbp,4),%rcx
  mov    %rax,%rbp
  mov    %r15,%rax
  mov    %rcx,0x10(%rsp)
  mov    %rbp,%r15
  mov    %rax,%rbp
  nopw   0x0(%rax,%rax,1)
L192:
  mov    (%r12,%r13,2),%rsi
  mov    -0x8(%r12,%rbp,8),%rdi
  mov    %r14d,%edx
  add    %r13,%rbx
  add    $0x8,%r15
  call   <distance2@plt>
  mov    0x18(%rsp),%rax
  mov    -0x8(%r15),%rdx
  movss  %xmm0,(%rbx)
  mov    (%rax),%rbx
  mov    0x8(%rsp),%rax
  movss  (%rbx,%r13,1),%xmm0
  add    $0x4,%r13
  movss  %xmm0,(%rdx,%rax,1)
  cmp    0x10(%rsp),%r13
  jne    L192
L132:
  addq   $0x8,0x20(%rsp)
  mov    0x28(%rsp),%r15
  cmp    0x38(%rsp),%r15
  jne    L170
  mov    %r12,%r15
L53:
  movss  0x6c(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  lea    0x6c(%rsp),%rbx
  comiss %xmm0,%xmm1
  ja     L85
L208:
  lea    D0(%rip),%rdi
  call   <printf@plt>
  push   $0x0
  mov    0x58(%rsp),%rbp
  mov    %r15,%rdx
  push   %rbp
  push   %r14
  push   %rbx
  mov    0x54(%rsp),%r14d
  mov    0x78(%rsp),%rbx
  mov    0x88(%rsp),%r8d
  mov    0x68(%rsp),%rcx
  mov    0x80(%rsp),%rsi
  mov    %r14d,%r9d
  mov    %rbx,%rdi
  call   <mergecb1@plt>
  mov    %rbx,%rdi
  add    $0x20,%rsp
  mov    %r14d,%esi
  mov    %eax,%r12d
  call   <free_fmatrix@plt>
  mov    %rbp,%rdi
  call   <free@plt>
L227:
  add    $0x78,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L146:
  lea    0x1(%r15),%rax
  mov    %rax,0x28(%rsp)
  jmp    L132
L85:
  mov    0x34(%rsp),%ebx
  mov    %r14d,%esi
  mov    %ebx,%edi
  call   <fmatrix@plt>
  mov    %rax,0x28(%rsp)
  mov    %rax,%rsi
  test   %ebx,%ebx
  jle    L273
  mov    %ebx,%r12d
  test   %r14d,%r14d
  jle    L418
  lea    (%rax,%r12,8),%rdx
  mov    %r14d,%eax
  mov    %r14d,%r10d
  mov    %r15,%r13
  shr    $0x2,%eax
  and    $0xfffffffc,%r10d
  mov    %r15,0x18(%rsp)
  sub    %rsi,%r13
  lea    -0x1(%rax),%ecx
  lea    0x1(%r10),%ebx
  mov    %r10d,%r11d
  mov    %r12,0x20(%rsp)
  lea    0x2(%r10),%ebp
  add    $0x1,%rcx
  lea    -0x1(%r14),%eax
  mov    %ebx,0x8(%rsp)
  mov    %ebp,0x10(%rsp)
  shl    $0x4,%rcx
  shl    $0x2,%r11
  mov    %r14d,%r9d
  shl    $0x2,%rbx
  shl    $0x2,%rbp
  mov    %rdx,%r12
  mov    %eax,%r15d
L200:
  mov    0x0(%r13,%rsi,1),%rax
  mov    (%rsi),%rdx
  lea    0x4(%rax),%r8
  mov    %rdx,%rdi
  sub    %r8,%rdi
  cmp    $0x8,%rdi
  jbe    L258
  xor    %edi,%edi
  cmp    $0x2,%r15d
  jbe    L258
  nopl   0x0(%rax,%rax,1)
L254:
  movups (%rax,%rdi,1),%xmm3
  movups %xmm3,(%rdx,%rdi,1)
  add    $0x10,%rdi
  cmp    %rcx,%rdi
  jne    L254
  cmp    %r10d,%r14d
  je     L171
  movss  (%rax,%r11,1),%xmm0
  movss  %xmm0,(%rdx,%r11,1)
  cmp    0x8(%rsp),%r14d
  jle    L171
  movss  (%rax,%rbx,1),%xmm0
  movss  %xmm0,(%rdx,%rbx,1)
  cmp    0x10(%rsp),%r14d
  jle    L171
  movss  (%rax,%rbp,1),%xmm0
  movss  %xmm0,(%rdx,%rbp,1)
L171:
  add    $0x8,%rsi
  cmp    %r12,%rsi
  jne    L200
  mov    0x18(%rsp),%r15
  mov    0x20(%rsp),%r12
L418:
  mov    0x34(%rsp),%ebx
  mov    $0x4,%esi
  mov    %ebx,%edi
  call   <calloc@plt>
  mov    %rax,%rcx
  mov    %rax,0x18(%rsp)
  lea    -0x1(%rbx),%eax
  cmp    $0x2,%eax
  mov    0x50(%rsp),%rax
  seta   %r13b
  lea    0x4(%rax),%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L326
  test   %r13b,%r13b
  je     L326
  mov    0x34(%rsp),%edx
  mov    0x50(%rsp),%rdi
  mov    %rcx,%rsi
  shr    $0x2,%edx
  mov    %rdi,%rax
  sub    %rdi,%rsi
  shl    $0x4,%rdx
  add    %rdi,%rdx
  nopw   0x0(%rax,%rax,1)
L80:
  movdqu (%rax),%xmm4
  movups %xmm4,(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L80
  mov    0x34(%rsp),%ebx
  mov    %ebx,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%bl
  je     L58
  mov    0x50(%rsp),%r11
  mov    %eax,%esi
  lea    0x0(,%rsi,4),%rdx
  mov    (%r11,%rsi,4),%edi
  mov    %edi,(%rcx,%rsi,4)
  lea    0x1(%rax),%esi
  cmp    %esi,%ebx
  jle    L58
  mov    0x4(%r11,%rdx,1),%esi
  add    $0x2,%eax
  mov    %esi,0x4(%rcx,%rdx,1)
  cmp    %eax,%ebx
  jle    L58
  mov    0x8(%r11,%rdx,1),%eax
  mov    %eax,0x8(%rcx,%rdx,1)
L58:
  mov    0x34(%rsp),%ebx
  mov    %ebx,%esi
  mov    %ebx,%edi
  call   <fmatrix@plt>
  mov    0x58(%rsp),%rdi
  mov    %ebx,%r10d
  mov    %ebx,%edx
  mov    %rax,%r8
  mov    %rax,0x20(%rsp)
  and    $0xfffffffc,%r10d
  lea    (%rdi,%r12,8),%rax
  lea    0x1(%r10),%r11d
  mov    %r10d,%r9d
  sub    %rdi,%r8
  mov    %rax,0x38(%rsp)
  mov    %ebx,%eax
  lea    0x2(%r10),%ebx
  mov    %rdi,%rsi
  shr    $0x2,%eax
  mov    %r11d,0x8(%rsp)
  shl    $0x2,%r9
  mov    %r8,%rbp
  lea    -0x1(%rax),%ecx
  mov    %ebx,0x10(%rsp)
  shl    $0x2,%r11
  shl    $0x2,%rbx
  add    $0x1,%rcx
  mov    %r15,0x40(%rsp)
  mov    0x38(%rsp),%r15
  shl    $0x4,%rcx
  mov    %r14d,0x38(%rsp)
  mov    %edx,%r14d
  nopl   0x0(%rax)
L323:
  mov    (%rsi),%rax
  mov    0x0(%rbp,%rsi,1),%rdx
  lea    0x4(%rax),%r8
  mov    %rdx,%rdi
  sub    %r8,%rdi
  cmp    $0x8,%rdi
  jbe    L34
  xor    %edi,%edi
  test   %r13b,%r13b
  je     L34
  nopw   0x0(%rax,%rax,1)
L11:
  movups (%rax,%rdi,1),%xmm2
  movups %xmm2,(%rdx,%rdi,1)
  add    $0x10,%rdi
  cmp    %rdi,%rcx
  jne    L11
  cmp    %r10d,%r14d
  je     L257
  movss  (%rax,%r9,1),%xmm0
  movss  %xmm0,(%rdx,%r9,1)
  cmp    0x8(%rsp),%r14d
  jle    L257
  movss  (%rax,%r11,1),%xmm0
  movss  %xmm0,(%rdx,%r11,1)
  cmp    %r14d,0x10(%rsp)
  jge    L257
  movss  (%rax,%rbx,1),%xmm0
  movss  %xmm0,(%rdx,%rbx,1)
L257:
  add    $0x8,%rsi
  cmp    %r15,%rsi
  jne    L323
  mov    0x40(%rsp),%r15
  mov    0x38(%rsp),%r14d
L297:
  cmp    $0x3,%r14d
  je     L147
  cmp    $0x1,%r14d
  jne    L105
  movl   $0x44480000,0x6c(%rsp)
L105:
  push   $0x1
  push   0x20(%rsp)
  push   %r14
  lea    0x84(%rsp),%rbx
  push   %rbx
  mov    0x54(%rsp),%ebp
  mov    0x48(%rsp),%r13
  mov    0x40(%rsp),%r12
  mov    0x88(%rsp),%r8d
  mov    0x68(%rsp),%rcx
  mov    %ebp,%r9d
  mov    0x80(%rsp),%rsi
  mov    %r13,%rdx
  mov    %r12,%rdi
  call   <mergecb1@plt>
  add    $0x20,%rsp
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <free_fmatrix@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <free_fmatrix@plt>
  movss  0x6c(%rsp),%xmm0
  jmp    L208
L34:
  xor    %edi,%edi
  nopw   0x0(%rax,%rax,1)
L345:
  movss  (%rax,%rdi,4),%xmm0
  movss  %xmm0,(%rdx,%rdi,4)
  add    $0x1,%rdi
  cmp    %r12,%rdi
  jne    L345
  jmp    L257
L258:
  xor    %edi,%edi
  nopw   0x0(%rax,%rax,1)
L176:
  movss  (%rax,%rdi,4),%xmm0
  movss  %xmm0,(%rdx,%rdi,4)
  add    $0x1,%rdi
  cmp    %r9,%rdi
  jne    L176
  jmp    L171
L147:
  movl   $0x43c80000,0x6c(%rsp)
  jmp    L105
L326:
  mov    0x50(%rsp),%rdx
  mov    %rdx,%rax
  lea    (%rdx,%r12,4),%rsi
  sub    %rdx,%rcx
L285:
  mov    (%rax),%edx
  mov    %edx,(%rcx,%rax,1)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L285
  jmp    L58
L273:
  mov    0x34(%rsp),%ebx
  mov    $0x4,%esi
  mov    %ebx,%edi
  call   <calloc@plt>
  mov    %ebx,%esi
  mov    %ebx,%edi
  mov    %rax,0x18(%rsp)
  call   <fmatrix@plt>
  mov    %rax,0x20(%rsp)
  jmp    L297
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D0
type_infered: string

tool: D0: thresh %f 

assistant: ```c
int mergecb(float *B, float **cb, unsigned char *P, int npt, int N, float thresh, int dim) {
  int i, j, newN, *count, l, ei, *count2;
  float **dist, **dist2, **cb2;
  if (N == 1)
    return 1;
  count = (int *)calloc(N, sizeof(int));
  for (l = 0; l < npt; l++)
    count[P[l]]++;
  dist = (float **)fmatrix(N, N);
  ei = N - 1;
  for (i = 0; i < ei; i++) {
    for (j = i + 1; j < N; j++) {
      dist[i][j] = distance2(cb[i], cb[j], dim);
      dist[j][i] = dist[i][j];
    }
  }
  if (thresh < 0) {
    cb2 = (float **)fmatrix(N, dim);
    for (i = 0; i < N; i++)
      for (j = 0; j < dim; j++)
        cb2[i][j] = cb[i][j];
    count2 = (int *)calloc(N, sizeof(int));
    for (i = 0; i < N; i++)
      count2[i] = count[i];
    dist2 = (float **)fmatrix(N, N);
    for (i = 0; i < N; i++)
      for (j = 0; j < N; j++)
        dist2[i][j] = dist[i][j];
    if (dim == 3)
      thresh = 400;
    else if (dim == 1)
      thresh = 800;
    mergecb1(dist2, B, cb2, P, npt, N, &thresh, dim, count2, 1);
    free_fmatrix(cb2, N);
    free(count2);
    free_fmatrix(dist2, N);
  }
  printf("thresh %f ", thresh);
  newN = mergecb1(dist, B, cb, P, npt, N, &thresh, dim, count, 0);
  free_fmatrix(dist, N);
  free(count);
  return newN;
}
```