user: 请将以下的汇编代码转换成C语言代码：

```asm
<read_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  movl   $0x1,(%rax)
  mov    $0x100,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  jmp    L59
L87:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xbf,%al
  jbe    L2
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  sub    $0xc000,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  lea    -0x1(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x1,-0x18(%rbp)
  jmp    L96
L2:
  mov    -0x1c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,(%rdx)
L96:
  addq   $0x1,-0x28(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jne    L59
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
L59:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L87
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  cmpl   $0x1,-0x18(%rbp)
  jne    L68
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,(%rax)
L68:
  movl   $0x0,-0x14(%rbp)
  jmp    L14
L53:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L27
L22:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x14(%rbp)
  addl   $0x1,-0x10(%rbp)
L27:
  mov    -0x1c(%rbp),%eax
  cmp    %eax,-0x10(%rbp)
  jl     L22
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2e,(%rax)
  addl   $0x1,-0x14(%rbp)
L14:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x14(%rbp)
  jl     L53
  mov    -0x14(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
unsigned char *read_name(unsigned char *reader, unsigned char *buffer, int *count) {
  unsigned char *name;
  unsigned int p = 0, jumped = 0, offset;
  int i, j;
  *count = 1;
  name = (unsigned char *)malloc(256);
  name[0] = '\0';
  while (*reader != 0) {
    if (*reader >= 192) {
      offset = (*reader) * 256 + *(reader + 1) - 49152;
      reader = buffer + offset - 1;
      jumped = 1;
    } else {
      name[p++] = *reader;
    }
    reader = reader + 1;
    if (jumped == 0) {
      *count = *count + 1;
    }
  }
  name[p] = '\0';
  if (jumped == 1) {
    *count = *count + 1;
  }
  for (i = 0; i < (int)strlen((const char *)name); i++) {
    p = name[i];
    for (j = 0; j < (int)p; j++) {
      name[i] = name[i + 1];
      i = i + 1;
    }
    name[i] = '.';
  }
  name[i - 1] = '\0';
  return name;
}
```