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

```asm
<inet_network>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x30,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  lea    -0x2c(%rbp),%rax
  mov    %rax,-0x38(%rbp)
L128:
  mov    $0x0,%ebx
  mov    $0xa,%r13d
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L123
  mov    $0x8,%r13d
  addq   $0x1,-0x48(%rbp)
L123:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L151
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L69
L151:
  mov    $0x10,%r13d
  addq   $0x1,-0x48(%rbp)
  jmp    L69
L15:
  mov    %r12d,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L74
  mov    %ebx,%eax
  mov    %r13d,%edx
  imul   %edx,%eax
  mov    %r12d,%edx
  add    %edx,%eax
  sub    $0x30,%eax
  mov    %eax,%ebx
  addq   $0x1,-0x48(%rbp)
  jmp    L69
L74:
  cmp    $0x10,%r13b
  jne    L116
  mov    %r12d,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L116
  mov    %ebx,%eax
  shl    $0x4,%eax
  mov    %eax,%ebx
  mov    %r12d,%r14d
  mov    %r12d,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <islower@plt>
  test   %rax,%rax
  je     L188
  mov    $0x61,%edx
  jmp    L45
L188:
  mov    $0x41,%edx
L45:
  mov    %r14d,%eax
  sub    %edx,%eax
  add    %ebx,%eax
  add    $0xa,%eax
  mov    %eax,%ebx
  addq   $0x1,-0x48(%rbp)
  nop
L69:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%r12d
  test   %r12b,%r12b
  jne    L15
  jmp    L133
L116:
  nop
L133:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L82
  lea    -0x2c(%rbp),%rax
  add    $0x3,%rax
  cmp    %rax,-0x38(%rbp)
  jb     L92
  mov    D13(%rip),%rax
  movzbl (%rax),%eax
  jmp    L209
L92:
  mov    -0x38(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    %bl,(%rax)
  addq   $0x1,-0x48(%rbp)
  jmp    L128
L82:
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L107
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L107
  mov    D13(%rip),%rax
  movzbl (%rax),%eax
  jmp    L209
L107:
  mov    -0x38(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  mov    %bl,(%rax)
  lea    -0x2c(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  sub    %rdx,%rax
  mov    %eax,%r13d
  mov    $0x0,%ebx
  mov    $0x0,%r12d
  jmp    L185
L32:
  movsbl %bl,%eax
  shl    $0x8,%eax
  mov    %eax,%ebx
  movsbl %r12b,%eax
  cltq
  movzbl -0x2c(%rbp,%rax,1),%eax
  or     %eax,%ebx
  mov    %r12d,%eax
  add    $0x1,%eax
  mov    %eax,%r12d
L185:
  cmp    %r13b,%r12b
  jl     L32
  mov    %ebx,%eax
L209:
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L109
  call   <__stack_chk_fail@plt>
L109:
  add    $0x30,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
```

assistant: ```c
in_addr_t inet_network(const char *cp) {
  register u_long val, base, n, i;
  register char c;
  u_long parts[4], *pp = parts;
again:
  val = 0;
  base = 10;
  if (*cp == '0')
    base = 8, cp++;
  if (*cp == 'x' || *cp == 'X')
    base = 16, cp++;
  while ((c = *cp) != 0) {
    if (isdigit((unsigned char)c)) {
      val = (val * base) + (c - '0');
      cp++;
      continue;
    }
    if (base == 16 && isxdigit((unsigned char)c)) {
      val = (val << 4) + (c + 10 - (islower((unsigned char)c) ? 'a' : 'A'));
      cp++;
      continue;
    }
    break;
  }
  if (*cp == '.') {
    if (pp >= parts + 3)
      return (INADDR_NONE);
    *pp++ = val, cp++;
    goto again;
  }
  if (*cp && !isspace((unsigned char)*cp))
    return (INADDR_NONE);
  *pp++ = val;
  n = pp - parts;
  for (val = 0, i = 0; i < n; i++) {
    val <<= 8;
    val |= parts[i] & 0xff;
  }
  return (val);
}
```