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

```asm
<read_d64_be>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  sar    $0x7,%al
  movsbl %al,%eax
  and    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x4,%eax
  and    $0x7f0,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  and    $0xf,%eax
  or     %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  and    $0xf000000,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D7(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L74
  pxor   %xmm0,%xmm0
  ucomisd -0x8(%rbp),%xmm0
  jp     L74
  pxor   %xmm0,%xmm0
  ucomisd -0x8(%rbp),%xmm0
  jne    L74
  pxor   %xmm0,%xmm0
  jmp    L31
L74:
  movsd  -0x8(%rbp),%xmm1
  movsd  D6(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  subl   $0x3ff,-0xc(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movsd  D6(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  je     L72
  movsd  -0x8(%rbp),%xmm0
  movq   D28(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L72:
  cmpl   $0x0,-0xc(%rbp)
  jle    L22
  mov    -0xc(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0x8(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L20
L22:
  cmpl   $0x0,-0xc(%rbp)
  jns    L20
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  neg    %edx
  cmovns %edx,%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  -0x8(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L20:
  movsd  -0x8(%rbp),%xmm0
L31:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D7
type_infered: f32[2]
name: retrieve_data
arguments: data_label: D6
type_infered: f32[2]
name: retrieve_data
arguments: data_label: D28
type_infered: f32[2]

tool: {"D7": [0.0,15.0]}

tool: {"D6": [0.0,22.0]}

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

assistant: ```c
double read_d64_be(unsigned char *cptr) {
  int exponent, negative;
  double dvalue;
  negative = (cptr[0] & 0x80) ? 1 : 0;
  exponent = ((cptr[0] & 0x7F) << 4) | ((cptr[1] >> 4) & 0xF);
  dvalue = (((cptr[1] & 0xF) << 24) | (cptr[2] << 16) | (cptr[3] << 8) | cptr[4]);
  dvalue += ((cptr[5] << 16) | (cptr[6] << 8) | cptr[7]) / ((double)0x1000000);
  if (exponent == 0 && dvalue == 0.0)
    return 0.0;
  dvalue += 0x10000000;
  exponent = exponent - 0x3FF;
  dvalue = dvalue / ((double)0x10000000);
  if (negative)
    dvalue *= -1;
  if (exponent > 0)
    dvalue *= (1 << exponent);
  else if (exponent < 0)
    dvalue /= (1 << abs(exponent));
  return dvalue;
}
```