user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%ebx
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x20(%rsp)
  lea    D54(%rip),%rdi
  call   <puts@plt>
  lea    0xc(%rsp),%rcx
  lea    0x18(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  lea    D40(%rip),%rdi
  call   <scanf@plt>
  cmp    $0x2,%ebx
  je     L1
L14:
  lea    0x20(%rsp),%rsi
  mov    0xc(%rsp),%edi
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  call   <trap@plt>
  mov    0xc(%rsp),%esi
  lea    D3(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movsd  0x20(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  lea    D14(%rip),%rbx
  mov    %rbx,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  movq   $0x0,0x20(%rsp)
  mov    0xc(%rsp),%edi
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  call   <local_trap@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  0x20(%rsp),%xmm0
  movsd  %xmm0,0x20(%rsp)
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0xc(%rsp),%esi
  lea    D26(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movsd  0x20(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  mov    %rbx,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  movq   $0x0,0x20(%rsp)
  mov    0xc(%rsp),%edi
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  call   <parallel_trap@plt>
  movsd  %xmm0,0x20(%rsp)
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0xc(%rsp),%esi
  lea    D13(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movsd  0x20(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  mov    %rbx,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L13
  mov    $0x0,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  ret
L1:
  mov    0x8(%rbp),%rdi
  mov    $0xa,%edx
  mov    $0x0,%esi
  call   <strtol@plt>
  jmp    L14
L13:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D54
type_infered: string
name: retrieve_data
arguments: label: D40
type_infered: string
name: retrieve_data
arguments: label: D3
type_infered: string
name: retrieve_data
arguments: label: D14
type_infered: string
name: retrieve_data
arguments: label: D26
type_infered: string
name: retrieve_data
arguments: label: D13
type_infered: string

tool: D54: Enter a, b and n:

tool: D40: %lf %lf %d

tool: D3: Version 1: With n = %d trapezoids, our estimate


tool: D14: of the integral from %f to %f = %.14e


tool: D26: Version 2: With n = %d trapezoids, our estimate


tool: D13: Version 3: With n = %d trapezoids, our estimate


assistant: ```c
int main(int argc, char *argv[]) {
  int n;
  int thread_count = 1;
  double a;
  double b;
  double global_result = 0.0;
  printf("Enter a, b and n:\n");
  scanf("%lf %lf %d", &a, &b, &n);
  if (argc == 2) {
    thread_count = strtol(argv[1], NULL, 10);
  }
#pragma omp parallel num_threads(thread_count)
  trap(a, b, n, &global_result);
  printf("Version 1: With n = %d trapezoids, our estimate\n", n);
  printf("of the integral from %f to %f = %.14e\n", a, b, global_result);
  global_result = 0.0;
#pragma omp parallel num_threads(thread_count) reduction(+ : global_result)
  global_result += local_trap(a, b, n);
  printf("\n");
  printf("Version 2: With n = %d trapezoids, our estimate\n", n);
  printf("of the integral from %f to %f = %.14e\n", a, b, global_result);
  global_result = 0.0;
  global_result = parallel_trap(a, b, n);
  printf("\n");
  printf("Version 3: With n = %d trapezoids, our estimate\n", n);
  printf("of the integral from %f to %f = %.14e\n", a, b, global_result);
  return 0;
}
```