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

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0xf98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1f88(%rsp)
  xor    %eax,%eax
  lea    0x30(%rsp),%rcx
  lea    0x28(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    0x38(%rsp),%r8
  lea    D22(%rip),%rdi
  call   <scanf@plt>
  mov    $0x0,%ebx
  lea    D43(%rip),%rbp
L184:
  mov    %ebx,%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movapd %xmm1,%xmm0
  mulsd  0x20(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  movapd %xmm1,%xmm2
  mulsd  0x28(%rsp),%xmm2
  mulsd  %xmm1,%xmm2
  addsd  %xmm2,%xmm0
  mulsd  0x30(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  addsd  0x38(%rsp),%xmm0
  movsd  %xmm0,0x40(%rsp,%rbx,8)
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    $0x3e8,%rbx
  jne    L184
  mov    $0x0,%eax
  lea    0x40(%rsp),%rdx
  pxor   %xmm0,%xmm0
L102:
  comisd (%rdx,%rax,8),%xmm0
  ja     L128
  add    $0x1,%rax
  cmp    $0x3e8,%rax
  jne    L102
  jmp    L74
L128:
  pxor   %xmm5,%xmm5
  cvtsi2sd %eax,%xmm5
  movsd  %xmm5,0x10(%rsp)
L74:
  mov    $0x0,%eax
  pxor   %xmm1,%xmm1
L6:
  movsd  0x40(%rsp,%rax,8),%xmm0
  comisd %xmm1,%xmm0
  ja     L149
  add    $0x1,%rax
  cmp    $0x3e8,%rax
  jne    L6
  jmp    L199
L149:
  pxor   %xmm6,%xmm6
  cvtsi2sd %eax,%xmm6
  movsd  %xmm6,0x18(%rsp)
L199:
  cvttsd2si 0x18(%rsp),%eax
  cltq
  movsd  0x40(%rsp,%rax,8),%xmm0
  lea    D20(%rip),%rbx
  comisd D48(%rip),%xmm0
  ja     L101
  jmp    L65
L186:
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  jbe    L160
  movsd  0x8(%rsp),%xmm5
  movsd  %xmm5,0x10(%rsp)
L192:
  movsd  0x10(%rsp),%xmm6
  movsd  0x18(%rsp),%xmm4
  ucomisd %xmm4,%xmm6
  setnp  %al
  mov    $0x0,%edx
  cmovne %edx,%eax
  test   %al,%al
  je     L107
  movsd  0x8(%rsp),%xmm6
  ucomisd %xmm4,%xmm6
  setnp  %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L65
L107:
  movsd  0x8(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  mov    %rbx,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  cvttsd2si 0x18(%rsp),%eax
  cltq
  movsd  0x40(%rsp,%rax,8),%xmm0
  comisd D48(%rip),%xmm0
  ja     L101
L65:
  mov    0x1f88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L87
  mov    $0x0,%eax
  add    $0x1f98,%rsp
  pop    %rbx
  pop    %rbp
  ret
L160:
  movapd %xmm3,%xmm0
  lea    D17(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L192
L77:
  movsd  0x8(%rsp),%xmm2
  movapd %xmm2,%xmm1
  movsd  0x10(%rsp),%xmm0
  mov    %rbx,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm4
  movsd  %xmm4,0x18(%rsp)
L101:
  cvttsd2si 0x10(%rsp),%eax
  cltq
  pxor   %xmm5,%xmm5
  comisd 0x40(%rsp,%rax,8),%xmm5
  jbe    L65
  movsd  0x10(%rsp),%xmm0
  addsd  0x18(%rsp),%xmm0
  mulsd  D21(%rip),%xmm0
  movapd %xmm0,%xmm3
  movsd  %xmm0,0x8(%rsp)
  cvttsd2si %xmm0,%eax
  cltq
  movsd  0x40(%rsp,%rax,8),%xmm0
  comisd D48(%rip),%xmm0
  jbe    L186
  movsd  0x8(%rsp),%xmm7
  ucomisd %xmm7,%xmm7
  jp     L77
  ucomisd 0x10(%rsp),%xmm7
  setnp  %al
  mov    $0x0,%edx
  cmovne %edx,%eax
  test   %al,%al
  je     L77
  jmp    L65
L87:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D22
data_type: string
name: read_data
arguments: tag: D43
data_type: string
name: read_data
arguments: tag: D20
data_type: string
name: read_data
arguments: tag: D48
data_type: byte[16]
name: read_data
arguments: tag: D17
data_type: string
name: read_data
arguments: tag: D21
data_type: byte[8]

tool: D22: %lf %lf %lf %lf

tool: D43: Func: %lf for x = %d


tool: D20: %lf	%lf	%lf


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

tool: D17: The root is at %lf

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

assistant: ```c
main() {
  double a, b, c, d;
  double p1, p2, mid;
  double function[1000];
  scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
  int i;
  for (i = 0; i <= 999; ++i) {
    function[i] = (a * i * i * i) + (b * i * i) + (c * i) + (d);
    printf("Func: %lf for x = %d\n", function[i], i);
  }
  for (i = 0; i <= 999; ++i) {
    if (function[i] < 0) {
      p1 = i;
      break;
    }
  }
  for (i = 0; i <= 999; ++i) {
    if (function[i] > 0) {
      p2 = i;
      break;
    }
  }
  while (function[(int)p2] > 0 && function[(int)p1] < 0) {
    mid = (p1 + p2) / 2.0;
    if (function[(int)mid] > 0) {
      p2 = mid;
    } else if (function[(int)mid] < 0) {
      p1 = mid;
    } else {
      printf("The root is at %lf", mid);
    }
    if (p1 == p2 && p2 == mid)
      break;
    printf("%lf\t%lf\t%lf\n", p1, p2, mid);
  }
}
```