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

```asm
<readFloatAsString>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movq   $0x0,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x5,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
  mov    $0x5,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %al,-0x1d(%rbp)
  movsbl -0x1d(%rbp),%eax
  mov    -0xc(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <floatEcho@plt>
  mov    %eax,-0x14(%rbp)
  jmp    L155
L57:
  cmpl   $0x0,-0x14(%rbp)
  je     L61
  movl   $0x0,-0xc(%rbp)
  cmpb   $0x7f,-0x1d(%rbp)
  je     L53
  cmpb   $0x8,-0x1d(%rbp)
  jne    L52
L53:
  cmpl   $0x0,-0x1c(%rbp)
  jle    L95
  mov    -0x1c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L146
  movl   $0x0,-0x10(%rbp)
L146:
  subl   $0x1,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  cmp    $0x5,%eax
  jle    L45
  subl   $0x5,-0x18(%rbp)
  mov    -0x18(%rbp),%ecx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <cambiarEspacioDeString@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L45
L95:
  movl   $0x1,-0xc(%rbp)
  jmp    L45
L52:
  cmpb   $0x2e,-0x1d(%rbp)
  jne    L24
  movl   $0x1,-0x10(%rbp)
L24:
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x1d(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L18
  mov    -0x18(%rbp),%ecx
  mov    -0x8(%rbp),%rax
  mov    $0x5,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <cambiarEspacioDeString@plt>
  mov    %rax,-0x8(%rbp)
  addl   $0x5,-0x18(%rbp)
L18:
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L61
L45:
  nop
L61:
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %al,-0x1d(%rbp)
  movsbl -0x1d(%rbp),%eax
  mov    -0xc(%rbp),%edx
  mov    -0x10(%rbp),%ecx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <floatEcho@plt>
  mov    %eax,-0x14(%rbp)
L155:
  cmpb   $0x1b,-0x1d(%rbp)
  je     L153
  cmpb   $0xa,-0x1d(%rbp)
  jne    L57
L153:
  cmpb   $0x1b,-0x1d(%rbp)
  jne    L140
  mov    $0x0,%eax
  jmp    L54
L140:
  mov    -0x8(%rbp),%rax
L54:
  leave
  ret
```

assistant: ```c
char *readFloatAsString() {
  char *s = NULL, c;
  int contador = 0, contadorMax = 5, i, valid, hasDot = 0, signPossible = 1;
  s = (char *)malloc(5 * sizeof(char));
  *s = '\0';
  c = getch();
  valid = floatEcho(c, hasDot, signPossible);
  while (c != 27 && c != 10) {
    if (valid) {
      signPossible = 0;
      if (c == 127 || c == 8) {
        if (contador > 0) {
          if (s[contador - 1] == '.')
            hasDot = 0;
          s[--contador] = '\0';
          if (contadorMax - contador > 5) {
            contadorMax -= 5;
            s = cambiarEspacioDeString(s, contadorMax, 0);
          }
        } else {
          signPossible = 1;
        }
      } else {
        if (c == '.')
          hasDot = 1;
        s[contador++] = c;
        if (contador >= contadorMax) {
          s = cambiarEspacioDeString(s, contadorMax, 5);
          contadorMax += 5;
        }
        s[contador] = '\0';
      }
    }
    c = getch();
    valid = floatEcho(c, hasDot, signPossible);
  }
  if (c == 27)
    return NULL;
  return s;
}
```