user: Demonstrate the C code that generates the assembly output below:

```asm
<IEE754_binary64_encode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  movsd  %xmm0,-0x28(%rbp)
  mov    %rdi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  comisd -0x28(%rbp),%xmm0
  seta   %al
  movzbl %al,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x28(%rbp),%rax
  movq   %rax,%xmm0
  call   <isinf@plt>
  test   %rax,%rax
  je     L67
  movl   $0x7ff,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L46
L67:
  mov    -0x28(%rbp),%rax
  movq   %rax,%xmm0
  call   <isnan@plt>
  test   %rax,%rax
  je     L7
  movl   $0x7ff,-0x14(%rbp)
  movl   $0xffffffff,-0x10(%rbp)
  jmp    L46
L7:
  cmpl   $0x0,-0xc(%rbp)
  je     L57
  movsd  -0x28(%rbp),%xmm0
  movq   D7(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
L57:
  movl   $0x0,-0x18(%rbp)
  lea    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <frexp@plt>
  movl   $0x0,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    $0x3fe,%eax
  jg     L68
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L46
L68:
  mov    -0x18(%rbp),%eax
  add    $0x3fe,%eax
  mov    %eax,-0x14(%rbp)
  cmpl   $0x7ff,-0x14(%rbp)
  jle    L46
  movl   $0x7ff,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
L46:
  mov    -0xc(%rbp),%eax
  shl    $0x7,%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  sar    $0x4,%eax
  and    $0x7f,%eax
  or     %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x14(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%esi
  mov    $0x30,%edx
  mov    -0x10(%rbp),%eax
  mov    %edx,%ecx
  sar    %cl,%eax
  and    $0xf,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  or     %esi,%edx
  mov    %dl,(%rax)
  mov    $0x28,%edx
  mov    -0x10(%rbp),%eax
  mov    %edx,%ecx
  sar    %cl,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  mov    $0x20,%edx
  mov    -0x10(%rbp),%eax
  mov    %edx,%ecx
  sar    %cl,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x3,%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%eax
  shr    $0x18,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%eax
  sar    $0x10,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x5,%rax
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x6,%rax
  mov    %dl,(%rax)
  mov    -0x30(%rbp),%rax
  add    $0x7,%rax
  mov    -0x10(%rbp),%edx
  mov    %dl,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L23
  call   <__stack_chk_fail@plt>
L23:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D7
type: byte[8]

tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
void IEE754_binary64_encode(double x, char out[8]) {
  bool sign = x < 0;
  uint16_t exponent;
  uint64_t fraction;
  if (isinf(x)) {
    exponent = 0x7FF;
    fraction = 0;
  } else if (isnan(x)) {
    exponent = 0x7FF;
    fraction = 0xFFFFFFFFFFFFF;
  } else {
    if (sign)
      x = -x;
    int e = 0;
    fraction = frexp(x, &e) * ((uint64_t)2 << 52);
    if (e <= 1022) {
      exponent = 0;
      fraction = 0;
    } else {
      exponent = e + 1022;
      if (exponent > 0x7FF) {
        exponent = 0x7FF;
        fraction = 0;
      }
    }
  }
  out[0] = ((sign << 7) & 0x80) | ((exponent >> 4) & 0x7F);
  out[1] = ((exponent << 4) & 0xF0) | ((fraction >> 48) & 0x0F);
  out[2] = (fraction >> 40) & 0xFF;
  out[3] = (fraction >> 32) & 0xFF;
  out[4] = (fraction >> 24) & 0xFF;
  out[5] = (fraction >> 16) & 0xFF;
  out[6] = (fraction >> 8) & 0xFF;
  out[7] = fraction & 0xFF;
}
```