user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<grisu3_parse_double>:
  endbr64
  push   %r15
  lea    0x3e9(%rdi),%r11
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  movq   $0x0,(%rdx)
  cmp    $0x3e8,%esi
  jg     L676
  add    $0x1,%esi
  movslq %esi,%rsi
  lea    (%rdi,%rsi,1),%r11
L676:
  cmp    %rbp,%r11
  je     L520
  movzbl 0x0(%rbp),%r10d
  cmp    $0x2d,%r10b
  je     L333
  cmp    $0x30,%r10b
  je     L248
  lea    -0x31(%r10),%eax
  cmp    $0x8,%al
  ja     L520
  mov    %rbp,%rdx
  xor    %r12d,%r12d
L662:
  sub    $0x30,%r10d
  lea    0x1(%rdx),%rbx
  movsbl %r10b,%r10d
L121:
  cmp    %r11,%rbx
  je     L399
  mov    D0(%rip),%rax
  mov    %rbx,%rdx
  movslq (%rax),%rdi
  mov    %rdi,%rax
  imul   $0x66666667,%rdi,%rdi
  sar    $0x1f,%eax
  sar    $0x22,%rdi
  sub    %eax,%edi
  jmp    L610
  nopl   0x0(%rax,%rax,1)
L320:
  cmp    %r10d,%edi
  jle    L696
  lea    (%r10,%r10,4),%ecx
  add    $0x1,%rdx
  lea    -0x30(%rax,%rcx,2),%r10d
  cmp    %rdx,%r11
  je     L399
L610:
  movsbl (%rdx),%eax
  lea    -0x30(%rax),%ecx
  cmp    $0x9,%cl
  jbe    L320
  xor    %r14d,%r14d
L409:
  cmp    %rdx,%r11
  je     L399
  mov    %rdx,%rsi
  xor    %r8d,%r8d
  jmp    L516
  cs nopw 0x0(%rax,%rax,1)
L291:
  add    $0x1,%rsi
  add    $0x1,%r8d
  cmp    %rsi,%r11
  je     L399
  movzbl (%rsi),%eax
L516:
  cmp    $0x30,%al
  je     L291
  cmp    %rsi,%r11
  je     L399
  lea    -0x31(%rax),%ecx
  cmp    $0x8,%cl
  jbe    L266
L413:
  sub    %rbx,%rdx
  mov    %edx,%r9d
  cmp    $0x2e,%al
  je     L265
L183:
  add    %r9d,%r8d
L664:
  or     $0x20,%eax
  cmp    $0x65,%al
  je     L464
L666:
  push   %r13
  mov    %r10d,%ecx
  mov    %r12d,%edx
  mov    %rbp,%rdi
  push   %r14
  call   <grisu3_encode_double@plt>
  pop    %rdx
  pop    %rcx
L119:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L464:
  mov    %r11,%rax
  sub    %rsi,%rax
  cmp    $0x1,%rax
  jle    L399
  movzbl 0x1(%rsi),%eax
  cmp    $0x2b,%al
  je     L344
  cmp    $0x2d,%al
  je     L92
  lea    0x1(%rsi),%rdx
  xor    %ecx,%ecx
L311:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L399
  lea    0x1(%rdx),%rsi
  movsbl %al,%eax
  cmp    %rsi,%r11
  jne    L397
  jmp    L523
  xchg   %ax,%ax
L389:
  cmp    $0x7fff,%eax
  jg     L551
  lea    (%rax,%rax,4),%eax
  lea    -0x30(%rdx,%rax,2),%eax
L551:
  add    $0x1,%rsi
  cmp    %rsi,%r11
  je     L523
L397:
  movsbl (%rsi),%edx
  lea    -0x30(%rdx),%edi
  cmp    $0x9,%dil
  jbe    L389
  test   %ecx,%ecx
  je     L155
L10:
  neg    %eax
L155:
  add    %eax,%r8d
  cmp    %rsi,%r11
  jne    L666
  nopl   0x0(%rax)
L399:
  xor    %eax,%eax
L613:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L212:
  mov    %r13,%rcx
  mov    %r12d,%edx
  mov    %r11,%rsi
  mov    %rbx,%rdi
  call   <grisu3_parse_hex_fp@plt>
  cmp    %rax,%rbx
  jne    L119
L520:
  add    $0x8,%rsp
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L333:
  lea    0x1(%rbp),%rdx
  cmp    %rdx,%r11
  je     L399
  movzbl 0x1(%rbp),%r10d
  cmp    $0x30,%r10b
  je     L358
  lea    -0x31(%r10),%ecx
  xor    %eax,%eax
  mov    $0x1,%r12d
  cmp    $0x8,%cl
  jbe    L662
  jmp    L119
  xchg   %ax,%ax
L248:
  mov    %rbp,%rdx
  xor    %r12d,%r12d
L97:
  lea    0x1(%rdx),%rbx
  xor    %eax,%eax
  cmp    %rbx,%r11
  je     L119
  movzbl 0x1(%rdx),%eax
  or     $0x20,%eax
  cmp    $0x78,%al
  jne    L269
  jmp    L212
  nopl   (%rax)
L98:
  add    $0x1,%rbx
  cmp    %rbx,%r11
  je     L399
L269:
  cmpb   $0x30,(%rbx)
  je     L98
  xor    %r10d,%r10d
  jmp    L121
  nopw   0x0(%rax,%rax,1)
L358:
  mov    $0x1,%r12d
  jmp    L97
L696:
  xor    %ecx,%ecx
  cmp    $0x34,%al
  mov    $0x1,%r14d
  setg   %cl
  add    %ecx,%r10d
  jmp    L409
  nopl   (%rax)
L265:
  movsbl 0x1(%rsi),%eax
  lea    0x1(%rsi),%r9
  lea    -0x30(%rax),%ecx
  cmp    $0x9,%cl
  ja     L399
  mov    %r9,%rcx
  lea    (%r8,%r9,1),%r15d
  cmp    %r9,%r11
  jne    L598
  jmp    L399
  nopl   (%rax)
L404:
  cmp    %r10d,%edi
  jle    L431
  lea    (%r10,%r10,4),%esi
  add    $0x1,%rcx
  lea    -0x30(%rax,%rsi,2),%r10d
  cmp    %rcx,%r11
  je     L399
  movsbl (%rcx),%eax
L598:
  mov    %r15d,%r8d
  lea    -0x30(%rax),%esi
  mov    %ecx,%ebx
  sub    %ecx,%r8d
  cmp    $0x9,%sil
  jbe    L404
L194:
  cmp    %rcx,%r11
  je     L399
  mov    %r8d,%edi
  mov    %rcx,%rsi
  sub    %ebx,%edi
  jmp    L542
  cs nopw 0x0(%rax,%rax,1)
L213:
  add    $0x1,%rsi
  cmp    %rsi,%r11
  je     L399
  movzbl (%rsi),%eax
L542:
  lea    (%rdi,%rsi,1),%r8d
  cmp    $0x30,%al
  je     L213
  cmp    %rsi,%r11
  je     L399
  sub    %r9,%rcx
  lea    (%rdx,%rcx,1),%r9d
  lea    -0x31(%rax),%edx
  cmp    $0x8,%dl
  ja     L183
  nopl   0x0(%rax)
L630:
  add    $0x1,%rsi
  cmp    %rsi,%r11
  je     L399
  movzbl (%rsi),%eax
  lea    -0x30(%rax),%edx
  cmp    $0x9,%dl
  jbe    L630
  add    %r9d,%r8d
  cmp    %rsi,%r11
  je     L399
  mov    $0x1,%r14d
  jmp    L664
  nopw   0x0(%rax,%rax,1)
L266:
  add    $0x1,%rsi
  lea    0x1(%r8),%r9d
  sub    %esi,%r9d
  cmp    %rsi,%r11
  jne    L493
  jmp    L399
  nopl   (%rax)
L307:
  add    $0x1,%rsi
  cmp    %rsi,%r11
  je     L399
L493:
  movzbl (%rsi),%eax
  lea    (%r9,%rsi,1),%r8d
  lea    -0x30(%rax),%ecx
  cmp    $0x9,%cl
  jbe    L307
  cmp    %rsi,%r11
  je     L399
  mov    $0x1,%r14d
  jmp    L413
L344:
  lea    0x2(%rsi),%rdx
  cmp    %rdx,%r11
  je     L399
  movzbl 0x2(%rsi),%eax
  xor    %ecx,%ecx
  jmp    L311
L523:
  test   %ecx,%ecx
  jne    L10
  xor    %eax,%eax
  jmp    L613
  nop
L431:
  test   %r14d,%r14d
  jne    L194
  xor    %esi,%esi
  cmp    $0x34,%al
  mov    $0x1,%r14d
  setg   %sil
  add    %esi,%r10d
  jmp    L194
L92:
  lea    0x2(%rsi),%rdx
  cmp    %rdx,%r11
  je     L399
  movzbl 0x2(%rsi),%eax
  mov    $0x1,%ecx
  jmp    L311
```

assistant: ```c
const char *grisu3_parse_double(const char *buf, int len, double *result) {
  const char *mark, *k, *end;
  int sign = 0, esign = 0;
  uint64_t fraction = 0;
  int exponent = 0;
  int ee = 0;
  int fraction_exp = 0;
  int ulp_half_error = 0;
  *result = 0.0;
  end = buf + len + 1;
  if (len > 1000) {
    end = buf + 1000 + 1;
  }
  if (buf == end) {
    return buf;
  }
  mark = buf;
  if (*buf == '-') {
    ++buf;
    sign = 1;
    if (buf == end) {
      return 0;
    }
  }
  if (*buf == '0') {
    ++buf;
    if (buf != end && (*buf | 0x20) == 'x') {
      k = grisu3_parse_hex_fp(buf, end, sign, result);
      if (k == buf) {
        return mark;
      }
      return k;
    }
    while (buf != end && *buf == '0') {
      ++buf;
    }
  } else {
    if (*buf < '1' || *buf > '9') {
      return sign ? 0 : mark;
    }
    fraction = *buf++ - '0';
  }
  k = buf;
  while (buf != end && *buf >= '0' && *buf <= '9') {
    if (fraction >= UINT64_MAX / 10) {
      fraction += *buf >= '5';
      ulp_half_error = 1;
      break;
    }
    fraction = fraction * 10 + *buf++ - '0';
  }
  fraction_exp = (int)(buf - k);
  while (buf != end && *buf == '0') {
    ++exponent;
    ++buf;
  }
  if (buf != end && *buf >= '1' && *buf <= '9') {
    ulp_half_error = 1;
    ++exponent;
    ++buf;
    while (buf != end && *buf >= '0' && *buf <= '9') {
      ++exponent;
      ++buf;
    }
  }
  if (buf != end && *buf == '.') {
    ++buf;
    k = buf;
    if (*buf < '0' || *buf > '9') {
      return 0;
    }
    while (buf != end && *buf >= '0' && *buf <= '9') {
      if (fraction >= UINT64_MAX / 10) {
        if (!ulp_half_error) {
          fraction += *buf >= '5';
          ulp_half_error = 1;
        }
        break;
      }
      fraction = fraction * 10 + *buf++ - '0';
      --exponent;
    }
    fraction_exp += (int)(buf - k);
    while (buf != end && *buf == '0') {
      ++exponent;
      ++buf;
    }
    if (buf != end && *buf >= '1' && *buf <= '9') {
      ulp_half_error = 1;
      ++buf;
      while (buf != end && *buf >= '0' && *buf <= '9') {
        ++buf;
      }
    }
  }
  exponent += fraction_exp;
  if (buf != end && (*buf | 0x20) == 'e') {
    if (end - buf < 2) {
      return 0;
    }
    ++buf;
    if (*buf == '+') {
      ++buf;
      if (buf == end) {
        return 0;
      }
    } else if (*buf == '-') {
      esign = 1;
      ++buf;
      if (buf == end) {
        return 0;
      }
    }
    if (*buf < '0' || *buf > '9') {
      return 0;
    }
    ee = *buf++ - '0';
    while (buf != end && *buf >= '0' && *buf <= '9') {
      if (ee <= 0x7fff) {
        ee = ee * 10 + *buf - '0';
      }
      ++buf;
    }
  }
  exponent = exponent + (esign ? -ee : ee);
  if (buf == end) {
    return 0;
  }
  return grisu3_encode_double(mark, buf, sign, fraction, exponent, fraction_exp, ulp_half_error, result);
}
```