user: Converte this assembly snippet into its equivalent C code:

```asm
<atof>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  jmp    L21
  nopl   0x0(%rax)
L4:
  add    $0x1,%ebp
L21:
  movsbl (%rbx),%edi
  mov    %rbx,%r13
  add    $0x1,%rbx
  call   <isspace@plt>
  test   %rax,%rax
  jne    L4
  movsbl 0x0(%r13),%edi
  cmp    $0x2b,%dil
  je     L66
  movl   $0xffffffff,0x1c(%rsp)
  movslq %ebp,%r13
  cmp    $0x2d,%dil
  je     L108
L186:
  add    %r12,%r13
  pxor   %xmm6,%xmm6
  mov    %r13,%r15
  movsd  %xmm6,0x8(%rsp)
  jmp    L22
  nopl   (%rax)
L18:
  movsbl -0x1(%r15),%eax
  movsd  D7(%rip),%xmm0
  pxor   %xmm1,%xmm1
  mulsd  0x8(%rsp),%xmm0
  movsbl (%r15),%edi
  sub    $0x30,%eax
  cvtsi2sd %eax,%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rsp)
L22:
  call   <isdigit@plt>
  mov    %ebp,%ebx
  mov    %r15,%r14
  sub    %r13d,%ebx
  add    %r15d,%ebx
  add    $0x1,%r15
  test   %rax,%rax
  jne    L18
  movsbl (%r14),%edi
  movslq %ebx,%r13
  cmp    $0x2e,%dil
  jne    L125
  add    $0x1,%ebx
  movslq %ebx,%r13
  movsbl (%r12,%r13,1),%edi
L125:
  movsd  D9(%rip),%xmm7
  add    %r12,%r13
  mov    %r13,%r15
  movsd  %xmm7,0x10(%rsp)
  jmp    L61
  nopl   0x0(%rax,%rax,1)
L116:
  movsbl -0x1(%r15),%eax
  pxor   %xmm1,%xmm1
  movsbl (%r15),%edi
  movsd  D7(%rip),%xmm0
  mulsd  0x8(%rsp),%xmm0
  sub    $0x30,%eax
  movsd  D7(%rip),%xmm2
  cvtsi2sd %eax,%xmm1
  mulsd  0x10(%rsp),%xmm2
  addsd  %xmm0,%xmm1
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
L61:
  call   <isdigit@plt>
  mov    %ebx,%ebp
  mov    %r15,%r14
  sub    %r13d,%ebp
  add    %r15d,%ebp
  add    $0x1,%r15
  test   %rax,%rax
  jne    L116
  movzbl (%r14),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x1c(%rsp),%xmm0
  mulsd  0x8(%rsp),%xmm0
  and    $0xffffffdf,%eax
  divsd  0x10(%rsp),%xmm0
  cmp    $0x45,%al
  jne    L52
  lea    0x1(%rbp),%eax
  cltq
  movsbl (%r12,%rax,1),%edi
  cmp    $0x2b,%dil
  je     L126
  mov    $0xffffffff,%ebx
  cmp    $0x2d,%dil
  je     L168
L112:
  add    %rax,%r12
  xor    %ebp,%ebp
  jmp    L75
  nopl   0x0(%rax)
L183:
  movsbl -0x1(%r12),%eax
  lea    0x0(%rbp,%rbp,4),%edx
  movsbl (%r12),%edi
  lea    -0x30(%rax,%rdx,2),%ebp
L75:
  movsd  %xmm0,0x8(%rsp)
  add    $0x1,%r12
  call   <isdigit@plt>
  movsd  0x8(%rsp),%xmm0
  test   %rax,%rax
  jne    L183
  lea    -0x1(%rbp),%eax
  cmp    $0x1,%ebx
  je     L185
  movsd  D7(%rip),%xmm1
  test   %ebp,%ebp
  jle    L52
  nopl   0x0(%rax)
L117:
  divsd  %xmm1,%xmm0
  sub    $0x1,%eax
  jae    L117
L52:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L66:
  movl   $0x1,0x1c(%rsp)
L108:
  add    $0x1,%ebp
  movslq %ebp,%r13
  movsbl (%r12,%r13,1),%edi
  jmp    L186
  nopl   0x0(%rax,%rax,1)
L126:
  mov    $0x1,%ebx
L168:
  lea    0x2(%rbp),%eax
  cltq
  movsbl (%r12,%rax,1),%edi
  jmp    L112
  nopl   0x0(%rax)
L185:
  test   %ebp,%ebp
  jle    L52
  movsd  D7(%rip),%xmm1
  nopl   0x0(%rax)
L109:
  mulsd  %xmm1,%xmm0
  sub    $0x1,%eax
  jae    L109
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D7
type_guessed: f64
name: retrieve_data
arguments: data_label: D9
type_guessed: f64

tool: D7: 10

tool: D9: 1

assistant: ```c
double atof(char s[]) {
  double val, power;
  int i, sign, exp;
  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') {
    i++;
    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;
}
```