user: Please show me the C implementation that matches the assembly code listed below:

```asm
<EasyClientName>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x90,%rsp
  mov    %rsi,%r12
  mov    %edx,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  mov    $0x80,%edx
  call   <ClientName@plt>
  movzbl (%rsp),%eax
  test   %al,%al
  je     L76
  mov    %rsp,%rdx
L15:
  and    $0x7f,%eax
  mov    %al,(%rdx)
  add    $0x1,%rdx
  movzbl (%rdx),%eax
  test   %al,%al
  jne    L15
L76:
  mov    %rsp,%rdi
  mov    $0x20,%esi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L78
  mov    %rsp,%r14
L134:
  lea    0x1(%rbx),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <memmove@plt>
  mov    $0x20,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L134
L78:
  mov    %rsp,%r13
  mov    $0x5b,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  mov    $0x5d,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  mov    %rax,%r13
  test   %rbx,%rbx
  je     L37
  test   %rax,%rax
  je     L37
  cmp    %rax,%rbx
  jae    L74
  add    $0x1,%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <memmove@plt>
L37:
  movzbl (%rsp),%eax
  and    $0xffffffdf,%eax
  cmp    $0x4d,%al
  jne    L128
  movzbl 0x1(%rsp),%edx
  and    $0xffffffdf,%edx
  movzbl (%rsp),%eax
  cmp    $0x52,%dl
  jne    L125
  mov    %rsp,%r13
  lea    0x2(%rsp),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <memmove@plt>
L128:
  movzbl (%rsp),%eax
  test   %al,%al
  je     L110
L125:
  mov    %rsp,%rbx
  jmp    L11
L74:
  add    $0x1,%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <memmove@plt>
  jmp    L37
L130:
  add    $0x1,%rbx
L112:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L110
L11:
  mov    %eax,%esi
  lea    -0x61(%rax),%edx
  cmp    $0x19,%dl
  setbe  %dl
  lea    -0x30(%rax),%ecx
  cmp    $0x9,%cl
  setbe  %cl
  or     %cl,%dl
  jne    L130
  cmp    $0x5f,%al
  je     L130
  lea    -0x41(%rsi),%eax
  cmp    $0x19,%al
  ja     L70
  add    $0x20,%esi
  mov    %sil,(%rbx)
  add    $0x1,%rbx
  jmp    L112
L70:
  lea    0x1(%rbx),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <memmove@plt>
  jmp    L112
L110:
  lea    -0x1(%rbp),%edx
  mov    %rsp,%rsi
  mov    %r12,%rdi
  call   <strncpy@plt>
  movslq %ebp,%rbp
  movb   $0x0,-0x1(%r12,%rbp,1)
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L69
  mov    %r12,%rax
  add    $0x90,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L69:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *EasyClientName(int client, char *buf, int size) {
  int i;
  char *str1, *str2, *ptr, c;
  char name[128];
  ClientName(client, name, sizeof(name));
  for (i = 0; name[i]; i++) {
    name[i] &= 127;
  }
  for (ptr = strstr(name, " "); ptr; ptr = strstr(name, " ")) {
    memmove(ptr, ptr + 1, strlen(ptr + 1) + 1);
  }
  str1 = strstr(name, "[");
  str2 = strstr(name, "]");
  if (str1 && str2) {
    if (str2 > str1) {
      memmove(str1, str2 + 1, strlen(str2 + 1) + 1);
    } else {
      memmove(str2, str1 + 1, strlen(str1 + 1) + 1);
    }
  }
  if ((name[0] == 'm' || name[0] == 'M') && (name[1] == 'r' || name[1] == 'R')) {
    memmove(name, name + 2, strlen(name + 2) + 1);
  }
  ptr = name;
  while (*ptr) {
    c = *ptr;
    if ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '_') {
      ptr++;
    } else if (c >= 'A' && c <= 'Z') {
      *ptr += 'a' - 'A';
      ptr++;
    } else {
      memmove(ptr, ptr + 1, strlen(ptr + 1) + 1);
    }
  }
  strncpy(buf, name, size - 1);
  buf[size - 1] = '\0';
  return buf;
}
```