user: What would the C source look like for the assembly code provided here:

```asm
<sock_cmpaddr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L11
  cmpq   $0x0,-0x30(%rbp)
  je     L11
  mov    $0xffffffff,%eax
  jmp    L98
L11:
  cmpq   $0x0,-0x30(%rbp)
  jne    L206
  cmpq   $0x0,-0x28(%rbp)
  je     L206
  mov    $0x1,%eax
  jmp    L98
L206:
  cmpq   $0x0,-0x28(%rbp)
  jne    L172
  cmpq   $0x0,-0x30(%rbp)
  jne    L172
  mov    $0x0,%eax
  jmp    L98
L172:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  je     L63
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  jmp    L98
L63:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x80,%eax
  je     L80
  cmp    $0x81,%eax
  jne    L115
  cmpl   $0x0,-0x34(%rbp)
  je     L70
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  je     L70
  mov    -0x18(%rbp),%eax
  sub    -0x14(%rbp),%eax
  jmp    L98
L70:
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x4,-0x1c(%rbp)
  jmp    L135
L80:
  cmpl   $0x0,-0x34(%rbp)
  je     L167
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  je     L167
  mov    -0x18(%rbp),%eax
  sub    -0x14(%rbp),%eax
  jmp    L98
L167:
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x4,-0x1c(%rbp)
  jmp    L135
L115:
  mov    $0xffffffff,%eax
  jmp    L98
L135:
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%rcx
  mov    -0x10(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
L98:
  leave
  ret
```

assistant: ```c
int sock_cmpaddr(const struct sockaddr *addr1, const struct sockaddr *addr2, int cmpport) {
  uint8_t *s1, *s2;
  int p1, p2;
  int slen;
  if (!addr1 && addr2) {
    return -1;
  }
  if (!addr2 && addr1) {
    return 1;
  }
  if (!addr1 && !addr2)
    return 0;
  if (addr1->sa_family != addr2->sa_family) {
    return addr1->sa_family - addr2->sa_family;
  }
  switch (addr1->sa_family) {
  case AF_INET:
    if (cmpport) {
      p1 = ((struct sockaddr_in *)addr1)->sin_port;
      p2 = ((struct sockaddr_in *)addr2)->sin_port;
      if (p1 != p2)
        return p1 - p2;
    }
    s1 = (uint8_t *)&(((struct sockaddr_in *)addr1)->sin_addr);
    s2 = (uint8_t *)&(((struct sockaddr_in *)addr2)->sin_addr);
    slen = sizeof(struct in_addr);
    break;
  case AF_INET6:
    if (cmpport) {
      p1 = ((struct sockaddr_in6 *)addr1)->sin6_port;
      p2 = ((struct sockaddr_in6 *)addr2)->sin6_port;
      if (p1 != p2)
        return p1 - p2;
    }
    s1 = (uint8_t *)&(((struct sockaddr_in6 *)addr1)->sin6_addr);
    s2 = (uint8_t *)&(((struct sockaddr_in6 *)addr2)->sin6_addr);
    slen = sizeof(struct in6_addr);
    break;
  default:
    return -1;
  }
  return memcmp(s1, s2, slen);
}
```