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

```asm
<_pscien>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rbx
  mov    %esi,-0x24(%rbp)
  mov    %edx,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%ecx
  lea    -0x20(%rbp),%rdx
  lea    -0x1c(%rbp),%rax
  push   0x18(%rbp)
  push   0x10(%rbp)
  mov    %rax,%rsi
  mov    %ecx,%edi
  call   <_ecvt@plt>
  add    $0x10,%rsp
  mov    %rax,%r12
  mov    -0x20(%rbp),%eax
  test   %eax,%eax
  je     L46
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movb   $0x2d,(%rax)
  jmp    L162
L46:
  mov    -0x28(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L146
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movb   $0x2b,(%rax)
  jmp    L162
L146:
  mov    -0x28(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L162
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movb   $0x20,(%rax)
L162:
  mov    %r12,%rdx
  lea    0x1(%rdx),%r12
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  cmpl   $0x0,-0x24(%rbp)
  jg     L119
  mov    -0x28(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L3
L119:
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movb   $0x2e,(%rax)
  jmp    L3
L109:
  movzbl (%r12),%eax
  test   %al,%al
  je     L86
  mov    %r12,%rdx
  lea    0x1(%rdx),%r12
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L3
L86:
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movb   $0x30,(%rax)
L3:
  subl   $0x1,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jns    L109
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movb   $0x65,(%rax)
  fldt   0x10(%rbp)
  fldz
  fucomip %st(1),%st
  fstp   %st(0)
  jp     L84
  fldt   0x10(%rbp)
  fldz
  fucomip %st(1),%st
  fstp   %st(0)
  je     L147
L84:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
L147:
  mov    -0x1c(%rbp),%eax
  test   %eax,%eax
  jns    L117
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movb   $0x2d,(%rax)
  mov    -0x1c(%rbp),%eax
  neg    %eax
  mov    %eax,-0x1c(%rbp)
  jmp    L151
L117:
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  movb   $0x2b,(%rax)
L151:
  mov    -0x1c(%rbp),%eax
  cmp    $0x63,%eax
  jle    L80
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  lea    0x30(%rax),%edx
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x5,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x64,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x1c(%rbp)
L80:
  mov    -0x1c(%rbp),%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
  lea    0x30(%rax),%edx
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  mov    %dl,(%rax)
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    %ecx,%eax
  lea    0x30(%rax),%edx
  mov    %rbx,%rax
  lea    0x1(%rax),%rbx
  mov    %dl,(%rax)
  mov    %rbx,%rax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  lea    -0x10(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
char *_pscien(long double r, register char *s, int n, int flags) {
  int sign, dp;
  register char *s1;
  s1 = _ecvt(r, n + 1, &dp, &sign);
  if (sign)
    *s++ = '-';
  else if (flags & 0x0002)
    *s++ = '+';
  else if (flags & 0x0004)
    *s++ = ' ';
  *s++ = *s1++;
  if ((n > 0) || (flags & 0x0008))
    *s++ = '.';
  while (--n >= 0)
    if (*s1)
      *s++ = *s1++;
    else
      *s++ = '0';
  *s++ = 'e';
  if (r != 0)
    --dp;
  if (dp < 0) {
    *s++ = '-';
    dp = -dp;
  } else {
    *s++ = '+';
  }
  if (dp >= 100) {
    *s++ = '0' + (dp / 100);
    dp %= 100;
  }
  *s++ = '0' + (dp / 10);
  *s++ = '0' + (dp % 10);
  return s;
}
```