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

```asm
<ether_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L52
L77:
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <_tolower@plt>
  mov    %al,-0x15(%rbp)
  cmpb   $0x2f,-0x15(%rbp)
  jle    L28
  cmpb   $0x39,-0x15(%rbp)
  jle    L284
L28:
  cmpb   $0x60,-0x15(%rbp)
  jle    L273
  cmpb   $0x66,-0x15(%rbp)
  jle    L284
L273:
  mov    $0xffffffff,%eax
  jmp    L127
L284:
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L174
  movsbl -0x15(%rbp),%eax
  sub    $0x30,%eax
  jmp    L158
L174:
  movsbl -0x15(%rbp),%eax
  sub    $0x57,%eax
L158:
  mov    %eax,-0x14(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <_tolower@plt>
  mov    %al,-0x15(%rbp)
  cmpq   $0x4,-0x10(%rbp)
  ja     L290
  cmpb   $0x3a,-0x15(%rbp)
  jne    L162
L290:
  cmpq   $0x5,-0x10(%rbp)
  jne    L159
  cmpb   $0x0,-0x15(%rbp)
  je     L159
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L159
L162:
  addq   $0x1,-0x28(%rbp)
  cmpb   $0x2f,-0x15(%rbp)
  jle    L173
  cmpb   $0x39,-0x15(%rbp)
  jle    L109
L173:
  cmpb   $0x60,-0x15(%rbp)
  jle    L145
  cmpb   $0x66,-0x15(%rbp)
  jle    L109
L145:
  mov    $0xffffffff,%eax
  jmp    L127
L109:
  shll   $0x4,-0x14(%rbp)
  movsbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L246
  movsbl -0x15(%rbp),%eax
  sub    $0x30,%eax
  jmp    L196
L246:
  movsbl -0x15(%rbp),%eax
  sub    $0x57,%eax
L196:
  add    %eax,-0x14(%rbp)
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  cmpq   $0x4,-0x10(%rbp)
  ja     L159
  cmpb   $0x3a,-0x15(%rbp)
  je     L159
  mov    $0xffffffff,%eax
  jmp    L127
L159:
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  mov    %dl,(%rax)
  cmpb   $0x0,-0x15(%rbp)
  je     L79
  addq   $0x1,-0x28(%rbp)
L79:
  addq   $0x1,-0x10(%rbp)
L52:
  cmpq   $0x5,-0x10(%rbp)
  jbe    L77
  mov    -0x28(%rbp),%rax
  mov    $0x23,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L106
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L106
L111:
  subq   $0x1,-0x8(%rbp)
L106:
  mov    -0x8(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jbe    L143
  mov    -0x8(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L111
L143:
  mov    -0x8(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L103
  mov    $0xffffffff,%eax
  jmp    L127
L103:
  mov    -0x8(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x8(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    $0x0,%eax
L127:
  leave
  ret
```

assistant: ```c
int ether_line(const char *line, struct ether_addr *addr, char *hostname) {
  size_t cnt;
  char *cp;
  for (cnt = 0; cnt < 6; ++cnt) {
    unsigned int number;
    char ch;
    ch = _tolower(*line++);
    if ((ch < '0' || ch > '9') && (ch < 'a' || ch > 'f'))
      return -1;
    number = isdigit(ch) ? (ch - '0') : (ch - 'a' + 10);
    ch = _tolower(*line);
    if ((cnt < 5 && ch != ':') || (cnt == 5 && ch != '\0' && !isspace(ch))) {
      ++line;
      if ((ch < '0' || ch > '9') && (ch < 'a' || ch > 'f'))
        return -1;
      number <<= 4;
      number += isdigit(ch) ? (ch - '0') : (ch - 'a' + 10);
      ch = *line;
      if (cnt < 5 && ch != ':')
        return -1;
    }
    addr->ether_addr_octet[cnt] = (unsigned char)number;
    if (ch != '\0')
      ++line;
  }
  cp = strchr(line, '#');
  if (cp == NULL)
    cp = line + strlen(line);
  while (cp > line && isspace(cp[-1]))
    --cp;
  if (cp == line)
    return -1;
  memcpy(hostname, line, cp - line);
  hostname[cp - line] = '\0';
  return 0;
}
```