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

```asm
<atof>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r13
  mov    %rdi,%rbx
  mov    $0x0,%r12d
  jmp    L54
L51:
  add    $0x1,%r12d
L54:
  mov    %rbx,%rbp
  movsbl (%rbx),%edi
  call   <isspace@plt>
  add    $0x1,%rbx
  test   %rax,%rax
  jne    L51
  movzbl 0x0(%rbp),%eax
  cmp    $0x2d,%al
  je     L81
  sub    $0x2b,%eax
  movl   $0x1,0x18(%rsp)
  test   $0xfd,%al
  je     L82
L75:
  movslq %r12d,%r14
  add    %r13,%r14
  mov    %r14,%rbx
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x8(%rsp)
  jmp    L141
L81:
  movl   $0xffffffff,0x18(%rsp)
L82:
  add    $0x1,%r12d
  jmp    L75
L125:
  movsd  0x8(%rsp),%xmm0
  mulsd  D22(%rip),%xmm0
  movsbl (%rbx),%eax
  sub    $0x30,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rsp)
  add    $0x1,%rbx
L141:
  mov    %r12d,%ebp
  sub    %r14d,%ebp
  add    %ebx,%ebp
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L125
  cmpb   $0x2e,(%rbx)
  sete   %al
  movzbl %al,%eax
  add    %eax,%ebp
  movslq %ebp,%r14
  add    %r13,%r14
  mov    %r14,%rbx
  movsd  D3(%rip),%xmm4
  movsd  %xmm4,0x10(%rsp)
  jmp    L176
L142:
  movsd  0x8(%rsp),%xmm0
  mulsd  D22(%rip),%xmm0
  movsbl (%rbx),%eax
  sub    $0x30,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rsp)
  movsd  0x10(%rsp),%xmm2
  mulsd  D22(%rip),%xmm2
  movsd  %xmm2,0x10(%rsp)
  add    $0x1,%rbx
L176:
  mov    %ebp,%r12d
  sub    %r14d,%r12d
  add    %ebx,%r12d
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L142
  movzbl (%rbx),%edx
  and    $0xffffffdf,%edx
  mov    $0x1,%eax
  cmp    $0x45,%dl
  jne    L94
  lea    0x1(%r12),%ebp
  movslq %ebp,%rax
  movzbl 0x0(%r13,%rax,1),%eax
  cmp    $0x2d,%al
  je     L88
  sub    $0x2b,%eax
  movl   $0x1,0x1c(%rsp)
  test   $0xfd,%al
  je     L123
L55:
  movslq %ebp,%rbp
  add    %r13,%rbp
  mov    $0x0,%ebx
L107:
  movsbl 0x0(%rbp),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L146
  lea    (%rbx,%rbx,4),%edx
  movsbl 0x0(%rbp),%eax
  lea    -0x30(%rax,%rdx,2),%ebx
  add    $0x1,%rbp
  jmp    L107
L88:
  movl   $0xffffffff,0x1c(%rsp)
L123:
  lea    0x2(%r12),%ebp
  jmp    L55
L146:
  test   %ebx,%ebx
  jle    L60
  mov    $0x1,%eax
L194:
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    $0x1,%ebx
  jne    L194
L94:
  cmpl   $0x1,0x1c(%rsp)
  je     L19
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x18(%rsp),%xmm0
  mulsd  0x8(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  0x10(%rsp),%xmm1
  divsd  %xmm1,%xmm0
L52:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L60:
  mov    $0x1,%eax
  jmp    L94
L19:
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x18(%rsp),%xmm0
  mulsd  0x8(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  %xmm1,%xmm0
  divsd  0x10(%rsp),%xmm0
  jmp    L52
```

tool_calls: name: extract_symbolic_data
arguments: label: D22
type: f32[2]
name: extract_symbolic_data
arguments: label: D3
type: f64

tool: {"D22": [0.0,2.5625]}

tool: D3: 1

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