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

```asm
<dtostrf>:
  endbr64
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edi,%ebx
  sub    $0x18,%rsp
  movsd  %xmm0,0x8(%rsp)
  call   <isnan@plt>
  movsd  0x8(%rsp),%xmm0
  test   %rax,%rax
  jne    L114
  movsd  %xmm0,0x8(%rsp)
  call   <isinf@plt>
  movsd  0x8(%rsp),%xmm0
  test   %rax,%rax
  jne    L237
  movsbl %bl,%ecx
  movzbl %bpl,%r8d
  test   %bpl,%bpl
  je     L124
  lea    0x1(%r8),%eax
  pxor   %xmm1,%xmm1
  sub    %eax,%ecx
  comisd %xmm0,%xmm1
  ja     L38
  xor    %r9d,%r9d
L35:
  movsd  D96(%rip),%xmm1
  movsd  D73(%rip),%xmm2
  xor    %eax,%eax
  nopl   (%rax)
L26:
  mulsd  %xmm2,%xmm1
  add    $0x1,%eax
  cmp    %al,%r13b
  ja     L26
  movsd  D30(%rip),%xmm3
  divsd  %xmm1,%xmm3
L77:
  addsd  %xmm3,%xmm0
  mov    $0x1,%esi
  movapd %xmm2,%xmm1
  comisd %xmm2,%xmm0
  jb     L137
  nopl   0x0(%rax,%rax,1)
L220:
  movapd %xmm1,%xmm3
  add    $0x1,%esi
  mulsd  %xmm2,%xmm1
  comisd %xmm1,%xmm0
  jae    L220
  divsd  %xmm3,%xmm0
L137:
  sub    %esi,%ecx
  test   %ecx,%ecx
  jle    L234
  movabs $0x2020202020202020,%rax
  movslq %ecx,%rdx
  cmp    $0x8,%ecx
  jae    L34
  test   $0x4,%cl
  jne    L184
  test   %ecx,%ecx
  jne    L194
L81:
  lea    (%r12,%rdx,1),%rcx
L190:
  test   %r9d,%r9d
  je     L103
  movb   $0x2d,(%rcx)
  add    $0x1,%rcx
L103:
  test   %bpl,%bpl
  lea    -0x1(%rsi,%r8,1),%edx
  setne  %r9b
  jmp    L255
  nopl   0x0(%rax)
L192:
  test   %edx,%edx
  jle    L142
L104:
  sub    $0x1,%edx
  mov    %rsi,%rcx
L255:
  cvttsd2si %xmm0,%eax
  mov    $0x9,%esi
  pxor   %xmm1,%xmm1
  cmp    %esi,%eax
  cmovg  %esi,%eax
  lea    0x1(%rcx),%rsi
  cvtsi2sd %eax,%xmm1
  mov    %eax,%edi
  or     $0x30,%edi
  mov    %dil,(%rcx)
  subsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  cmp    %r8d,%edx
  jne    L192
  test   %r9b,%r9b
  je     L192
  movb   $0x2e,0x1(%rcx)
  lea    0x2(%rcx),%rsi
  jmp    L104
  nopl   0x0(%rax)
L124:
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  jbe    L224
  xorpd  D109(%rip),%xmm0
  movsd  D20(%rip),%xmm3
  sub    $0x1,%ecx
  mov    $0x1,%r9d
  movsd  D73(%rip),%xmm2
  jmp    L77
  nopl   0x0(%rax)
L142:
  movb   $0x0,0x1(%rcx)
  add    $0x18,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L114:
  mov    %r12,%rdi
  lea    D33(%rip),%rsi
  call   <strcpy@plt>
  add    $0x18,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L34:
  mov    %ecx,%edi
  mov    %rax,(%r12)
  mov    %r12,%r10
  mov    %rax,-0x8(%r12,%rdi,1)
  lea    0x8(%r12),%rdi
  and    $0xfffffffffffffff8,%rdi
  sub    %rdi,%r10
  add    %r10d,%ecx
  shr    $0x3,%ecx
  rep stos %rax,%es:(%rdi)
  jmp    L81
  nopl   0x0(%rax,%rax,1)
L194:
  movb   $0x20,(%r12)
  test   $0x2,%cl
  je     L81
  mov    %ecx,%ecx
  mov    $0x2020,%eax
  mov    %ax,-0x2(%r12,%rcx,1)
  jmp    L81
L237:
  mov    %r12,%rdi
  lea    D50(%rip),%rsi
  call   <strcpy@plt>
  add    $0x18,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L224:
  movsd  D20(%rip),%xmm3
  movsd  D73(%rip),%xmm2
  xor    %r9d,%r9d
  jmp    L77
  nopl   0x0(%rax,%rax,1)
L234:
  mov    %r12,%rcx
  jmp    L190
L184:
  mov    %ecx,%ecx
  movl   $0x20202020,(%r12)
  movl   $0x20202020,-0x4(%r12,%rcx,1)
  jmp    L81
L38:
  xorpd  D109(%rip),%xmm0
  sub    $0x1,%ecx
  mov    $0x1,%r9d
  jmp    L35
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D96
data_type: f64
name: extract_symbolic_data
arguments: data_label: D73
data_type: f64
name: extract_symbolic_data
arguments: data_label: D30
data_type: f64
name: extract_symbolic_data
arguments: data_label: D109
data_type: f32[4]
name: extract_symbolic_data
arguments: data_label: D20
data_type: f32[2]
name: extract_symbolic_data
arguments: data_label: D33
data_type: string
name: extract_symbolic_data
arguments: data_label: D50
data_type: string

tool: D96: 2

tool: D73: 10

tool: D30: 1

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

tool: {"D20": [0.0,1.75]}

tool: D33: nan

tool: D50: inf

assistant: ```c
char *dtostrf(double number, signed char width, unsigned char prec, char *s) {
  bool negative = false;
  if (isnan(number)) {
    strcpy(s, "nan");
    return s;
  }
  if (isinf(number)) {
    strcpy(s, "inf");
    return s;
  }
  char *out = s;
  int fillme = width;
  if (prec > 0) {
    fillme -= (prec + 1);
  }
  if (number < 0.0) {
    negative = true;
    fillme--;
    number = -number;
  }
  double rounding = 2.0;
  for (uint8_t i = 0; i < prec; ++i)
    rounding *= 10.0;
  rounding = 1.0 / rounding;
  number += rounding;
  double tenpow = 1.0;
  int digitcount = 1;
  while (number >= 10.0 * tenpow) {
    tenpow *= 10.0;
    digitcount++;
  }
  number /= tenpow;
  fillme -= digitcount;
  while (fillme-- > 0) {
    *out++ = ' ';
  }
  if (negative)
    *out++ = '-';
  digitcount += prec;
  int8_t digit = 0;
  while (digitcount-- > 0) {
    digit = (int8_t)number;
    if (digit > 9)
      digit = 9;
    *out++ = (char)('0' | digit);
    if ((digitcount == prec) && (prec > 0)) {
      *out++ = '.';
    }
    number -= digit;
    number *= 10.0;
  }
  *out = 0;
  return s;
}
```