user: 请将以下的汇编代码转换成C语言代码:

```asm
<inet_aton>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  movzbl (%rdi),%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    %rax,(%rsp)
L156:
  movsbl %bpl,%r15d
  mov    %r15d,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L4
  mov    $0xa,%r14d
  cmp    $0x30,%bpl
  je     L33
L13:
  add    $0x1,%rbx
  xor    %r12d,%r12d
  jmp    L129
  nopl   0x0(%rax)
L88:
  cmp    $0x10,%r14d
  jne    L238
  mov    %r15d,%edi
  call   <isascii@plt>
  test   %rax,%rax
  je     L238
  mov    %r15d,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L238
  mov    %r15d,%edi
  shl    $0x4,%r12d
  lea    0xa(%r15),%ebp
  call   <islower@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0xffffffe0,%eax
  add    $0x61,%eax
  sub    %eax,%ebp
  or     %ebp,%r12d
  movzbl (%rbx),%ebp
L103:
  add    $0x1,%rbx
  movsbl %bpl,%r15d
L129:
  mov    %r15d,%edi
  lea    -0x1(%rbx),%r13
  call   <isascii@plt>
  test   %rax,%rax
  je     L88
  mov    %r15d,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L88
  imul   %r14d,%r12d
  movzbl (%rbx),%ebp
  lea    -0x30(%r12,%r15,1),%r12d
  jmp    L103
L238:
  cmp    $0x2e,%bpl
  jne    L159
  mov    (%rsp),%rsi
  lea    0x1c(%rsp),%rax
  cmp    %rax,%rsi
  je     L4
  add    $0x4,%rsi
  movzbl 0x1(%r13),%ebp
  lea    0x1(%r13),%rbx
  mov    %r12d,-0x4(%rsi)
  mov    %rsi,(%rsp)
  jmp    L156
  nopw   0x0(%rax,%rax,1)
L33:
  movzbl 0x1(%rbx),%ebp
  mov    %ebp,%eax
  and    $0xffffffdf,%eax
  cmp    $0x58,%al
  je     L342
  add    $0x1,%rbx
  mov    $0x8,%r14d
  movsbl %bpl,%r15d
  jmp    L13
L163:
  mov    %r15d,%edi
  call   <isascii@plt>
  test   %rax,%rax
  je     L4
  mov    %r15d,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L350
  nopl   0x0(%rax)
L4:
  xor    %r12d,%r12d
L272:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L128
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L342:
  movsbl 0x2(%rbx),%r15d
  mov    $0x10,%r14d
  add    $0x2,%rbx
  mov    %r15d,%ebp
  jmp    L13
L159:
  test   %bpl,%bpl
  jne    L163
L350:
  mov    (%rsp),%rax
  sub    0x8(%rsp),%rax
  sar    $0x2,%rax
  add    $0x1,%eax
  cmp    $0x3,%eax
  je     L46
  ja     L187
  test   %eax,%eax
  je     L4
  cmp    $0x2,%eax
  jne    L272
  cmp    $0xffffff,%r12d
  jg     L4
  mov    0x10(%rsp),%eax
  cmp    $0xff,%eax
  jg     L4
  shl    $0x18,%eax
  or     %eax,%r12d
  jmp    L272
  nopl   0x0(%rax,%rax,1)
L187:
  cmp    $0x4,%eax
  jne    L272
  cmp    $0xff,%r12d
  jg     L4
  mov    0x10(%rsp),%eax
  cmp    $0xff,%eax
  jg     L4
  mov    0x14(%rsp),%ecx
  cmp    $0xff,%ecx
  jg     L4
  mov    0x18(%rsp),%edx
  cmp    $0xff,%edx
  jg     L4
  shl    $0x18,%eax
  shl    $0x10,%ecx
  or     %ecx,%eax
  shl    $0x8,%edx
  or     %edx,%eax
  or     %eax,%r12d
  jmp    L272
L46:
  cmp    $0xffff,%r12d
  jg     L4
  mov    0x10(%rsp),%eax
  cmp    $0xff,%eax
  jg     L4
  mov    0x14(%rsp),%edx
  cmp    $0xff,%edx
  jg     L4
  shl    $0x18,%eax
  shl    $0x10,%edx
  or     %edx,%eax
  or     %eax,%r12d
  jmp    L272
L128:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint32_t inet_aton(const char *cp) {
  uint32_t val;
  uint8_t base, n;
  char c;
  uint32_t parts[4];
  uint32_t *pp = parts;
  c = *cp;
  for (;;) {
    if (!isdigit(c))
      return false;
    val = 0;
    base = 10;
    if (c == '0') {
      c = *++cp;
      if (c == 'x' || c == 'X')
        base = 16, c = *++cp;
      else
        base = 8;
    }
    for (;;) {
      if (isascii(c) && isdigit(c)) {
        val = (val * base) + (c - '0');
        c = *++cp;
      } else if (base == 16 && isascii(c) && isxdigit(c)) {
        val = (val << 4) | (c + 10 - (islower(c) ? 'a' : 'A'));
        c = *++cp;
      } else
        break;
    }
    if (c == '.') {
      if (pp >= parts + 3)
        return false;
      *pp++ = val;
      c = *++cp;
    } else
      break;
  }
  if (c != '\0' && (!isascii(c) || !isspace(c)))
    return false;
  n = pp - parts + 1;
  switch (n) {
  case 0:
    return false;
  case 1:
    break;
  case 2:
    if ((val > 0xffffff) || (parts[0] > 0xff))
      return false;
    val |= parts[0] << 24;
    break;
  case 3:
    if ((val > 0xffff) || (parts[0] > 0xff) || (parts[1] > 0xff))
      return false;
    val |= (parts[0] << 24) | (parts[1] << 16);
    break;
  case 4:
    if ((val > 0xff) || (parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff))
      return false;
    val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
    break;
  }
  return (val);
}
```