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

```asm
<strtod>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  fldz
  fstpt  -0x10(%rbp)
  movl   $0x1,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L33
L156:
  addq   $0x1,-0x28(%rbp)
L33:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L156
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x2b,%eax
  je     L10
  cmp    $0x2d,%eax
  jne    L100
  movl   $0xffffffff,-0x30(%rbp)
L10:
  addq   $0x1,-0x28(%rbp)
L100:
  nop
  jmp    L208
L131:
  fldt   -0x10(%rbp)
  fldt   0xe6f(%rip)        # 2000 <_fini+0xcec>
  fmulp  %st,%st(1)
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x48(%rbp)
  fildl  -0x48(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x10(%rbp)
L208:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L131
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L228
  fld1
  fstpt  -0x20(%rbp)
  addq   $0x1,-0x28(%rbp)
  jmp    L227
L121:
  fldt   -0x20(%rbp)
  fldt   0xe2b(%rip)        # 2010 <_fini+0xcfc>
  fmulp  %st,%st(1)
  fstpt  -0x20(%rbp)
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x48(%rbp)
  fildl  -0x48(%rbp)
  fldt   -0x20(%rbp)
  fmulp  %st,%st(1)
  fldt   -0x10(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x10(%rbp)
L227:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L121
L228:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  or     $0x20,%eax
  cmp    $0x65,%al
  jne    L210
  fldt   0xdc4(%rip)        # 2000 <_fini+0xcec>
  fstpt  -0x20(%rbp)
  addq   $0x1,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x39,%eax
  jg     L136
  cmp    $0x30,%eax
  jge    L50
  cmp    $0x2b,%eax
  je     L77
  cmp    $0x2d,%eax
  jne    L136
  fldt   0xda8(%rip)        # 2010 <_fini+0xcfc>
  fstpt  -0x20(%rbp)
L77:
  addq   $0x1,-0x28(%rbp)
  jmp    L126
L136:
  fldz
  fstpt  -0x10(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L198
L50:
  nop
L126:
  jmp    L205
L181:
  mov    -0x2c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x2c(%rbp)
L205:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L181
L188:
  mov    -0x2c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L118
  fldt   -0x10(%rbp)
  fldt   -0x20(%rbp)
  fmulp  %st,%st(1)
  fstpt  -0x10(%rbp)
L118:
  shrl   -0x2c(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  je     L40
  fldt   -0x20(%rbp)
  fmul   %st(0),%st
  fstpt  -0x20(%rbp)
  jmp    L188
L210:
  nop
  jmp    L198
L40:
  nop
L198:
  cmpq   $0x0,-0x40(%rbp)
  je     L158
  mov    -0x40(%rbp),%rax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,(%rax)
L158:
  fildl  -0x30(%rbp)
  fldt   -0x10(%rbp)
  fmulp  %st,%st(1)
  fstpl  -0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double strtod(const char *restrict s, char **restrict endptr) {
  const char *p = s;
  long double factor, value = 0.L;
  int sign = 1;
  unsigned int expo = 0;
  while (isspace(*p))
    p++;
  switch (*p) {
  case '-':
    sign = -1;
  case '+':
    p++;
  default:
    break;
  }
  while ((unsigned int)(*p - '0') < 10u)
    value = value * 10 + (*p++ - '0');
  if (*p == '.') {
    factor = 1.;
    p++;
    while ((unsigned int)(*p - '0') < 10u) {
      factor *= 0.1;
      value += (*p++ - '0') * factor;
    }
  }
  if ((*p | 32) == 'e') {
    factor = 10.L;
    switch (*++p) {
    case '-':
      factor = 0.1;
    case '+':
      p++;
      break;
    case '0':
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
    case '8':
    case '9':
      break;
    default:
      value = 0.L;
      p = s;
      goto done;
    }
    while ((unsigned int)(*p - '0') < 10u)
      expo = 10 * expo + (*p++ - '0');
    while (1) {
      if (expo & 1)
        value *= factor;
      if ((expo >>= 1) == 0)
        break;
      factor *= factor;
    }
  }
done:
  if (endptr)
    *endptr = (char *)p;
  return value * sign;
}
```