user: 这段汇编代码用C语言表示是什么样的:

```asm
<compare_dnsname>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L150
  cmpq   $0x0,-0x40(%rbp)
  jne    L265
L150:
  mov    $0xffffffff,%eax
  jmp    L298
L265:
  mov    -0x30(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  jne    L182
  mov    -0x30(%rbp),%rax
  movsbl %al,%edx
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L182
  mov    $0x0,%eax
  jmp    L298
L182:
  mov    -0x30(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L4
  mov    -0x40(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L22
L4:
  mov    $0xffffffff,%eax
  jmp    L298
L320:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3f,%al
  jg     L221
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3f,%al
  jle    L253
L221:
  mov    $0xffffffff,%eax
  jmp    L298
L253:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbq %al,%rax
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  cmp    %rax,%rdx
  ja     L184
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbq %al,%rax
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  cmp    %rax,%rdx
  jbe    L218
L184:
  mov    $0xffffffff,%eax
  jmp    L298
L218:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L40
  mov    -0x30(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x28(%rbp)
  je     L39
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x30(%rbp),%rax
  lea    -0x1(%rax),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  cmp    %rax,%rdx
  jne    L323
  mov    -0x14(%rbp),%eax
  jmp    L298
L323:
  mov    $0xffffffff,%eax
  jmp    L298
L40:
  cmpl   $0x0,-0x18(%rbp)
  jne    L146
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L246
  mov    -0x40(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x38(%rbp)
  jne    L168
  movl   $0x1,-0x18(%rbp)
  jmp    L146
L168:
  mov    -0x38(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x40(%rbp),%rax
  lea    -0x1(%rax),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  cmp    %rax,%rdx
  jne    L191
  movl   $0x1,-0x14(%rbp)
  movl   $0x1,-0x18(%rbp)
  jmp    L146
L191:
  mov    $0xffffffff,%eax
  jmp    L298
L246:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L138
  movl   $0x1,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L146
L138:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x38(%rbp),%rdx
  lea    0x1(%rdx),%rsi
  mov    -0x28(%rbp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L146
  movl   $0x1,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
L146:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbq %al,%rax
  add    $0x1,%rax
  add    %rax,-0x28(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jne    L28
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    $0x1,%eax
  cltq
  jmp    L98
L28:
  mov    $0x0,%eax
L98:
  add    %rax,-0x38(%rbp)
L22:
  mov    -0x10(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x28(%rbp)
  jae    L312
  mov    -0x8(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x38(%rbp)
  jb     L320
  jmp    L312
L39:
  nop
L312:
  mov    -0x14(%rbp),%eax
L298:
  leave
  ret
```

assistant: ```c
int compare_dnsname(const char *s, size_t slen, const char *n, size_t nlen) {
  const char *s0 = s, *n0 = n;
  int done = 0, retcode = 0;
  if (slen < 1 || nlen < 1)
    return -1;
  if (slen == nlen && memcmp(s, n, slen) == 0)
    return 0;
  if (*(s0 + slen - 1) || *(n0 + nlen - 1))
    return -1;
  while (s < s0 + slen && n < n0 + nlen) {
    if (*s >= 0x40 || *n >= 0x40)
      return -1;
    if (s + *s + 1 > s0 + slen || n + *n + 1 > n0 + nlen)
      return -1;
    if (*s == '\0') {
      if (s == s0 + slen - 1)
        break;
      else if (s + 1 == s0 + slen - 1)
        return retcode;
      else
        return -1;
    }
    if (!done) {
      if (*n == '\0') {
        if (n == n0 + nlen - 1) {
          done = 1;
        } else if (n + 1 == n0 + nlen - 1) {
          retcode = 1;
          done = 1;
        } else
          return -1;
      } else {
        if (*s != *n) {
          done = 1;
          retcode = 1;
        } else {
          if (memcmp(s + 1, n + 1, *s)) {
            done = 1;
            retcode = 1;
          }
        }
      }
    }
    s += *s + 1;
    n += done ? 0 : (*n + 1);
  }
  return retcode;
}
```