user: 请从给定的汇编指令推导出C源代码：

```asm
<mk_bms>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rsi),%r12d
  test   %r12d,%r12d
  je     L5
  movsd  D21(%rip),%xmm1
  mov    %rdi,%r13
  mov    %rsi,%rbp
  xor    %ebx,%ebx
  movsd  D20(%rip),%xmm3
  mov    %rdi,%rax
  nopl   (%rax)
L31:
  pxor   %xmm0,%xmm0
  cvtss2sd (%rax),%xmm0
  comisd %xmm1,%xmm0
  jb     L9
  comisd %xmm0,%xmm3
  jae    L169
L9:
  add    $0x1,%ebx
  add    $0x4,%rax
  cmp    %ebx,%r12d
  jne    L31
L5:
  mov    $0x6,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L72
L33:
  mov    %r14,%rsi
  mov    $0x6,%edi
  call   <uint_char@plt>
  mov    $0xffffff06,%edx
  mov    %dx,0x4(%r14)
  jmp    L62
  nopw   0x0(%rax,%rax,1)
L169:
  lea    0x7(%r12),%r15d
  shr    $0x3,%r15d
  add    $0x6,%r15d
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L126
L120:
  mov    %r15d,%edi
  mov    %r14,%rsi
  mov    %ebx,%r15d
  call   <uint_char@plt>
  mov    $0x6,%eax
  shr    $0x3,%r15d
  lea    0x6(%r14),%rcx
  mov    %ax,0x4(%r14)
  mov    D21(%rip),%rax
  movq   %rax,%xmm1
  mov    D20(%rip),%rax
  movq   %rax,%xmm3
  je     L79
  mov    %r15d,%r15d
  mov    %rcx,%rdi
  mov    $0xff,%esi
  mov    %r15,%rdx
  call   <memset@plt>
  mov    %rax,%rcx
  mov    D20(%rip),%rax
  add    %r15,%rcx
  movq   %rax,%xmm3
  mov    D21(%rip),%rax
  movq   %rax,%xmm1
L79:
  and    $0xfffffff8,%ebx
  cmp    %ebx,%r12d
  jbe    L41
  sub    $0x1,%r12d
  mov    %ebx,%edx
  xor    %esi,%esi
  sub    %ebx,%r12d
  lea    0x0(%r13,%rdx,4),%rax
  add    %r12,%rdx
  lea    0x4(%r13,%rdx,4),%r8
  mov    $0x80,%edx
  nopl   (%rax)
L128:
  movss  (%rax),%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  comisd %xmm2,%xmm1
  ja     L22
L4:
  comisd %xmm3,%xmm2
  mov    %esi,%edi
  jbe    L116
L22:
  lea    (%rdx,%rsi,1),%edi
  mov    %ebx,%esi
  add    $0x1,%ebx
  movss  %xmm0,0x0(%r13,%rsi,4)
L116:
  shr    %edx
  mov    %edx,%esi
  jne    L85
  add    $0x4,%rax
  mov    %dil,(%rcx)
  lea    0x1(%rcx),%rdx
  cmp    %rax,%r8
  je     L41
  movss  (%rax),%xmm0
  pxor   %xmm2,%xmm2
  mov    %rdx,%rcx
  mov    $0x80,%edx
  cvtss2sd %xmm0,%xmm2
  comisd %xmm2,%xmm1
  ja     L22
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L85:
  add    $0x4,%rax
  cmp    %rax,%r8
  je     L36
  mov    %edi,%esi
  jmp    L128
  nopl   (%rax)
L36:
  mov    %dil,(%rcx)
L41:
  mov    %ebx,0x0(%rbp)
L62:
  add    $0x8,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L126:
  lea    D42(%rip),%rsi
  lea    D34(%rip),%rdi
  call   <fatal_error@plt>
  jmp    L120
L72:
  lea    D42(%rip),%rsi
  lea    D34(%rip),%rdi
  call   <fatal_error@plt>
  jmp    L33
```

tool_calls: name: retrieve_data
arguments: data_tag: D21
type_infered: f64
name: retrieve_data
arguments: data_tag: D20
type_infered: f64
name: retrieve_data
arguments: data_tag: D42
type_infered: string
name: retrieve_data
arguments: data_tag: D34
type_infered: string

tool: D21: 9.9989e+20

tool: D20: 9.9991e+20

tool: 

tool: D34: mk_bms: memory allocation problem

assistant: ```c
unsigned char *mk_bms(float *data, unsigned int *ndata) {
  int bms_size;
  unsigned char *bms, *cbits;
  unsigned int nn, i, start, c, imask, i0;
  nn = *ndata;
  for (i = 0; i < nn; i++) {
    if (((data[i]) >= 9.9989e20 && (data[i]) <= 9.9991e20))
      break;
  }
  if (i == nn) {
    bms = (unsigned char *)malloc(6);
    if (bms == NULL)
      fatal_error("mk_bms: memory allocation problem", "");
    uint_char(6, bms);
    bms[4] = 6;
    bms[5] = 255;
    return bms;
  }
  bms_size = 6 + (nn + 7) / 8;
  bms = (unsigned char *)malloc(bms_size);
  if (bms == NULL)
    fatal_error("mk_bms: memory allocation problem", "");
  uint_char(bms_size, bms);
  bms[4] = 6;
  bms[5] = 0;
  cbits = bms + 6;
  i0 = i >> 3;
  for (i = 0; i < i0; i++) {
    *cbits++ = 255;
  }
  c = 0;
  imask = 128;
  i0 = i0 << 3;
  start = i0;
  for (i = i0; i < nn; i++) {
    if (((data[i]) < 9.9989e20 || (data[i]) > 9.9991e20)) {
      c += imask;
      data[start++] = data[i];
    }
    if ((imask >>= 1) == 0) {
      *cbits++ = c;
      c = 0;
      imask = 128;
    }
  }
  if (imask != 128)
    *cbits = c;
  *ndata = start;
  return bms;
}
```