user: Demonstrate the C code that generates the assembly output below:

```asm
<parse_host>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %r9,-0x60(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x10(%rbp)
  movq   $0xffffffffffffffff,-0x20(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L27
  mov    -0x10(%rbp),%rax
  sub    -0x38(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x20(%rbp)
L27:
  mov    -0x28(%rbp),%rax
  sub    $0x1,%rax
  cmp    %rax,-0x20(%rbp)
  jae    L12
  mov    -0x28(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  je     L12
  mov    -0x28(%rbp),%rax
  sub    -0x20(%rbp),%rax
  mov    -0x58(%rbp),%rdx
  cmp    %rax,%rdx
  cmovbe %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x50(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x28(%rbp)
L12:
  cmpq   $0x1,-0x28(%rbp)
  jbe    L13
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5b,%al
  jne    L13
  mov    -0x28(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L13
  mov    -0x28(%rbp),%rax
  lea    -0x2(%rax),%rdx
  mov    -0x48(%rbp),%rax
  cmp    %rdx,%rax
  cmova  %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    -0x18(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    -0x60(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L56
L13:
  mov    -0x48(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  cmp    %rax,%rdx
  cmovbe %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x38(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x60(%rbp),%rax
  movl   $0x0,(%rax)
L56:
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void parse_host(const char *host, char *parsed_hostname, size_t parsed_hostname_size, char *parsed_port, size_t parsed_port_size, int *parsed_family) {
  size_t len = strlen(host);
  char *p = strrchr(host, ':');
  ssize_t offset = -1;
  if (p != NULL)
    offset = p - host + 1;
  if (offset >= 0 && offset < len - 1 && host[len - 1] != ']') {
    size_t parsed_pos_len = ((len - offset) < (parsed_port_size) ? (len - offset) : (parsed_port_size));
    strncpy(parsed_port, host + offset, parsed_pos_len);
    parsed_port[parsed_pos_len] = 0;
    len = offset - 1;
  }
  size_t parsed_hostname_len;
  if (len >= 2 && host[0] == '[' && host[len - 1] == ']') {
    parsed_hostname_len = ((len - 2) < (parsed_hostname_size) ? (len - 2) : (parsed_hostname_size));
    strncpy(parsed_hostname, host + 1, parsed_hostname_len);
    *parsed_family = AF_INET6;
  } else {
    parsed_hostname_len = ((len) < (parsed_hostname_size) ? (len) : (parsed_hostname_size));
    strncpy(parsed_hostname, host, parsed_hostname_len);
    *parsed_family = 0;
  }
  parsed_hostname[parsed_hostname_len] = 0;
}
```