user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ScaleData>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,%eax
  mov    %edx,-0x50(%rbp)
  movsd  %xmm0,-0x58(%rbp)
  movsd  %xmm1,-0x60(%rbp)
  mov    %al,-0x4c(%rbp)
  movsbl -0x4c(%rbp),%eax
  sub    $0x53,%eax
  cmp    $0x22,%eax
  ja     L86
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D9(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D9(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L216
L135:
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x58(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  cvttsd2si %xmm0,%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x3c(%rbp)
L216:
  mov    -0x3c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L135
  jmp    L170
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L84
L124:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  cwtl
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x58(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  mov    -0x3c(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  cvttsd2si %xmm0,%edx
  mov    %dx,(%rax)
  addl   $0x1,-0x3c(%rbp)
L84:
  mov    -0x3c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L124
  jmp    L170
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L15
L245:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x58(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  mov    -0x3c(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  cvttsd2si %xmm0,%edx
  mov    %dx,(%rax)
  addl   $0x1,-0x3c(%rbp)
L15:
  mov    -0x3c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L245
  jmp    L170
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L116
L125:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x58(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  cvttsd2si %xmm0,%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x3c(%rbp)
L116:
  mov    -0x3c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L125
  jmp    L170
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L244
L149:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%eax
  test   %rax,%rax
  js     L99
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L211
L99:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L211:
  mulsd  -0x58(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  cvttsd2si %xmm0,%rdx
  mov    %edx,(%rax)
  addl   $0x1,-0x3c(%rbp)
L244:
  mov    -0x3c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L149
  jmp    L170
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L240
L35:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  -0x58(%rbp),%xmm0
  addsd  -0x60(%rbp),%xmm0
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x3c(%rbp)
L240:
  mov    -0x3c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L35
  jmp    L170
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x3c(%rbp)
  jmp    L235
L234:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x58(%rbp),%xmm0
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x3c(%rbp)
L235:
  mov    -0x3c(%rbp),%eax
  cmp    -0x50(%rbp),%eax
  jl     L234
  jmp    L170
L86:
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L170
  nop
L170:
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D15
type_infered: string

tool: D15: Another impossible error


assistant: ```c
void ScaleData(void *data, char type, int npts, double m, double b) {
  unsigned char *data_c;
  short *data_s;
  unsigned short *data_u;
  unsigned *data_U;
  int *data_i;
  float *data_f;
  double *data_d;
  int i;
  switch (type) {
  case 'n':
    break;
  case 'c':
    data_c = (unsigned char *)data;
    for (i = 0; i < npts; i++) {
      data_c[i] = (unsigned char)((double)data_c[i] * m + b);
    }
    break;
  case 's':
    data_s = (short *)data;
    for (i = 0; i < npts; i++) {
      data_s[i] = (short)((double)data_s[i] * m + b);
    }
    break;
  case 'u':
    data_u = (unsigned short *)data;
    for (i = 0; i < npts; i++) {
      data_u[i] = (unsigned short)((double)data_u[i] * m + b);
    }
    break;
  case 'S':
  case 'i':
    data_i = (int *)data;
    for (i = 0; i < npts; i++) {
      data_i[i] = (int)((double)data_i[i] * m + b);
    }
    break;
  case 'U':
    data_U = (unsigned *)data;
    for (i = 0; i < npts; i++) {
      data_U[i] = (unsigned)((double)data_U[i] * m + b);
    }
    break;
  case 'f':
    data_f = (float *)data;
    for (i = 0; i < npts; i++) {
      data_f[i] = (float)((double)data_f[i] * m + b);
    }
    break;
  case 'd':
    data_d = (double *)data;
    for (i = 0; i < npts; i++) {
      data_d[i] = data_d[i] * m + b;
    }
    break;
  default:
    printf("Another impossible error\n");
    abort();
    break;
  }
}
```