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

```asm
<string_to_double>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0xffffffff,-0x28(%rbp)
  movl   $0x1,-0x24(%rbp)
  movl   $0x1,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L22
  movl   $0xffffffff,-0x24(%rbp)
  movl   $0x1,-0x30(%rbp)
L22:
  movl   $0x0,-0x2c(%rbp)
  jmp    L52
L107:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L21
  jmp    L34
L71:
  movsd  -0x18(%rbp),%xmm1
  movsd  D8(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%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,-0x18(%rbp)
  addl   $0x1,-0x30(%rbp)
L34:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L71
  addl   $0x1,-0x30(%rbp)
  jmp    L17
L2:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  lea    -0x30(%rax),%ebx
  mov    -0x28(%rbp),%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <pow@plt>
  movsbl %al,%eax
  imul   %ebx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0x18(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  subl   $0x1,-0x28(%rbp)
  addl   $0x1,-0x30(%rbp)
L17:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L2
  movl   $0x0,-0x20(%rbp)
  jmp    L9
L21:
  addl   $0x1,-0x2c(%rbp)
L52:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x2c(%rbp)
  jl     L107
L9:
  cmpl   $0x1,-0x20(%rbp)
  jne    L32
  jmp    L118
L50:
  movsd  -0x18(%rbp),%xmm1
  movsd  D8(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%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,-0x18(%rbp)
  addl   $0x1,-0x30(%rbp)
L118:
  mov    -0x30(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L50
L32:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x24(%rbp),%xmm0
  movsd  -0x18(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D8
type_guessed: f32[2]

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

assistant: ```c
double string_to_double(char number_as_string[]) {
  double number = 0;
  int i = 0, j = 0, k = 0, p = -1, sign = 1, is_int = 1;
  if (number_as_string[0] == '-') {
    sign = -1;
    i = 1;
  }
  for (j = 0; j < strlen(number_as_string); j++) {
    if (number_as_string[j] == '.') {
      while (number_as_string[i] != '.') {
        number = number * 10 + (number_as_string[i] - '0');
        i++;
      }
      i++;
      while (number_as_string[i] != '\0') {
        number = number + ((number_as_string[i] - '0') * pow(10, p));
        p--;
        i++;
      }
      is_int = 0;
      break;
    }
  }
  if (is_int == 1) {
    while (number_as_string[i] != '\0') {
      number = number * 10 + (number_as_string[i] - '0');
      i++;
    }
  }
  number = number * sign;
  return number;
}
```