user: 请将以下的汇编代码转换成C语言代码：

```asm
<form_flat_clusters_maxclust_monocrit>:
  endbr64
  push   %r15
  mov    %rdi,%r11
  movslq %ecx,%rdi
  pxor   %xmm0,%xmm0
  push   %r14
  mov    %rdi,%rax
  cvtsi2sd %edi,%xmm0
  pxor   %xmm1,%xmm1
  push   %r13
  shr    $0x3,%rax
  push   %r12
  cvtsi2sd %rax,%xmm1
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mulsd  D17(%rip),%xmm0
  mov    %rdx,0x38(%rsp)
  mov    %r8d,0x2c(%rsp)
  ucomisd %xmm1,%xmm0
  jp     L212
  mov    %eax,%ebx
  jne    L212
L92:
  movsd  -0x10(%rbp,%rdi,8),%xmm3
  movslq %ebx,%rbx
  shl    $0x2,%rdi
  mov    %r11,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <malloc@plt>
  mov    %rbx,%rdi
  mov    $0x1,%esi
  mov    %rbx,(%rsp)
  mov    %rax,%r14
  call   <calloc@plt>
  mov    %rbx,%rdi
  mov    $0x1,%esi
  mov    %r12d,%ebx
  mov    %rax,%r15
  call   <calloc@plt>
  sub    $0x2,%ebx
  movsd  0x8(%rsp),%xmm3
  mov    0x10(%rsp),%r11
  mov    %rax,%r13
  lea    -0x2(%r12,%r12,1),%eax
  mov    %eax,0x28(%rsp)
  mov    %eax,(%r14)
  js     L29
  movsd  D8(%rip),%xmm5
  movslq %ebx,%rbx
  movsd  %xmm5,0x30(%rsp)
  jmp    L192
  nopl   0x0(%rax)
L109:
  sub    $0x1,%rbx
  test   %ebx,%ebx
  js     L29
L192:
  movsd  0x0(%rbp,%rbx,8),%xmm0
  comisd %xmm3,%xmm0
  ja     L109
  mov    0x28(%rsp),%eax
  mov    (%rsp),%rdx
  xor    %esi,%esi
  mov    %r15,%rdi
  mov    %r11,0x20(%rsp)
  movsd  %xmm0,0x18(%rsp)
  movsd  %xmm3,0x10(%rsp)
  mov    %eax,(%r14)
  call   <memset@plt>
  mov    (%rsp),%rdx
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  mov    %rbx,0x8(%rsp)
  mov    0x28(%rsp),%ecx
  xor    %eax,%eax
  mov    0x20(%rsp),%r11
  movsd  0x18(%rsp),%xmm0
  xor    %r8d,%r8d
  movsd  0x10(%rsp),%xmm3
  jmp    L193
  nopl   (%rax)
L229:
  movzbl %sil,%r10d
  movslq %eax,%r9
  bt     %ecx,%r10d
  jb     L179
  cvttsd2si %xmm1,%r10d
  mov    $0x1,%ebx
  shl    %cl,%ebx
  or     %esi,%ebx
  mov    %bl,(%rdi)
  cmp    %r10d,%r12d
  jle    L23
  add    $0x1,%r8d
L179:
  add    %r13,%rdx
  movzbl (%rdx),%edi
  bt     %ecx,%edi
  mov    %edi,%esi
  jb     L110
  cvttsd2si %xmm2,%edi
  cmp    %edi,%r12d
  jle    L8
  add    $0x1,%r8d
L110:
  sub    $0x1,%eax
  cmp    $0xffffffff,%eax
  je     L11
L20:
  movslq %eax,%rdx
  mov    (%r14,%rdx,4),%ecx
L193:
  sub    %r12d,%ecx
  lea    0x0(,%rcx,4),%edx
  movslq %ecx,%r9
  not    %ecx
  movslq %edx,%rdx
  and    $0x7,%ecx
  lea    (%r11,%rdx,8),%rdx
  movsd  (%rdx),%xmm1
  movsd  0x8(%rdx),%xmm2
  mov    %r9,%rdx
  shr    $0x3,%rdx
  comisd 0x0(%rbp,%r9,8),%xmm0
  lea    (%r15,%rdx,1),%rdi
  movzbl (%rdi),%esi
  jb     L229
  mov    $0x1,%ebx
  sub    $0x1,%eax
  add    $0x1,%r8d
  shl    %cl,%ebx
  or     %bl,0x0(%r13,%rdx,1)
  or     %ebx,%esi
  mov    %sil,(%rdi)
  cmp    $0xffffffff,%eax
  jne    L20
L11:
  mov    0x8(%rsp),%rbx
  cmp    0x2c(%rsp),%r8d
  jle    L35
  comisd 0x30(%rsp),%xmm0
  ja     L171
L35:
  comisd %xmm0,%xmm3
  jbe    L109
  cmp    0x2c(%rsp),%r8d
  jg     L109
  sub    $0x1,%rbx
  movapd %xmm0,%xmm3
  test   %ebx,%ebx
  jns    L192
L29:
  mov    0x38(%rsp),%rdx
  mov    %r12d,%ecx
  mov    %rbp,%rsi
  mov    %r11,%rdi
  movapd %xmm3,%xmm0
  mov    $0x1,%eax
  call   <form_flat_clusters_from_monotonic_criterion@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  add    $0x48,%rsp
  mov    %r13,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <free@plt>
  nopl   0x0(%rax,%rax,1)
L23:
  mov    %r10d,0x4(%r14,%r9,4)
  add    $0x1,%eax
  jmp    L20
  nopl   (%rax)
L8:
  mov    $0x1,%ebx
  mov    %edi,0x4(%r14,%r9,4)
  add    $0x1,%eax
  shl    %cl,%ebx
  or     %ebx,%esi
  mov    %sil,(%rdx)
  jmp    L20
  nopl   0x0(%rax)
L212:
  lea    0x1(%rax),%ebx
  jmp    L92
  nopl   0x0(%rax,%rax,1)
L171:
  movsd  %xmm0,0x30(%rsp)
  jmp    L109
```

tool_calls: name: parse_data
arguments: data_tag: D17
datatype: f32[2]
name: parse_data
arguments: data_tag: D8
datatype: f32[2]

tool: {"D17": [0.0,1.5]}

tool: {"D8": [0.0,-1.875]}

assistant: ```c
void form_flat_clusters_maxclust_monocrit(const double *Z, const double *mono_crit, int *T, int n, int mc) {
  int *curNode;
  int ndid, lid, rid, k, nc, g, ms;
  unsigned char *lvisited, *rvisited;
  const double *Zrow;
  double thresh, maxmono_crit;
  double max_illegal = -1.0;
  double min_legal = 0.0;
  int min_legal_nc = 1;
  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)));
  k = 0;
  min_legal = mono_crit[n - 2];
  curNode = (int *)malloc(n * sizeof(int));
  lvisited = (unsigned char *)malloc(bff);
  rvisited = (unsigned char *)malloc(bff);
  curNode[k] = (n * 2) - 2;
  bzero(lvisited, bff);
  bzero(rvisited, bff);
  nc = 0;
  ;
  for (g = n - 2; g >= 0; g--) {
    thresh = mono_crit[g];
    if (thresh > min_legal) {
      continue;
    }
    k = 0;
    curNode[k] = (n * 2) - 2;
    bzero(lvisited, bff);
    bzero(rvisited, bff);
    nc = 0;
    ms = -1;
    while (k >= 0) {
      ndid = curNode[k];
      Zrow = Z + ((ndid - n) * 4);
      lid = (int)Zrow[0];
      rid = (int)Zrow[1];
      maxmono_crit = mono_crit[ndid - n];
      if (maxmono_crit <= thresh) {
        nc++;
        k--;
        ((lvisited)[(ndid - n) / (sizeof(unsigned char) * 8)] |= ((0x1) << (((sizeof(unsigned char) * 8) - 1) - ((ndid - n) % (sizeof(unsigned char) * 8)))));
        ((rvisited)[(ndid - n) / (sizeof(unsigned char) * 8)] |= ((0x1) << (((sizeof(unsigned char) * 8) - 1) - ((ndid - n) % (sizeof(unsigned char) * 8)))));
        continue;
      }
      if (!(((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)))));
        if (lid >= n) {
          curNode[k + 1] = lid;
          k++;
          continue;
        } else if (lid < n) {
          nc++;
        }
      }
      if (!(((rvisited)[(ndid - n) / (sizeof(unsigned char) * 8)] >> (((sizeof(unsigned char) * 8) - 1) - ((ndid - n) % (sizeof(unsigned char) * 8)))) & 0x1)) {
        if (rid >= n) {
          ((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;
        } else if (rid < n) {
          nc++;
        }
      }
      k--;
    }
    if (thresh > max_illegal && nc > mc) {
      ;
      max_illegal = thresh;
      continue;
    }
    if (thresh < min_legal && nc <= mc) {
      min_legal = thresh;
      min_legal_nc = nc;
      ;
    }
  }
  form_flat_clusters_from_monotonic_criterion(Z, mono_crit, T, min_legal, n);
  free(curNode);
  free(lvisited);
  free(rvisited);
}
```