user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<inet_network>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    $0xa,%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  movzbl 0x0(%rbp),%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x14(%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    %rax,%r14
  cmp    $0x30,%bl
  jne    L154
L41:
  movzbl 0x1(%rbp),%ebx
  mov    $0x8,%r13d
  add    $0x1,%rbp
L154:
  mov    %ebx,%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  jne    L17
L24:
  movzbl 0x1(%rbp),%ebx
  test   %bl,%bl
  je     L79
  lea    0x2(%rbp),%r13
  xor    %r12d,%r12d
L152:
  movzbl %bl,%r15d
  lea    -0x1(%r13),%rbp
  mov    %r15d,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L185
  mov    %r15d,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  jne    L47
L89:
  movzbl 0x0(%rbp),%eax
  cmp    $0x2e,%al
  jne    L160
  lea    0x17(%rsp),%rax
  cmp    %rax,%r14
  je     L64
  movzbl 0x1(%rbp),%ebx
  add    $0x1,%r14
  add    $0x1,%rbp
  mov    %r12b,-0x1(%r14)
  mov    $0xa,%r13d
  cmp    $0x30,%bl
  je     L41
  mov    %ebx,%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  je     L24
L17:
  test   %bl,%bl
  je     L79
  xor    %r12d,%r12d
L28:
  movzbl %bl,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L89
  mov    %r12d,%eax
  add    $0x1,%rbp
  imul   %r13d,%eax
  mov    %eax,%r12d
  lea    -0x30(%rbx,%r12,1),%r12d
  movzbl 0x0(%rbp),%ebx
  test   %bl,%bl
  jne    L28
  cs nopw 0x0(%rax,%rax,1)
L159:
  mov    %r12d,%ebx
L79:
  mov    %bl,(%r14)
  add    $0x1,%r14
  sub    0x8(%rsp),%r14
  test   %r14b,%r14b
  jle    L87
  sub    $0x1,%r14d
  movsbq %r14b,%r14
  movzbl 0x14(%rsp,%r14,1),%eax
  jmp    L121
  nopl   0x0(%rax,%rax,1)
L185:
  shl    $0x4,%r12d
  lea    -0x30(%rbx,%r12,1),%r12d
L198:
  movzbl 0x0(%r13),%ebx
  add    $0x1,%r13
  test   %bl,%bl
  jne    L152
  jmp    L159
L160:
  mov    %r12d,%ebx
  test   %al,%al
  je     L79
  movzbl %al,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L79
  nop
L64:
  mov    D5(%rip),%rax
  movzbl (%rax),%eax
L121:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L114
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L47:
  mov    %r15d,%edi
  shl    $0x4,%r12d
  call   <islower@plt>
  lea    0xa(%rbx,%r12,1),%r12d
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0xffffffe0,%eax
  add    $0x61,%eax
  sub    %eax,%r12d
  jmp    L198
L87:
  xor    %eax,%eax
  jmp    L121
L114:
  call   <__stack_chk_fail@plt>
```

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);
}
```