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

```asm
<_to_float>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %edx,-0x50(%rbp)
  mov    %ecx,-0x54(%rbp)
  mov    %r8d,-0x58(%rbp)
  mov    %r9d,-0x5c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    $0x34,%edx
  mov    -0x4c(%rbp),%eax
  mov    %edx,%ecx
  sar    %cl,%eax
  and    $0x7ff,%eax
  mov    %eax,%r12d
  mov    -0x4c(%rbp),%eax
  shl    $0xb,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x4c(%rbp),%eax
  shr    $0x1f,%eax
  movzbl %al,%eax
  mov    %eax,-0x24(%rbp)
  cmp    $0x7ff,%r12d
  jne    L492
  cmpl   $0x0,-0x24(%rbp)
  je     L12
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x2d,(%rax)
L12:
  mov    -0x30(%rbp),%eax
  test   %eax,%eax
  jne    L501
  mov    -0x50(%rbp),%eax
  mov    %eax,%edi
  call   <isupper@plt>
  test   %rax,%rax
  je     L250
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x49,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x4e,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x46,(%rax)
  jmp    L315
L250:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x69,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x6e,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x66,(%rax)
  jmp    L315
L501:
  mov    -0x50(%rbp),%eax
  mov    %eax,%edi
  call   <isupper@plt>
  test   %rax,%rax
  je     L454
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x4e,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x41,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x4e,(%rax)
  jmp    L315
L454:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x6e,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x61,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x6e,(%rax)
L315:
  mov    -0x48(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x48(%rbp),%rax
  sub    -0x20(%rbp),%rax
  jmp    L205
L492:
  cmpl   $0x46,-0x50(%rbp)
  jne    L497
  movl   $0x66,-0x50(%rbp)
L497:
  mov    -0x30(%rbp),%eax
  or     %r12d,%eax
  test   %eax,%eax
  je     L500
  sub    $0x3fe,%r12d
  mov    -0x30(%rbp),%eax
  mov    %eax,-0x30(%rbp)
  mov    $0x1,%ebx
  jmp    L423
L500:
  mov    $0x0,%ebx
L423:
  test   %ebx,%ebx
  je     L488
  cmpl   $0x0,-0x24(%rbp)
  je     L488
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x2d,(%rax)
  jmp    L186
L488:
  cmpl   $0x0,-0x58(%rbp)
  je     L258
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x2b,(%rax)
  jmp    L186
L258:
  cmpl   $0x0,-0x5c(%rbp)
  je     L186
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x20,(%rax)
L186:
  mov    $0x0,%ebx
  jmp    L314
L87:
  lea    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <_rlrshift@plt>
  add    $0x1,%r12d
L412:
  mov    -0x30(%rbp),%eax
  mov    $0x20,%edx
  mov    %edx,%ecx
  sar    %cl,%eax
  cmp    $0x33333332,%eax
  ja     L87
  mov    -0x30(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  mov    %eax,-0x30(%rbp)
  add    $0x1,%r12d
  sub    $0x1,%ebx
  jmp    L390
L481:
  mov    -0x30(%rbp),%eax
  add    %eax,%eax
  mov    %eax,-0x30(%rbp)
  sub    $0x1,%r12d
L390:
  mov    -0x30(%rbp),%eax
  mov    $0x20,%edx
  mov    %edx,%ecx
  sar    %cl,%eax
  test   %eax,%eax
  jns    L481
L314:
  cmp    $0xfffffffe,%r12d
  jl     L412
  jmp    L462
L405:
  lea    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <_ldiv5@plt>
  sub    $0x1,%r12d
  add    $0x1,%ebx
  jmp    L156
L614:
  mov    -0x30(%rbp),%eax
  add    %eax,%eax
  mov    %eax,-0x30(%rbp)
  sub    $0x1,%r12d
L156:
  mov    -0x30(%rbp),%eax
  mov    $0x20,%edx
  mov    %edx,%ecx
  sar    %cl,%eax
  test   %eax,%eax
  jns    L614
L462:
  test   %r12d,%r12d
  jg     L405
  jmp    L626
L616:
  lea    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <_rlrshift@plt>
  add    $0x1,%r12d
L626:
  cmp    $0x3,%r12d
  jle    L616
  cmpl   $0x0,0x10(%rbp)
  jns    L191
  movl   $0x6,0x10(%rbp)
L191:
  movl   $0x0,-0x28(%rbp)
  cmpl   $0x67,-0x50(%rbp)
  je     L189
  cmpl   $0x47,-0x50(%rbp)
  jne    L629
L189:
  cmpl   $0x0,-0x54(%rbp)
  jne    L79
  cmpl   $0x0,0x10(%rbp)
  jle    L79
  movl   $0x1,-0x28(%rbp)
L79:
  cmp    $0xfffffffd,%ebx
  jl     L547
  mov    0x10(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,%ebx
  jle    L363
L547:
  cmpl   $0x67,-0x50(%rbp)
  jne    L452
  movl   $0x65,-0x50(%rbp)
  jmp    L629
L452:
  movl   $0x45,-0x50(%rbp)
  jmp    L629
L363:
  movl   $0x66,-0x50(%rbp)
L629:
  cmpl   $0x66,-0x50(%rbp)
  jne    L228
  mov    0x10(%rbp),%eax
  lea    (%rbx,%rax,1),%r12d
  test   %r12d,%r12d
  jns    L316
  mov    $0x0,%r12d
  jmp    L316
L228:
  mov    0x10(%rbp),%eax
  lea    0x1(%rax),%r12d
L316:
  movl   $0x10,-0x34(%rbp)
  cmp    $0x10,%r12d
  jle    L453
  mov    $0x10,%r12d
L453:
  movl   $0x0,-0x2c(%rbp)
  jmp    L705
L589:
  lea    -0x2c(%rbp),%rax
  mov    %rax,%rdi
  call   <_ldiv5@plt>
  lea    -0x2c(%rbp),%rax
  mov    %rax,%rdi
  call   <_rlrshift@plt>
L705:
  mov    %r12d,%eax
  lea    -0x1(%rax),%r12d
  test   %eax,%eax
  jne    L589
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x30(%rbp),%eax
  mov    $0x20,%edx
  mov    %edx,%ecx
  sar    %cl,%eax
  and    $0xf0000000,%eax
  test   %eax,%eax
  je     L402
  lea    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <_ldiv5@plt>
  lea    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <_rlrshift@plt>
  add    $0x1,%ebx
L402:
  cmpl   $0x66,-0x50(%rbp)
  jne    L265
  test   %ebx,%ebx
  jle    L120
  jmp    L202
L546:
  lea    -0x34(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_get_digit@plt>
  mov    %rax,%rcx
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  sub    $0x1,%ebx
L202:
  test   %ebx,%ebx
  jg     L546
  jmp    L657
L120:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x30,(%rax)
L657:
  cmpl   $0x0,-0x54(%rbp)
  jne    L554
  cmpl   $0x0,0x10(%rbp)
  jle    L15
L554:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x2e,(%rax)
  jmp    L15
L2:
  test   %ebx,%ebx
  jns    L32
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x30,(%rax)
  add    $0x1,%ebx
  jmp    L15
L32:
  lea    -0x34(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_get_digit@plt>
  mov    %rax,%rcx
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L15:
  mov    0x10(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x10(%rbp)
  test   %eax,%eax
  jg     L2
  jmp    L558
L265:
  lea    -0x34(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_get_digit@plt>
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L690
  sub    $0x1,%ebx
L690:
  cmpl   $0x0,-0x54(%rbp)
  jne    L305
  cmpl   $0x0,0x10(%rbp)
  jle    L502
L305:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x2e,(%rax)
  jmp    L502
L484:
  lea    -0x34(%rbp),%rdx
  lea    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_get_digit@plt>
  mov    %rax,%rcx
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L502:
  mov    0x10(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,0x10(%rbp)
  test   %eax,%eax
  jg     L484
L558:
  cmpl   $0x0,-0x28(%rbp)
  je     L530
  nop
L592:
  subq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L592
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L530
  addq   $0x1,-0x48(%rbp)
L530:
  cmpl   $0x65,-0x50(%rbp)
  je     L342
  cmpl   $0x45,-0x50(%rbp)
  jne    L31
L342:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x50(%rbp),%edx
  mov    %dl,(%rax)
  test   %ebx,%ebx
  jns    L261
  neg    %ebx
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x2d,(%rax)
  jmp    L109
L261:
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x2b,(%rax)
L109:
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ebx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    0x30(%rax),%ecx
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ebx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ebx
  mov    %ebx,%edx
  mov    %edx,%ebx
  mov    %ebx,%eax
  lea    0x30(%rax),%ecx
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L31:
  mov    -0x48(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x48(%rbp),%rax
  sub    -0x20(%rbp),%rax
L205:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L607
  call   <__stack_chk_fail@plt>
L607:
  add    $0x50,%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
int _to_float(char *buf, uint64_t double_temp, int c, int falt, int fplus, int fspace, int precision) {
  register int decexp;
  register int exp;
  int sign;
  int digit_count;
  uint64_t fract;
  uint64_t ltemp;
  int prune_zero;
  char *start = buf;
  exp = double_temp >> 52 & 0x7ff;
  fract = (double_temp << 11) & ~(1ull << 63);
  sign = !!(double_temp & (1ull << 63));
  if (exp == 0x7ff) {
    if (sign) {
      *buf++ = '-';
    }
    if (!fract) {
      if (isupper(c)) {
        *buf++ = 'I';
        *buf++ = 'N';
        *buf++ = 'F';
      } else {
        *buf++ = 'i';
        *buf++ = 'n';
        *buf++ = 'f';
      }
    } else {
      if (isupper(c)) {
        *buf++ = 'N';
        *buf++ = 'A';
        *buf++ = 'N';
      } else {
        *buf++ = 'n';
        *buf++ = 'a';
        *buf++ = 'n';
      }
    }
    *buf = 0;
    return buf - start;
  }
  if (c == 'F') {
    c = 'f';
  }
  if ((exp | fract) != 0) {
    exp -= (1023 - 1);
    fract |= (1ull << 63);
    decexp = true;
  } else
    decexp = false;
  if (decexp && sign) {
    *buf++ = '-';
  } else if (fplus) {
    *buf++ = '+';
  } else if (fspace) {
    *buf++ = ' ';
  }
  decexp = 0;
  while (exp <= -3) {
    while ((fract >> 32) >= (0xFFFFFFFF / 5)) {
      _rlrshift(&fract);
      exp++;
    }
    fract *= 5;
    exp++;
    decexp--;
    while ((fract >> 32) <= (0xFFFFFFFF / 2)) {
      fract <<= 1;
      exp--;
    }
  }
  while (exp > 0) {
    _ldiv5(&fract);
    exp--;
    decexp++;
    while ((fract >> 32) <= (0xFFFFFFFF / 2)) {
      fract <<= 1;
      exp--;
    }
  }
  while (exp < (0 + 4)) {
    _rlrshift(&fract);
    exp++;
  }
  if (precision < 0)
    precision = 6;
  prune_zero = false;
  if ((c == 'g') || (c == 'G')) {
    if (!falt && (precision > 0))
      prune_zero = true;
    if ((decexp < (-4 + 1)) || (decexp > (precision + 1))) {
      if (c == 'g')
        c = 'e';
      else
        c = 'E';
    } else
      c = 'f';
  }
  if (c == 'f') {
    exp = precision + decexp;
    if (exp < 0)
      exp = 0;
  } else
    exp = precision + 1;
  digit_count = 16;
  if (exp > 16)
    exp = 16;
  ltemp = 0x0800000000000000;
  while (exp--) {
    _ldiv5(&ltemp);
    _rlrshift(&ltemp);
  }
  fract += ltemp;
  if ((fract >> 32) & 0xF0000000) {
    _ldiv5(&fract);
    _rlrshift(&fract);
    decexp++;
  }
  if (c == 'f') {
    if (decexp > 0) {
      while (decexp > 0) {
        *buf++ = _get_digit(&fract, &digit_count);
        decexp--;
      }
    } else
      *buf++ = '0';
    if (falt || (precision > 0))
      *buf++ = '.';
    while (precision-- > 0) {
      if (decexp < 0) {
        *buf++ = '0';
        decexp++;
      } else
        *buf++ = _get_digit(&fract, &digit_count);
    }
  } else {
    *buf = _get_digit(&fract, &digit_count);
    if (*buf++ != '0')
      decexp--;
    if (falt || (precision > 0))
      *buf++ = '.';
    while (precision-- > 0)
      *buf++ = _get_digit(&fract, &digit_count);
  }
  if (prune_zero) {
    while (*--buf == '0')
      ;
    if (*buf != '.')
      buf++;
  }
  if ((c == 'e') || (c == 'E')) {
    *buf++ = (char)c;
    if (decexp < 0) {
      decexp = -decexp;
      *buf++ = '-';
    } else
      *buf++ = '+';
    *buf++ = (char)((decexp / 10) + '0');
    decexp %= 10;
    *buf++ = (char)(decexp + '0');
  }
  *buf = 0;
  return buf - start;
}
```