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

```asm
<sc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x20(%rbp)
  mov    $0x4,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x20(%rbp),%edx
  mov    -0x38(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  cmpl   $0x0,-0x20(%rbp)
  jg     L145
  mov    -0x38(%rbp),%rax
  jmp    L51
L145:
  movl   $0x0,-0x2c(%rbp)
  jmp    L149
L96:
  movl   $0x1,-0x1c(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L164
L71:
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x28(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L118
  addl   $0x1,-0x1c(%rbp)
  jmp    L121
L118:
  cmpl   $0x1,-0x1c(%rbp)
  jne    L111
  mov    -0x20(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x24(%rbp)
  jmp    L66
L9:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rdx
  lea    0x1(%rdx),%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  subl   $0x1,-0x24(%rbp)
L66:
  mov    -0x24(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jge    L9
  addl   $0x1,-0x20(%rbp)
  jmp    L54
L111:
  mov    -0x2c(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x24(%rbp)
  jmp    L140
L92:
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    -0x2(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x38(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x24(%rbp)
L140:
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x24(%rbp)
  jle    L92
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x2,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L54:
  mov    -0x1c(%rbp),%eax
  lea    0x30(%rax),%edx
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  jmp    L168
L121:
  addl   $0x1,-0x28(%rbp)
L164:
  mov    -0x20(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jge    L71
L168:
  addl   $0x1,-0x2c(%rbp)
  addl   $0x1,-0x2c(%rbp)
L149:
  mov    -0x2c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L96
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,%ebx
  jle    L67
  mov    -0x18(%rbp),%rax
  jmp    L51
L67:
  mov    -0x38(%rbp),%rax
L51:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *sc(char str[]) {
  int i, j, k;
  int len;
  int count;
  char *old;
  len = strlen(str);
  old = malloc(sizeof(len + 1));
  strncpy(old, str, len);
  if (len < 1)
    return str;
  for (i = 0; i < len; i++, i++) {
    for (count = 1, j = i + 1; j < len + 1; j++)
      if (str[i] == str[j])
        count++;
      else {
        if (count == 1) {
          for (k = len - 1; k >= j; k--)
            str[k + 1] = str[k];
          len++;
        } else {
          for (k = i + 2; k < len - count + 2; k++)
            str[k] = str[k + count - 2];
          len = len - count + 2;
          str[len] = '\0';
        }
        str[i + 1] = '0' + count;
        break;
      }
  }
  if (strlen(str) > strlen(old))
    return old;
  else
    return str;
}
```