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

```asm
<nextremum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x130,%rsp
  mov    %rdi,-0x108(%rbp)
  mov    %esi,-0x10c(%rbp)
  movsd  %xmm0,-0x118(%rbp)
  mov    %edx,-0x110(%rbp)
  mov    %rcx,-0x120(%rbp)
  mov    %r8,-0x128(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xe4(%rbp)
  mov    -0x120(%rbp),%rax
  movl   $0x0,(%rax)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  jmp    L37
L244:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0xd8(%rbp)
  movl   $0x1,-0xf4(%rbp)
  jmp    L160
L19:
  mov    -0xf4(%rbp),%edx
  mov    -0x108(%rbp),%rax
  mov    -0x128(%rbp),%rcx
  mov    %edx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   *%rcx
  movq   %xmm0,%rax
  mov    %rax,-0xc8(%rbp)
  movsd  -0xc8(%rbp),%xmm0
  movq   D7(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movsd  -0xd8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd8(%rbp)
  addl   $0x1,-0xf4(%rbp)
L160:
  mov    -0xf4(%rbp),%eax
  cmp    -0x10c(%rbp),%eax
  jle    L19
  movsd  -0x118(%rbp),%xmm0
  comisd -0xd8(%rbp),%xmm0
  jbe    L316
  movl   $0x1,-0xe4(%rbp)
  jmp    L37
L316:
  movl   $0x0,-0xf4(%rbp)
  jmp    L223
L232:
  movl   $0x0,-0xec(%rbp)
  jmp    L4
L318:
  movl   $0x0,-0xf0(%rbp)
  mov    -0xf4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0xd8(%rbp)
  jmp    L69
L177:
  cmpl   $0x2,-0xf0(%rbp)
  jg     L280
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0xf0(%rbp),%xmm1
  movsd  D26(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0xd8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xe0(%rbp)
  jmp    L68
L280:
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0xe0(%rbp)
L68:
  mov    -0xf4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  movsd  -0xe0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xf4(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x108(%rbp),%rax
  mov    -0x128(%rbp),%rdx
  mov    %ecx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   *%rdx
  movq   %xmm0,%rax
  mov    %rax,-0xc8(%rbp)
  movsd  -0xc8(%rbp),%xmm0
  movq   D7(%rip),%xmm1
  andpd  %xmm0,%xmm1
  movsd  -0x118(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L107
  movl   $0x5,-0xec(%rbp)
  jmp    L292
L107:
  movsd  -0xc8(%rbp),%xmm0
  movsd  %xmm0,-0xc0(%rbp)
  movsd  -0xe0(%rbp),%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  cmpl   $0x0,-0xf0(%rbp)
  jne    L187
  movsd  -0xc0(%rbp),%xmm0
  movsd  %xmm0,-0xb0(%rbp)
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0x60(%rbp)
  jmp    L252
L187:
  mov    -0xf0(%rbp),%eax
  cltq
  movsd  -0xc0(%rbp),%xmm0
  movsd  %xmm0,-0xb0(%rbp,%rax,8)
  movl   $0x0,-0xe8(%rbp)
  jmp    L200
L42:
  mov    -0xe8(%rbp),%eax
  cltq
  movsd  -0x60(%rbp,%rax,8),%xmm1
  movsd  -0xd0(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movq   D7(%rip),%xmm1
  andpd  %xmm0,%xmm1
  movsd  -0x118(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L33
  mov    -0xf0(%rbp),%eax
  cltq
  movsd  D10(%rip),%xmm0
  movsd  %xmm0,-0x60(%rbp,%rax,8)
  jmp    L79
L33:
  mov    -0xe8(%rbp),%eax
  cltq
  movsd  -0xb0(%rbp,%rax,8),%xmm1
  movsd  -0xc0(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  mov    -0xe8(%rbp),%eax
  cltq
  movsd  -0x60(%rbp,%rax,8),%xmm2
  movsd  -0xd0(%rbp),%xmm1
  subsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  mov    -0xf0(%rbp),%eax
  cltq
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0x60(%rbp,%rax,8)
  addl   $0x1,-0xe8(%rbp)
L200:
  mov    -0xe8(%rbp),%eax
  cmp    -0xf0(%rbp),%eax
  jl     L42
L79:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  mov    -0xf0(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xe8(%rbp)
  jmp    L77
L272:
  movsd  -0xa8(%rbp),%xmm0
  movq   D67(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    -0xe8(%rbp),%eax
  add    $0x1,%eax
  cltq
  movsd  -0x60(%rbp,%rax,8),%xmm1
  addsd  -0xd0(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  subl   $0x1,-0xe8(%rbp)
L77:
  cmpl   $0x0,-0xe8(%rbp)
  jns    L272
  movsd  -0x60(%rbp),%xmm0
  movsd  -0xd0(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
L252:
  addl   $0x1,-0xf0(%rbp)
L69:
  cmpl   $0x7,-0xf0(%rbp)
  jle    L177
L292:
  mov    -0xf4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  movsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L4:
  mov    -0xec(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xec(%rbp)
  cmp    $0x4,%eax
  jle    L318
  mov    -0xf4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  movsd  -0xe0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xf4(%rbp)
L223:
  mov    -0xf4(%rbp),%eax
  cmp    -0x10c(%rbp),%eax
  jl     L232
  mov    -0x120(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x120(%rbp),%rax
  mov    %edx,(%rax)
L37:
  cmpl   $0x0,-0xe4(%rbp)
  jne    L231
  mov    -0x120(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x110(%rbp)
  jg     L244
L231:
  mov    -0x108(%rbp),%rax
  mov    -0x128(%rbp),%rdx
  mov    $0x0,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   *%rdx
  movq   %xmm0,%rax
  mov    %rax,-0xc8(%rbp)
  mov    -0x10c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  movsd  -0xc8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  D39(%rip),%xmm0
  movsd  %xmm0,-0xb8(%rbp)
  mov    -0x108(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0xd8(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  addsd  -0xb8(%rbp),%xmm0
  mov    -0x108(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x108(%rbp),%rax
  mov    -0x128(%rbp),%rdx
  mov    $0x0,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   *%rdx
  movq   %xmm0,%rax
  mov    %rax,-0xc0(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  subsd  -0xb8(%rbp),%xmm0
  mov    -0x108(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x108(%rbp),%rax
  mov    -0x128(%rbp),%rdx
  mov    $0x0,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   *%rdx
  movq   %xmm0,%rax
  mov    %rax,-0xd0(%rbp)
  mov    -0x108(%rbp),%rax
  movsd  -0xd8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0xc0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0xd0(%rbp),%xmm1
  movsd  -0xc8(%rbp),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm0,-0xd8(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L44
  mov    -0x120(%rbp),%rax
  add    $0x4,%rax
  movl   $0xffffffff,(%rax)
  jmp    L277
L44:
  mov    -0x120(%rbp),%rax
  add    $0x4,%rax
  movl   $0x1,(%rax)
L277:
  movl   $0x1,-0xf0(%rbp)
L57:
  addl   $0x1,-0xf0(%rbp)
  movsd  D39(%rip),%xmm0
  movsd  %xmm0,-0xb8(%rbp)
  mov    -0xf0(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0xd8(%rbp)
  mov    -0xf0(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  movsd  -0xd8(%rbp),%xmm0
  addsd  -0xb8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x108(%rbp),%rax
  mov    -0x128(%rbp),%rdx
  mov    $0x0,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   *%rdx
  movq   %xmm0,%rax
  mov    %rax,-0xd0(%rbp)
  mov    -0xf0(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  movsd  -0xd8(%rbp),%xmm0
  subsd  -0xb8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x108(%rbp),%rax
  mov    -0x128(%rbp),%rdx
  mov    $0x0,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   *%rdx
  movq   %xmm0,%rax
  mov    %rax,-0xc0(%rbp)
  mov    -0xf0(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x108(%rbp),%rax
  add    %rdx,%rax
  movsd  -0xd8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0xc0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0xd0(%rbp),%xmm1
  movsd  -0xc8(%rbp),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm0,-0xd8(%rbp)
  mov    -0x120(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0xd8(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L185
  mov    -0xf0(%rbp),%eax
  cmp    -0x10c(%rbp),%eax
  jl     L57
L185:
  mov    -0x120(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0xd8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  ja     L275
  jmp    L92
L275:
  mov    -0x120(%rbp),%rax
  add    $0x4,%rax
  movl   $0x0,(%rax)
L92:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L70
  call   <__stack_chk_fail@plt>
L70:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D7
type: qword
name: disassemble_data
arguments: tag: D26
type: f64
name: disassemble_data
arguments: tag: D10
type: byte[8]
name: disassemble_data
arguments: tag: D67
type: f32[2]
name: disassemble_data
arguments: tag: D39
type: f64

tool: D7: 9223372036854775807

tool: D26: 0.01

tool: {"D10": [0x82,0x4d,0xc7,0x72,0x61,0x42,0x33,0x47]}

tool: {"D67": [0.0,-0.0]}

tool: D39: 1e-05

assistant: ```c
void nextremum(double x[], int n, double eps, int k, int js[], double (*ff)()) {
  double y[10], b[10], z, t, h1, h2, f, dx;
  int i, j, m, l;
  int done = 0;
  js[0] = 0;
  h2 = 0.0;
  while (!done && js[0] < k) {
    t = 0.0;
    for (i = 1; i <= n; i++) {
      f = (*ff)(x, i);
      t = t + fabs(f);
    }
    if (t < eps)
      done = 1;
    else {
      for (i = 0; i < n; i++) {
        m = 0;
        while (m++ < 5) {
          j = 0;
          t = x[i];
          while (j <= 7) {
            if (j <= 2)
              z = t + j * 0.01;
            else
              z = h2;
            x[i] = z;
            f = (*ff)(x, i + 1);
            if (fabs(f) < eps) {
              m = 5;
              break;
            } else {
              h1 = f;
              h2 = z;
              if (j == 0) {
                y[0] = h1;
                b[0] = h2;
              } else {
                y[j] = h1;
                for (l = 0; l < j; l++) {
                  if (fabs(h2 - b[l]) < eps) {
                    b[j] = 1.0e+35;
                    break;
                  }
                  b[j] = h2 = (h1 - y[l]) / (h2 - b[l]);
                }
                h2 = 0.0;
                for (l = j - 1; l >= 0; l--)
                  h2 = -y[1] / (b[l + 1] + h2);
                h2 = h2 + b[0];
              }
              j = j + 1;
            }
          }
          x[i] = h2;
        }
        x[i] = z;
      }
      js[0]++;
    }
  }
  f = (*ff)(x, 0);
  x[n] = f;
  dx = 0.00001;
  t = x[0];
  x[0] = t + dx;
  h1 = (*ff)(x, 0);
  x[0] = t - dx;
  h2 = (*ff)(x, 0);
  x[0] = t;
  t = h1 + h2 - 2.0 * f;
  if (t > 0.0)
    js[1] = -1;
  else
    js[1] = 1;
  j = 1;
  do {
    j++;
    dx = 0.00001;
    t = x[j - 1];
    x[j - 1] = t + dx;
    h2 = (*ff)(x, 0);
    x[j - 1] = t - dx;
    h1 = (*ff)(x, 0);
    x[j - 1] = t;
    t = h1 + h2 - 2.0 * f;
  } while ((t * js[1] < 0.0) && (j < n));
  if (t * js[1] > 0.0)
    js[1] = 0;
}
```