user: Converte this assembly snippet into its equivalent C code:

```asm
<flt2ieee_nan>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  ucomiss D45(%rip),%xmm0
  jp     L101
  je     L132
L101:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  comisd D7(%rip),%xmm1
  jb     L71
  movsd  D20(%rip),%xmm2
  comisd %xmm1,%xmm2
  jae    L12
L71:
  pxor   %xmm1,%xmm1
  mov    $0x0,%ebp
  comiss %xmm0,%xmm1
  ja     L73
L51:
  lea    0x4(%rsp),%rdi
  cvtss2sd %xmm0,%xmm0
  call   <frexp@plt>
  mulsd  D12(%rip),%xmm0
  addsd  D57(%rip),%xmm0
  cvttsd2si %xmm0,%rax
  mov    %eax,%edx
  cmp    $0xffffff,%eax
  jbe    L41
  shr    %edx
  addl   $0x1,0x4(%rsp)
L41:
  mov    0x4(%rsp),%eax
  add    $0x7e,%eax
  js     L138
  cmp    $0xff,%eax
  jg     L8
  mov    %eax,%ecx
  sar    %ecx
  add    %ebp,%ecx
  mov    %cl,(%rbx)
  mov    %dl,0x3(%rbx)
  movzbl %dh,%ecx
  mov    %cl,0x2(%rbx)
  shr    $0x10,%edx
  and    $0x7f,%edx
  shl    $0x7,%eax
  add    %eax,%edx
  mov    %dl,0x1(%rbx)
  jmp    L96
L132:
  movb   $0x0,0x3(%rdi)
  movb   $0x0,0x2(%rdi)
  movb   $0x0,0x1(%rdi)
  movb   $0x0,(%rdi)
L96:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L121
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L12:
  movb   $0xff,0x3(%rbx)
  movb   $0xff,0x2(%rbx)
  movb   $0xff,0x1(%rbx)
  movb   $0xff,(%rbx)
  jmp    L96
L73:
  xorps  D34(%rip),%xmm0
  mov    $0x80,%ebp
  jmp    L51
L138:
  mov    %bpl,(%rbx)
  movb   $0x0,0x3(%rbx)
  movb   $0x0,0x2(%rbx)
  movb   $0x0,0x1(%rbx)
  jmp    L96
L8:
  add    $0x7f,%ebp
  mov    %bpl,(%rbx)
  movb   $0x80,0x1(%rbx)
  movb   $0x0,0x3(%rbx)
  movb   $0x0,0x2(%rbx)
  jmp    L96
L121:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D45
type: f64
name: parse_data
arguments: data_label: D7
type: f64[2]
name: parse_data
arguments: data_label: D20
type: f64
name: parse_data
arguments: data_label: D12
type: byte[8]
name: parse_data
arguments: data_label: D57
type: f64
name: parse_data
arguments: data_label: D34
type: byte[16]

tool: D45: 0

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

tool: D20: 9.9991e+20

tool: {"D12": [0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x41]}

tool: D57: 0.5

tool: {"D34": [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;
}
```