user: 请从给定的汇编指令推导出C源代码:

```asm
<licenseKeyFormatting>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  mov    %eax,%r12d
  call   <malloc@plt>
  mov    %rax,%r14
  test   %r12d,%r12d
  jle    L28
  lea    -0x1(%r12),%eax
  mov    %rbx,%rdi
  xor    %r13d,%r13d
  lea    0x1(%rbx,%rax,1),%rcx
  nopl   0x0(%rax,%rax,1)
L54:
  movzbl (%rdi),%eax
  cmp    $0x2d,%al
  je     L65
  movslq %r13d,%rdx
  add    $0x1,%r13d
  mov    %al,(%r14,%rdx,1)
L65:
  add    $0x1,%rdi
  cmp    %rcx,%rdi
  jne    L54
  movslq %r13d,%rax
  movb   $0x0,(%r14,%rax,1)
  mov    %r13d,%eax
  cltd
  idiv   %ebp
  lea    0x1(%r13,%rax,1),%edi
  mov    %edx,0x14(%rsp)
  call   <malloc@plt>
  mov    0x14(%rsp),%edx
  mov    %rax,%r12
  mov    %edx,%r15d
  test   %edx,%edx
  je     L92
  lea    0x1(%r14),%rax
  lea    -0x1(%rdx),%ebx
  mov    %r12,%r15
  mov    %rax,0x18(%rsp)
  add    %rax,%rbx
  sub    %r14,%r15
  mov    %rbx,0x8(%rsp)
  mov    %r14,%rbx
  xchg   %ax,%ax
L192:
  movsbl (%rbx),%edi
  call   <toupper@plt>
  mov    %al,(%r15,%rbx,1)
  add    $0x1,%rbx
  cmp    %rbx,0x8(%rsp)
  jne    L192
  movslq 0x14(%rsp),%rax
  cmpb   $0x0,(%r14,%rax,1)
  jne    L74
  mov    %eax,%ebx
  mov    %rax,%rdx
L167:
  lea    (%r12,%rdx,1),%rcx
  cmp    %r13d,0x14(%rsp)
  jge    L165
  mov    0x18(%rsp),%rdx
  lea    (%rax,%r14,1),%r15
  lea    -0x1(%r13),%r8d
  sub    0x14(%rsp),%r8d
  add    %rax,%rdx
  mov    $0x1,%eax
  lea    (%r8,%rdx,1),%rsi
  sub    %r15d,%eax
  mov    %rsi,0x8(%rsp)
  mov    %eax,0x14(%rsp)
  jmp    L22
  nopw   0x0(%rax,%rax,1)
L175:
  cmpb   $0x0,0x1(%r15)
  je     L58
  movslq %r14d,%r14
  add    $0x2,%ebx
  add    $0x1,%r15
  movb   $0x2d,(%r12,%r14,1)
  cmp    %r15,0x8(%rsp)
  je     L149
L22:
  movsbl (%r15),%edi
  movslq %ebx,%r13
  lea    0x1(%rbx),%r14d
  add    %r12,%r13
  call   <toupper@plt>
  mov    %al,0x0(%r13)
  mov    0x14(%rsp),%eax
  add    %r15d,%eax
  cltd
  idiv   %ebp
  test   %edx,%edx
  je     L175
L58:
  mov    %r14d,%ebx
  add    $0x1,%r15
  cmp    %r15,0x8(%rsp)
  jne    L22
L149:
  movslq %ebx,%rcx
  add    %r12,%rcx
L165:
  movb   $0x0,(%rcx)
  add    $0x28,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L74:
  lea    0x1(%rax),%ebx
  movb   $0x2d,(%r12,%rax,1)
  movslq %ebx,%rdx
  jmp    L167
L92:
  test   %r13d,%r13d
  je     L196
  lea    -0x1(%r13),%eax
  lea    0x1(%r14,%rax,1),%rax
  mov    %rax,0x8(%rsp)
  mov    $0x1,%eax
  sub    %r14d,%eax
  mov    %eax,0x14(%rsp)
  jmp    L39
  nopl   (%rax)
L166:
  cmpb   $0x0,0x1(%r14)
  je     L117
  movslq %r13d,%r13
  add    $0x2,%r15d
  add    $0x1,%r14
  movb   $0x2d,(%r12,%r13,1)
  cmp    %r14,0x8(%rsp)
  je     L0
L39:
  movsbl (%r14),%edi
  movslq %r15d,%rbx
  lea    0x1(%r15),%r13d
  add    %r12,%rbx
  call   <toupper@plt>
  mov    %al,(%rbx)
  mov    0x14(%rsp),%eax
  add    %r14d,%eax
  cltd
  idiv   %ebp
  test   %edx,%edx
  je     L166
L117:
  mov    %r13d,%r15d
  add    $0x1,%r14
  cmp    %r14,0x8(%rsp)
  jne    L39
L0:
  movslq %r15d,%rcx
  add    %r12,%rcx
  jmp    L165
  nopw   0x0(%rax,%rax,1)
L28:
  movb   $0x0,(%rax)
  mov    $0x1,%edi
  call   <malloc@plt>
  mov    %rax,%r12
L196:
  mov    %r12,%rcx
  jmp    L165
```

assistant: ```c
char *licenseKeyFormatting(char *S, int K) {
  int len = strlen(S);
  int i, j;
  char *C, *ret;
  C = (char *)malloc(sizeof(char) * (len + 1));
  for (i = 0, j = 0; i < len; i++) {
    if (S[i] != '-') {
      C[j++] = S[i];
    }
  }
  C[j] = '\0';
  len = j;
  ret = (char *)malloc(sizeof(char) * (j + j / K + 1));
  j = 0;
  if (len % K) {
    for (i = 0; i < len % K; i++) {
      ret[j++] = toupper(C[i]);
    }
    if (C[i]) {
      ret[j++] = '-';
    }
    for (; i < len; i++) {
      ret[j++] = toupper(C[i]);
      if ((i + 1 - len % K) % K == 0 && C[i + 1]) {
        ret[j++] = '-';
      }
    }
  } else {
    for (i = 0; i < len; i++) {
      ret[j++] = toupper(C[i]);
      if ((i + 1) % K == 0 && C[i + 1]) {
        ret[j++] = '-';
      }
    }
  }
  ret[j] = '\0';
  return ret;
}
```