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    L177
  nopl   0x0(%rax)
L121:
  add    $0x1,%ebp
L177:
  movsbl (%rbx),%edi
  mov    %rbx,%r13
  add    $0x1,%rbx
  call   <isspace@plt>
  test   %rax,%rax
  jne    L121
  movsbl 0x0(%r13),%edi
  cmp    $0x2d,%dil
  je     L102
  movl   $0x1,0x18(%rsp)
  movslq %ebp,%r13
  cmp    $0x2b,%dil
  je     L84
L185:
  add    %r12,%r13
  pxor   %xmm6,%xmm6
  mov    %r13,%r14
  movsd  %xmm6,0x8(%rsp)
  jmp    L132
  nopl   (%rax)
L15:
  movsbl -0x1(%r14),%eax
  movsd  D55(%rip),%xmm0
  pxor   %xmm1,%xmm1
  mulsd  0x8(%rsp),%xmm0
  movsbl (%r14),%edi
  sub    $0x30,%eax
  cvtsi2sd %eax,%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rsp)
L132:
  call   <isdigit@plt>
  mov    %ebp,%ebx
  mov    %r14,%r15
  sub    %r13d,%ebx
  add    %r14d,%ebx
  add    $0x1,%r14
  test   %rax,%rax
  jne    L15
  movsbl (%r15),%edi
  movslq %ebx,%r13
  cmp    $0x2e,%dil
  jne    L147
  add    $0x1,%ebx
  movslq %ebx,%r13
  movsbl (%r12,%r13,1),%edi
L147:
  mov    D6(%rip),%rax
  add    %r12,%r13
  mov    %r13,%r14
  mov    %rax,0x10(%rsp)
  jmp    L106
  nopl   0x0(%rax)
L157:
  movsbl -0x1(%r14),%eax
  pxor   %xmm1,%xmm1
  movsbl (%r14),%edi
  movsd  D55(%rip),%xmm0
  mulsd  0x8(%rsp),%xmm0
  sub    $0x30,%eax
  movsd  D55(%rip),%xmm2
  cvtsi2sd %eax,%xmm1
  mulsd  0x10(%rsp),%xmm2
  addsd  %xmm0,%xmm1
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
L106:
  call   <isdigit@plt>
  mov    %ebx,%ebp
  mov    %r14,%r15
  sub    %r13d,%ebp
  add    %r14d,%ebp
  add    $0x1,%r14
  test   %rax,%rax
  jne    L157
  movzbl (%r15),%eax
  mov    D6(%rip),%rcx
  and    $0xffffffdf,%eax
  movq   %rcx,%xmm1
  cmp    $0x45,%al
  jne    L19
  lea    0x1(%rbp),%eax
  cltq
  movsbl (%r12,%rax,1),%edi
  cmp    $0x2d,%dil
  je     L57
  movl   $0x1,0x1c(%rsp)
  cmp    $0x2b,%dil
  je     L63
L43:
  add    %rax,%r12
  xor    %ebx,%ebx
  jmp    L178
  nopl   (%rax)
L198:
  movsbl -0x1(%r12),%eax
  lea    (%rbx,%rbx,4),%edx
  movsbl (%r12),%edi
  lea    -0x30(%rax,%rdx,2),%ebx
L178:
  call   <isdigit@plt>
  add    $0x1,%r12
  test   %rax,%rax
  jne    L198
  test   %ebx,%ebx
  jle    L10
  mov    $0x1,%eax
  nopl   (%rax)
L171:
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    $0x1,%ebx
  jne    L171
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
L19:
  pxor   %xmm0,%xmm0
  cmpl   $0x1,0x1c(%rsp)
  cvtsi2sdl 0x18(%rsp),%xmm0
  mulsd  0x8(%rsp),%xmm0
  je     L60
  mulsd  0x10(%rsp),%xmm1
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  divsd  %xmm1,%xmm0
  ret
  nopw   0x0(%rax,%rax,1)
L102:
  movl   $0xffffffff,0x18(%rsp)
L84:
  add    $0x1,%ebp
  movslq %ebp,%r13
  movsbl (%r12,%r13,1),%edi
  jmp    L185
  nopl   0x0(%rax,%rax,1)
L60:
  mulsd  %xmm1,%xmm0
  divsd  0x10(%rsp),%xmm0
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L57:
  movl   $0xffffffff,0x1c(%rsp)
L63:
  lea    0x2(%rbp),%eax
  cltq
  movsbl (%r12,%rax,1),%edi
  jmp    L43
L10:
  mov    D6(%rip),%rax
  movq   %rax,%xmm1
  jmp    L19
```

tool_calls: name: read_data
arguments: label: D55
data_type: f32[2]
name: read_data
arguments: label: D6
data_type: f64

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

tool: D6: 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));
}
```