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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0xf90,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x1f70(%rbp),%rsi
  lea    -0x1f78(%rbp),%rcx
  lea    -0x1f80(%rbp),%rdx
  lea    -0x1f88(%rbp),%rax
  mov    %rsi,%r8
  mov    %rax,%rsi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x0,-0x1f8c(%rbp)
  jmp    L110
L22:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x1f8c(%rbp),%xmm1
  movsd  -0x1f88(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x1f8c(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x1f8c(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x1f8c(%rbp),%xmm2
  movsd  -0x1f80(%rbp),%xmm0
  mulsd  %xmm0,%xmm2
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x1f8c(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  pxor   %xmm2,%xmm2
  cvtsi2sdl -0x1f8c(%rbp),%xmm2
  movsd  -0x1f78(%rbp),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x1f70(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x1f8c(%rbp),%eax
  cltq
  movsd  %xmm0,-0x1f50(%rbp,%rax,8)
  mov    -0x1f8c(%rbp),%eax
  cltq
  mov    -0x1f50(%rbp,%rax,8),%rax
  mov    -0x1f8c(%rbp),%edx
  mov    %edx,%esi
  movq   %rax,%xmm0
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  addl   $0x1,-0x1f8c(%rbp)
L110:
  cmpl   $0x3e7,-0x1f8c(%rbp)
  jle    L22
  movl   $0x0,-0x1f8c(%rbp)
  jmp    L173
L220:
  mov    -0x1f8c(%rbp),%eax
  cltq
  movsd  -0x1f50(%rbp,%rax,8),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L195
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x1f8c(%rbp),%xmm0
  movsd  %xmm0,-0x1f68(%rbp)
  jmp    L47
L195:
  addl   $0x1,-0x1f8c(%rbp)
L173:
  cmpl   $0x3e7,-0x1f8c(%rbp)
  jle    L220
L47:
  movl   $0x0,-0x1f8c(%rbp)
  jmp    L58
L51:
  mov    -0x1f8c(%rbp),%eax
  cltq
  movsd  -0x1f50(%rbp,%rax,8),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L62
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x1f8c(%rbp),%xmm0
  movsd  %xmm0,-0x1f60(%rbp)
  jmp    L106
L62:
  addl   $0x1,-0x1f8c(%rbp)
L58:
  cmpl   $0x3e7,-0x1f8c(%rbp)
  jle    L51
L106:
  jmp    L2
L135:
  movsd  -0x1f68(%rbp),%xmm0
  addsd  -0x1f60(%rbp),%xmm0
  movsd  D32(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x1f58(%rbp)
  movsd  -0x1f58(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  cltq
  movsd  -0x1f50(%rbp,%rax,8),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L56
  movsd  -0x1f58(%rbp),%xmm0
  movsd  %xmm0,-0x1f60(%rbp)
  jmp    L5
L56:
  movsd  -0x1f58(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  cltq
  movsd  -0x1f50(%rbp,%rax,8),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L166
  movsd  -0x1f58(%rbp),%xmm0
  movsd  %xmm0,-0x1f68(%rbp)
  jmp    L5
L166:
  mov    -0x1f58(%rbp),%rax
  movq   %rax,%xmm0
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L5:
  movsd  -0x1f68(%rbp),%xmm0
  ucomisd -0x1f60(%rbp),%xmm0
  jp     L206
  movsd  -0x1f68(%rbp),%xmm0
  ucomisd -0x1f60(%rbp),%xmm0
  jne    L206
  movsd  -0x1f60(%rbp),%xmm0
  ucomisd -0x1f58(%rbp),%xmm0
  jp     L206
  movsd  -0x1f60(%rbp),%xmm0
  ucomisd -0x1f58(%rbp),%xmm0
  je     L211
L206:
  movsd  -0x1f58(%rbp),%xmm1
  movsd  -0x1f60(%rbp),%xmm0
  mov    -0x1f68(%rbp),%rax
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
L2:
  movsd  -0x1f60(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  cltq
  movsd  -0x1f50(%rbp,%rax,8),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L178
  movsd  -0x1f68(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  cltq
  movsd  -0x1f50(%rbp,%rax,8),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  ja     L135
  jmp    L178
L211:
  nop
L178:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L65
  call   <__stack_chk_fail@plt>
L65:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D5
type_infered: string
name: unpack_data
arguments: data_tag: D30
type_infered: string
name: unpack_data
arguments: data_tag: D32
type_infered: f64
name: unpack_data
arguments: data_tag: D4
type_infered: string
name: unpack_data
arguments: data_tag: D14
type_infered: string

tool: D5: %lf %lf %lf %lf

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


tool: D32: 2

tool: D4: The root is at %lf

tool: D14: %lf	%lf	%lf


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);
  }
}
```