user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<host_is_host_with_port>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r14
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <assert@plt>
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <host_is_ipv6_with_port@plt>
  test   %eax,%eax
  js     L132
  mov    %eax,%ebx
  mov    $0x0,%ebp
  je     L118
L28:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L62
  mov    %ebx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L118:
  mov    $0x3a,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L28
  lea    0x4(%rsp),%rdx
  mov    %r14,%rsi
  mov    D3(%rip),%rax
  mov    (%rax),%edi
  call   <inet_pton@plt>
  mov    $0x0,%ebp
  cmp    $0x1,%eax
  je     L28
  mov    %r14,%rdi
  call   <strdup@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L189
  mov    %rax,%r14
  mov    $0x0,%r15d
  jmp    L154
L173:
  lea    0x1(%rax),%r14
  mov    %rax,%r15
L154:
  mov    $0x3a,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L173
  movb   $0x0,(%r15)
  mov    %r14,%r15
  jmp    L72
L124:
  add    $0x1,%r15
L72:
  movsbl (%r15),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L124
  cmpb   $0x0,(%r15)
  jne    L28
  cmpb   $0x0,(%r14)
  je     L28
  test   %r12,%r12
  je     L106
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,(%r12)
  test   %rax,%rax
  je     L189
L106:
  mov    $0x1,%ebx
  test   %r13,%r13
  je     L28
  mov    %r14,%rdi
  call   <strdup@plt>
  mov    %rax,0x0(%r13)
  test   %rax,%rax
  je     L39
  mov    $0x1,%ebx
  jmp    L28
L39:
  mov    (%r12),%rdi
  call   <free@plt>
L189:
  mov    $0xffffffff,%ebx
  jmp    L28
L132:
  mov    $0xffffffff,%ebx
  mov    $0x0,%ebp
  jmp    L28
L62:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int host_is_host_with_port(const char *host, char **addr, char **port) {
  char *str = NULL;
  int rv = -1;
  int is_host_with_port = 0;
  int ret;
  assert(host);
  if ((ret = host_is_ipv6_with_port(host, addr, port)) < 0)
    goto cleanup;
  if (ret) {
    rv = ret;
    goto cleanup;
  }
  if (strchr(host, ':')) {
    struct sockaddr_in6 saddr;
    char *addrptr;
    char *portptr;
    char *lastcolonptr = NULL;
    char *tmp;
    if (inet_pton(AF_INET6, host, &saddr) == 1)
      goto out;
    if (!(str = strdup(host)))
      goto cleanup;
    addrptr = str;
    portptr = addrptr;
    while ((tmp = strchr(portptr, ':'))) {
      lastcolonptr = tmp;
      portptr = tmp + 1;
    }
    *lastcolonptr = '\0';
    tmp = portptr;
    while (isdigit(*tmp))
      tmp++;
    if (*tmp == '\0' && strlen(portptr)) {
      is_host_with_port = 1;
      if (addr) {
        if (!(*addr = strdup(addrptr)))
          goto cleanup;
      }
      if (port) {
        if (!(*port = strdup(portptr))) {
          free(*addr);
          goto cleanup;
        }
      }
    }
  }
out:
  rv = is_host_with_port;
cleanup:
  free(str);
  return (rv);
}
```