user: What is the c source code of the assembly code below?

```asm
<brent>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x50,%rsp
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm1,0x8(%rsp)
  movsd  %xmm0,(%rsp)
  call   <max_err@plt>
  movsd  %xmm0,0x48(%rsp)
  movsd  (%rsp),%xmm0
  call   *%rbx
  movsd  0x8(%rsp),%xmm1
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm1,%xmm0
  call   *%rbx
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm5
  movsd  0x8(%rsp),%xmm1
  movapd %xmm0,%xmm6
  jmp    L30
  nopl   0x0(%rax)
L12:
  movsd  %xmm1,0x20(%rsp)
  movapd %xmm2,%xmm0
  movsd  %xmm6,0x18(%rsp)
  movsd  %xmm5,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   *%rbx
  movsd  0x10(%rsp),%xmm5
  pxor   %xmm6,%xmm6
  movsd  0x8(%rsp),%xmm2
  movapd %xmm0,%xmm3
  movsd  0x20(%rsp),%xmm1
  movapd %xmm5,%xmm0
  mulsd  %xmm3,%xmm0
  cmpltsd %xmm6,%xmm0
  movsd  0x18(%rsp),%xmm6
  movapd %xmm0,%xmm4
  andpd  %xmm0,%xmm5
  movapd %xmm0,%xmm7
  andnpd %xmm3,%xmm4
  andnpd %xmm2,%xmm7
  orpd   %xmm4,%xmm5
  movsd  (%rsp),%xmm4
  andpd  %xmm0,%xmm4
  orpd   %xmm4,%xmm7
  movapd %xmm3,%xmm4
  movsd  %xmm7,(%rsp)
  movapd %xmm0,%xmm7
  andpd  %xmm0,%xmm4
  andnpd %xmm6,%xmm7
  movapd %xmm7,%xmm6
  orpd   %xmm4,%xmm6
  movapd %xmm2,%xmm4
  andpd  %xmm0,%xmm4
  andnpd %xmm1,%xmm0
  movapd %xmm0,%xmm1
  movapd %xmm3,%xmm0
  andpd  D14(%rip),%xmm0
  comisd 0x48(%rsp),%xmm0
  orpd   %xmm4,%xmm1
  jb     L25
L30:
  movsd  (%rsp),%xmm0
  movsd  D13(%rip),%xmm7
  movsd  %xmm6,0x28(%rsp)
  movsd  %xmm5,0x20(%rsp)
  addsd  %xmm1,%xmm0
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm1,0x10(%rsp)
  mulsd  %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movapd %xmm7,%xmm0
  call   *%rbx
  movsd  (%rsp),%xmm9
  movsd  0x28(%rsp),%xmm6
  movsd  0x20(%rsp),%xmm5
  movapd %xmm0,%xmm4
  movapd %xmm9,%xmm2
  movapd %xmm6,%xmm3
  movapd %xmm6,%xmm8
  movsd  %xmm6,0x30(%rsp)
  mulsd  %xmm6,%xmm2
  subsd  %xmm5,%xmm3
  movapd %xmm5,%xmm1
  movsd  %xmm5,0x38(%rsp)
  subsd  %xmm0,%xmm1
  subsd  %xmm4,%xmm8
  movsd  %xmm4,0x28(%rsp)
  movapd %xmm3,%xmm7
  movapd %xmm5,%xmm3
  subsd  %xmm6,%xmm3
  movsd  %xmm7,0x40(%rsp)
  mulsd  %xmm0,%xmm2
  divsd  %xmm3,%xmm2
  divsd  %xmm1,%xmm2
  movsd  0x10(%rsp),%xmm1
  movapd %xmm1,%xmm3
  mulsd  %xmm5,%xmm3
  movapd %xmm3,%xmm0
  movsd  0x18(%rsp),%xmm3
  mulsd  %xmm4,%xmm0
  movsd  %xmm3,0x20(%rsp)
  divsd  %xmm7,%xmm0
  divsd  %xmm8,%xmm0
  movapd %xmm4,%xmm8
  subsd  %xmm5,%xmm8
  addsd  %xmm0,%xmm2
  movsd  0x8(%rsp),%xmm0
  mulsd  %xmm5,%xmm0
  mulsd  %xmm6,%xmm0
  divsd  %xmm8,%xmm0
  movapd %xmm4,%xmm8
  subsd  %xmm6,%xmm8
  divsd  %xmm8,%xmm0
  addsd  %xmm0,%xmm2
  movapd %xmm9,%xmm0
  movsd  %xmm2,0x18(%rsp)
  call   <condicoes@plt>
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm2
  test   %eax,%eax
  movsd  0x20(%rsp),%xmm3
  movsd  0x28(%rsp),%xmm4
  movsd  0x30(%rsp),%xmm6
  movsd  0x38(%rsp),%xmm5
  movsd  0x40(%rsp),%xmm7
  jne    L12
  movsd  (%rsp),%xmm10
  movsd  %xmm5,0x28(%rsp)
  movapd %xmm1,%xmm5
  movapd %xmm1,%xmm2
  movsd  %xmm6,0x20(%rsp)
  subsd  %xmm10,%xmm5
  movapd %xmm5,%xmm0
  mulsd  %xmm6,%xmm0
  divsd  %xmm7,%xmm0
  subsd  %xmm0,%xmm2
  movapd %xmm10,%xmm0
  movsd  %xmm2,0x18(%rsp)
  call   <condicoes@plt>
  movsd  0x10(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm2
  test   %eax,%eax
  movsd  0x20(%rsp),%xmm6
  movsd  0x28(%rsp),%xmm5
  jne    L12
  movsd  0x8(%rsp),%xmm2
  jmp    L12
  cs nopw 0x0(%rax,%rax,1)
L25:
  add    $0x50,%rsp
  movapd %xmm2,%xmm0
  pop    %rbx
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D14
type_guessed: qword[2]
name: disassemble_data
arguments: tag: D13
type_guessed: byte[8]

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

tool: {"D13": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

assistant: ```c
double brent(double x0, double x1, int p, double (*f)(double x)) {
  double xm, fxm, x2, fx2;
  double maxerr = max_err(p);
  double fx0 = f(x0);
  double fx1 = f(x1);
  do {
    xm = (x0 + x1) / 2;
    fxm = f(xm);
    x2 = x0 * fx1 * fxm / (fx0 - fx1) / (fx0 - fxm) + x1 * fx0 * fxm / (fx1 - fx0) / (fx1 - fxm) + xm * fx0 * fx1 / (fxm - fx0) / (fxm - fx1);
    if (!condicoes(x0, x1, x2, fx2, fxm)) {
      x2 = x1 - fx1 * (x1 - x0) / (fx1 - fx0);
      if (!condicoes(x0, x1, x2, fx2, fxm)) {
        x2 = xm;
      }
    }
    fx2 = f(x2);
    if (fx0 * fx2 < 0) {
      x1 = x2;
      fx1 = fx2;
    } else {
      x0 = x2;
      fx0 = fx2;
    }
  } while (fabs(fx2) >= maxerr);
  return x2;
}
```