user: 下面的汇编指令对应的C源代码是什么:

```asm
<realhostname>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,%r13
  mov    %rdx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    D17(%rip),%rax
  mov    (%rax),%ebx
  movslq %ebx,%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L97:
  cmp    %rdx,%rsp
  je     L52
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L97
L52:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L102
  orq    $0x0,-0x8(%rsp,%rax,1)
L102:
  mov    %rsp,%r14
  mov    D18(%rip),%rax
  mov    (%rax),%edx
  mov    $0x4,%esi
  mov    %r12,%rdi
  call   <gethostbyaddr@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L178
  mov    0x8(%rax),%esi
  mov    %ebx,%edx
  mov    %r14,%rdi
  call   <strlcpy@plt>
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %rax,%rsi
  mov    %r14,%rdi
  call   <trimdomain@plt>
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    $0x2,%ebx
  cmp    %r13,%rax
  jbe    L51
L71:
  mov    (%r12),%edi
  call   <inet_ntoa@plt>
  mov    %rax,%rsi
  mov    %r13,%rdx
  mov    -0x48(%rbp),%rdi
  call   <strncpy@plt>
L58:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L81
  mov    %ebx,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L51:
  mov    %rsp,-0x50(%rbp)
  mov    D17(%rip),%rax
  mov    (%rax),%edx
  movslq %edx,%rax
  add    $0xf,%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L148:
  cmp    %rcx,%rsp
  je     L9
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L148
L9:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L16
  orq    $0x0,-0x8(%rsp,%rax,1)
L16:
  mov    0x8(%r15),%esi
  mov    %rsp,%rdi
  call   <strlcpy@plt>
  mov    %rsp,%rdi
  call   <gethostbyname@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L65
  mov    (%rax),%rax
  mov    (%rax),%rdi
  test   %rdi,%rdi
  je     L112
L167:
  mov    $0x4,%edx
  mov    %r12,%rsi
  call   <memcmp@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  je     L80
  mov    (%r15),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,(%r15)
  mov    0x8(%rax),%rdi
  test   %rdi,%rdi
  jne    L167
  mov    $0x1,%ebx
L39:
  mov    -0x50(%rbp),%rsp
  jmp    L71
L80:
  mov    %r13,%rdx
  mov    %r14,%rsi
  mov    -0x48(%rbp),%rdi
  call   <strncpy@plt>
  mov    -0x50(%rbp),%rsp
  jmp    L58
L65:
  mov    $0x3,%ebx
  jmp    L39
L112:
  mov    $0x1,%ebx
  jmp    L39
L178:
  mov    $0x2,%ebx
  jmp    L71
L81:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int realhostname(char *host, size_t hsize, const struct in_addr *ip) {
  char trimmed[MAXHOSTNAMELEN];
  int result;
  struct hostent *hp;
  result = (2);
  hp = gethostbyaddr((const char *)ip, sizeof(*ip), AF_INET);
  if (hp != NULL) {
    strlcpy(trimmed, hp->h_name, sizeof(trimmed));
    trimdomain(trimmed, strlen(trimmed));
    if (strlen(trimmed) <= hsize) {
      char lookup[MAXHOSTNAMELEN];
      strlcpy(lookup, hp->h_name, sizeof(lookup));
      hp = gethostbyname(lookup);
      if (hp == NULL)
        result = (3);
      else
        for (;; hp->h_addr_list++) {
          if (*hp->h_addr_list == NULL) {
            result = (1);
            break;
          }
          if (!memcmp(*hp->h_addr_list, ip, sizeof(*ip))) {
            strncpy(host, trimmed, hsize);
            return (0);
          }
        }
    }
  }
  strncpy(host, inet_ntoa(*ip), hsize);
  return result;
}
```