user: Please show me the C implementation that matches the assembly code listed below:

```asm
<prefix_pton>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    D35(%rip),%rax
  movslq (%rax),%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L199:
  cmp    %rdx,%rsp
  je     L173
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L199
L173:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L93
  orq    $0x0,-0x8(%rsp,%rax,1)
L93:
  mov    %rsp,%r15
  mov    $0x2f,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L190
  lea    0x1(%rax),%r14
  mov    %r14,%rdi
  call   <strlen@plt>
  lea    -0x1(%rax),%rdx
  mov    $0x0,%eax
  cmp    $0x2,%rdx
  ja     L217
  movzbl 0x1(%r13),%eax
  test   %al,%al
  je     L149
  mov    %r14,%rdx
L216:
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L96
  add    $0x1,%rdx
  movzbl (%rdx),%eax
  test   %al,%al
  jne    L216
L149:
  mov    %r14,%rdi
  call   <atoi@plt>
  mov    %eax,%r14d
  sub    %rbx,%r13
  mov    D35(%rip),%rax
  movslq (%rax),%rdx
  mov    $0x0,%eax
  cmp    %r13,%rdx
  jbe    L217
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <memcpy@plt>
  movb   $0x0,(%r15,%r13,1)
  mov    %r12,%rdx
  mov    %r15,%rsi
  mov    D29(%rip),%rax
  mov    (%rax),%edi
  call   <inet_pton@plt>
  cmp    $0x1,%eax
  jne    L127
  cmp    $0x80,%r14d
  jg     L212
  mov    -0x48(%rbp),%rbx
  mov    %r14d,(%rbx)
  jmp    L217
L190:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rax,%r14
  mov    D35(%rip),%rax
  movslq (%rax),%rdx
  mov    $0x0,%eax
  cmp    %rdx,%r14
  jae    L217
  mov    %r14,%rdx
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <memcpy@plt>
  movb   $0x0,(%r15,%r14,1)
  mov    -0x48(%rbp),%rax
  movl   $0x80,(%rax)
  mov    %r12,%rdx
  mov    %r15,%rsi
  mov    D29(%rip),%rax
  mov    (%rax),%edi
  call   <inet_pton@plt>
  cmp    $0x1,%eax
  je     L217
  mov    0x8(%r12),%rax
  lea    0xc0(%rax),%rdx
  mov    %r15,%rsi
  mov    D53(%rip),%rax
  mov    (%rax),%edi
  call   <inet_pton@plt>
  mov    %eax,%edx
  mov    $0x0,%eax
  cmp    $0x1,%edx
  jne    L217
  test   %r13,%r13
  je     L30
  mov    $0x80,%r14d
L91:
  mov    $0x0,%eax
  cmp    $0x20,%r14d
  jg     L217
  lea    0x60(%r14),%eax
  mov    -0x48(%rbp),%rbx
  mov    %eax,(%rbx)
L30:
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    (%r12),%rax
  movl   $0xffff,0x14(%rax)
  mov    $0x1,%eax
  jmp    L217
L96:
  mov    $0x0,%eax
L217:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L34
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L212:
  mov    $0x0,%eax
  jmp    L217
L127:
  mov    0x8(%r12),%rax
  lea    0xc0(%rax),%rdx
  mov    %r15,%rsi
  mov    D53(%rip),%rax
  mov    (%rax),%edi
  call   <inet_pton@plt>
  cmp    $0x1,%eax
  je     L91
  mov    $0x0,%eax
  jmp    L217
L34:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int prefix_pton(const char *src, struct in6_addr *addr, uint8_t *plen) {
  char buf[INET6_ADDRSTRLEN];
  char *slash = strchr(src, '/'), *c;
  uint8_t parsed_len = 128;
  size_t addrlen;
  if (slash) {
    addrlen = strlen(slash + 1);
    if (!addrlen || addrlen > 3)
      return 0;
    for (c = slash + 1; *c; c++) {
      if (*c < '0' || *c > '9')
        return 0;
    }
    parsed_len = atoi(slash + 1);
    addrlen = slash - src;
  } else {
    addrlen = strlen(src);
  }
  if (addrlen >= INET6_ADDRSTRLEN)
    return 0;
  memcpy(buf, src, addrlen);
  buf[addrlen] = 0;
  if (!slash)
    *plen = 128;
  if (inet_pton(AF_INET6, buf, addr) == 1) {
    if (slash) {
      if (parsed_len > 128)
        return 0;
      *plen = parsed_len;
    }
  } else if (inet_pton(AF_INET, buf, &addr->s6_addr[12]) == 1) {
    if (slash) {
      if (parsed_len > 32)
        return 0;
      *plen = parsed_len + 96;
    }
    memset(addr, 0, 10);
    addr->s6_addr16[5] = 0xffff;
  } else {
    return 0;
  }
  return 1;
}
```