user: Translate the below assembly code into C programming language:

```asm
<read_compressed_array>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  mov    %rsi,%rdx
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  mov    $0xa,%esi
  push   %rbx
  mov    %edi,%ebx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x3e(%rsp),%r12
  mov    %r12,%rdi
  call   <IO_Read_Str@plt>
  test   %eax,%eax
  jne    L13
L206:
  xor    %eax,%eax
L134:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L143
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L13:
  mov    %r12,%rdi
  call   <ConvertFromIeeeExtended@plt>
  mov    %rbp,%rdx
  mov    $0xa,%esi
  mov    %r12,%rdi
  movsd  %xmm0,0x18(%rsp)
  call   <IO_Read_Str@plt>
  test   %eax,%eax
  je     L206
  mov    %r12,%rdi
  call   <ConvertFromIeeeExtended@plt>
  lea    -0x1(%r14),%eax
  cltd
  movsd  %xmm0,0x8(%rsp)
  idiv   %ebx
  mov    %eax,0x28(%rsp)
  cmp    $0x7,%eax
  jg     L305
  xor    %r13d,%r13d
  xor    %r8d,%r8d
  lea    0x3c(%rsp),%r12
  test   %r14d,%r14d
  jle    L226
  nopl   0x0(%rax,%rax,1)
L69:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %r8d,0x10(%rsp)
  call   <vlq_read_short@plt>
  test   %eax,%eax
  je     L134
  add    0x3c(%rsp),%r13w
  pxor   %xmm0,%xmm0
  mov    0x10(%rsp),%r8d
  movswl %r13w,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  0x8(%rsp),%xmm0
  divsd  D21(%rip),%xmm0
  cmp    %r8d,%r14d
  jle    L285
  test   %ebx,%ebx
  lea    0x1(%r8),%eax
  setg   %cl
  cltq
  xor    %edx,%edx
  test   %cl,%cl
  je     L285
  nopl   0x0(%rax,%rax,1)
L91:
  add    $0x1,%edx
  movsd  %xmm0,-0x8(%r15,%rax,8)
  cmp    %edx,%ebx
  setg   %sil
  cmp    %eax,%r14d
  setg   %cl
  add    $0x1,%rax
  test   %cl,%sil
  jne    L91
L285:
  lea    (%rbx,%r8,1),%eax
  cmp    %eax,%r14d
  jle    L312
  mov    %eax,%r8d
  jmp    L69
L305:
  add    $0x1,%eax
  lea    0x0(,%rax,8),%edi
  mov    %eax,0x2c(%rsp)
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  test   %r14d,%r14d
  jle    L108
  xor    %r13d,%r13d
  xor    %r11d,%r11d
  lea    0x3c(%rsp),%r12
  jmp    L1
  nopw   0x0(%rax,%rax,1)
L222:
  mov    %eax,%r11d
L1:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %r11d,0x10(%rsp)
  call   <vlq_read_short@plt>
  test   %eax,%eax
  je     L134
  mov    0x10(%rsp),%r11d
  add    0x3c(%rsp),%r13w
  pxor   %xmm0,%xmm0
  mov    0x20(%rsp),%rdi
  mov    %r11d,%eax
  cltd
  idiv   %ebx
  movswl %r13w,%edx
  cvtsi2sd %edx,%xmm0
  mulsd  0x8(%rsp),%xmm0
  divsd  D21(%rip),%xmm0
  addsd  0x18(%rsp),%xmm0
  cltq
  movsd  %xmm0,(%rdi,%rax,8)
  lea    (%rbx,%r11,1),%eax
  cmp    %eax,%r14d
  jg     L222
  mov    %rdi,%rdx
L83:
  mov    0x28(%rsp),%eax
  mov    0x2c(%rsp),%ecx
  mov    %r15,%rdi
  mov    %r11d,0x10(%rsp)
  imul   %ebx,%eax
  lea    0x1(%rax),%esi
  call   <filter_interp8@plt>
  movslq 0x10(%rsp),%r11
  lea    0x1(%r11),%eax
  cmp    %eax,%r14d
  jle    L302
  cltq
  lea    0x3c(%rsp),%r12
  lea    (%r15,%rax,8),%rdx
  lea    -0x2(%r14),%eax
  sub    %r11d,%eax
  add    %r11,%rax
  lea    0x10(%r15,%rax,8),%rbx
  nopw   0x0(%rax,%rax,1)
L198:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %rdx,0x10(%rsp)
  call   <vlq_read_short@plt>
  test   %eax,%eax
  je     L134
  add    0x3c(%rsp),%r13w
  pxor   %xmm0,%xmm0
  mov    0x10(%rsp),%rdx
  movswl %r13w,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  0x8(%rsp),%xmm0
  add    $0x8,%rdx
  divsd  D21(%rip),%xmm0
  addsd  0x18(%rsp),%xmm0
  movsd  %xmm0,-0x8(%rdx)
  cmp    %rbx,%rdx
  jne    L198
L302:
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  test   %r14d,%r14d
  jg     L291
L37:
  mov    $0x1,%eax
  jmp    L134
L226:
  neg    %ebx
  mov    %ebx,%r8d
L312:
  lea    0x1(%r8),%eax
  cmp    %eax,%r14d
  jle    L298
  cltq
  movslq %r8d,%rdx
  lea    0x3c(%rsp),%r12
  lea    (%r15,%rax,8),%rbx
  lea    -0x2(%r14),%eax
  sub    %r8d,%eax
  add    %rdx,%rax
  lea    0x10(%r15,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  xchg   %ax,%ax
L231:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <vlq_read_short@plt>
  test   %eax,%eax
  je     L134
  add    0x3c(%rsp),%r13w
  pxor   %xmm0,%xmm0
  add    $0x8,%rbx
  movswl %r13w,%eax
  cvtsi2sd %eax,%xmm0
  mulsd  0x8(%rsp),%xmm0
  divsd  D21(%rip),%xmm0
  movsd  %xmm0,-0x8(%rbx)
  cmp    0x10(%rsp),%rbx
  jne    L231
L298:
  mov    %r14d,%esi
  mov    %r15,%rdi
  call   <filter_reduce8@plt>
  test   %r14d,%r14d
  jle    L37
  cmp    $0x1,%r14d
  je     L236
  mov    %r14d,%edx
  movsd  0x18(%rsp),%xmm1
  mov    %r15,%rax
  shr    %edx
  sub    $0x1,%edx
  unpcklpd %xmm1,%xmm1
  shl    $0x4,%rdx
  lea    0x10(%r15,%rdx,1),%rdx
  nop
L23:
  movupd (%rax),%xmm0
  add    $0x10,%rax
  addpd  %xmm1,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L23
  mov    %r14d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r14b
  je     L291
L25:
  cltq
  movsd  0x18(%rsp),%xmm0
  lea    (%r15,%rax,8),%rax
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
L291:
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  nopl   0x0(%rax,%rax,1)
L51:
  comisd (%r15,%rax,8),%xmm0
  jbe    L265
  movq   $0x0,(%r15,%rax,8)
L265:
  add    $0x1,%rax
  cmp    %eax,%r14d
  jg     L51
  jmp    L37
L236:
  xor    %eax,%eax
  jmp    L25
L108:
  mov    %ebx,%r11d
  xor    %r13d,%r13d
  mov    %rax,%rdx
  neg    %r11d
  jmp    L83
L143:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D21
type_infered: f64

tool: D21: 16383

assistant: ```c
int read_compressed_array(int ratio, FILE *fp, double *v, int n) {
  int i;
  char data[10];
  double base;
  double delta;
  short previous = 0;
  if (!IO_Read_Str(data, 10, fp))
    return 0;
  base = ConvertFromIeeeExtended(data);
  if (!IO_Read_Str(data, 10, fp))
    return 0;
  delta = ConvertFromIeeeExtended(data);
  if ((1 + (n - 1) / ratio) >= (2 * 4 + 1)) {
    double *sv;
    sv = ((double *)malloc((1 + (n - 1) / ratio) * sizeof(double)));
    for (i = 0; i < n; i += ratio) {
      short s;
      if (!vlq_read_short(fp, &s))
        return 0;
      s += previous;
      previous = s;
      sv[i / ratio] = base + (s * delta) / 16383.0;
    }
    filter_interp8(v, ((n - 1) / ratio) * ratio + 1, sv, 1 + (n - 1) / ratio);
    for (i = i - ratio + 1; i < n; i++) {
      short s;
      if (!vlq_read_short(fp, &s))
        return 0;
      s += previous;
      previous = s;
      v[i] = base + (s * delta) / 16383.0;
    }
    free(sv);
  } else {
    for (i = 0; i < n; i += ratio) {
      int j;
      short s;
      double value;
      if (!vlq_read_short(fp, &s))
        return 0;
      s += previous;
      previous = s;
      value = (s * delta) / 16383.0;
      for (j = 0; (((i + j) < n) && (j < ratio)); j++)
        v[i + j] = value;
    }
    for (i = i - ratio + 1; i < n; i++) {
      short s;
      if (!vlq_read_short(fp, &s))
        return 0;
      s += previous;
      previous = s;
      v[i] = (s * delta) / 16383.0;
    }
    filter_reduce8(v, n);
    for (i = 0; i < n; i++)
      v[i] += base;
  }
  for (i = 0; i < n; i++)
    if (v[i] < 0)
      v[i] = 0;
  return 1;
}
```