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

```asm
<get_ip_from_ifname>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %edi,-0x84(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x70(%rbp)
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  lea    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <getifaddrs@plt>
  test   %rax,%rax
  je     L44
  mov    $0x0,%eax
  jmp    L236
L44:
  mov    -0x84(%rbp),%eax
  add    $0xffffff80,%eax
  cmp    $0x1,%eax
  jbe    L229
  mov    $0x0,%eax
  jmp    L236
L229:
  nop
  mov    -0x78(%rbp),%rax
  mov    %rax,-0x68(%rbp)
  jmp    L36
L157:
  mov    -0x68(%rbp),%rax
  mov    0x8(%rax),%rax
  test   %rax,%rax
  je     L7
  mov    -0x68(%rbp),%rax
  mov    (%rax),%edx
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L167
  mov    -0x68(%rbp),%rax
  mov    0x10(%rax),%edx
  mov    -0x90(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L96
  cmpl   $0x81,-0x84(%rbp)
  jne    L67
  mov    -0x68(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    (%rax),%eax
  cmp    $0x81,%eax
  jne    L67
  mov    -0x68(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x60(%rbp)
  mov    -0x60(%rbp),%rsi
  mov    -0x68(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    (%rax),%eax
  lea    -0x50(%rbp),%rdx
  mov    $0x40,%ecx
  mov    %eax,%edi
  call   <inet_ntop@plt>
  test   %rax,%rax
  je     L22
  lea    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x70(%rbp)
  jmp    L225
L67:
  cmpl   $0x80,-0x84(%rbp)
  jne    L172
  mov    -0x68(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    (%rax),%eax
  cmp    $0x80,%eax
  jne    L172
  mov    -0x68(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x58(%rbp),%rsi
  mov    -0x68(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    (%rax),%eax
  lea    -0x50(%rbp),%rdx
  mov    $0x40,%ecx
  mov    %eax,%edi
  call   <inet_ntop@plt>
  test   %rax,%rax
  je     L155
  lea    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x70(%rbp)
  jmp    L225
L7:
  nop
  jmp    L172
L167:
  nop
  jmp    L172
L96:
  nop
L172:
  mov    -0x68(%rbp),%rax
  mov    0x18(%rax),%rax
  mov    %rax,-0x68(%rbp)
L36:
  cmpq   $0x0,-0x68(%rbp)
  jne    L157
  jmp    L225
L22:
  nop
  jmp    L225
L155:
  nop
L225:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <freeifaddrs@plt>
  cmpq   $0x0,-0x70(%rbp)
  je     L189
  mov    -0x70(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L189
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x70(%rbp)
L189:
  mov    -0x70(%rbp),%rax
L236:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L150
  call   <__stack_chk_fail@plt>
L150:
  leave
  ret
```

assistant: ```c
char *get_ip_from_ifname(const int inet_family, const char *const ifname) {
  char *retv = NULL;
  struct ifaddrs *myaddrs;
  struct ifaddrs *ifa;
  struct sockaddr_in *s4;
  struct sockaddr_in6 *s6;
  char buf[64] = {'\0'};
  if (getifaddrs(&myaddrs))
    return NULL;
  switch (inet_family) {
  case AF_INET:
  case AF_INET6:
    break;
  default:
    return NULL;
  }
  for (ifa = myaddrs; ifa != NULL; ifa = ifa->ifa_next) {
    if (NULL == ifa->ifa_addr)
      continue;
    if (0 == (ifa->ifa_flags & IFF_UP))
      continue;
    if (strcmp(ifname, ifa->ifa_name))
      continue;
    if (AF_INET == inet_family) {
      if (ifa->ifa_addr->sa_family == AF_INET) {
        s4 = (struct sockaddr_in *)(ifa->ifa_addr);
        if (inet_ntop(ifa->ifa_addr->sa_family, (void *)&(s4->sin_addr), buf, sizeof(buf)) == NULL) {
          break;
        } else {
          retv = strdup(buf);
          break;
        }
      }
    }
    if (AF_INET6 == inet_family) {
      if (ifa->ifa_addr->sa_family == AF_INET6) {
        s6 = (struct sockaddr_in6 *)(ifa->ifa_addr);
        if (inet_ntop(ifa->ifa_addr->sa_family, (void *)&(s6->sin6_addr), buf, sizeof(buf)) == NULL) {
          break;
        } else {
          retv = strdup(buf);
          break;
        }
      }
    }
  }
  freeifaddrs(myaddrs);
  if (retv && ('\0' == retv[0])) {
    free(retv);
    retv = NULL;
  }
  return retv;
}
```