user: 请将以下的汇编代码转换成C语言代码：

```asm
<MakeErrString>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x38,%rsp
  mov    (%rdi),%rdi
  test   %rdi,%rdi
  je     L52
  call   <free@plt>
L52:
  mov    %ebx,%r13d
  mov    %ebx,%r11d
  mov    %ebx,%r10d
  mov    %ebx,%r9d
  and    $0x2,%r11d
  and    $0x1,%r13d
  mov    %ebx,%r8d
  mov    %ebx,%esi
  cmp    $0x1,%r11d
  mov    %r13d,%edx
  mov    %ebx,%ecx
  mov    %r11d,0x20(%rsp)
  sbb    $0xffffffff,%edx
  and    $0x4,%r10d
  cmp    $0x1,%r10d
  mov    %edx,%r15d
  mov    %r10d,0x1c(%rsp)
  sbb    $0xffffffff,%r15d
  and    $0x8,%r9d
  mov    %edx,0x18(%rsp)
  cmp    $0x1,%r9d
  mov    %r15d,%r14d
  mov    %r9d,0x14(%rsp)
  sbb    $0xffffffff,%r14d
  and    $0x10,%r8d
  cmp    $0x1,%r8d
  mov    %r14d,%eax
  mov    %r8d,0x10(%rsp)
  sbb    $0xffffffff,%eax
  and    $0x20,%esi
  cmp    $0x1,%esi
  mov    %eax,0x24(%rsp)
  sbb    $0xffffffff,%eax
  and    $0x40,%ecx
  mov    %esi,0xc(%rsp)
  cmp    $0x1,%ecx
  mov    %eax,0x28(%rsp)
  sbb    $0xffffffff,%eax
  and    $0x80,%ebx
  mov    %ecx,0x8(%rsp)
  cmp    $0x1,%ebx
  mov    %eax,0x2c(%rsp)
  sbb    $0xffffffff,%eax
  movslq %eax,%r12
  lea    0x1(%r12),%edi
  call   <malloc@plt>
  test   %r13d,%r13d
  mov    0x8(%rsp),%ecx
  mov    0xc(%rsp),%esi
  mov    0x10(%rsp),%r8d
  mov    0x14(%rsp),%r9d
  movslq 0x18(%rsp),%rdx
  mov    0x1c(%rsp),%r10d
  mov    0x20(%rsp),%r11d
  je     L26
  movb   $0x2d,(%rax)
L26:
  test   %r11d,%r11d
  je     L24
  movslq %r13d,%r13
  movb   $0x42,(%rax,%r13,1)
L24:
  test   %r10d,%r10d
  je     L70
  movb   $0x4e,(%rax,%rdx,1)
L70:
  test   %r9d,%r9d
  je     L84
  movslq %r15d,%r15
  movb   $0x54,(%rax,%r15,1)
L84:
  test   %r8d,%r8d
  je     L89
  movslq %r14d,%r14
  movb   $0x56,(%rax,%r14,1)
L89:
  test   %esi,%esi
  je     L42
  movslq 0x24(%rsp),%rdx
  movb   $0x57,(%rax,%rdx,1)
L42:
  test   %ecx,%ecx
  je     L69
  movslq 0x28(%rsp),%rdx
  movb   $0x52,(%rax,%rdx,1)
L69:
  test   %ebx,%ebx
  je     L19
  movslq 0x2c(%rsp),%rdx
  movb   $0x44,(%rax,%rdx,1)
L19:
  movb   $0x0,(%rax,%r12,1)
  mov    %rax,0x0(%rbp)
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void MakeErrString(char **str, int errn) {
  int nerr = 0;
  char *string;
  string = *str;
  if (NULL != string)
    free(string);
  if ((errn & 1) == 1)
    nerr++;
  if ((errn & 2) == 2)
    nerr++;
  if ((errn & 4) == 4)
    nerr++;
  if ((errn & 8) == 8)
    nerr++;
  if ((errn & 16) == 16)
    nerr++;
  if ((errn & 32) == 32)
    nerr++;
  if ((errn & 64) == 64)
    nerr++;
  if ((errn & 128) == 128)
    nerr++;
  string = malloc((nerr + 1) * sizeof(char));
  nerr = 0;
  if ((errn & 1) == 1)
    string[nerr++] = '-';
  if ((errn & 2) == 2)
    string[nerr++] = 'B';
  if ((errn & 4) == 4)
    string[nerr++] = 'N';
  if ((errn & 8) == 8)
    string[nerr++] = 'T';
  if ((errn & 16) == 16)
    string[nerr++] = 'V';
  if ((errn & 32) == 32)
    string[nerr++] = 'W';
  if ((errn & 64) == 64)
    string[nerr++] = 'R';
  if ((errn & 128) == 128)
    string[nerr++] = 'D';
  string[nerr] = '\0';
  *str = string;
}
```