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

```asm
<strtod>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  movl   $0x0,-0x14(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movl   $0x1,-0x20(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L127
L338:
  addq   $0x1,-0x38(%rbp)
L127:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L338
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L338
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L306
  addq   $0x1,-0x38(%rbp)
  jmp    L263
L306:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L263
  movl   $0xffffffff,-0x20(%rbp)
  addq   $0x1,-0x38(%rbp)
  jmp    L263
L118:
  orl    $0x1,-0x14(%rbp)
  movsd  -0x10(%rbp),%xmm1
  movsd  D18(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addq   $0x1,-0x38(%rbp)
L263:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L297
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L118
L297:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L224
  movsd  D8(%rip),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addq   $0x1,-0x38(%rbp)
  jmp    L262
L302:
  orl    $0x2,-0x14(%rbp)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addq   $0x1,-0x38(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movsd  D18(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
L262:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L224
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L302
L224:
  cmpl   $0x0,-0x14(%rbp)
  jne    L290
  cmpq   $0x0,-0x40(%rbp)
  je     L218
  mov    -0x40(%rbp),%rax
  mov    -0x38(%rbp),%rdx
  mov    %rdx,(%rax)
L218:
  pxor   %xmm0,%xmm0
  jmp    L325
L290:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x65,%al
  je     L276
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x45,%al
  jne    L327
L276:
  addq   $0x1,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L267
  addq   $0x1,-0x38(%rbp)
  jmp    L109
L267:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L109
  mov    -0x38(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x38(%rbp)
  movl   $0xffffffff,-0x1c(%rbp)
L109:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L74
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L233
L74:
  cmpq   $0x0,-0x40(%rbp)
  je     L108
  mov    -0x40(%rbp),%rax
  mov    -0x38(%rbp),%rdx
  mov    %rdx,(%rax)
L108:
  movsd  -0x10(%rbp),%xmm0
  jmp    L325
L39:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x24(%rbp),%xmm1
  movsd  D18(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %eax,-0x24(%rbp)
  addq   $0x1,-0x38(%rbp)
L233:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L327
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L39
L327:
  cmpl   $0x0,-0x1c(%rbp)
  jns    L104
  movl   $0x1,-0x18(%rbp)
  jmp    L90
L245:
  movsd  -0x10(%rbp),%xmm0
  movsd  D18(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x18(%rbp)
L90:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L245
  jmp    L133
L104:
  movl   $0x1,-0x18(%rbp)
  jmp    L200
L64:
  movsd  -0x10(%rbp),%xmm1
  movsd  D18(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x18(%rbp)
L200:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L64
L133:
  cmpq   $0x0,-0x40(%rbp)
  je     L132
  mov    -0x40(%rbp),%rax
  mov    -0x38(%rbp),%rdx
  mov    %rdx,(%rax)
L132:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x20(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
L325:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D18
type_guessed: f64
name: disassemble_data
arguments: data_tag: D8
type_guessed: f64

tool: D18: 10

tool: D8: 0.1

assistant: ```c
double strtod(const char *s, const char **sret) {
  double r;
  int e;
  double d;
  int sign;
  int esign, i, flags = 0;
  r = 0.0;
  sign = 1.0;
  e = 0;
  esign = 1;
  while ((*s == ' ') || (*s == '\t')) {
    s++;
  }
  if (*s == '+') {
    s++;
  } else if (*s == '-') {
    sign = -1;
    s++;
  }
  while ((*s >= '0') && (*s <= '9')) {
    flags |= 1;
    r *= 10.0;
    r += *s - '0';
    s++;
  }
  if (*s == '.') {
    d = 0.1;
    s++;
    while ((*s >= '0') && (*s <= '9')) {
      flags |= 2;
      r += d * (*s - '0');
      s++;
      d /= 10.0;
    }
  }
  if (flags == 0) {
    if (sret) {
      *sret = s;
    }
    return 0;
  }
  if ((*s == 'e') || (*s == 'E')) {
    s++;
    if (*s == '+') {
      s++;
    } else if (*s == '-') {
      *s++;
      esign = -1;
    }
    if ((*s < '0') || (*s > '9')) {
      if (sret) {
        *sret = s;
      }
      return r;
    }
    while ((*s >= '0') && (*s <= '9')) {
      e *= 10.0;
      e += *s - '0';
      s++;
    }
  }
  if (esign < 0) {
    for (i = 1; i <= e; i++) {
      r /= 10.0;
    }
  } else {
    for (i = 1; i <= e; i++) {
      r *= 10.0;
    }
  }
  if (sret) {
    *sret = s;
  }
  return (r * sign);
}
```