user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<rkqs>:
  endbr64
  push   %r15
  movapd %xmm0,%xmm3
  push   %r14
  movslq %edx,%r14
  push   %r13
  lea    0x0(,%r14,8),%rax
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r14,%rbx
  mov    %rbx,%r15
  sub    $0x48,%rsp
  movsd  (%rcx),%xmm0
  mov    0x88(%rsp),%r13
  mov    %rax,0x38(%rsp)
  mov    %rsi,0x18(%rsp)
  lea    0x0(%r13,%rax,1),%r12
  mov    %rcx,0x20(%rsp)
  mov    %r13,%r14
  mov    %r8,%r13
  add    %r12,%rax
  mov    %r9,0x30(%rsp)
  mov    %rax,0x10(%rsp)
  mov    0x90(%rsp),%rax
  movsd  %xmm1,0x28(%rsp)
  movl   $0x0,(%rax)
  nopl   0x0(%rax)
L118:
  mov    0x10(%rsp),%r9
  mov    0x18(%rsp),%rsi
  movapd %xmm3,%xmm1
  mov    %ebx,%edx
  mov    %r14,%r8
  mov    %r12,%rcx
  mov    %rbp,%rdi
  movsd  %xmm3,0x8(%rsp)
  call   <rkck@plt>
  test   %ebx,%ebx
  movsd  0x8(%rsp),%xmm3
  movq   D47(%rip),%xmm2
  jle    L37
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  nopl   0x0(%rax,%rax,1)
L30:
  movsd  (%r14,%rax,8),%xmm1
  divsd  0x0(%r13,%rax,8),%xmm1
  add    $0x1,%rax
  andpd  %xmm2,%xmm1
  maxsd  %xmm1,%xmm0
  cmp    %r15,%rax
  jne    L30
  divsd  0x28(%rsp),%xmm0
  comisd D69(%rip),%xmm0
  jbe    L112
L19:
  mov    D13(%rip),%rax
  movsd  %xmm3,0x8(%rsp)
  movq   %rax,%xmm1
  call   <pow@plt>
  movsd  0x8(%rsp),%xmm3
  pxor   %xmm5,%xmm5
  movapd %xmm0,%xmm1
  movsd  D59(%rip),%xmm0
  comisd %xmm5,%xmm3
  mulsd  %xmm3,%xmm0
  mulsd  D99(%rip),%xmm3
  mulsd  %xmm1,%xmm0
  jb     L131
  maxsd  %xmm3,%xmm0
  movapd %xmm0,%xmm3
L122:
  mov    0x20(%rsp),%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm1
  addsd  %xmm3,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L118
  jne    L118
  mov    0x90(%rsp),%rax
  movl   $0x1,(%rax)
  add    $0x48,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L131:
  minsd  %xmm3,%xmm0
  movapd %xmm0,%xmm3
  jmp    L122
  nopw   0x0(%rax,%rax,1)
L37:
  pxor   %xmm0,%xmm0
  divsd  0x28(%rsp),%xmm0
  comisd D69(%rip),%xmm0
  ja     L19
L112:
  comisd D42(%rip),%xmm0
  mov    %r14,%r13
  ja     L128
  movsd  D36(%rip),%xmm0
  mulsd  %xmm3,%xmm0
L9:
  mov    0x80(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x30(%rsp),%rax
  movsd  %xmm3,(%rax)
  mov    0x20(%rsp),%rax
  addsd  (%rax),%xmm3
  movsd  %xmm3,(%rax)
  test   %ebx,%ebx
  jle    L6
  mov    0x38(%rsp),%rax
  lea    0x8(%r13,%rax,1),%rax
  cmp    %rax,%rbp
  je     L158
  lea    -0x1(%rbx),%eax
  cmp    $0x2,%eax
  jbe    L158
  mov    %ebx,%edx
  xor    %eax,%eax
  shr    %edx
  shl    $0x4,%rdx
L147:
  movupd (%r12,%rax,1),%xmm6
  movups %xmm6,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L147
  mov    %ebx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%ebx
  je     L6
  movsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
L6:
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L128:
  movsd  D94(%rip),%xmm1
  movsd  %xmm3,0x8(%rsp)
  call   <pow@plt>
  movsd  0x8(%rsp),%xmm3
  movapd %xmm0,%xmm1
  movsd  D59(%rip),%xmm0
  mulsd  %xmm3,%xmm0
  mulsd  %xmm1,%xmm0
  jmp    L9
L158:
  mov    %ebx,%ebx
  xor    %eax,%eax
L103:
  movsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rbx,%rax
  jne    L103
  jmp    L6
```

tool_calls: name: retrieve_data
arguments: tag: D47
type: qword
name: retrieve_data
arguments: tag: D69
type: f64[2]
name: retrieve_data
arguments: tag: D13
type: f32[2]
name: retrieve_data
arguments: tag: D59
type: f64
name: retrieve_data
arguments: tag: D99
type: f64
name: retrieve_data
arguments: tag: D42
type: byte[16]
name: retrieve_data
arguments: tag: D36
type: f64
name: retrieve_data
arguments: tag: D94
type: byte[8]

tool: D47: 9223372036854775807

tool: {"D69": [1.0,-0.25]}

tool: {"D13": [0.0,-1.625]}

tool: D59: 0.9

tool: D99: 0.1

tool: {"D42": [0xc3,0xa0,0x4c,0xa3,0xc9,0xc5,0x28,0x3f,0x9a,0x99,0x99,0x99,0x99,0x99,0xc9,0xbf]}

tool: D36: 5

tool: {"D94": [0x9a,0x99,0x99,0x99,0x99,0x99,0xc9,0xbf]}

assistant: ```c
int rkqs(double *y, double *dydx, int n, double *x, double htry, double eps, double *yscal, double *hdid, double *hnext, double *work, int *ier) {
  int i;
  double errmax, h, htemp, xnew, *yerr, *ytemp;
  double *work2;
  yerr = work;
  ytemp = work + n;
  work2 = ytemp + n;
  h = htry;
  *ier = 0;
  for (;;) {
    rkck(y, dydx, n, *x, h, ytemp, yerr, work2);
    errmax = 0.0;
    for (i = 0; i < n; i++)
      errmax = ((errmax) > (fabs(yerr[i] / yscal[i])) ? (errmax) : (fabs(yerr[i] / yscal[i])));
    errmax /= eps;
    if (errmax > 1.0) {
      htemp = 0.9 * h * pow(errmax, -0.25);
      h = (h >= 0.0 ? ((htemp) > (0.1 * h) ? (htemp) : (0.1 * h)) : ((htemp) < (0.1 * h) ? (htemp) : (0.1 * h)));
      xnew = (*x) + h;
      if (xnew == *x) {
        *ier = 1;
        return -1;
      }
      continue;
    } else {
      if (errmax > 1.89e-4)
        *hnext = 0.9 * h * pow(errmax, -0.2);
      else
        *hnext = 5.0 * h;
      *x += (*hdid = h);
      for (i = 0; i < n; i++)
        y[i] = ytemp[i];
      break;
    }
  }
  return 0;
}
```