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

```asm
<__dtostr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  movq   %xmm0,%r13
  mov    %rdi,%r15
  mov    %esi,%ebp
  mov    %edx,0x8(%rsp)
  mov    %ecx,%r12d
  mov    %r8d,0xc(%rsp)
  call   <isinf@plt>
  test   %eax,%eax
  jne    L25
  mov    %eax,%ebx
  movq   %r13,%xmm0
  call   <isnan@plt>
  test   %rax,%rax
  jne    L106
  mov    %r13,%rdx
  movq   %r13,%xmm5
  ucomisd D4(%rip),%xmm5
  jp     L147
  je     L608
L147:
  pxor   %xmm0,%xmm0
  movq   %r13,%xmm7
  mov    %r15,%r14
  movq   %r13,%xmm1
  comisd %xmm7,%xmm0
  ja     L235
L68:
  test   %r12d,%r12d
  je     L303
  movsd  D131(%rip),%xmm0
  movsd  D80(%rip),%xmm2
L154:
  mulsd  %xmm2,%xmm0
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  jne    L154
L277:
  addsd  %xmm0,%xmm1
  movsd  D179(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L273
L597:
  shr    $0x34,%rdx
  and    $0x7ff,%edx
  sub    $0x3ff,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  mulsd  D40(%rip),%xmm0
  cvttsd2si %xmm0,%rbx
  add    $0x1,%rbx
  test   %rbx,%rbx
  jle    L495
  mov    %ebx,%eax
  cmp    $0xa,%ebx
  jbe    L348
  movsd  D74(%rip),%xmm0
  movsd  D23(%rip),%xmm2
L617:
  mulsd  %xmm2,%xmm0
  sub    $0xa,%eax
  cmp    $0xa,%eax
  ja     L617
  cmp    $0x1,%eax
  jbe    L118
L510:
  movsd  D74(%rip),%xmm2
L282:
  mulsd  %xmm2,%xmm0
  sub    $0x1,%eax
  cmp    $0x1,%eax
  ja     L282
L118:
  comisd D31(%rip),%xmm0
  jbe    L380
L263:
  mov    $0x1,%edx
  mov    $0x0,%ecx
  movsd  D74(%rip),%xmm4
  movsd  D31(%rip),%xmm3
  jmp    L623
L25:
  lea    D143(%rip),%rdx
  mov    %ebp,%esi
  mov    %r15,%rdi
  call   <copystring@plt>
L612:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L106:
  lea    D169(%rip),%rdx
  mov    %ebp,%esi
  mov    %r15,%rdi
  call   <copystring@plt>
  jmp    L612
L608:
  test   %r12d,%r12d
  je     L388
  lea    0x2(%r12),%eax
  cmp    %eax,%ebp
  jb     L119
  test   %eax,%eax
  je     L305
  jmp    L391
L240:
  mov    $0x1,%eax
L391:
  test   %rdx,%rdx
  jns    L356
  movb   $0x2d,(%r15)
  cmp    $0x1,%eax
  jbe    L62
  mov    $0x1,%ebx
  jmp    L356
L62:
  mov    $0x1,%eax
  mov    $0x2,%edx
  jmp    L148
L235:
  xorpd  D60(%rip),%xmm1
  movb   $0x2d,(%r15)
  sub    $0x1,%ebp
  lea    0x1(%r15),%r14
  jmp    L68
L303:
  movsd  D131(%rip),%xmm0
  jmp    L277
L273:
  movb   $0x30,(%r14)
  sub    $0x1,%ebp
  add    $0x1,%r14
  jmp    L597
L595:
  lea    0x30(%rax),%edx
  mov    %dl,(%r14)
  add    $0x1,%r14
  test   %ebp,%ebp
  je     L276
  movsbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  sub    $0x1,%ebp
  mov    %ecx,%edx
L603:
  divsd  %xmm4,%xmm0
  comisd %xmm3,%xmm0
  jbe    L380
L623:
  movapd %xmm1,%xmm2
  divsd  %xmm0,%xmm2
  cvttsd2si %xmm2,%eax
  test   %edx,%edx
  je     L595
  test   %al,%al
  je     L603
  jmp    L595
L276:
  movq   %r13,%xmm1
  divsd  %xmm0,%xmm1
  mov    $0x0,%r8d
  mov    %r12d,%ecx
  mov    0x8(%rsp),%edx
  mov    $0x0,%esi
  mov    %r15,%rdi
  movapd %xmm1,%xmm0
  call   <__dtostr>
  test   %eax,%eax
  je     L612
  movslq %eax,%rdx
  add    %r14,%rdx
  movb   $0x65,(%rdx)
  lea    0x1(%rdx),%r14
  not    %eax
  mov    %eax,%ecx
  mov    $0x4,%r8d
  mov    $0x1,%r9d
  mov    $0x3e8,%esi
  mov    $0x0,%r10d
  jmp    L590
L605:
  sub    $0x1,%ecx
  mov    %rbx,%rax
  cqto
  idiv   %rdi
  mov    %rdx,%rbx
  mov    %r10d,%r9d
L364:
  movslq %esi,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%esi
  sub    $0x1,%r8d
  je     L142
L590:
  movslq %esi,%rdi
  test   %r9d,%r9d
  je     L184
  cmp    %rbx,%rdi
  jg     L364
L184:
  test   %ecx,%ecx
  je     L605
  mov    %rbx,%rax
  cqto
  idiv   %rdi
  add    $0x30,%eax
  mov    %al,(%r14)
  add    $0x1,%r14
  jmp    L605
L142:
  mov    $0x0,%eax
  test   %ecx,%ecx
  je     L612
  jmp    L390
L495:
  movsd  D80(%rip),%xmm0
L380:
  cmp    %r15,%r14
  je     L442
L198:
  test   %r12d,%r12d
  jne    L243
  mov    %r14,%rax
  sub    %r15,%rax
  add    $0x1,%eax
  cmp    0x8(%rsp),%eax
  jae    L390
L243:
  mov    $0x0,%eax
  test   %ebp,%ebp
  je     L612
  sub    $0x1,%ebp
  movb   $0x2e,(%r14)
  lea    0x1(%r14),%rdi
  cmpl   $0x0,0xc(%rsp)
  je     L90
  test   %r12d,%r12d
  cmove  0x8(%rsp),%r12d
  mov    %r15d,%eax
  sub    %edi,%eax
  lea    0x1(%r12,%rax,1),%r12d
L250:
  mov    $0x0,%eax
  cmp    %ebp,%r12d
  ja     L612
  test   %r12d,%r12d
  je     L77
L357:
  lea    -0x1(%r12),%r8d
  lea    0x2(%r14,%r8,1),%rsi
  mov    %rdi,%rdx
  movsd  D74(%rip),%xmm3
L477:
  movapd %xmm1,%xmm2
  divsd  %xmm0,%xmm2
  cvttsd2si %xmm2,%eax
  lea    0x30(%rax),%ecx
  mov    %cl,(%rdx)
  add    $0x1,%rdx
  movsbl %al,%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  mulsd  %xmm0,%xmm2
  subsd  %xmm2,%xmm1
  divsd  %xmm3,%xmm0
  cmp    %rdx,%rsi
  jne    L477
  lea    0x1(%rdi,%r8,1),%r14
L390:
  movb   $0x0,(%r14)
  mov    %r14d,%eax
  sub    %r15d,%eax
  jmp    L612
L442:
  mov    $0x0,%eax
  test   %ebp,%ebp
  je     L612
  sub    $0x1,%ebp
  movb   $0x30,(%r14)
  add    $0x1,%r14
  jmp    L198
L90:
  test   %r12d,%r12d
  jne    L245
  mov    0x8(%rsp),%r12d
  add    $0x1,%r12d
  mov    %rdi,%rax
  sub    %r15,%rax
  sub    %eax,%r12d
  jmp    L250
L77:
  mov    %rdi,%r14
  jmp    L390
L245:
  mov    0xc(%rsp),%eax
  cmp    %ebp,%r12d
  jbe    L357
  jmp    L612
L348:
  movsd  D74(%rip),%xmm0
  cmp    $0x1,%ebx
  ja     L510
  jmp    L263
L265:
  movb   $0x2d,(%r15)
  mov    $0x1,%ebx
  mov    $0x8,%eax
  jmp    L356
L388:
  test   %ebp,%ebp
  jne    L240
L119:
  mov    $0x8,%eax
  test   %rdx,%rdx
  js     L265
L356:
  mov    %ebx,%ecx
  add    %r15,%rcx
  mov    %rcx,%rdx
  mov    %ebx,%esi
  sub    %ecx,%esi
L377:
  movb   $0x30,(%rdx)
  add    $0x1,%rdx
  lea    (%rsi,%rdx,1),%ecx
  cmp    %eax,%ecx
  jb     L377
  lea    0x1(%rbx),%ecx
  lea    -0x1(%rax),%edx
  sub    %ebx,%edx
  cmp    %eax,%ecx
  mov    $0x0,%eax
  cmova  %eax,%edx
  lea    (%rcx,%rdx,1),%eax
L305:
  cmpb   $0x30,(%r15)
  setne  %dl
  movzbl %dl,%edx
  add    $0x1,%rdx
L148:
  movb   $0x2e,(%r15,%rdx,1)
  mov    %eax,%edx
  movb   $0x0,(%r15,%rdx,1)
  jmp    L612
```

tool_calls: name: extract_symbolic_data
arguments: tag: D4
type_infered: f64
name: extract_symbolic_data
arguments: tag: D131
type_infered: f64
name: extract_symbolic_data
arguments: tag: D80
type_infered: f64
name: extract_symbolic_data
arguments: tag: D179
type_infered: f64
name: extract_symbolic_data
arguments: tag: D40
type_infered: f64
name: extract_symbolic_data
arguments: tag: D74
type_infered: f64
name: extract_symbolic_data
arguments: tag: D23
type_infered: f64
name: extract_symbolic_data
arguments: tag: D31
type_infered: f64[2]
name: extract_symbolic_data
arguments: tag: D143
type_infered: string
name: extract_symbolic_data
arguments: tag: D169
type_infered: string
name: extract_symbolic_data
arguments: tag: D60
type_infered: byte[16]

tool: D4: 0

tool: D131: 0.5

tool: D80: 0.1

tool: D179: 1

tool: D40: 0.3010299956639812

tool: D74: 10

tool: D23: 10000000000

tool: {"D31": [0.9,-0.0]}

tool: D143: inf

tool: D169: nan

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

assistant: ```c
int __dtostr(double d, char *buf, unsigned int maxlen, unsigned int prec, unsigned int prec2, int g) {
  union {
    unsigned long long l;
    double d;
  } u = {.d = d};
  signed long e = ((u.l >> 52) & ((1 << 11) - 1)) - 1023;
  signed long e10;
  unsigned int i;
  double backup = d;
  double tmp;
  char *oldbuf = buf;
  if ((i = isinf(d)))
    return copystring(buf, maxlen, i > 0 ? "inf" : "-inf");
  if (isnan(d))
    return copystring(buf, maxlen, "nan");
  e10 = 1 + (long)(e * 0.30102999566398119802);
  if (d == 0.0) {
    prec2 = prec2 == 0 ? 1 : prec2 + 2;
    prec2 = prec2 > maxlen ? 8 : prec2;
    i = 0;
    if (prec2 && (long long)u.l < 0) {
      buf[0] = '-';
      ++i;
    }
    for (; i < prec2; ++i)
      buf[i] = '0';
    buf[buf[0] == '0' ? 1 : 2] = '.';
    buf[i] = 0;
    return i;
  }
  if (d < 0.0) {
    d = -d;
    *buf = '-';
    --maxlen;
    ++buf;
  }
  tmp = 0.5;
  for (i = 0; i < prec2; i++) {
    tmp *= 0.1;
  }
  d += tmp;
  if (d < 1.0) {
    *buf = '0';
    --maxlen;
    ++buf;
  }
  if (e10 > 0) {
    int first = 1;
    tmp = 10.0;
    i = e10;
    while (i > 10) {
      tmp = tmp * 1e10;
      i -= 10;
    }
    while (i > 1) {
      tmp = tmp * 10;
      --i;
    }
    while (tmp > 0.9) {
      char digit;
      double fraction = d / tmp;
      digit = (int)(fraction);
      if (!first || digit) {
        first = 0;
        *buf = digit + '0';
        ++buf;
        if (!maxlen) {
          int len = __dtostr(backup / tmp, oldbuf, maxlen, prec, prec2, 0);
          int initial = 1;
          if (len == 0)
            return 0;
          maxlen -= len;
          buf += len;
          if (maxlen > 0) {
            *buf = 'e';
            ++buf;
          }
          --maxlen;
          for (len = 1000; len > 0; len /= 10) {
            if (e10 >= len || !initial) {
              if (maxlen > 0) {
                *buf = (e10 / len) + '0';
                ++buf;
              }
              --maxlen;
              initial = 0;
              e10 = e10 % len;
            }
          }
          if (maxlen > 0)
            goto fini;
          return 0;
        }
        d -= digit * tmp;
        --maxlen;
      }
      tmp /= 10.0;
    }
  } else {
    tmp = 0.1;
  }
  if (buf == oldbuf) {
    if (!maxlen)
      return 0;
    --maxlen;
    *buf = '0';
    ++buf;
  }
  if (prec2 || prec > (unsigned int)(buf - oldbuf) + 1) {
    if (!maxlen)
      return 0;
    --maxlen;
    *buf = '.';
    ++buf;
    if (g) {
      if (prec2)
        prec = prec2;
      prec -= buf - oldbuf - 1;
    } else {
      prec -= buf - oldbuf - 1;
      if (prec2)
        prec = prec2;
    }
    if (prec > maxlen)
      return 0;
    while (prec > 0) {
      char digit;
      double fraction = d / tmp;
      digit = (int)(fraction);
      *buf = digit + '0';
      ++buf;
      d -= digit * tmp;
      tmp /= 10.0;
      --prec;
    }
  }
fini:
  *buf = 0;
  return buf - oldbuf;
}
```