user: Converte this assembly snippet into its equivalent C code:

```asm
<mk_sec5and7>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %esi,-0x7c(%rbp)
  mov    %rdx,-0x88(%rbp)
  mov    %rcx,-0x90(%rbp)
  mov    %r8d,-0x80(%rbp)
  mov    %r9d,-0x94(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    0x10(%rbp),%eax
  mov    %eax,-0x54(%rbp)
  cmpl   $0x0,-0x7c(%rbp)
  jne    L26
  movl   $0x0,-0x60(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x58(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  jmp    L9
L26:
  lea    -0x64(%rbp),%rcx
  lea    -0x68(%rbp),%rdx
  mov    -0x7c(%rbp),%esi
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <min_max_array_all_defined@plt>
  movss  -0x68(%rbp),%xmm0
  movss  %xmm0,-0x58(%rbp)
  cmpl   $0x0,-0x80(%rbp)
  jne    L39
  movss  -0x68(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movss  -0x64(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  subsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movl   $0x0,-0x94(%rbp)
  pxor   %xmm0,%xmm0
  ucomisd -0x28(%rbp),%xmm0
  jp     L221
  pxor   %xmm0,%xmm0
  ucomisd -0x28(%rbp),%xmm0
  je     L193
L221:
  lea    -0x5c(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <frexp@plt>
  mov    -0x5c(%rbp),%eax
  sub    0x18(%rbp),%eax
  mov    %eax,-0x54(%rbp)
  mov    0x18(%rbp),%eax
  mov    %eax,-0x60(%rbp)
  mov    -0x54(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    D74(%rip),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <ldexp@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x30(%rbp)
  movss  -0x64(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  subsd  -0x40(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x30(%rbp),%xmm1
  movsd  D5(%rip),%xmm0
  addsd  %xmm1,%xmm0
  pxor   %xmm2,%xmm2
  cvtsd2ss %xmm0,%xmm2
  movd   %xmm2,%eax
  movd   %eax,%xmm0
  call   <floor@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  lea    -0x5c(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <frexp@plt>
  mov    -0x5c(%rbp),%edx
  mov    -0x60(%rbp),%eax
  cmp    %eax,%edx
  je     L10
  addl   $0x1,-0x54(%rbp)
  jmp    L10
L193:
  movl   $0x0,-0x60(%rbp)
  mov    -0x60(%rbp),%eax
  mov    %eax,-0x54(%rbp)
  movsd  D74(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  jmp    L10
L39:
  cmpl   $0x0,-0x94(%rbp)
  je     L182
  mov    -0x94(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    D12(%rip),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <Int_Power@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x38(%rbp)
  movss  -0x68(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x38(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x68(%rbp)
  movss  -0x64(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x38(%rbp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x64(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L253
L86:
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x38(%rbp),%xmm0
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x50(%rbp)
L253:
  mov    -0x50(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jb     L86
L182:
  mov    -0x54(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    D74(%rip),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <ldexp@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x30(%rbp)
  movss  -0x68(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movss  -0x64(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  subsd  -0x40(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x30(%rbp),%xmm1
  movsd  D5(%rip),%xmm0
  addsd  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtsd2ss %xmm0,%xmm3
  movd   %xmm3,%eax
  movd   %eax,%xmm0
  call   <floor@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  lea    -0x60(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <frexp@plt>
  mov    -0x60(%rbp),%eax
  cmp    %eax,0x20(%rbp)
  jge    L10
  mov    -0x60(%rbp),%eax
  sub    0x20(%rbp),%eax
  add    %eax,-0x54(%rbp)
  mov    0x20(%rbp),%eax
  mov    %eax,-0x60(%rbp)
L10:
  cmpl   $0x0,-0x54(%rbp)
  je     L69
  mov    -0x54(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    D74(%rip),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <ldexp@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x30(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L232
L73:
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  subsd  -0x40(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x50(%rbp)
L232:
  mov    -0x50(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jb     L73
  jmp    L9
L69:
  movl   $0x0,-0x50(%rbp)
  jmp    L251
L250:
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  subsd  -0x40(%rbp),%xmm0
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x50(%rbp)
L251:
  mov    -0x50(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jb     L250
L9:
  movq   $0x15,-0x20(%rbp)
  mov    -0x7c(%rbp),%eax
  shr    $0x3,%eax
  mov    %eax,%edx
  mov    -0x60(%rbp),%eax
  mov    %edx,%ecx
  imul   %eax,%ecx
  mov    -0x7c(%rbp),%eax
  and    $0x7,%eax
  mov    %eax,%edx
  mov    -0x60(%rbp),%eax
  imul   %edx,%eax
  add    $0x7,%eax
  shr    $0x3,%eax
  add    %ecx,%eax
  add    $0x5,%eax
  mov    %eax,%eax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x90(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  cmpq   $0x0,-0x10(%rbp)
  jne    L238
  lea    D36(%rip),%rax
  mov    %rax,%rsi
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  call   <fatal_error@plt>
L238:
  mov    -0x18(%rbp),%rax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <uint_char@plt>
  mov    -0x10(%rbp),%rax
  add    $0x4,%rax
  movb   $0x7,(%rax)
  cmpl   $0x0,-0x7c(%rbp)
  je     L150
  mov    $0x0,%eax
  call   <omp_get_num_threads@plt>
  mov    %eax,-0x48(%rbp)
  mov    -0x48(%rbp),%edx
  mov    -0x7c(%rbp),%eax
  add    %edx,%eax
  sub    $0x1,%eax
  mov    -0x48(%rbp),%esi
  mov    $0x0,%edx
  div    %esi
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  add    $0x7,%eax
  and    $0xfffffff8,%eax
  mov    %eax,-0x44(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L210
L59:
  mov    -0x7c(%rbp),%eax
  sub    -0x50(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x4c(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jbe    L170
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
L170:
  mov    -0x60(%rbp),%edx
  mov    -0x50(%rbp),%eax
  shr    $0x3,%eax
  mov    %eax,%ecx
  mov    -0x60(%rbp),%eax
  imul   %ecx,%eax
  mov    %eax,%eax
  lea    0x5(%rax),%rcx
  mov    -0x10(%rbp),%rax
  lea    (%rcx,%rax,1),%rsi
  mov    -0x50(%rbp),%eax
  lea    0x0(,%rax,4),%rcx
  mov    -0x78(%rbp),%rax
  lea    (%rcx,%rax,1),%rdi
  mov    -0x4c(%rbp),%eax
  mov    %edx,%ecx
  mov    %eax,%edx
  call   <flist2bitstream@plt>
  mov    -0x44(%rbp),%eax
  add    %eax,-0x50(%rbp)
L210:
  mov    -0x50(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jb     L59
L150:
  mov    -0x60(%rbp),%eax
  test   %eax,%eax
  jne    L133
  movl   $0x0,-0x54(%rbp)
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x94(%rbp)
  pxor   %xmm0,%xmm0
  cvtss2sd -0x58(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
L133:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x88(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  cmpq   $0x0,-0x10(%rbp)
  jne    L17
  lea    D36(%rip),%rax
  mov    %rax,%rsi
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  call   <fatal_error@plt>
L17:
  mov    -0x20(%rbp),%rax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <uint_char@plt>
  mov    -0x10(%rbp),%rax
  add    $0x4,%rax
  movb   $0x5,(%rax)
  mov    -0x10(%rbp),%rax
  lea    0x5(%rax),%rdx
  mov    -0x7c(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <uint_char@plt>
  mov    -0x10(%rbp),%rax
  add    $0x9,%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <uint2_char@plt>
  mov    -0x10(%rbp),%rax
  lea    0xb(%rax),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <flt2ieee@plt>
  mov    -0x10(%rbp),%rax
  lea    0xf(%rax),%rdx
  mov    -0x54(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <int2_char@plt>
  mov    -0x10(%rbp),%rax
  lea    0x11(%rax),%rdx
  mov    -0x94(%rbp),%eax
  neg    %eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <int2_char@plt>
  mov    -0x60(%rbp),%edx
  mov    -0x10(%rbp),%rax
  add    $0x13,%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x14,%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L77
  call   <__stack_chk_fail@plt>
L77:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D74
type_guessed: f64
name: extract_symbolic_data
arguments: label: D5
type_guessed: f64
name: extract_symbolic_data
arguments: label: D12
type_guessed: f64
name: extract_symbolic_data
arguments: label: D36
type_guessed: f64
name: extract_symbolic_data
arguments: label: D104
type_guessed: string

tool: D74: 1

tool: D5: 0.5

tool: D12: 10

tool: D36: 0

tool: D104: mk_sec5and7: memory allocation

assistant: ```c
int mk_sec5and7(float *data, unsigned int n, unsigned char **sec5, unsigned char **sec7, int use_scale, int dec_scale, int bin_scale, int wanted_bits, int max_bits) {
  float min_val, max_val, ncep_min_val;
  int nbits, binary_scale, j;
  double ref, frange, scale, dec_factor;
  size_t sec5_size, sec7_size;
  unsigned char *p;
  unsigned int i, k, di;
  int nthreads;
  binary_scale = bin_scale;
  if (n == 0) {
    nbits = 0;
    ref = ncep_min_val = 0.0;
  } else {
    min_max_array_all_defined(data, n, &min_val, &max_val);
    ncep_min_val = min_val;
    if (use_scale == 0) {
      ref = min_val;
      frange = max_val - ref;
      dec_scale = 0;
      if (frange != 0.0) {
        frexp(frange, &j);
        binary_scale = j - wanted_bits;
        nbits = wanted_bits;
        scale = ldexp(1.0, -binary_scale);
        frange = floor((max_val - ref) * scale + 0.5);
        frexp(frange, &j);
        if (j != nbits)
          binary_scale++;
      } else {
        binary_scale = nbits = 0;
        scale = 1;
      }
    } else {
      if (dec_scale) {
        dec_factor = Int_Power(10.0, -dec_scale);
        min_val *= dec_factor;
        max_val *= dec_factor;
#pragma omp parallel for
        for (i = 0; i < n; i++) {
          data[i] *= dec_factor;
        }
      }
      scale = ldexp(1.0, -binary_scale);
      ref = min_val;
      frange = floor((max_val - ref) * scale + 0.5);
      frexp(frange, &nbits);
      if (nbits > max_bits) {
        binary_scale += (nbits - max_bits);
        nbits = max_bits;
      }
    }
    if (binary_scale) {
      scale = ldexp(1.0, -binary_scale);
#pragma omp parallel for
      for (i = 0; i < n; i++) {
        data[i] = (data[i] - ref) * scale;
      }
    } else {
#pragma omp parallel for
      for (i = 0; i < n; i++) {
        data[i] = data[i] - ref;
      }
    }
  }
  sec5_size = 21;
  sec7_size = 5 + (nbits * (n / 8)) + (nbits * (n % 8) + 7) / 8;
  *sec7 = p = (unsigned char *)malloc(sec7_size);
  if (p == NULL)
    fatal_error("mk_sec5and7: memory allocation", "");
  uint_char(sec7_size, p);
  p[4] = 7;
  if (n != 0) {
#pragma omp parallel private(i, k)
    {
#pragma omp single
      {
        nthreads = omp_get_num_threads();
        di = (n + nthreads - 1) / nthreads;
        di = ((di + 7) | 7) ^ 7;
      }
#pragma omp for
      for (i = 0; i < n; i += di) {
        k = n - i;
        if (k > di)
          k = di;
        flist2bitstream(data + i, p + 5 + (i / 8) * nbits, k, nbits);
      }
    }
  }
  if (nbits == 0) {
    dec_scale = binary_scale = 0;
    ref = ncep_min_val;
  }
  *sec5 = p = (unsigned char *)malloc(sec5_size);
  if (p == NULL)
    fatal_error("mk_sec5and7: memory allocation", "");
  uint_char(sec5_size, p);
  p[4] = 5;
  uint_char(n, p + 5);
  uint2_char(0, p + 9);
  flt2ieee(ref, p + 11);
  int2_char(binary_scale, p + 15);
  int2_char(-dec_scale, p + 17);
  p[19] = nbits;
  p[20] = 0;
  return 0;
}
```