user: What would the C source look like for the assembly code provided here:

```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     L1
  movsd  D42(%rip),%xmm1
  mov    %rdi,%r13
  mov    %rsi,%rbp
  xor    %ebx,%ebx
  movsd  D44(%rip),%xmm3
  mov    %rdi,%rax
  nopl   (%rax)
L44:
  pxor   %xmm0,%xmm0
  cvtss2sd (%rax),%xmm0
  comisd %xmm1,%xmm0
  jb     L18
  comisd %xmm0,%xmm3
  jae    L57
L18:
  add    $0x1,%ebx
  add    $0x4,%rax
  cmp    %ebx,%r12d
  jne    L44
L1:
  mov    $0x6,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L66
L124:
  mov    %r14,%rsi
  mov    $0x6,%edi
  call   <uint_char@plt>
  mov    $0xffffff06,%edx
  mov    %dx,0x4(%r14)
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L57:
  lea    0x7(%r12),%r15d
  shr    $0x3,%r15d
  add    $0x6,%r15d
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L9
L139:
  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    D42(%rip),%rax
  movq   %rax,%xmm1
  mov    D44(%rip),%rax
  movq   %rax,%xmm3
  je     L122
  mov    %r15d,%r15d
  mov    %rcx,%rdi
  mov    $0xff,%esi
  mov    %r15,%rdx
  call   <memset@plt>
  mov    %rax,%rcx
  mov    D44(%rip),%rax
  add    %r15,%rcx
  movq   %rax,%xmm3
  mov    D42(%rip),%rax
  movq   %rax,%xmm1
L122:
  and    $0xfffffff8,%ebx
  cmp    %ebx,%r12d
  jbe    L106
  lea    -0x1(%r12),%eax
  mov    %ebx,%esi
  sub    %ebx,%eax
  lea    0x0(%r13,%rsi,4),%rdx
  add    %rsi,%rax
  xor    %esi,%esi
  lea    0x4(%r13,%rax,4),%r8
  mov    $0x80,%eax
  nopl   0x0(%rax)
L115:
  movss  (%rdx),%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  comisd %xmm2,%xmm1
  ja     L36
  comisd %xmm3,%xmm2
  jbe    L31
L36:
  mov    %ebx,%edi
  add    %eax,%esi
  add    $0x1,%ebx
  movss  %xmm0,0x0(%r13,%rdi,4)
L31:
  shr    %eax
  jne    L49
  mov    %sil,(%rcx)
  mov    $0x80,%eax
  xor    %esi,%esi
  add    $0x1,%rcx
L49:
  add    $0x4,%rdx
  cmp    %rdx,%r8
  jne    L115
  cmp    $0x80,%eax
  je     L106
  mov    %sil,(%rcx)
L106:
  mov    %ebx,0x0(%rbp)
L10:
  add    $0x8,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  lea    D46(%rip),%rsi
  lea    D41(%rip),%rdi
  call   <fatal_error@plt>
  jmp    L139
L66:
  lea    D46(%rip),%rsi
  lea    D41(%rip),%rdi
  call   <fatal_error@plt>
  jmp    L124
```

tool_calls: name: retrieve_data
arguments: tag: D42
data_type: f64
name: retrieve_data
arguments: tag: D44
data_type: f64
name: retrieve_data
arguments: tag: D46
data_type: string
name: retrieve_data
arguments: tag: D41
data_type: string

tool: D42: 9.9989e+20

tool: D44: 9.9991e+20

tool: 

tool: D41: 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;
}
```