user: Converte this assembly snippet into its equivalent C code:

```asm
<inet_network>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x14(%rsp),%r15
  jmp    L200
L225:
  add    $0x2,%rbx
  movb   $0x10,0xf(%rsp)
L9:
  movzbl (%rbx),%ebp
  lea    0x1(%rbx),%r13
  mov    $0x0,%r12d
  test   %bpl,%bpl
  je     L41
L205:
  lea    -0x1(%r13),%rbx
  movsbl %bpl,%r14d
  mov    %r14d,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L176
  cmpb   $0x10,0xf(%rsp)
  jne    L165
  mov    %r14d,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  jne    L115
L165:
  movzbl (%rbx),%eax
  cmp    $0x2e,%al
  jne    L192
  lea    0x18(%rsp),%rax
  cmp    %rax,%r15
  je     L116
  add    $0x1,%r15
  mov    %r12b,-0x1(%r15)
  add    $0x1,%rbx
L200:
  movb   $0xa,0xf(%rsp)
  cmpb   $0x30,(%rbx)
  jne    L9
  movzbl 0x1(%rbx),%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  je     L225
  add    $0x1,%rbx
  movb   $0x8,0xf(%rsp)
  jmp    L9
L176:
  mov    %r12d,%eax
  mulb   0xf(%rsp)
  mov    %eax,%r12d
  lea    -0x30(%rbp,%r12,1),%r12d
  mov    %r13,%rbx
L122:
  movzbl (%rbx),%ebp
  add    $0x1,%r13
  test   %bpl,%bpl
  jne    L205
  jmp    L165
L115:
  shl    $0x4,%r12d
  mov    %r14d,%edi
  call   <islower@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0xffffffe0,%eax
  add    $0x61,%eax
  lea    0xa(%r12,%rbp,1),%r12d
  sub    %eax,%r12d
  mov    %r13,%rbx
  jmp    L122
L41:
  mov    %ebp,%r12d
  jmp    L165
L116:
  mov    D3(%rip),%rax
  movzbl (%rax),%eax
L19:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L61
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L192:
  test   %al,%al
  jne    L119
L29:
  mov    %r12b,(%r15)
  lea    0x20(%rsp),%rax
  sub    %rax,%r15
  lea    0xd(%r15),%rdx
  cmp    $0x4,%dl
  jg     L46
  movsbl %dl,%ecx
  mov    $0x0,%eax
  test   %ecx,%ecx
  jle    L19
L132:
  add    $0x1,%eax
  cmp    %ecx,%eax
  jne    L132
  movsbl %dl,%eax
  sub    $0x1,%eax
  cltq
  movzbl 0x14(%rsp,%rax,1),%eax
  jmp    L19
L119:
  movsbl %al,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L29
  mov    D3(%rip),%rax
  movzbl (%rax),%eax
  jmp    L19
L46:
  mov    D3(%rip),%rax
  movzbl (%rax),%eax
  jmp    L19
L61:
  call   <__stack_chk_fail@plt>
```

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