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

```asm
<dd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
L150:
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <dns_domain_equal@plt>
  test   %rax,%rax
  je     L104
  mov    -0x8(%rbp),%eax
  jmp    L126
L104:
  cmpl   $0x3,-0x8(%rbp)
  jle    L86
  mov    $0xffffffff,%eax
  jmp    L126
L86:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jg     L4
  mov    $0xffffffff,%eax
  jmp    L126
L4:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3,%al
  jle    L113
  mov    $0xffffffff,%eax
  jmp    L126
L113:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L109
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L129
L109:
  mov    $0xffffffff,%eax
  jmp    L126
L129:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x1,%al
  jne    L42
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
  addq   $0x2,-0x18(%rbp)
  jmp    L77
L42:
  cmpl   $0x0,-0x4(%rbp)
  jne    L24
  mov    $0xffffffff,%eax
  jmp    L126
L24:
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L168
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L258
L168:
  mov    $0xffffffff,%eax
  jmp    L126
L258:
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2,%al
  jne    L162
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
  addq   $0x3,-0x18(%rbp)
  jmp    L77
L162:
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L257
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L176
L257:
  mov    $0xffffffff,%eax
  jmp    L126
L176:
  mov    -0x4(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  sub    $0x30,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0xff,-0x4(%rbp)
  jbe    L219
  mov    $0xffffffff,%eax
  jmp    L126
L219:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  mov    %dl,(%rax)
  addq   $0x4,-0x18(%rbp)
L77:
  addl   $0x1,-0x8(%rbp)
  jmp    L150
L126:
  leave
  ret
```

assistant: ```c
int dd(const char *q, const char *base, char ip[4]) {
  int j = 0;
  unsigned int x = 0;
  for (j = 0;; ++j) {
    if (dns_domain_equal(q, base))
      return j;
    if (j >= 4)
      return -1;
    if (*q <= 0)
      return -1;
    if (*q >= 4)
      return -1;
    if ((q[1] < '0') || (q[1] > '9'))
      return -1;
    x = q[1] - '0';
    if (*q == 1) {
      ip[j] = x;
      q += 2;
      continue;
    }
    if (!x)
      return -1;
    if ((q[2] < '0') || (q[2] > '9'))
      return -1;
    x = x * 10 + (q[2] - '0');
    if (*q == 2) {
      ip[j] = x;
      q += 3;
      continue;
    }
    if ((q[3] < '0') || (q[3] > '9'))
      return -1;
    x = x * 10 + (q[3] - '0');
    if (x > 255)
      return -1;
    ip[j] = x;
    q += 4;
  }
}
```