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

```asm
<write_d64_le>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movsd  %xmm0,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x18(%rbp),%rax
  mov    $0x8,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  jp     L30
  pxor   %xmm0,%xmm0
  ucomisd -0x20(%rbp),%xmm0
  je     L14
L30:
  pxor   %xmm0,%xmm0
  comisd -0x20(%rbp),%xmm0
  jbe    L20
  movsd  -0x20(%rbp),%xmm0
  movq   D7(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%edx
  mov    -0x18(%rbp),%rax
  add    $0x7,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
L20:
  lea    -0x10(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <frexp@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x10(%rbp),%eax
  add    $0x3fe,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  sar    $0x4,%eax
  and    $0x7f,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x7,%rax
  mov    %dl,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  shl    $0x4,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  mov    %dl,(%rax)
  movsd  -0x20(%rbp),%xmm1
  movsd  D27(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  mov    %eax,%edi
  call   <double2int@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  sar    $0x18,%eax
  and    $0xf,%eax
  or     %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x5,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    %dl,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  mov    -0xc(%rbp),%edx
  mov    %dl,(%rax)
  movsd  D3(%rip),%xmm0
  mov    -0x20(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmod@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x20(%rbp)
  movsd  -0x20(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  mov    %eax,%edi
  call   <double2int@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L1
L14:
  nop
L1:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L19
  call   <__stack_chk_fail@plt>
L19:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D7
type_infered: f32[2]
name: disassemble_data
arguments: tag: D27
type_infered: f32[2]
name: disassemble_data
arguments: tag: D3
type_infered: f64
name: disassemble_data
arguments: tag: D16
type_infered: f32[2]

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

tool: {"D27": [0.0,24.0]}

tool: D3: 1

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

assistant: ```c
void write_d64_le(unsigned char *out, double in) {
  int exponent, mantissa;
  memset(out, 0, sizeof(double));
  if (in == 0.0)
    return;
  if (in < 0.0) {
    in *= -1.0;
    out[7] |= 0x80;
  }
  in = frexp(in, &exponent);
  exponent += 1022;
  out[7] |= (exponent >> 4) & 0x7F;
  out[6] |= (exponent << 4) & 0xF0;
  in *= 0x20000000;
  mantissa = double2int(floor(in));
  out[6] |= (mantissa >> 24) & 0xF;
  out[5] = (mantissa >> 16) & 0xFF;
  out[4] = (mantissa >> 8) & 0xFF;
  out[3] = mantissa & 0xFF;
  in = fmod(in, 1.0);
  in *= 0x1000000;
  mantissa = double2int(floor(in));
  out[2] = (mantissa >> 16) & 0xFF;
  out[1] = (mantissa >> 8) & 0xFF;
  out[0] = mantissa & 0xFF;
  return;
}
```