user: 请从给定的汇编指令推导出C源代码：

```asm
<check_bus_or_interface_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L6
  cmpq   $0xff,-0x8(%rbp)
  jbe    L44
L6:
  mov    $0x0,%eax
  jmp    L10
L44:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x1,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L68
L238:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jle    L35
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7a,%al
  jle    L218
L35:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L271
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5a,%al
  jg     L271
L218:
  mov    $0x1,%eax
  jmp    L7
L271:
  mov    $0x0,%eax
L7:
  mov    %eax,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L43
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jg     L43
  mov    $0x1,%eax
  jmp    L293
L43:
  mov    $0x0,%eax
L293:
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L140
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L283
  addl   $0x1,-0x20(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L125
L283:
  cmpl   $0x0,-0x18(%rbp)
  jne    L125
  cmpl   $0x0,-0x14(%rbp)
  jne    L125
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L125
  cmpl   $0x0,-0x2c(%rbp)
  je     L59
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L125
L59:
  mov    $0x0,%eax
  jmp    L10
L140:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L194
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  sete   %al
  movzbl %al,%eax
  jmp    L10
L194:
  cmpl   $0x0,-0x18(%rbp)
  jne    L79
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L79
  cmpl   $0x0,-0x2c(%rbp)
  je     L153
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L79
L153:
  mov    $0x0,%eax
  jmp    L10
L79:
  movl   $0x1,-0x1c(%rbp)
L125:
  addq   $0x1,-0x10(%rbp)
L68:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L238
  cmpl   $0x0,-0x1c(%rbp)
  je     L33
  cmpl   $0x1,-0x20(%rbp)
  jle    L33
  mov    $0x1,%eax
  jmp    L10
L33:
  mov    $0x0,%eax
L10:
  leave
  ret
```

assistant: ```c
int check_bus_or_interface_name(const char *name, int hyphens_allowed) {
  unsigned long length = strlen(name);
  if (length == 0 || length > 255)
    return 0;
  const char *p = name;
  int segments = 1;
  int in_segment = 0;
  while (*p) {
    int alpha = (*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z');
    int digit = *p >= '0' && *p <= '9';
    if (in_segment) {
      if (*p == '.') {
        ++segments;
        in_segment = 0;
      } else if (!alpha && !digit && *p != '_' && (!hyphens_allowed || *p != '-')) {
        return 0;
      }
    } else {
      if (*p == '*') {
        return *(p + 1) == '\0';
      } else if (!alpha && *p != '_' && (!hyphens_allowed || *p != '-')) {
        return 0;
      }
      in_segment = 1;
    }
    ++p;
  }
  return in_segment && segments >= 2;
}
```