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  D18(%rip),%xmm0
  mov    %rdx,0x38(%rsp)
  mov    %r8d,0x2c(%rsp)
  ucomisd %xmm1,%xmm0
  jp     L38
  mov    %eax,%ebx
  jne    L38
L137:
  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     L192
  movsd  D12(%rip),%xmm5
  movslq %ebx,%rbx
  movsd  %xmm5,0x30(%rsp)
  jmp    L77
  nopl   0x0(%rax)
L73:
  sub    $0x1,%rbx
  test   %ebx,%ebx
  js     L192
L77:
  movsd  0x0(%rbp,%rbx,8),%xmm0
  comisd %xmm3,%xmm0
  ja     L73
  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    L24
  nopl   (%rax)
L214:
  movzbl %sil,%r10d
  movslq %eax,%r9
  bt     %ecx,%r10d
  jb     L98
  cvttsd2si %xmm1,%r10d
  mov    $0x1,%ebx
  shl    %cl,%ebx
  or     %esi,%ebx
  mov    %bl,(%rdi)
  cmp    %r10d,%r12d
  jle    L198
  add    $0x1,%r8d
L98:
  add    %r13,%rdx
  movzbl (%rdx),%edi
  bt     %ecx,%edi
  mov    %edi,%esi
  jb     L3
  cvttsd2si %xmm2,%edi
  cmp    %edi,%r12d
  jle    L10
  add    $0x1,%r8d
L3:
  sub    $0x1,%eax
  cmp    $0xffffffff,%eax
  je     L103
L107:
  movslq %eax,%rdx
  mov    (%r14,%rdx,4),%ecx
L24:
  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     L214
  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    L107
L103:
  mov    0x8(%rsp),%rbx
  cmp    0x2c(%rsp),%r8d
  jle    L128
  comisd 0x30(%rsp),%xmm0
  ja     L190
L128:
  comisd %xmm0,%xmm3
  jbe    L73
  cmp    0x2c(%rsp),%r8d
  jg     L73
  sub    $0x1,%rbx
  movapd %xmm0,%xmm3
  test   %ebx,%ebx
  jns    L77
L192:
  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)
L198:
  mov    %r10d,0x4(%r14,%r9,4)
  add    $0x1,%eax
  jmp    L107
  nopl   (%rax)
L10:
  mov    $0x1,%ebx
  mov    %edi,0x4(%r14,%r9,4)
  add    $0x1,%eax
  shl    %cl,%ebx
  or     %ebx,%esi
  mov    %sil,(%rdx)
  jmp    L107
  nopl   0x0(%rax)
L38:
  lea    0x1(%rax),%ebx
  jmp    L137
  nopl   0x0(%rax,%rax,1)
L190:
  movsd  %xmm0,0x30(%rsp)
  jmp    L73
```

tool_calls: name: read_data
arguments: label: D18
type_guessed: f32[2]
name: read_data
arguments: label: D12
type_guessed: f32[2]

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

tool: {"D12": [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);
}
```