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

```asm
<grd_rampup>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  movss  %xmm0,-0x14(%rbp)
  movss  %xmm1,-0x18(%rbp)
  movss  %xmm2,-0x1c(%rbp)
  movss  %xmm3,-0x20(%rbp)
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  pxor   %xmm0,%xmm0
  cvtss2sd -0x1c(%rbp),%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd -0x14(%rbp),%xmm2
  movsd  D47(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  comisd %xmm1,%xmm0
  jbe    L40
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L40:
  movss  -0x1c(%rbp),%xmm0
  divss  -0x18(%rbp),%xmm0
  movss  %xmm0,-0xc(%rbp)
  movss  -0xc(%rbp),%xmm0
  divss  -0x20(%rbp),%xmm0
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  call   <ceil@plt>
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,(%rax)
  movl   $0x0,-0x10(%rbp)
  jmp    L18
L2:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x10(%rbp),%xmm0
  mulss  -0x20(%rbp),%xmm0
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mulss  -0x18(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L18:
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L2
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  movss  -0x1c(%rbp),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movd   %eax,%xmm0
  call   <fabs@plt>
  cmp    $0x1,%eax
  jle    L66
  pxor   %xmm4,%xmm4
  cvtss2sd -0x4(%rbp),%xmm4
  movq   %xmm4,%rax
  movq   %rax,%xmm0
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L66:
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x4(%rbp),%ecx
  mov    -0x8(%rbp),%edx
  movd   %ecx,%xmm0
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <scalefloats@plt>
  cmpq   $0x0,-0x28(%rbp)
  je     L10
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x8(%rbp),%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <cumulativeSum@plt>
  movss  -0x20(%rbp),%xmm1
  movss  D43(%rip),%xmm0
  mulss  %xmm0,%xmm1
  movd   %xmm1,%ecx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x8(%rbp),%edx
  movd   %ecx,%xmm0
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <scalefloats@plt>
L10:
  cmpq   $0x0,-0x38(%rbp)
  je     L33
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x8(%rbp),%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <diffArray@plt>
  movss  D4(%rip),%xmm0
  divss  -0x20(%rbp),%xmm0
  movd   %xmm0,%ecx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x8(%rbp),%edx
  movd   %ecx,%xmm0
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <scalefloats@plt>
L33:
  cmpq   $0x0,-0x40(%rbp)
  je     L30
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,(%rax)
  movl   $0x0,-0x10(%rbp)
  jmp    L3
L8:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x10(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mulss  -0x20(%rbp),%xmm0
  movss  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L3:
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L8
L30:
  mov    -0x48(%rbp),%rax
  mov    -0x8(%rbp),%edx
  mov    %edx,(%rax)
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D47
type_infered: f64
name: read_data
arguments: tag: D9
type_infered: string
name: read_data
arguments: tag: D8
type_infered: string
name: read_data
arguments: tag: D43
type_infered: byte[4]
name: read_data
arguments: tag: D4
type_infered: byte[4]

tool: D47: 1.001

tool: D9: grd_rampup: Gtgt > 1.001*GMAX

tool: D8: grd_rampup: abs(scaling)=%.2f> 1 !


tool: {"D43": [0x00,0x08,0x85,0x45]}

tool: {"D4": [0x00,0x00,0x80,0x3f]}

assistant: ```c
void grd_rampup(float GMAX, float SMAX, float Gtgt, float Ts, float **kx, float **gx, float **slew, float **time, int *N) {
  float T_ramp;
  int N_ramp;
  float scaling;
  int n;
  if (Gtgt > 1.001 * GMAX)
    printf("grd_rampup: Gtgt > 1.001*GMAX\n");
  T_ramp = Gtgt / SMAX;
  N_ramp = ceil(T_ramp / Ts) + 1;
  *gx = (float *)malloc(N_ramp * sizeof(float));
  for (n = 0; n < N_ramp; n++)
    (*gx)[n] = n * Ts * SMAX;
  scaling = (Gtgt / (*gx)[N_ramp - 1]);
  if (fabs(scaling) > 1)
    printf("grd_rampup: abs(scaling)=%.2f> 1 !\n", scaling);
  scalefloats(*gx, N_ramp, scaling);
  if (kx) {
    *kx = (float *)malloc(N_ramp * sizeof(float));
    cumulativeSum(*gx, *kx, N_ramp);
    scalefloats(*kx, N_ramp, 4257 * Ts);
  }
  if (slew) {
    *slew = (float *)malloc(N_ramp * sizeof(float));
    diffArray(*gx, *slew, N_ramp);
    scalefloats(*slew, N_ramp, 1.0f / Ts);
  }
  if (time) {
    *time = (float *)malloc(N_ramp * sizeof(float));
    for (n = 0; n < N_ramp; n++)
      (*time)[n] = n * Ts;
  }
  *N = N_ramp;
  return;
}
```