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

```asm
<form_flat_clusters_from_monotonic_criterion>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  movslq %ecx,%rdi
  pxor   %xmm1,%xmm1
  push   %r14
  mov    %rdi,%rax
  cvtsi2sd %edi,%xmm1
  pxor   %xmm2,%xmm2
  push   %r13
  shr    $0x3,%rax
  push   %r12
  cvtsi2sd %rax,%xmm2
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  mulsd  D4(%rip),%xmm1
  mov    %rdx,0x20(%rsp)
  ucomisd %xmm2,%xmm1
  jp     L209
  mov    %eax,%r13d
  jne    L209
L96:
  shl    $0x2,%rdi
  movslq %r13d,%r13
  movsd  %xmm0,0x28(%rsp)
  call   <malloc@plt>
  mov    $0x1,%esi
  mov    %r13,%rdi
  mov    %rax,%r12
  call   <calloc@plt>
  mov    $0x1,%esi
  mov    %r13,%rdi
  mov    %rax,0x10(%rsp)
  call   <calloc@plt>
  lea    -0x2(%rbx,%rbx,1),%r9d
  mov    %rbp,(%rsp)
  xor    %esi,%esi
  mov    %rax,0x18(%rsp)
  movsd  0x28(%rsp),%xmm0
  mov    $0xffffffff,%r10d
  xor    %r11d,%r11d
  mov    %r9d,(%r12)
  movl   $0x0,0xc(%rsp)
  nopl   (%rax)
L105:
  mov    %r9d,%eax
  mov    (%rsp),%rcx
  sub    %ebx,%eax
  lea    0x0(,%rax,4),%edx
  movslq %edx,%rdx
  lea    (%r15,%rdx,8),%rdx
  cvttsd2si (%rdx),%edi
  cvttsd2si 0x8(%rdx),%r8d
  movslq %eax,%rdx
  movsd  (%rcx,%rdx,8),%xmm1
  cmp    $0xffffffff,%r10d
  je     L81
L70:
  cmp    %edi,%ebx
  jg     L181
  mov    %rdx,%r13
  mov    %eax,%ecx
  shr    $0x3,%r13
  add    0x10(%rsp),%r13
  not    %ecx
  movzbl 0x0(%r13),%ebp
  and    $0x7,%ecx
  bt     %ecx,%ebp
  mov    %ebp,%r14d
  jae    L88
L181:
  cmp    %r8d,%ebx
  jg     L229
  shr    $0x3,%rdx
  add    0x18(%rsp),%rdx
  not    %eax
  movzbl (%rdx),%r13d
  mov    %eax,%ecx
  and    $0x7,%ecx
  movzbl %r13b,%eax
  bt     %ecx,%eax
  jae    L103
L229:
  cmp    %r9d,%ebx
  jg     L218
  cmp    %edi,%ebx
  jle    L24
  mov    0x20(%rsp),%rax
  movslq %edi,%rdi
  lea    (%rax,%rdi,4),%rax
  cmp    $0xffffffff,%r10d
  je     L132
  mov    0xc(%rsp),%edi
  mov    %edi,(%rax)
  cmp    %r8d,%ebx
  jg     L116
L134:
  cmp    %esi,%r10d
  mov    $0xffffffff,%eax
  cmove  %eax,%r10d
L218:
  sub    $0x1,%esi
  jb     L3
L1:
  movslq %esi,%r11
  mov    (%r12,%r11,4),%r9d
  jmp    L105
  nopl   0x0(%rax)
L24:
  cmp    %r8d,%ebx
  jle    L134
  cmp    $0xffffffff,%r10d
  je     L110
L116:
  mov    0x20(%rsp),%rax
  mov    0xc(%rsp),%edi
  movslq %r8d,%r8
  mov    %edi,(%rax,%r8,4)
  jmp    L134
  nopl   0x0(%rax)
L81:
  comisd %xmm1,%xmm0
  jb     L70
  addl   $0x1,0xc(%rsp)
  mov    %esi,%r10d
  jmp    L70
  nopw   0x0(%rax,%rax,1)
L88:
  mov    $0x1,%eax
  mov    %edi,0x4(%r12,%r11,4)
  add    $0x1,%esi
  shl    %cl,%eax
  or     %eax,%r14d
  mov    %r14b,0x0(%r13)
  jmp    L1
  nopl   0x0(%rax,%rax,1)
L103:
  mov    $0x1,%eax
  mov    %r8d,0x4(%r12,%r11,4)
  add    $0x1,%esi
  shl    %cl,%eax
  or     %eax,%r13d
  mov    %r13b,(%rdx)
  jmp    L1
  nopw   0x0(%rax,%rax,1)
L3:
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
  nopw   0x0(%rax,%rax,1)
L209:
  lea    0x1(%rax),%r13d
  jmp    L96
  nopl   0x0(%rax)
L132:
  addl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%edi
  mov    %edi,(%rax)
  cmp    %r8d,%ebx
  jle    L218
L110:
  addl   $0x1,0xc(%rsp)
  mov    0x20(%rsp),%rdi
  movslq %r8d,%r8
  mov    0xc(%rsp),%eax
  mov    %eax,(%rdi,%r8,4)
  jmp    L218
```

tool_calls: name: retrieve_data
arguments: label: D4
type_guessed: byte[8]

tool: {"D4": [0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x3f]}

assistant: ```c
void form_flat_clusters_from_monotonic_criterion(const double *Z, const double *mono_crit, int *T, double cutoff, int n) {
  int *curNode;
  int ndid, lid, rid, k, ms, nc;
  unsigned char *lvisited, *rvisited;
  double max_crit;
  const double *Zrow;
  const int bff = (((((double)(n)) / (double)(sizeof(unsigned char) * 8)) == ((double)(((n)) / ((sizeof(unsigned char) * 8)))) ? (((n)) / ((sizeof(unsigned char) * 8))) : (((n)) / ((sizeof(unsigned char) * 8)) + 1)));
  curNode = (int *)malloc(n * sizeof(int));
  lvisited = (unsigned char *)malloc(bff);
  rvisited = (unsigned char *)malloc(bff);
  nc = 0;
  ms = -1;
  k = 0;
  curNode[k] = (n * 2) - 2;
  bzero(lvisited, bff);
  bzero(rvisited, bff);
  ms = -1;
  while (k >= 0) {
    ndid = curNode[k];
    Zrow = Z + ((ndid - n) * 4);
    lid = (int)Zrow[0];
    rid = (int)Zrow[1];
    max_crit = mono_crit[ndid - n];
    ;
    if (ms == -1 && max_crit <= cutoff) {
      ;
      ms = k;
      nc++;
    }
    if (lid >= n && !(((lvisited)[(ndid - n) / (sizeof(unsigned char) * 8)] >> (((sizeof(unsigned char) * 8) - 1) - ((ndid - n) % (sizeof(unsigned char) * 8)))) & 0x1)) {
      ((lvisited)[(ndid - n) / (sizeof(unsigned char) * 8)] |= ((0x1) << (((sizeof(unsigned char) * 8) - 1) - ((ndid - n) % (sizeof(unsigned char) * 8)))));
      curNode[k + 1] = lid;
      k++;
      continue;
    }
    if (rid >= n && !(((rvisited)[(ndid - n) / (sizeof(unsigned char) * 8)] >> (((sizeof(unsigned char) * 8) - 1) - ((ndid - n) % (sizeof(unsigned char) * 8)))) & 0x1)) {
      ((rvisited)[(ndid - n) / (sizeof(unsigned char) * 8)] |= ((0x1) << (((sizeof(unsigned char) * 8) - 1) - ((ndid - n) % (sizeof(unsigned char) * 8)))));
      curNode[k + 1] = rid;
      k++;
      continue;
    }
    if (ndid >= n) {
      if (lid < n) {
        if (ms == -1) {
          nc++;
          T[lid] = nc;
        } else {
          T[lid] = nc;
        }
      }
      if (rid < n) {
        if (ms == -1) {
          nc++;
          T[rid] = nc;
        } else {
          T[rid] = nc;
        }
      }
      if (ms == k) {
        ms = -1;
      }
    }
    k--;
  }
  free(curNode);
  free(lvisited);
  free(rvisited);
}
```