user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<CodeQuality>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  movzbl (%rsi),%eax
  mov    %eax,%ebx
  mov    %al,0x17(%rsp)
  xor    %eax,%eax
  cmp    $0x20,%bl
  jle    L147
  movzbl 0x1(%rsi),%r12d
  lea    -0x1(%rdx),%eax
  mov    %rdi,%r13
  mov    %eax,0x18(%rsp)
  cmp    $0x20,%r12b
  jle    L35
  lea    0x2(%rsi),%rax
  xor    %r15d,%r15d
  mov    $0x1,%ebp
  mov    %rax,0x8(%rsp)
  lea    D12(%rip),%r14
  jmp    L45
  nopl   0x0(%rax)
L80:
  cmp    %ebp,0x18(%rsp)
  jge    L95
  cmp    $0xff,%ebp
  jg     L134
  movzbl 0x17(%rsp),%ebx
  movslq %r15d,%rdi
  mov    %ebp,%ecx
  add    %r13,%rdi
  neg    %ebx
  movsbl %bl,%edx
L32:
  mov    %r14,%rsi
  mov    $0x1,%ebp
  call   <sprintf@plt>
  mov    %r12b,0x17(%rsp)
  xor    %ecx,%ecx
  add    %eax,%r15d
L26:
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  movzbl -0x1(%rax),%r12d
  cmp    $0x20,%r12b
  jle    L110
L45:
  cmp    %r12b,0x17(%rsp)
  jne    L80
  mov    %ebp,%ecx
  add    $0x1,%ebp
  jmp    L26
  nop
L134:
  movzbl 0x17(%rsp),%edx
  neg    %edx
  movsbl %dl,%ebx
  nopw   0x0(%rax,%rax,1)
L153:
  movslq %r15d,%rdi
  mov    $0xff,%ecx
  mov    %ebx,%edx
  mov    %r14,%rsi
  add    %r13,%rdi
  call   <sprintf@plt>
  mov    %ebp,%ecx
  sub    $0xff,%ebp
  add    %eax,%r15d
  cmp    $0xff,%ebp
  jg     L153
  cmp    %ebp,0x18(%rsp)
  jge    L122
  movslq %r15d,%rdi
  mov    %ebp,%ecx
  mov    %ebx,%edx
  add    %r13,%rdi
  jmp    L32
  nopl   0x0(%rax)
L110:
  cmp    0x18(%rsp),%ebp
  jg     L67
  movslq %ecx,%rdx
  movslq %r15d,%rax
  movsbl 0x17(%rsp),%esi
  mov    %ecx,0x8(%rsp)
  add    $0x1,%rdx
  lea    0x0(%r13,%rax,1),%rdi
  call   <memset@plt>
  mov    0x8(%rsp),%ecx
  lea    0x1(%r15,%rcx,1),%eax
L147:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L95:
  movslq %r15d,%rdi
  movsbl 0x17(%rsp),%esi
  movslq %ebp,%rdx
  add    %ebp,%r15d
  add    %r13,%rdi
  mov    $0x1,%ebp
  call   <memset@plt>
  mov    %r12b,0x17(%rsp)
  xor    %ecx,%ecx
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L122:
  movslq %r15d,%rdi
  movsbl 0x17(%rsp),%esi
  movslq %ebp,%rdx
  mov    %ecx,0x1c(%rsp)
  add    %r13,%rdi
  mov    $0x1,%ebp
  call   <memset@plt>
  mov    0x1c(%rsp),%ecx
  mov    %r12b,0x17(%rsp)
  lea    -0xff(%r15,%rcx,1),%r15d
  xor    %ecx,%ecx
  jmp    L26
  nopl   0x0(%rax)
L67:
  movslq %r15d,%rax
  add    %rax,%r13
L90:
  movzbl 0x17(%rsp),%ebx
  mov    %ebp,%ecx
  mov    %r13,%rdi
  lea    D12(%rip),%rsi
  neg    %ebx
  movsbl %bl,%edx
  call   <sprintf@plt>
  add    $0x28,%rsp
  pop    %rbx
  add    %r15d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L35:
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  jle    L68
  mov    %bl,0x0(%r13)
  mov    $0x1,%eax
  jmp    L147
L68:
  xor    %r15d,%r15d
  mov    $0x1,%ebp
  jmp    L90
```

tool_calls: name: extract_symbolic_data
arguments: tag: D12
datatype: string

tool: D12: %c%c

assistant: ```c
int CodeQuality(char *buf, char *str, int n) {
  char prech, ch;
  int i, count = 1, len = 0;
  n--;
  if ((prech = *str) < 33)
    return len;
  for (i = 1; (ch = *(str + i)) > 32; i++) {
    if (prech == ch)
      count++;
    else {
      if (count > n) {
        if (count < 256)
          len += sprintf(buf + len, "%c%c", -prech, count);
        else {
          do {
            len += sprintf(buf + len, "%c%c", -prech, 255);
            count -= 255;
          } while (count > 255);
          if (count > n)
            len += sprintf(buf + len, "%c%c", -prech, count);
          else
            while (count-- > 0)
              *(buf + len++) = prech;
        }
      } else
        while (count-- > 0)
          *(buf + len++) = prech;
      count = 1;
      prech = ch;
    }
  }
  if (count > n)
    len += sprintf(buf + len, "%c%c", -prech, count);
  else
    while (count-- > 0)
      *(buf + len++) = prech;
  return len;
}
```