user: What would the C source look like for the assembly code provided here?

```asm
<ftoa>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  movsd  %xmm0,-0x38(%rbp)
  mov    %rdi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movsd  -0x38(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L105
  mov    -0x40(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x40(%rbp)
  movb   $0x2b,(%rax)
  jmp    L58
L105:
  movsd  -0x38(%rbp),%xmm0
  movq   D8(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x40(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x40(%rbp)
  movb   $0x2d,(%rax)
L58:
  pxor   %xmm0,%xmm0
  ucomisd -0x38(%rbp),%xmm0
  jp     L101
  pxor   %xmm0,%xmm0
  ucomisd -0x38(%rbp),%xmm0
  jne    L101
  movl   $0x1,-0x30(%rbp)
  jmp    L56
L101:
  lea    -0x30(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <frexp@plt>
  mov    -0x30(%rbp),%eax
  imul   $0xffff8a69,%eax,%eax
  movslq %eax,%rdx
  imul   $0x14f8b589,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0xd,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x30(%rbp),%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <pow10@plt>
  movsd  -0x38(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  jmp    L107
L84:
  addl   $0x1,-0x2c(%rbp)
L107:
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <pow10@plt>
  movsd  -0x18(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  D2(%rip),%xmm0
  comisd -0x10(%rbp),%xmm0
  ja     L84
  jmp    L9
L48:
  subl   $0x1,-0x2c(%rbp)
L9:
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <pow10@plt>
  movsd  -0x18(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  comisd D46(%rip),%xmm0
  jae    L48
  mov    -0x2c(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x30(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
L56:
  movl   $0x0,-0x28(%rbp)
  jmp    L64
L7:
  lea    -0x20(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rdi
  movq   %rax,%xmm0
  call   <modf@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D46(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x20(%rbp),%xmm1
  movsd  D45(%rip),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x40(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x40(%rbp)
  cvttsd2si %xmm0,%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x28(%rbp)
L64:
  cmpl   $0x12,-0x28(%rbp)
  jne    L7
  mov    -0x40(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%edx
  mov    $0x1,%eax
  sub    %edx,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L98
  call   <__stack_chk_fail@plt>
L98:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D8
type_infered: f32[2]
name: disassemble_data
arguments: label: D2
type_infered: f64
name: disassemble_data
arguments: label: D46
type_infered: f64[2]
name: disassemble_data
arguments: label: D45
type_infered: f32[2]

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

tool: D2: 1

tool: {"D46": [10.0,48.0]}

tool: {"D45": [0.0,3.125]}

assistant: ```c
int ftoa(double f, char *bp) {
  int e, e1, e2, i;
  double digit, g, p;
  if (f >= 0)
    *bp++ = '+';
  else {
    f = -f;
    *bp++ = '-';
  }
  if (f == 0.)
    e = 1;
  else {
    frexp(f, &e);
    e = -e * 30103 / 100000;
    e1 = e / 2;
    e2 = e - e1;
    p = f * pow10(e2);
    while ((g = p * pow10(e1)) < 1.)
      e1++;
    while ((g = p * pow10(e1)) >= 10.)
      --e1;
    e = e1 + e2;
    f = g;
  }
  for (i = 0; i != 18; i++) {
    f = modf(f, &digit) * 10.;
    *bp++ = digit + '0';
  }
  *bp = '\0';
  return 1 - e;
}
```