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

```asm
<getLocalHostIp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x488,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x478(%rsp)
  xor    %eax,%eax
  lea    0x18(%rsp),%rdi
  movq   $0x0,0x18(%rsp)
  call   <getifaddrs@plt>
  test   %rax,%rax
  jne    L133
  mov    0x18(%rsp),%rbp
  pxor   %xmm0,%xmm0
  movaps %xmm0,0x20(%rsp)
  test   %rbp,%rbp
  je     L134
  movl   $0x0,0xc(%rsp)
  mov    D16(%rip),%rbx
  lea    0x70(%rsp),%r13
  jmp    L104
  nopl   0x0(%rax)
L27:
  mov    0x10(%rbp),%rbp
  test   %rbp,%rbp
  je     L87
L104:
  mov    0x8(%rbp),%rdi
  mov    (%rbx),%rax
  cmp    %rax,(%rdi)
  jne    L27
  mov    0x0(%rbp),%eax
  test   $0x1,%al
  je     L27
  test   $0x8,%al
  jne    L27
  sub    $0x8,%rsp
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  mov    $0x401,%ecx
  push   $0x2
  mov    %r13,%rdx
  mov    $0x10,%esi
  call   <getnameinfo@plt>
  mov    0x8(%rbp),%r15
  lea    0x40(%rsp),%r14
  mov    (%rbx),%rdi
  mov    $0x10,%ecx
  mov    %r14,%rdx
  mov    %r15,%rsi
  call   <inet_ntop@plt>
  pop    %rdx
  pop    %rcx
  test   %rax,%rax
  je     L27
  mov    %r13,%rsi
  mov    %r14,%rdi
  call   <strcmp@plt>
  xor    %esi,%esi
  test   %rax,%rax
  setne  %sil
  cmpq   $0x0,0x20(%rsp)
  jne    L99
  movdqu (%r15),%xmm1
  lea    0x20(%rsp),%rdi
  movaps %xmm1,0x20(%rsp)
  call   <ipAddressLevel@plt>
  mov    0x10(%rbp),%rbp
  mov    %eax,0xc(%rsp)
  test   %rbp,%rbp
  jne    L104
  nopw   0x0(%rax,%rax,1)
L87:
  mov    0x18(%rsp),%rbp
L134:
  mov    %rbp,%rdi
  call   <freeifaddrs@plt>
  cmpq   $0x0,0x20(%rsp)
  je     L133
  mov    D16(%rip),%rax
  lea    0x20(%rsp),%rsi
  mov    $0x10,%ecx
  mov    %r12,%rdx
  mov    (%rax),%rdi
  call   <inet_ntop@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
L79:
  mov    0x478(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x488,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L99:
  mov    %r15,%rdi
  call   <ipAddressLevel@plt>
  cmp    %eax,0xc(%rsp)
  jge    L27
  movdqu (%r15),%xmm2
  mov    %eax,0xc(%rsp)
  movaps %xmm2,0x20(%rsp)
  jmp    L27
L133:
  mov    $0xffffffff,%eax
  jmp    L79
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int getLocalHostIp(char *ip) {
  struct ifaddrs *ifaddrs = NULL;
  if (getifaddrs(&ifaddrs)) {
    return -1;
  }
  struct in_addr res = {0};
  int res_level = 0, tmp_level = 0;
  char ipBuf[64];
  struct ifaddrs *ifa;
  for (ifa = ifaddrs; NULL != ifa; ifa = ifa->ifa_next) {
    char hostname[1025];
    if (ifa->ifa_addr->sa_family == AF_INET) {
      if (!(ifa->ifa_flags & 0x1)) {
        continue;
      }
      if (ifa->ifa_flags & 0x8) {
        continue;
      }
      getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), hostname, 1025, NULL, 0, 0x00000002);
      struct in_addr *addr = &((struct sockaddr_in *)ifa->ifa_addr)->sin_addr;
      if (NULL == inet_ntop(AF_INET, addr, ipBuf, 16)) {
        continue;
      }
      int offset = strcmp(ipBuf, hostname) == 0 ? 0 : 1;
      if (0 == res.s_addr) {
        res = *addr;
        res_level = ipAddressLevel(&res, offset);
      } else if (res_level < (tmp_level = ipAddressLevel(addr, offset))) {
        res = *addr;
        res_level = tmp_level;
      }
    }
  }
  freeifaddrs(ifaddrs);
  if (0 == res.s_addr) {
    return -1;
  } else {
    return NULL == inet_ntop(AF_INET, &res, ip, 16) ? -1 : 0;
  }
}
```