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

```asm
<brent>:
  endbr64
  push   %r12
  movapd %xmm0,%xmm6
  movapd %xmm0,%xmm7
  mov    %rsi,%r12
  push   %rbp
  minsd  %xmm2,%xmm7
  maxsd  %xmm2,%xmm6
  mov    %rdi,%rbp
  push   %rbx
  movapd %xmm1,%xmm0
  mov    $0x64,%ebx
  sub    $0x60,%rsp
  movsd  %xmm8,0x10(%rsp)
  movsd  %xmm3,0x58(%rsp)
  movsd  %xmm7,(%rsp)
  movsd  %xmm6,0x8(%rsp)
  movsd  %xmm1,0x48(%rsp)
  call   *%rdi
  movsd  0x48(%rsp),%xmm9
  movq   D63(%rip),%xmm5
  pxor   %xmm3,%xmm3
  movsd  0x8(%rsp),%xmm6
  movsd  (%rsp),%xmm7
  movapd %xmm0,%xmm13
  movsd  %xmm0,0x50(%rsp)
  movsd  0x10(%rsp),%xmm8
  movapd %xmm9,%xmm2
  movsd  %xmm0,(%rsp)
  nopl   (%rax)
L300:
  movapd %xmm2,%xmm0
  movapd %xmm7,%xmm12
  movapd %xmm6,%xmm4
  andpd  %xmm5,%xmm0
  addsd  %xmm6,%xmm12
  subsd  %xmm7,%xmm4
  mulsd  0x58(%rsp),%xmm0
  movapd %xmm2,%xmm1
  addsd  D40(%rip),%xmm0
  mulsd  D105(%rip),%xmm4
  mulsd  D105(%rip),%xmm12
  movapd %xmm0,%xmm11
  addsd  %xmm0,%xmm11
  subsd  %xmm12,%xmm1
  movapd %xmm11,%xmm14
  subsd  %xmm4,%xmm14
  andpd  %xmm5,%xmm1
  comisd %xmm1,%xmm14
  jae    L15
  movapd %xmm3,%xmm1
  andpd  %xmm5,%xmm1
  comisd %xmm0,%xmm1
  jbe    L171
  movapd %xmm2,%xmm10
  movapd %xmm13,%xmm15
  movapd %xmm13,%xmm4
  subsd  %xmm9,%xmm10
  subsd  0x50(%rsp),%xmm15
  movapd %xmm2,%xmm1
  subsd  (%rsp),%xmm4
  subsd  0x48(%rsp),%xmm1
  pxor   %xmm14,%xmm14
  mulsd  %xmm10,%xmm15
  mulsd  %xmm1,%xmm4
  mulsd  %xmm15,%xmm10
  mulsd  %xmm4,%xmm1
  subsd  %xmm15,%xmm4
  addsd  %xmm4,%xmm4
  subsd  %xmm10,%xmm1
  comisd %xmm14,%xmm4
  jbe    L145
  xorpd  D102(%rip),%xmm1
L145:
  movsd  D105(%rip),%xmm10
  movapd %xmm1,%xmm15
  andpd  %xmm5,%xmm15
  mulsd  %xmm4,%xmm10
  mulsd  %xmm10,%xmm3
  andpd  %xmm5,%xmm3
  comisd %xmm3,%xmm15
  jae    L280
  movapd %xmm7,%xmm3
  andpd  %xmm5,%xmm4
  subsd  %xmm2,%xmm3
  mulsd  %xmm4,%xmm3
  comisd %xmm1,%xmm3
  jae    L280
  movapd %xmm6,%xmm3
  subsd  %xmm2,%xmm3
  mulsd  %xmm4,%xmm3
  comisd %xmm3,%xmm1
  jae    L280
  divsd  %xmm4,%xmm1
  movapd %xmm1,%xmm3
  addsd  %xmm2,%xmm3
  movapd %xmm3,%xmm4
  subsd  %xmm7,%xmm4
  comisd %xmm4,%xmm11
  ja     L260
  movapd %xmm6,%xmm4
  subsd  %xmm3,%xmm4
  comisd %xmm4,%xmm11
  ja     L260
  movapd %xmm1,%xmm4
  movapd %xmm8,%xmm3
  movapd %xmm1,%xmm8
  andpd  %xmm5,%xmm4
  comisd %xmm0,%xmm4
  jae    L204
  nop
L106:
  andpd  %xmm5,%xmm0
  movapd %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm0,%xmm8
  jae    L71
  xorpd  D102(%rip),%xmm1
L71:
  addsd  %xmm2,%xmm1
  jmp    L262
  nopl   0x0(%rax)
L260:
  subsd  %xmm2,%xmm12
  pxor   %xmm3,%xmm3
  movapd %xmm0,%xmm4
  andpd  %xmm5,%xmm4
  comisd %xmm3,%xmm12
  jb     L237
  movapd %xmm8,%xmm3
  movapd %xmm4,%xmm8
  jmp    L273
L171:
  comisd %xmm12,%xmm2
  jb     L28
  movapd %xmm7,%xmm3
  subsd  %xmm2,%xmm3
L269:
  movsd  D17(%rip),%xmm8
  mulsd  %xmm3,%xmm8
  movapd %xmm8,%xmm4
  andpd  %xmm5,%xmm4
L273:
  comisd %xmm0,%xmm4
  jb     L106
L204:
  movapd %xmm8,%xmm1
  addsd  %xmm2,%xmm1
L262:
  movsd  %xmm6,0x40(%rsp)
  movapd %xmm1,%xmm0
  movsd  %xmm3,0x38(%rsp)
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm9,0x28(%rsp)
  movsd  %xmm8,0x20(%rsp)
  movsd  %xmm7,0x18(%rsp)
  movsd  %xmm13,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   *%rbp
  movsd  0x10(%rsp),%xmm13
  movsd  0x8(%rsp),%xmm1
  movq   D63(%rip),%xmm5
  movsd  0x18(%rsp),%xmm7
  comisd %xmm0,%xmm13
  movsd  0x20(%rsp),%xmm8
  movsd  0x28(%rsp),%xmm9
  movsd  0x30(%rsp),%xmm2
  movsd  0x38(%rsp),%xmm3
  movsd  0x40(%rsp),%xmm6
  jb     L68
  comisd %xmm2,%xmm1
  movsd  %xmm9,0x48(%rsp)
  movapd %xmm2,%xmm9
  jae    L161
  movsd  (%rsp),%xmm6
  movsd  %xmm13,(%rsp)
  movapd %xmm0,%xmm13
  movsd  %xmm6,0x50(%rsp)
  movapd %xmm2,%xmm6
  movapd %xmm1,%xmm2
L59:
  sub    $0x1,%ebx
  jne    L300
  lea    D112(%rip),%rdi
  movsd  %xmm13,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <nrerror@plt>
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm13
L15:
  movsd  %xmm2,(%r12)
  add    $0x60,%rsp
  movapd %xmm13,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L68:
  movapd %xmm1,%xmm4
  cmpltsd %xmm2,%xmm4
  movapd %xmm4,%xmm12
  andpd  %xmm4,%xmm6
  andnpd %xmm1,%xmm12
  orpd   %xmm12,%xmm6
  movapd %xmm1,%xmm12
  andpd  %xmm4,%xmm12
  andnpd %xmm7,%xmm4
  movapd %xmm4,%xmm7
  movsd  (%rsp),%xmm4
  orpd   %xmm12,%xmm7
  comisd %xmm0,%xmm4
  jae    L121
  ucomisd %xmm2,%xmm9
  jp     L12
  je     L70
L12:
  movsd  0x50(%rsp),%xmm4
  comisd %xmm0,%xmm4
  jae    L120
  movsd  0x48(%rsp),%xmm4
  mov    $0x0,%edx
  ucomisd %xmm2,%xmm4
  setnp  %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L120
  ucomisd %xmm9,%xmm4
  setnp  %dl
  cmove  %edx,%eax
  test   %al,%al
  je     L59
  nopw   0x0(%rax,%rax,1)
L120:
  movsd  %xmm1,0x48(%rsp)
  movsd  %xmm0,0x50(%rsp)
  jmp    L59
  nopl   0x0(%rax)
L280:
  comisd %xmm12,%xmm2
  jb     L49
  movapd %xmm7,%xmm3
  subsd  %xmm2,%xmm3
L229:
  movsd  D17(%rip),%xmm8
  mulsd  %xmm3,%xmm8
  movapd %xmm8,%xmm4
  andpd  %xmm5,%xmm4
  jmp    L273
  nopw   0x0(%rax,%rax,1)
L121:
  movsd  (%rsp),%xmm4
  movsd  %xmm9,0x48(%rsp)
  movapd %xmm1,%xmm9
  movsd  %xmm0,(%rsp)
  movsd  %xmm4,0x50(%rsp)
  jmp    L59
  nopl   0x0(%rax)
L28:
  movapd %xmm6,%xmm3
  subsd  %xmm2,%xmm3
  jmp    L269
  nopl   (%rax)
L161:
  movsd  (%rsp),%xmm7
  movsd  %xmm13,(%rsp)
  movapd %xmm0,%xmm13
  movsd  %xmm7,0x50(%rsp)
  movapd %xmm2,%xmm7
  movapd %xmm1,%xmm2
  jmp    L59
  nopl   0x0(%rax,%rax,1)
L49:
  movapd %xmm6,%xmm3
  subsd  %xmm2,%xmm3
  jmp    L229
  nopl   (%rax)
L70:
  movsd  %xmm9,0x48(%rsp)
  movapd %xmm1,%xmm9
  movsd  (%rsp),%xmm1
  movsd  %xmm0,(%rsp)
  movsd  %xmm1,0x50(%rsp)
  jmp    L59
  nopl   0x0(%rax)
L237:
  movapd %xmm4,%xmm1
  xorpd  D102(%rip),%xmm1
  movapd %xmm8,%xmm3
  movapd %xmm1,%xmm8
  jmp    L273
```

tool_calls: name: read_data
arguments: tag: D63
type: qword
name: read_data
arguments: tag: D40
type: byte[8]
name: read_data
arguments: tag: D105
type: f64
name: read_data
arguments: tag: D102
type: f32[4]
name: read_data
arguments: tag: D17
type: f64
name: read_data
arguments: tag: D112
type: string

tool: D63: 9223372036854775807

tool: {"D40": [0xbb,0xbd,0xd7,0xd9,0xdf,0x7c,0xdb,0x3d]}

tool: D105: 0.5

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

tool: D17: 0.381966

tool: D112: Too many iterations in brent

assistant: ```c
double brent(double ax, double bx, double cx, double (*f)(double), double tol, double *xmin) {
  int iter;
  double a, b, d, etemp, fu, fv, fw, fx, p, q, r, tol1, tol2, u, v, w, x, xm;
  double e = 0.0;
  a = (ax < cx ? ax : cx);
  b = (ax > cx ? ax : cx);
  x = w = v = bx;
  fw = fv = fx = (*f)(x);
  for (iter = 1; iter <= 100; iter++) {
    xm = 0.5 * (a + b);
    tol2 = 2.0 * (tol1 = tol * fabs(x) + 1.0e-10);
    if (fabs(x - xm) <= (tol2 - 0.5 * (b - a))) {
      *xmin = x;
      return fx;
    }
    if (fabs(e) > tol1) {
      r = (x - w) * (fx - fv);
      q = (x - v) * (fx - fw);
      p = (x - v) * q - (x - w) * r;
      q = 2.0 * (q - r);
      if (q > 0.0)
        p = -p;
      q = fabs(q);
      etemp = e;
      e = d;
      if (fabs(p) >= fabs(0.5 * q * etemp) || p <= q * (a - x) || p >= q * (b - x))
        d = 0.3819660 * (e = (x >= xm ? a - x : b - x));
      else {
        d = p / q;
        u = x + d;
        if (u - a < tol2 || b - u < tol2)
          d = ((xm - x) >= 0.0 ? fabs(tol1) : -fabs(tol1));
      }
    } else {
      d = 0.3819660 * (e = (x >= xm ? a - x : b - x));
    }
    u = (fabs(d) >= tol1 ? x + d : x + ((d) >= 0.0 ? fabs(tol1) : -fabs(tol1)));
    fu = (*f)(u);
    if (fu <= fx) {
      if (u >= x)
        a = x;
      else
        b = x;
      (v) = (w);
      (w) = (x);
      (x) = (u);
      (fv) = (fw);
      (fw) = (fx);
      (fx) = (fu);
    } else {
      if (u < x)
        a = u;
      else
        b = u;
      if (fu <= fw || w == x) {
        v = w;
        w = u;
        fv = fw;
        fw = fu;
      } else if (fu <= fv || v == x || v == w) {
        v = u;
        fv = fu;
      }
    }
  }
  nrerror("Too many iterations in brent");
  *xmin = x;
  return fx;
}
```