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

```asm
<strtod>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %rdi,%rbx
  jmp    L5
L244:
  add    $0x1,%rbx
L5:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L244
  movzbl (%rbx),%eax
  cmp    $0x2b,%al
  je     L235
  movl   $0x1,0xc(%rsp)
  cmp    $0x2d,%al
  jne    L96
  movl   $0xffffffff,0xc(%rsp)
L243:
  add    $0x1,%rbx
L96:
  movzbl (%rbx),%edx
  movsbl %dl,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L143
  fldz
  flds   0xe8a(%rip)        # 2000 <_fini+0xd5c>
L264:
  fmul   %st,%st(1)
  add    $0x1,%rbx
  mov    %eax,(%rsp)
  fildl  (%rsp)
  faddp  %st,%st(2)
  movzbl (%rbx),%edx
  movsbl %dl,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L264
  fstp   %st(0)
L57:
  cmp    $0x2e,%dl
  je     L3
L31:
  movzbl (%rbx),%eax
  or     $0x20,%eax
  cmp    $0x65,%al
  je     L248
  jmp    L176
L83:
  fstp   %st(0)
L176:
  test   %rbp,%rbp
  je     L228
  mov    %rbx,0x0(%rbp)
L228:
  fildl  0xc(%rsp)
  fmulp  %st,%st(1)
  fstpl  (%rsp)
  movsd  (%rsp),%xmm0
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L235:
  movl   $0x1,0xc(%rsp)
  jmp    L243
L143:
  fldz
  jmp    L57
L3:
  lea    0x1(%rbx),%rdx
  movsbl 0x1(%rbx),%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L209
  fld1
  fldl   0xe1b(%rip)        # 2008 <_fini+0xd64>
L112:
  fmul   %st,%st(1)
  add    $0x1,%rdx
  mov    %eax,(%rsp)
  fildl  (%rsp)
  fmul   %st(2),%st
  faddp  %st,%st(3)
  movsbl (%rdx),%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L112
  fstp   %st(0)
  fstp   %st(0)
  mov    %rdx,%rbx
  jmp    L31
L209:
  mov    %rdx,%rbx
  jmp    L31
L248:
  movzbl 0x1(%rbx),%eax
  cmp    $0x2d,%al
  je     L153
  jg     L231
  cmp    $0x2b,%al
  jne    L280
  flds   0xdd6(%rip)        # 2000 <_fini+0xd5c>
L74:
  add    $0x2,%rbx
L194:
  movzbl (%rbx),%edx
  movsbl %dl,%ecx
  sub    $0x30,%ecx
  mov    $0x0,%eax
  cmp    $0x9,%ecx
  ja     L146
L250:
  add    $0x1,%rbx
  lea    (%rax,%rax,4),%eax
  movsbl %dl,%edx
  lea    -0x30(%rdx,%rax,2),%eax
  movzbl (%rbx),%edx
  movsbl %dl,%ecx
  sub    $0x30,%ecx
  cmp    $0x9,%ecx
  jbe    L250
  jmp    L146
L280:
  fstp   %st(0)
  mov    %r12,%rbx
  fldz
  jmp    L176
L231:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L177
  add    $0x1,%rbx
  flds   0xd84(%rip)        # 2000 <_fini+0xd5c>
  jmp    L194
L153:
  fldl   0xd84(%rip)        # 2008 <_fini+0xd64>
  jmp    L74
L116:
  shr    %eax
  je     L83
  fmul   %st(0),%st
L146:
  test   $0x1,%al
  je     L116
  fmul   %st,%st(1)
  jmp    L116
L177:
  fstp   %st(0)
  mov    %r12,%rbx
  fldz
  jmp    L176
```

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;
}
```