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

```asm
<atof>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L208
L215:
  addl   $0x1,-0x18(%rbp)
L208:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L215
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L29
  mov    $0xffffffff,%eax
  jmp    L109
L29:
  mov    $0x1,%eax
L109:
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  je     L106
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L121
L106:
  addl   $0x1,-0x18(%rbp)
L121:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  jmp    L35
L95:
  movsd  -0x10(%rbp),%xmm1
  movsd  D36(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x18(%rbp)
L35:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L95
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L142
  addl   $0x1,-0x18(%rbp)
L142:
  movsd  D9(%rip),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L65
L102:
  movsd  -0x10(%rbp),%xmm1
  movsd  D36(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x8(%rbp),%xmm1
  movsd  D36(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x1,-0x18(%rbp)
L65:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L102
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x14(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x65,%al
  je     L55
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x45,%al
  jne    L154
L55:
  addl   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L175
  mov    $0xffffffff,%eax
  jmp    L96
L175:
  mov    $0x1,%eax
L96:
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  je     L222
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L21
L222:
  addl   $0x1,-0x18(%rbp)
L21:
  movl   $0x0,-0x1c(%rbp)
  jmp    L73
L83:
  mov    -0x1c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %ecx,%eax
  mov    %eax,-0x1c(%rbp)
  addl   $0x1,-0x18(%rbp)
L73:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L83
  cmpl   $0x1,-0x14(%rbp)
  jne    L43
  jmp    L91
L131:
  movsd  -0x10(%rbp),%xmm1
  movsd  D36(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L91:
  mov    -0x1c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  test   %eax,%eax
  jg     L131
  jmp    L154
L119:
  movsd  -0x10(%rbp),%xmm0
  movsd  D36(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
L43:
  mov    -0x1c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  test   %eax,%eax
  jg     L119
L154:
  movsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D36
type_guessed: f64
name: read_data
arguments: data_tag: D9
type_guessed: f64

tool: D36: 10

tool: D9: 1

assistant: ```c
double atof(char s[]) {
  double val, power;
  int exp, i, sign;
  for (i = 0; isspace(s[i]); i++)
    ;
  sign = (s[i] == '-') ? -1 : 1;
  if (s[i] == '+' || s[i] == '-')
    i++;
  for (val = 0.0; isdigit(s[i]); i++)
    val = 10.0 * val + (s[i] - '0');
  if (s[i] == '.')
    i++;
  for (power = 1.0; isdigit(s[i]); i++) {
    val = 10.0 * val + (s[i] - '0');
    power *= 10.0;
  }
  val = sign * val / power;
  if (s[i] == 'e' || s[i] == 'E') {
    sign = (s[++i] == '-') ? -1 : 1;
    if (s[i] == '+' || s[i] == '-')
      i++;
    for (exp = 0; isdigit(s[i]); i++)
      exp = 10 * exp + (s[i] - '0');
    if (sign == 1)
      while (exp-- > 0)
        val *= 10;
    else
      while (exp-- > 0)
        val /= 10;
  }
  return val;
}
```