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

```asm
<double64_le_write>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movsd  %xmm0,-0x18(%rbp)
  mov    %rdi,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x20(%rbp),%rax
  mov    $0x8,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jp     L45
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  je     L22
L45:
  pxor   %xmm0,%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L15
  movsd  -0x18(%rbp),%xmm0
  movq   D24(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x7,%rax
  movzbl (%rax),%edx
  mov    -0x20(%rbp),%rax
  add    $0x7,%rax
  or     $0xffffff80,%edx
  mov    %dl,(%rax)
L15:
  lea    -0x10(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <frexp@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x10(%rbp),%eax
  add    $0x3fe,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x20(%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    -0x20(%rbp),%rax
  add    $0x7,%rax
  mov    %dl,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x6,%rax
  movzbl (%rax),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  shl    $0x4,%eax
  or     %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x6,%rax
  mov    %dl,(%rax)
  movsd  -0x18(%rbp),%xmm1
  movsd  D14(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  mov    %eax,%edi
  call   <lrint@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x20(%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    -0x20(%rbp),%rax
  add    $0x6,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x5,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  mov    %dl,(%rax)
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  mov    -0xc(%rbp),%edx
  mov    %dl,(%rax)
  movsd  D32(%rip),%xmm0
  mov    -0x18(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmod@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm1
  movsd  D27(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  mov    %eax,%edi
  call   <lrint@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L13
L22:
  nop
L13:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L46
  call   <__stack_chk_fail@plt>
L46:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D24
type_infered: f32[2]
name: unpack_data
arguments: label: D14
type_infered: f32[2]
name: unpack_data
arguments: label: D32
type_infered: f64
name: unpack_data
arguments: label: D27
type_infered: f32[2]

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

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

tool: D32: 1

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

assistant: ```c
void double64_le_write(double in, unsigned char *out) {
  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 = lrint(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 = lrint(floor(in));
  out[2] = (mantissa >> 16) & 0xFF;
  out[1] = (mantissa >> 8) & 0xFF;
  out[0] = mantissa & 0xFF;
  return;
}
```