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

```asm
<strtod>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L199
  pxor   %xmm0,%xmm0
  jmp    L74
L199:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L58
  addq   $0x1,-0x28(%rbp)
  jmp    L53
L58:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L53
  addq   $0x1,-0x28(%rbp)
  movl   $0xffffffff,-0x14(%rbp)
  jmp    L53
L170:
  movsd  -0x8(%rbp),%xmm1
  movsd  D23(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addq   $0x1,-0x28(%rbp)
L53:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L182
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L170
L182:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L79
  addq   $0x1,-0x28(%rbp)
  jmp    L232
L158:
  movsd  -0x8(%rbp),%xmm1
  movsd  D23(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addq   $0x1,-0x28(%rbp)
  subl   $0x1,-0x18(%rbp)
L232:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L79
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L158
L79:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x45,%al
  je     L213
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x65,%al
  jne    L238
L213:
  movl   $0x1,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  addq   $0x1,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L152
  addq   $0x1,-0x28(%rbp)
  jmp    L161
L152:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L161
  addq   $0x1,-0x28(%rbp)
  movl   $0xffffffff,-0x14(%rbp)
  jmp    L161
L124:
  mov    -0x10(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %edx,%eax
  mov    %eax,-0x10(%rbp)
  addq   $0x1,-0x28(%rbp)
L161:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L210
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L124
L210:
  mov    -0x10(%rbp),%eax
  imul   -0xc(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L238
L151:
  movsd  -0x8(%rbp),%xmm1
  movsd  D23(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  subl   $0x1,-0x18(%rbp)
L238:
  cmpl   $0x0,-0x18(%rbp)
  jg     L151
  jmp    L160
L147:
  movsd  -0x8(%rbp),%xmm1
  movsd  D0(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x1,-0x18(%rbp)
L160:
  cmpl   $0x0,-0x18(%rbp)
  js     L147
  cmpq   $0x0,-0x30(%rbp)
  je     L67
  mov    -0x30(%rbp),%rax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,(%rax)
L67:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
L74:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D23
type_guessed: f64
name: parse_data
arguments: data_tag: D0
type_guessed: f64

tool: D23: 10

tool: D0: 0.1

assistant: ```c
double strtod(const char *nptr, char **endptr) {
  double val = 0.0;
  int d = 0;
  int sign = 1;
  if (!nptr) {
    return 0.0;
  }
  if (*nptr == '+') {
    nptr++;
  } else if (*nptr == '-') {
    nptr++;
    sign = -1;
  }
  while (*nptr >= '0' && *nptr <= '9') {
    val = val * 10.0 + (*nptr - '0');
    nptr++;
  }
  if (*nptr == '.') {
    nptr++;
    while (*nptr >= '0' && *nptr <= '9') {
      val = val * 10.0 + (*nptr - '0');
      nptr++;
      d--;
    }
  }
  if (*nptr == 'E' || *nptr == 'e') {
    int e_sign = 1;
    int e_val = 0;
    nptr++;
    if (*nptr == '+') {
      nptr++;
    } else if (*nptr == '-') {
      nptr++;
      sign = -1;
    }
    while ((*nptr >= '0' && *nptr <= '9')) {
      e_val = e_val * 10 + (*nptr - '0');
      nptr++;
    }
    d += e_val * e_sign;
  }
  while (d > 0) {
    val *= 10.0;
    d--;
  }
  while (d < 0) {
    val *= 0.1;
    d++;
  }
  if (endptr) {
    *endptr = (char *)nptr;
  }
  return sign * val;
}
```