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

```asm
<deriv1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  movsd  %xmm0,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  cmp    $0x2,%edx
  je     L119
  cmp    $0x3,%edx
  je     L77
  mov    D9(%rip),%r12
  cmp    $0x1,%edx
  je     L76
L121:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L136
  movq   %r12,%xmm0
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L76:
  mov    %rsp,-0x50(%rbp)
  lea    -0x1(%rsi),%edx
  movslq %edx,%rax
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rdi
  and    $0xfffffffffffffff0,%rdi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L135:
  cmp    %rcx,%rsp
  je     L66
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L135
L66:
  mov    %rdi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L57
  orq    $0x0,-0x8(%rsp,%rax,1)
L57:
  mov    %rsp,%r14
  test   %edx,%edx
  js     L83
  lea    -0x1(%rsi),%r15d
  lea    0x2(%r15),%rdx
  mov    $0x1,%eax
L103:
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,-0x8(%r14,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L103
  mov    $0x0,%ebx
  mov    D9(%rip),%r12
L125:
  mov    (%r14,%rbx,8),%r13
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  -0x48(%rbp),%xmm0
  call   <pow@plt>
  movq   %r13,%xmm3
  mulsd  %xmm0,%xmm3
  movq   %r12,%xmm4
  addsd  %xmm3,%xmm4
  movq   %xmm4,%r12
  mov    %rbx,%rax
  add    $0x1,%rbx
  cmp    %r15,%rax
  jne    L125
L73:
  mov    -0x50(%rbp),%rsp
  jmp    L121
L83:
  mov    D9(%rip),%r12
  jmp    L73
L119:
  mov    (%rdi),%r13
  mov    0x8(%rdi),%r12
  mov    0x10(%rdi),%r14
  movsd  -0x48(%rbp),%xmm1
  movsd  D48(%rip),%xmm0
  call   <pow@plt>
  movq   %xmm0,%rbx
  movq   %r14,%xmm1
  subsd  D16(%rip),%xmm1
  movsd  -0x48(%rbp),%xmm0
  call   <pow@plt>
  movapd %xmm0,%xmm1
  movq   %r12,%xmm0
  movq   %r14,%xmm6
  mulsd  %xmm6,%xmm0
  mulsd  %xmm0,%xmm1
  movq   %rbx,%xmm0
  movq   %r13,%xmm7
  mulsd  %xmm7,%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%r12
  jmp    L121
L77:
  mov    0x8(%rdi),%r14
  mov    0x20(%rdi),%r13
  movq   %r13,%xmm0
  mulsd  -0x48(%rbp),%xmm0
  addsd  0x28(%rdi),%xmm0
  call   <cos@plt>
  movq   %xmm0,%r12
  movq   %r14,%xmm0
  mulsd  -0x48(%rbp),%xmm0
  addsd  0x10(%rbx),%xmm0
  call   <sin@plt>
  movapd %xmm0,%xmm1
  movq   %r14,%xmm0
  mulsd  (%rbx),%xmm0
  movq   %r12,%xmm2
  mulsd  %xmm0,%xmm2
  movq   %r13,%xmm0
  mulsd  0x18(%rbx),%xmm0
  mulsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm2
  movq   %xmm2,%r12
  jmp    L121
L136:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D9
data_type: f64
name: parse_data
arguments: data_label: D48
data_type: f64
name: parse_data
arguments: data_label: D16
data_type: f64

tool: D9: 0

tool: D48: 2.7182818284

tool: D16: 1

assistant: ```c
double deriv1(double *param, int dimension, int functiontype, double x) {
  int i;
  double first_derivate = 0;
  switch (functiontype) {
  case 1: {
    int len = (dimension - 1);
    double D[len];
    for (i = 0; i <= len; i++) {
      D[i] = param[i + 1] * (i + 1);
    }
    for (i = 0; i <= len; i++) {
      first_derivate += D[i] * (pow(x, i));
    }
    break;
  }
  case 2: {
    double a = param[0];
    double b = param[1];
    double n = param[2];
    first_derivate = (a * (pow(2.7182818284, x)) + b * n * (pow(x, (n - 1))));
    break;
  }
  case 3: {
    double A = param[0];
    double m = param[1];
    double t = param[2];
    double B = param[3];
    double n = param[4];
    double p = param[5];
    first_derivate = A * m * (cos(n * x + p)) - B * n * (sin(m * x + t));
    break;
  }
  }
  return first_derivate;
}
```