user: Please show me the C implementation that matches the assembly code listed below:

```asm
<flt2ieee_nan>:
  endbr64
  push   %rbp
  pxor   %xmm1,%xmm1
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  ucomiss %xmm1,%xmm0
  jp     L114
  je     L85
L114:
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  comisd D49(%rip),%xmm2
  jb     L8
  movsd  D38(%rip),%xmm3
  comisd %xmm2,%xmm3
  jae    L10
L8:
  xor    %ebp,%ebp
  comiss %xmm0,%xmm1
  ja     L35
L132:
  lea    0x4(%rsp),%rdi
  movapd %xmm2,%xmm0
  call   <frexp@plt>
  mulsd  D43(%rip),%xmm0
  addsd  D47(%rip),%xmm0
  cvttsd2si %xmm0,%rax
  mov    %eax,%edx
  cmp    $0xffffff,%eax
  ja     L28
  mov    0x4(%rsp),%eax
  add    $0x7e,%eax
  js     L66
L143:
  cmp    $0xff,%eax
  jg     L27
  mov    %eax,%ecx
  shl    $0x7,%eax
  sar    %ecx
  add    %ecx,%ebp
  mov    %edx,%ecx
  shr    $0x10,%edx
  and    $0x7f,%edx
  rol    $0x8,%cx
  mov    %bpl,(%rbx)
  add    %eax,%edx
  mov    %cx,0x2(%rbx)
  mov    %dl,0x1(%rbx)
L1:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L55
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L28:
  mov    0x4(%rsp),%eax
  shr    %edx
  add    $0x1,%eax
  add    $0x7e,%eax
  jns    L143
L66:
  xor    %edx,%edx
  mov    %bpl,(%rbx)
  mov    %dx,0x1(%rbx)
  movb   $0x0,0x3(%rbx)
  jmp    L1
  nopl   (%rax)
L35:
  xorps  D29(%rip),%xmm0
  pxor   %xmm2,%xmm2
  mov    $0xffffff80,%ebp
  cvtss2sd %xmm0,%xmm2
  jmp    L132
  nopl   0x0(%rax)
L85:
  movl   $0x0,(%rdi)
  jmp    L1
L10:
  movl   $0xffffffff,(%rbx)
  jmp    L1
  nopl   0x0(%rax,%rax,1)
L27:
  add    $0x7f,%ebp
  mov    $0x80,%eax
  movb   $0x0,0x3(%rbx)
  mov    %bpl,(%rbx)
  mov    %ax,0x1(%rbx)
  jmp    L1
L55:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D49
type_guessed: f64[2]
name: parse_data
arguments: data_tag: D38
type_guessed: f64
name: parse_data
arguments: data_tag: D43
type_guessed: f32[2]
name: parse_data
arguments: data_tag: D47
type_guessed: f64
name: parse_data
arguments: data_tag: D29
type_guessed: byte[16]

tool: {"D49": [9.9989e20,9.9991e20]}

tool: D38: 9.9991e+20

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

tool: D47: 0.5

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

assistant: ```c
int flt2ieee_nan(float x, unsigned char *ieee) {
  int sign, exp;
  unsigned int umant;
  double mant;
  if (x == 0.0) {
    ieee[0] = ieee[1] = ieee[2] = ieee[3] = 0;
    return 0;
  }
  if (((x) >= 9.9989e20 && (x) <= 9.9991e20)) {
    ieee[0] = ieee[1] = ieee[2] = ieee[3] = 255;
    return 0;
  }
  if (x < 0.0) {
    sign = 128;
    x = -x;
  } else
    sign = 0;
  mant = frexp((double)x, &exp);
  umant = mant * 16777216 + 0.5;
  if (umant >= 16777216) {
    umant = umant / 2;
    exp++;
  }
  exp = exp - 1 + 127;
  if (exp < 0) {
    ieee[0] = sign;
    ieee[1] = ieee[2] = ieee[3] = 0;
    return 0;
  }
  if (exp > 255) {
    ieee[0] = sign + 127;
    ieee[1] = 128;
    ieee[2] = ieee[3] = 0;
    return 0;
  }
  ieee[0] = sign + (exp >> 1);
  ieee[3] = umant & 255;
  ieee[2] = (umant >> 8) & 255;
  ieee[1] = ((exp & 1) << 7) + ((umant >> 16) & 127);
  return 0;
}
```