user: Translate the below assembly code into C programming language:

```asm
<grisu3_parse_double>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %rdx,-0x58(%rbp)
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  mov    -0x58(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  cmpl   $0x3e8,-0x4c(%rbp)
  jle    L682
  mov    -0x48(%rbp),%rax
  add    $0x3e9,%rax
  mov    %rax,-0x18(%rbp)
L682:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jne    L540
  mov    -0x48(%rbp),%rax
  jmp    L364
L540:
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L286
  addq   $0x1,-0x48(%rbp)
  movl   $0x1,-0x34(%rbp)
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jne    L286
  mov    $0x0,%eax
  jmp    L364
L286:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L77
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L483
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  or     $0x20,%eax
  cmp    $0x78,%al
  jne    L483
  mov    -0x58(%rbp),%rcx
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%rsi
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <grisu3_parse_hex_fp@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  jne    L645
  mov    -0x10(%rbp),%rax
  jmp    L364
L645:
  mov    -0x8(%rbp),%rax
  jmp    L364
L598:
  addq   $0x1,-0x48(%rbp)
L483:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L178
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L598
  jmp    L178
L77:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jle    L572
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L487
L572:
  cmpl   $0x0,-0x34(%rbp)
  jne    L96
  mov    -0x10(%rbp),%rax
  jmp    L364
L96:
  mov    $0x0,%eax
  jmp    L364
L487:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x2c(%rbp)
L178:
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L254
L355:
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L789
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x34,%al
  setg   %al
  movzbl %al,%eax
  add    %eax,-0x2c(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L798
L789:
  mov    -0x2c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x2c(%rbp)
L254:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L798
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L798
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L355
L798:
  mov    -0x48(%rbp),%rax
  sub    -0x8(%rbp),%rax
  mov    %eax,-0x20(%rbp)
  jmp    L541
L749:
  addl   $0x1,-0x28(%rbp)
  addq   $0x1,-0x48(%rbp)
L541:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L1
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L749
L1:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L94
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jle    L94
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L94
  movl   $0x1,-0x1c(%rbp)
  addl   $0x1,-0x28(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L609
L530:
  addl   $0x1,-0x28(%rbp)
  addq   $0x1,-0x48(%rbp)
L609:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L94
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L94
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L530
L94:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L50
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L50
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L167
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L60
L167:
  mov    $0x0,%eax
  jmp    L364
L39:
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %eax,-0x2c(%rbp)
  jl     L588
  cmpl   $0x0,-0x1c(%rbp)
  jne    L289
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x34,%al
  setg   %al
  movzbl %al,%eax
  add    %eax,-0x2c(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L289
L588:
  mov    -0x2c(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x2c(%rbp)
  subl   $0x1,-0x28(%rbp)
L60:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L625
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L625
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L39
  jmp    L625
L289:
  nop
L625:
  mov    -0x48(%rbp),%rax
  sub    -0x8(%rbp),%rax
  add    %eax,-0x20(%rbp)
  jmp    L772
L392:
  addl   $0x1,-0x28(%rbp)
  addq   $0x1,-0x48(%rbp)
L772:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L507
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L392
L507:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L50
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jle    L50
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L50
  movl   $0x1,-0x1c(%rbp)
  addq   $0x1,-0x48(%rbp)
  jmp    L280
L187:
  addq   $0x1,-0x48(%rbp)
L280:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L50
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L50
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L187
L50:
  mov    -0x20(%rbp),%eax
  add    %eax,-0x28(%rbp)
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L365
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  or     $0x20,%eax
  cmp    $0x65,%al
  jne    L365
  mov    -0x18(%rbp),%rax
  sub    -0x48(%rbp),%rax
  cmp    $0x1,%rax
  jg     L354
  mov    $0x0,%eax
  jmp    L364
L354:
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L742
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jne    L270
  mov    $0x0,%eax
  jmp    L364
L742:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L270
  movl   $0x1,-0x30(%rbp)
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jne    L270
  mov    $0x0,%eax
  jmp    L364
L270:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L462
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L672
L462:
  mov    $0x0,%eax
  jmp    L364
L672:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x24(%rbp)
  jmp    L768
L421:
  cmpl   $0x7fff,-0x24(%rbp)
  jg     L671
  mov    -0x24(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x24(%rbp)
L671:
  addq   $0x1,-0x48(%rbp)
L768:
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  je     L365
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L365
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L421
L365:
  cmpl   $0x0,-0x30(%rbp)
  je     L34
  mov    -0x24(%rbp),%eax
  neg    %eax
  jmp    L201
L34:
  mov    -0x24(%rbp),%eax
L201:
  add    %eax,-0x28(%rbp)
  mov    -0x48(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jne    L690
  mov    $0x0,%eax
  jmp    L364
L690:
  mov    -0x20(%rbp),%r9d
  mov    -0x28(%rbp),%r8d
  mov    -0x2c(%rbp),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x48(%rbp),%rsi
  mov    -0x10(%rbp),%rax
  push   -0x58(%rbp)
  mov    -0x1c(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <grisu3_encode_double@plt>
  add    $0x10,%rsp
L364:
  leave
  ret
```

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