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

```asm
<scan_ip6>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  mov    $0x2,%r15d
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  xor    %r12d,%r12d
  mov    %r13d,%r14d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movups %xmm0,(%rsi)
  cmpb   $0x3a,0x0(%rbp)
  lea    0x38(%rsp),%rsi
  jne    L234
  cmpb   $0x3a,0x1(%rbp)
  je     L118
L186:
  add    $0x1,%r12d
  add    $0x1,%rbp
L234:
  mov    $0x10,%edx
  mov    %rbp,%rdi
  mov    %rsi,0x8(%rsp)
  call   <strtoul@plt>
  mov    0x38(%rsp),%rdx
  mov    0x8(%rsp),%rsi
  sub    %rbp,%rdx
  test   %edx,%edx
  mov    %edx,%r14d
  je     L57
  mov    %edx,%ecx
  lea    (%rcx,%rbp,1),%rdi
  cmp    $0xc,%r13
  je     L124
  movzbl %ah,%ecx
  mov    %al,0x1(%rbx,%r13,1)
  add    %edx,%r12d
  mov    %cl,(%rbx,%r13,1)
  cmp    $0x10,%r15d
  je     L151
L156:
  mov    %rdi,%rbp
  add    $0x2,%r13
  add    $0x2,%r15d
  cmpb   $0x3a,0x0(%rbp)
  mov    %r13d,%r14d
  jne    L234
  cmpb   $0x3a,0x1(%rbp)
  jne    L186
L118:
  lea    0x2(%rbp),%rdi
  add    $0x2,%r12d
  lea    0x38(%rsp),%r8
  xor    %r15d,%r15d
L160:
  cmpb   $0x3a,(%rdi)
  mov    %r15d,%ebp
  je     L96
  test   %r15,%r15
  je     L86
L177:
  lea    0x40(%rsp),%r13
L36:
  mov    $0x10,%esi
  xor    %eax,%eax
  sub    %ebp,%esi
  nop
L139:
  movzbl 0x0(%r13,%rax,1),%ecx
  lea    (%rsi,%rax,1),%edx
  add    $0x1,%rax
  mov    %cl,(%rbx,%rdx,1)
  cmp    %eax,%ebp
  ja     L139
L151:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L119
  add    $0x68,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L124:
  cmpb   $0x2e,(%rdi)
  je     L51
  mov    %ah,0xc(%rbx)
  add    %edx,%r12d
  mov    %al,0xd(%rbx)
  jmp    L156
  nopw   0x0(%rax,%rax,1)
L96:
  test   %r15,%r15
  je     L151
  add    $0x1,%rdi
  add    $0x1,%r12d
  nopl   (%rax)
L86:
  mov    $0x10,%edx
  mov    %r8,%rsi
  mov    %r8,0x10(%rsp)
  mov    %rdi,0x8(%rsp)
  call   <strtol@plt>
  mov    0x8(%rsp),%rdi
  mov    0x10(%rsp),%r8
  mov    %rax,%rdx
  mov    0x38(%rsp),%rax
  mov    %rax,%r9
  sub    %rdi,%r9
  cmp    %edi,%eax
  je     L179
  mov    %r9d,%ecx
  lea    0x0(%rbp,%r14,1),%eax
  add    %rdi,%rcx
  cmp    $0xc,%eax
  jbe    L226
L54:
  add    $0x2,%ebp
  movzbl %dh,%eax
  mov    %dl,0x41(%rsp,%r15,1)
  lea    0x40(%rsp),%r13
  lea    (%r14,%rbp,1),%edi
  mov    %al,0x40(%rsp,%r15,1)
  add    %r9d,%r12d
  add    $0x2,%r15
  cmp    $0x10,%edi
  je     L36
L143:
  mov    %rcx,%rdi
  jmp    L160
L226:
  cmpb   $0x2e,(%rcx)
  jne    L54
  lea    0x40(%rsp),%r13
  mov    %r8,0x28(%rsp)
  lea    0x0(%r13,%r15,1),%rsi
  mov    %rcx,0x20(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %r9,0x10(%rsp)
  mov    %rdi,0x8(%rsp)
  call   <inet_aton@plt>
  mov    0x8(%rsp),%rdi
  mov    0x10(%rsp),%r9
  test   %rax,%rax
  mov    0x18(%rsp),%rdx
  mov    0x20(%rsp),%rcx
  mov    0x28(%rsp),%r8
  jne    L215
  mov    $0xc,%r14d
  movzbl %dh,%eax
  mov    %dl,0x41(%rsp,%r15,1)
  add    %r9d,%r12d
  mov    %al,0x40(%rsp,%r15,1)
  sub    %ebp,%r14d
  add    $0x2,%r15
  jmp    L143
L51:
  lea    0xc(%rbx),%rsi
  mov    %rbp,%rdi
  add    %r14d,%r12d
  call   <inet_aton@plt>
  test   %rax,%rax
  jne    L151
L57:
  xor    %r12d,%r12d
  jmp    L151
L179:
  cmpb   $0x1,(%rdi)
  adc    $0xffffffff,%r12d
  test   %ebp,%ebp
  je     L151
  jmp    L177
L215:
  call   <strlen@plt>
  add    $0x4,%ebp
  add    %eax,%r12d
  jmp    L36
L119:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned int scan_ip6(const char *s, char ip[16]) {
  unsigned int i;
  unsigned int len = 0;
  unsigned long u;
  char suffix[16];
  unsigned int prefixlen = 0;
  unsigned int suffixlen = 0;
  for (i = 0; i < 16; i++)
    ip[i] = 0;
  for (;;) {
    if (*s == ':') {
      len++;
      if (s[1] == ':') {
        s += 2;
        len++;
        break;
      }
      s++;
    }
    {
      char *tmp;
      u = strtoul(s, &tmp, 16);
      i = tmp - s;
    }
    if (!i)
      return 0;
    if (prefixlen == 12 && s[i] == '.') {
      if (inet_aton(s, (struct in_addr *)(ip + 12)))
        return i + len;
      else
        return 0;
    }
    ip[prefixlen++] = (u >> 8);
    ip[prefixlen++] = (u & 255);
    s += i;
    len += i;
    if (prefixlen == 16)
      return len;
  }
  for (;;) {
    if (*s == ':') {
      if (suffixlen == 0)
        break;
      s++;
      len++;
    } else if (suffixlen != 0)
      break;
    {
      char *tmp;
      u = strtol(s, &tmp, 16);
      i = tmp - s;
    }
    if (!i) {
      if (*s)
        len--;
      break;
    }
    if (suffixlen + prefixlen <= 12 && s[i] == '.') {
      if (inet_aton(s, (struct in_addr *)(suffix + suffixlen))) {
        suffixlen += 4;
        len += strlen(s);
        break;
      } else
        prefixlen = 12 - suffixlen;
    }
    suffix[suffixlen++] = (u >> 8);
    suffix[suffixlen++] = (u & 255);
    s += i;
    len += i;
    if (prefixlen + suffixlen == 16)
      break;
  }
  for (i = 0; i < suffixlen; i++)
    ip[16 - suffixlen + i] = suffix[i];
  return len;
}
```