user: Demonstrate the C code that generates the assembly output below:

```asm
<rndstr>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L2
  lea    0x24(%rsp),%rax
  mov    %esi,%r13d
  mov    $0x4,%ebp
  xor    %ebx,%ebx
  mov    %rax,(%rsp)
L4:
  cmp    $0x4,%ebp
  je     L107
L27:
  movslq %ebp,%rax
  lea    0x1(%rbx),%r15d
  add    (%rsp),%rax
  add    $0x1,%ebp
  movzbl (%rax),%r12d
  movslq %ebx,%rcx
  cmp    %r13d,%r15d
  je     L29
L147:
  lea    (%r14,%rcx,1),%rsi
  cmp    $0x3e,%r12b
  ja     L77
  movabs $0x7800180c00000000,%rax
  bt     %r12,%rax
  jb     L131
L77:
  movsbl %r12b,%edi
  mov    %rsi,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %edi,0x8(%rsp)
  call   <isascii@plt>
  mov    0x8(%rsp),%edi
  mov    0x10(%rsp),%rcx
  test   %rax,%rax
  mov    0x18(%rsp),%rsi
  jne    L182
L15:
  cmp    %r13d,%ebx
  jl     L4
  add    %rcx,%r14
L2:
  movb   $0x0,(%r14)
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L131:
  test   %ebx,%ebx
  je     L133
  cmpb   $0x5c,-0x1(%r14,%rcx,1)
  je     L71
L133:
  lea    0x2(%rbx),%eax
  cmp    %r13d,%eax
  jge    L15
  movslq %r15d,%r15
  movb   $0x5c,(%rsi)
  mov    %eax,%ebx
  mov    %r12b,(%r14,%r15,1)
  cmp    $0x4,%ebp
  jne    L27
L107:
  xor    %eax,%eax
  lea    0x1(%rbx),%r15d
  mov    $0x1,%ebp
  call   <lrand48@plt>
  movslq %ebx,%rcx
  mov    %eax,0x24(%rsp)
  mov    (%rsp),%rax
  movzbl (%rax),%r12d
  cmp    %r13d,%r15d
  jne    L147
L29:
  cmp    $0x5c,%r12b
  je     L15
  cmp    $0x20,%r12b
  jne    L147
  jmp    L15
  nopw   0x0(%rax,%rax,1)
L71:
  lea    0x3(%rbx),%eax
  cmp    %r13d,%eax
  jge    L15
  add    $0x2,%ebx
  movslq %r15d,%r15
  movb   $0x5c,(%rsi)
  movslq %ebx,%rbx
  movb   $0x5c,(%r14,%r15,1)
  mov    %r12b,(%r14,%rbx,1)
  mov    %eax,%ebx
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L182:
  mov    %rcx,0x8(%rsp)
  mov    %rsi,0x10(%rsp)
  call   <iscntrl@plt>
  mov    0x8(%rsp),%rcx
  test   %eax,%eax
  jne    L15
  mov    0x10(%rsp),%rsi
  movslq %r15d,%rcx
  mov    %r15d,%ebx
  mov    %r12b,(%rsi)
  jmp    L15
L34:
  call   <__stack_chk_fail@plt>
```

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