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

```asm
<rndstr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x18(%rbp)
  movl   $0x4,-0x14(%rbp)
  lea    -0x1c(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L104
L22:
  cmpl   $0x4,-0x14(%rbp)
  jne    L51
  mov    $0x0,%eax
  call   <lrand48@plt>
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x14(%rbp)
L51:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x1d(%rbp)
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x2c(%rbp)
  jne    L222
  cmpb   $0x5c,-0x1d(%rbp)
  je     L61
  cmpb   $0x20,-0x1d(%rbp)
  je     L61
L222:
  cmpb   $0x3d,-0x1d(%rbp)
  je     L94
  cmpb   $0x3b,-0x1d(%rbp)
  je     L94
  cmpb   $0x2c,-0x1d(%rbp)
  je     L94
  cmpb   $0x2b,-0x1d(%rbp)
  je     L94
  cmpb   $0x22,-0x1d(%rbp)
  je     L94
  cmpb   $0x3c,-0x1d(%rbp)
  je     L94
  cmpb   $0x3e,-0x1d(%rbp)
  je     L94
  cmpb   $0x23,-0x1d(%rbp)
  jne    L107
L94:
  cmpl   $0x0,-0x18(%rbp)
  jle    L44
  mov    -0x18(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L44
  mov    -0x18(%rbp),%eax
  add    $0x3,%eax
  cmp    %eax,-0x2c(%rbp)
  jle    L77
  mov    -0x18(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x5c,(%rax)
  mov    -0x18(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x5c,(%rax)
  mov    -0x18(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x1d(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L77
L44:
  mov    -0x18(%rbp),%eax
  add    $0x2,%eax
  cmp    %eax,-0x2c(%rbp)
  jle    L101
  mov    -0x18(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x5c,(%rax)
  mov    -0x18(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x1d(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L101
L77:
  jmp    L101
L107:
  movsbl -0x1d(%rbp),%eax
  mov    %eax,%edi
  call   <isascii@plt>
  test   %rax,%rax
  je     L61
  movsbl -0x1d(%rbp),%eax
  mov    %eax,%edi
  call   <iscntrl@plt>
  test   %eax,%eax
  jne    L61
  mov    -0x18(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x18(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x1d(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L61
L101:
  nop
L61:
  addl   $0x1,-0x14(%rbp)
L104:
  mov    -0x18(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L22
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L28
  call   <__stack_chk_fail@plt>
L28:
  leave
  ret
```

assistant: ```c
void rndstr(char *buf, int ndigits) {
  unsigned int rndNum;
  int charNum;
  int byteNum;
  char newChar;
  char *rndArray;
  charNum = 0;
  byteNum = 4;
  rndArray = (char *)(&rndNum);
  while (charNum < ndigits) {
    if (byteNum == 4) {
      rndNum = lrand48();
      byteNum = 0;
    }
    newChar = rndArray[byteNum];
    if (!(((charNum + 1) == ndigits) && ((newChar == '\\') || (newChar == ' ')))) {
      if ((newChar == '=') || (newChar == ';') || (newChar == ',') || (newChar == '+') || (newChar == '"') || (newChar == '<') || (newChar == '>') || (newChar == '#')) {
        if ((charNum > 0) && (buf[charNum - 1] == '\\')) {
          if ((charNum + 3) < ndigits) {
            buf[charNum++] = '\\';
            buf[charNum++] = '\\';
            buf[charNum++] = newChar;
          }
        } else {
          if ((charNum + 2) < ndigits) {
            buf[charNum++] = '\\';
            buf[charNum++] = newChar;
          }
        }
      } else {
        if (isascii(newChar) && !iscntrl(newChar))
          buf[charNum++] = newChar;
      }
    }
    byteNum++;
  }
  buf[charNum] = '\0';
}
```