user: Translate the below assembly code into C programming language:

```asm
<Code2Quality>:
  endbr64
  push   %r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  movzbl (%rsi),%ebp
  mov    %rdi,(%rsp)
  mov    %rsi,0x8(%rsp)
  cmp    $0x20,%bpl
  jle    L248
  movzbl 0x1(%rsi),%ebx
  lea    -0x1(%rdx),%ecx
  mov    %ecx,0x14(%rsp)
  cmp    $0x20,%bl
  jle    L322
  mov    $0x1,%r15d
  mov    $0x1,%r10d
  xor    %r11d,%r11d
  lea    D7(%rip),%r13
  jmp    L230
  nopw   0x0(%rax,%rax,1)
L119:
  cmp    %bl,%r11b
  jne    L99
  cmp    $0x20,%r15d
  jle    L283
L99:
  cmp    %r15d,0x14(%rsp)
  jge    L215
  mov    %ebp,%edx
  neg    %edx
  cmp    $0xff,%r15d
  jg     L39
  movslq %r14d,%rdi
  movsbl %dl,%edx
  add    (%rsp),%rdi
  mov    %r15d,%ecx
L147:
  mov    %r13,%rsi
  mov    $0x1,%r15d
  call   <sprintf@plt>
  mov    %ebp,%r11d
  mov    %ebx,%ebp
  add    %eax,%r14d
L76:
  mov    0x10(%rsp),%r10d
L236:
  mov    0x8(%rsp),%rsi
  movslq %r10d,%rax
  movzbl (%rsi,%rax,1),%ebx
  cmp    $0x20,%bl
  jle    L263
L230:
  lea    0x1(%r10),%eax
  mov    %eax,0x10(%rsp)
  cmp    %bl,%bpl
  jne    L119
  add    $0x1,%r15d
  jmp    L76
  nopl   0x0(%rax,%rax,1)
L39:
  movsbl %dl,%r12d
  nopl   0x0(%rax)
L276:
  movslq %r14d,%rdi
  mov    $0xff,%ecx
  add    (%rsp),%rdi
  mov    %r12d,%edx
  mov    %r13,%rsi
  call   <sprintf@plt>
  mov    %r15d,%ecx
  sub    $0xff,%r15d
  add    %eax,%r14d
  cmp    $0xff,%r15d
  jg     L276
  cmp    %r15d,0x14(%rsp)
  jge    L161
  movslq %r14d,%rdi
  mov    %r15d,%ecx
  add    (%rsp),%rdi
  mov    %r12d,%edx
  jmp    L147
  nopw   0x0(%rax,%rax,1)
L263:
  cmp    0x14(%rsp),%r15d
  jg     L162
  test   %r15d,%r15d
  jle    L248
  mov    (%rsp),%rdi
  movslq %r14d,%rax
  movslq %r15d,%rdx
  movsbl %bpl,%esi
  add    %r15d,%r14d
  add    %rax,%rdi
  call   <memset@plt>
L248:
  add    $0x28,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L215:
  test   %r15d,%r15d
  jle    L13
  movslq %r14d,%rdi
  movslq %r15d,%rdx
  movsbl %bpl,%esi
  add    (%rsp),%rdi
  call   <memset@plt>
  add    %r15d,%r14d
L13:
  mov    %ebx,%ebp
  mov    $0x1,%r15d
  xor    %r11d,%r11d
  jmp    L76
  nopl   0x0(%rax,%rax,1)
L161:
  movslq %r15d,%rdx
  movsbl %bpl,%esi
  movslq %r14d,%rdi
  add    (%rsp),%rdi
  mov    %ecx,0x18(%rsp)
  mov    $0x1,%r15d
  call   <memset@plt>
  mov    0x18(%rsp),%ecx
  mov    %ebp,%r11d
  mov    %ebx,%ebp
  lea    -0xff(%rcx,%r14,1),%r14d
  jmp    L76
  nopl   0x0(%rax,%rax,1)
L162:
  movslq %r14d,%rax
  add    %rax,(%rsp)
L242:
  mov    (%rsp),%rdi
  neg    %ebp
  mov    %r15d,%ecx
  lea    D7(%rip),%rsi
  movsbl %bpl,%edx
  call   <sprintf@plt>
  add    %eax,%r14d
  jmp    L248
L283:
  movslq 0x10(%rsp),%rdx
  mov    0x8(%rsp),%rcx
  lea    0x2(%r10),%eax
  cmp    %bl,(%rcx,%rdx,1)
  jne    L309
  lea    0x3(%r10),%eax
  mov    $0x1,%ecx
  cltq
  nopw   0x0(%rax,%rax,1)
L23:
  mov    0x8(%rsp),%rsi
  mov    %eax,%r10d
  add    $0x1,%rax
  mov    %ecx,%r12d
  add    $0x1,%ecx
  cmp    %bl,-0x2(%rsi,%rax,1)
  je     L23
  cmp    $0xff,%ecx
  jg     L160
L337:
  movslq %r14d,%rdi
  movsbl %r15b,%edx
  add    (%rsp),%rdi
  mov    %r13,%rsi
  mov    %r10d,0x10(%rsp)
  call   <sprintf@plt>
  mov    0x10(%rsp),%r10d
  xor    %r11d,%r11d
  add    %eax,%r14d
  jmp    L236
L322:
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L117
  mov    %bpl,(%rdi)
  mov    $0x1,%r14d
  jmp    L248
L117:
  xor    %r14d,%r14d
  mov    $0x1,%r15d
  jmp    L242
L160:
  movslq %r14d,%rdi
  movsbl %r15b,%edx
  add    (%rsp),%rdi
  mov    $0xff,%ecx
  mov    %r13,%rsi
  mov    %r11b,0x18(%rsp)
  sub    $0xfe,%r12d
  mov    %r10d,0x10(%rsp)
  call   <sprintf@plt>
  mov    0x10(%rsp),%r10d
  cmp    $0x100,%r12d
  movzbl 0x18(%rsp),%r11d
  lea    (%r14,%rax,1),%ebx
  mov    %ebx,%r14d
  jle    L188
  mov    %r11d,%eax
  neg    %eax
  movsbl %al,%eax
  mov    %eax,0x1c(%rsp)
  nopl   0x0(%rax)
L148:
  mov    0x1c(%rsp),%edx
  movslq %ebx,%rdi
  mov    $0xff,%ecx
  add    (%rsp),%rdi
  mov    %r13,%rsi
  mov    %r11b,0x18(%rsp)
  sub    $0xff,%r12d
  mov    %r10d,0x10(%rsp)
  call   <sprintf@plt>
  mov    0x10(%rsp),%r10d
  movzbl 0x18(%rsp),%r11d
  add    %eax,%ebx
  cmp    $0x100,%r12d
  mov    %ebx,%r14d
  jg     L148
L188:
  cmp    %r12d,0x14(%rsp)
  jge    L303
  neg    %r11d
  movslq %ebx,%rdi
  mov    %r12d,%ecx
  add    (%rsp),%rdi
  movsbl %r11b,%edx
  mov    %r13,%rsi
  mov    %r10d,0x10(%rsp)
  call   <sprintf@plt>
  mov    0x10(%rsp),%r10d
  xor    %r11d,%r11d
  lea    (%rbx,%rax,1),%r14d
  jmp    L236
L303:
  lea    -0x1(%r15),%r12d
  test   %r15d,%r15d
  jle    L68
  mov    %r12d,%edx
  movsbl %r11b,%esi
  movslq %ebx,%rdi
  add    (%rsp),%rdi
  add    $0x1,%rdx
  mov    %r10d,0x10(%rsp)
  lea    0x1(%rbx,%r12,1),%r14d
  mov    $0xffffffff,%r15d
  call   <memset@plt>
  mov    0x10(%rsp),%r10d
  xor    %r11d,%r11d
  jmp    L236
L309:
  mov    %eax,%r10d
  mov    $0x1,%ecx
  jmp    L337
L68:
  mov    %r12d,%r15d
  xor    %r11d,%r11d
  jmp    L236
```

tool_calls: name: disassemble_data
arguments: label: D7
type_guessed: string

tool: D7: %c%c

assistant: ```c
int Code2Quality(char *buf, char *str, int n) {
  char prech, ch, pprech = 0;
  int i, count = 1, len = 0, countch = 1;
  n--;
  if ((prech = *str) < 33)
    return len;
  for (i = 1; (ch = *(str + i)) > 32;) {
    if (prech == ch)
      count++;
    else {
      if (ch == pprech) {
        if (count < 33) {
          i++;
          while (ch == *(str + i++))
            countch++;
          if (countch < 256)
            len += sprintf(buf + len, "%c%c", count, countch);
          else {
            len += sprintf(buf + len, "%c%c", count, 255);
            countch -= 255;
            while (countch > 256) {
              len += sprintf(buf + len, "%c%c", -pprech, 255);
              countch -= 255;
            }
            if (countch > n)
              len += sprintf(buf + len, "%c%c", -pprech, countch);
            else
              while (count-- > 0)
                *(buf + len++) = pprech;
          }
          pprech = 0;
          countch = 1;
          continue;
        }
      }
      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;
        }
        pprech = prech;
      } else {
        while (count-- > 0)
          *(buf + len++) = prech;
        pprech = 0;
      }
      count = 1;
      prech = ch;
    }
    i++;
  }
  if (count > n)
    len += sprintf(buf + len, "%c%c", -prech, count);
  else
    while (count-- > 0)
      *(buf + len++) = prech;
  return len;
}
```