user: 请将以下的汇编代码转换成C语言代码：

```asm
<extremum>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xf8,%rsp
  mov    %rdi,0x18(%rsp)
  movsd  %xmm0,0x8(%rsp)
  mov    %esi,0x2c(%rsp)
  mov    %rdx,0x20(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xe8(%rsp)
  xor    %eax,%eax
  pxor   %xmm6,%xmm6
  movsd  %xmm6,(%rsp)
  jmp    L42
L178:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  mulsd  D46(%rip),%xmm0
  mov    0x18(%rsp),%rax
  addsd  (%rax),%xmm0
  movq   %xmm0,%rbx
  jmp    L168
L96:
  movsd  %xmm2,0x40(%rsp,%r12,8)
  jle    L139
  mov    %r13d,%edi
  mov    $0x0,%eax
  lea    0x90(%rsp),%rcx
  lea    0x40(%rsp),%rsi
  movq   %rbx,%xmm1
  movsd  0x8(%rsp),%xmm3
  jmp    L124
L129:
  mov    %rdx,%rax
L124:
  subsd  (%rcx,%rax,8),%xmm1
  movapd %xmm1,%xmm0
  andpd  D67(%rip),%xmm1
  comisd %xmm1,%xmm3
  ja     L109
  movapd %xmm2,%xmm1
  subsd  (%rsi,%rax,8),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp)
  lea    0x1(%rax),%rdx
  cmp    %rax,%rdi
  jne    L129
  jmp    L99
L109:
  mov    D1(%rip),%rax
  mov    %rax,0x0(%rbp)
L99:
  mov    %r13,%rax
  pxor   %xmm0,%xmm0
  lea    0x90(%rsp),%rdx
L5:
  addsd  0x8(%rdx,%rax,8),%xmm0
  movapd %xmm0,%xmm1
  movsd  0x40(%rsp,%rax,8),%xmm0
  xorpd  D80(%rip),%xmm0
  divsd  %xmm1,%xmm0
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L5
L26:
  addsd  0x90(%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  cmp    $0x7,%r15d
  jg     L34
L135:
  add    $0x1,%r12
  add    $0x1,%r15d
  add    $0x1,%r13
  add    $0x8,%rbp
L134:
  mov    %r12d,%r14d
  mov    (%rsp),%rbx
  cmp    $0x2,%r12d
  jle    L178
L168:
  lea    0x30(%rsp),%rdi
  movq   %rbx,%xmm0
  mov    $0x1,%eax
  mov    0x10(%rsp),%rsi
  call   *%rsi
  movsd  0x38(%rsp),%xmm2
  movapd %xmm2,%xmm0
  andpd  D67(%rip),%xmm0
  movsd  0x8(%rsp),%xmm4
  comisd %xmm0,%xmm4
  ja     L19
  test   %r14d,%r14d
  jne    L96
  movsd  %xmm2,0x40(%rsp)
  mov    %rbx,0x90(%rsp)
  mov    %rbx,(%rsp)
  jmp    L135
L139:
  test   %r13d,%r13d
  jns    L99
  pxor   %xmm0,%xmm0
  jmp    L26
L34:
  mov    0x18(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x20(%rsp),%rax
  mov    (%rax),%eax
  mov    %eax,0x28(%rsp)
  add    $0x1,%eax
L42:
  mov    0x20(%rsp),%rbx
  mov    %eax,(%rbx)
  cmp    0x2c(%rsp),%eax
  jge    L84
  lea    0x90(%rsp),%rbp
  mov    $0xffffffffffffffff,%r13
  mov    $0x1,%r15d
  mov    $0x0,%r12d
  jmp    L134
L19:
  mov    0x18(%rsp),%rax
  movsd  (%rsp),%xmm6
  movsd  %xmm6,(%rax)
  mov    0x20(%rsp),%rax
  addl   $0x1,(%rax)
L84:
  lea    0x30(%rsp),%rdi
  mov    0x18(%rsp),%rbx
  movsd  (%rbx),%xmm0
  mov    $0x1,%eax
  mov    0x10(%rsp),%rcx
  call   *%rcx
  movsd  0x30(%rsp),%xmm0
  movsd  %xmm0,0x8(%rbx)
  movsd  (%rbx),%xmm0
  movapd %xmm0,%xmm1
  andpd  D67(%rip),%xmm1
  mov    D47(%rip),%rbx
  movsd  D31(%rip),%xmm2
  comisd %xmm1,%xmm2
  jae    L40
  movapd %xmm0,%xmm1
  mulsd  D47(%rip),%xmm1
  andpd  D67(%rip),%xmm1
  movq   %xmm1,%rbx
L40:
  lea    0x30(%rsp),%r12
  movq   %rbx,%xmm7
  subsd  %xmm7,%xmm0
  mov    %r12,%rdi
  mov    $0x1,%eax
  mov    0x10(%rsp),%r14
  call   *%r14
  mov    0x30(%rsp),%rbp
  mov    0x18(%rsp),%r15
  movq   %rbx,%xmm0
  addsd  (%r15),%xmm0
  mov    %r12,%rdi
  mov    $0x1,%eax
  call   *%r14
  movq   %rbp,%xmm0
  addsd  0x30(%rsp),%xmm0
  movsd  0x8(%r15),%xmm1
  addsd  %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  sbb    %eax,%eax
  or     $0x1,%eax
  mov    0x20(%rsp),%rcx
  mov    %eax,0x4(%rcx)
  mov    0xe8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L136
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L136:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D46
type_guessed: f64
name: parse_data
arguments: data_tag: D67
type_guessed: qword[2]
name: parse_data
arguments: data_tag: D1
type_guessed: byte[8]
name: parse_data
arguments: data_tag: D80
type_guessed: f32[4]
name: parse_data
arguments: data_tag: D47
type_guessed: byte[8]
name: parse_data
arguments: data_tag: D31
type_guessed: f64

tool: D46: 0.01

tool: {"D67": [0x7fffffffffffffff,0x0000000000000000]}

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

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

tool: {"D47": [0xf1,0x68,0xe3,0x88,0xb5,0xf8,0xe4,0x3e]}

tool: D31: 1

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