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

```asm
<getrpcport>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %edx,-0x60(%rbp)
  mov    %ecx,-0x64(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x400,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L108:
  cmp    %rdx,%rsp
  je     L99
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L108
L99:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L6
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L6:
  mov    %rsp,%rax
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,-0x30(%rbp)
  jmp    L54
L9:
  mov    -0x44(%rbp),%edx
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L67
  mov    D28(%rip),%rax
  mov    (%rax),%rdx
  mov    D37(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  je     L2
L67:
  mov    $0x0,%eax
  jmp    L86
L2:
  shlq   -0x38(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L44:
  cmp    %rdx,%rsp
  je     L27
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L44
L27:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L43
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L43:
  mov    %rsp,%rax
  add    $0xf,%rax
  shr    $0x4,%rax
  shl    $0x4,%rax
  mov    %rax,-0x30(%rbp)
L54:
  lea    -0x44(%rbp),%r8
  lea    -0x40(%rbp),%rdi
  mov    -0x38(%rbp),%rcx
  mov    -0x30(%rbp),%rdx
  lea    -0x28(%rbp),%rsi
  mov    -0x58(%rbp),%rax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <gethostbyname_r@plt>
  test   %rax,%rax
  jne    L9
  mov    -0x40(%rbp),%rax
  test   %rax,%rax
  je     L9
  mov    -0x40(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%rax
  mov    0x4(%rax),%eax
  lea    -0x20(%rbp),%rcx
  add    $0xc,%rcx
  mov    %eax,%esi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    D25(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  movq   $0x0,-0x20(%rbp)
  mov    -0x64(%rbp),%ecx
  mov    -0x60(%rbp),%edx
  mov    -0x5c(%rbp),%esi
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <pmap_getport@plt>
L86:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L1
  call   <__stack_chk_fail@plt>
L1:
  leave
  ret
```

assistant: ```c
int getrpcport(const char *host, u_long prognum, u_long versnum, u_int proto) {
  struct sockaddr_in addr;
  struct hostent hostbuf, *hp;
  size_t buflen;
  char *buffer;
  int herr;
  buflen = 1024;
  buffer = alloca(buflen);
  while (gethostbyname_r(host, &hostbuf, buffer, buflen, &hp, &herr) != 0 || hp == NULL)
    if (herr != NETDB_INTERNAL || errno != ERANGE)
      return 0;
    else {
      buflen *= 2;
      buffer = alloca(buflen);
    }
  memcpy((char *)&addr.sin_addr, hp->h_addr, hp->h_length);
  addr.sin_family = AF_INET;
  addr.sin_port = 0;
  return pmap_getport(&addr, prognum, versnum, proto);
}
```