user: Translate the below assembly code into C programming language:

```asm
<mac_aton>:
  endbr64
  test   %rdi,%rdi
  je     L581
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  cmp    $0x11,%eax
  jne    L301
  movzbl (%rbx),%edx
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  jbe    L588
  lea    -0x41(%rdx),%eax
  cmp    $0x5,%al
  ja     L27
  lea    -0x37(%rdx),%eax
L588:
  movzbl 0x1(%rbx),%edx
  shl    $0x4,%eax
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  jbe    L488
L7:
  lea    -0x41(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L8
  lea    -0x37(%rax,%rdx,1),%eax
L81:
  mov    %al,0x0(%rbp)
  movzbl 0x2(%rbx),%edx
  cmp    $0x3a,%dl
  sete   %al
  cmp    $0x2d,%dl
  sete   %cl
  or     %cl,%al
  je     L301
  test   %dl,%dl
  je     L301
  movzbl 0x3(%rbx),%ecx
  lea    -0x30(%rcx),%eax
  cmp    $0x9,%al
  jbe    L138
  lea    -0x41(%rcx),%eax
  cmp    $0x5,%al
  ja     L402
  lea    -0x37(%rcx),%eax
L138:
  movzbl 0x4(%rbx),%ecx
  shl    $0x4,%eax
  lea    -0x30(%rcx),%esi
  cmp    $0x9,%sil
  ja     L595
  add    %esi,%eax
L338:
  mov    %al,0x1(%rbp)
  movzbl 0x5(%rbx),%ecx
  cmp    %cl,%dl
  jne    L301
  movzbl 0x6(%rbx),%edx
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  jbe    L296
  lea    -0x41(%rdx),%eax
  cmp    $0x5,%al
  ja     L209
  lea    -0x37(%rdx),%eax
L296:
  movzbl 0x7(%rbx),%edx
  shl    $0x4,%eax
  lea    -0x30(%rdx),%esi
  cmp    $0x9,%sil
  ja     L281
  add    %esi,%eax
L12:
  mov    %al,0x2(%rbp)
  cmp    0x8(%rbx),%cl
  jne    L301
  movzbl 0x9(%rbx),%edx
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  jbe    L318
  lea    -0x41(%rdx),%eax
  cmp    $0x5,%al
  ja     L570
  lea    -0x37(%rdx),%eax
L318:
  movzbl 0xa(%rbx),%edx
  shl    $0x4,%eax
  lea    -0x30(%rdx),%esi
  cmp    $0x9,%sil
  ja     L230
  add    %esi,%eax
L94:
  mov    %al,0x3(%rbp)
  movzbl 0xb(%rbx),%esi
  cmp    %sil,%cl
  jne    L301
  movzbl 0xc(%rbx),%edx
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  jbe    L99
  lea    -0x41(%rdx),%eax
  cmp    $0x5,%al
  jbe    L414
  lea    -0x61(%rdx),%eax
  cmp    $0x5,%al
  ja     L301
  lea    -0x57(%rdx),%eax
L99:
  movzbl 0xd(%rbx),%edx
  shl    $0x4,%eax
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  ja     L438
  add    %ecx,%eax
L110:
  mov    %al,0x4(%rbp)
  movzbl 0xe(%rbx),%eax
  test   %sil,%sil
  jne    L347
  cmp    $0x3a,%al
  sete   %dl
  cmp    $0x2d,%al
  sete   %cl
  or     %cl,%dl
  je     L301
  test   %al,%al
  je     L301
L256:
  movzbl 0xf(%rbx),%edx
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  jbe    L207
  lea    -0x41(%rdx),%eax
  cmp    $0x5,%al
  ja     L32
  lea    -0x37(%rdx),%eax
L207:
  movzbl 0x10(%rbx),%edx
  shl    $0x4,%eax
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  jbe    L190
  lea    -0x41(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L366
  lea    -0x37(%rax,%rdx,1),%eax
  jmp    L214
  nopl   (%rax)
L347:
  cmp    %sil,%al
  je     L256
L301:
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L488:
  add    %ecx,%eax
  jmp    L81
  nopw   0x0(%rax,%rax,1)
L595:
  lea    -0x41(%rcx),%esi
  cmp    $0x5,%sil
  ja     L34
  lea    -0x37(%rax,%rcx,1),%eax
  jmp    L338
  cs nopw 0x0(%rax,%rax,1)
L281:
  lea    -0x41(%rdx),%esi
  cmp    $0x5,%sil
  ja     L397
  lea    -0x37(%rax,%rdx,1),%eax
  jmp    L12
  cs nopw 0x0(%rax,%rax,1)
L230:
  lea    -0x41(%rdx),%esi
  cmp    $0x5,%sil
  jbe    L208
  lea    -0x61(%rdx),%esi
  cmp    $0x5,%sil
  ja     L301
  lea    -0x57(%rax,%rdx,1),%eax
  jmp    L94
  nop
L438:
  lea    -0x41(%rdx),%ecx
  cmp    $0x5,%cl
  jbe    L535
  lea    -0x61(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L301
  lea    -0x57(%rax,%rdx,1),%eax
  jmp    L110
  nopl   0x0(%rax)
L190:
  add    %ecx,%eax
L214:
  mov    %al,0x5(%rbp)
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L27:
  lea    -0x61(%rdx),%eax
  cmp    $0x5,%al
  ja     L301
  lea    -0x57(%rdx),%eax
  movzbl 0x1(%rbx),%edx
  shl    $0x4,%eax
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  ja     L7
  jmp    L488
  cs nopw 0x0(%rax,%rax,1)
L8:
  lea    -0x61(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L301
  lea    -0x57(%rax,%rdx,1),%eax
  jmp    L81
  nopl   (%rax)
L402:
  lea    -0x61(%rcx),%eax
  cmp    $0x5,%al
  ja     L301
  lea    -0x57(%rcx),%eax
  jmp    L138
  nopl   0x0(%rax,%rax,1)
L34:
  lea    -0x61(%rcx),%esi
  cmp    $0x5,%sil
  ja     L301
  lea    -0x57(%rax,%rcx,1),%eax
  jmp    L338
  cs nopw 0x0(%rax,%rax,1)
L209:
  lea    -0x61(%rdx),%eax
  cmp    $0x5,%al
  ja     L301
  lea    -0x57(%rdx),%eax
  jmp    L296
  nopl   0x0(%rax,%rax,1)
L397:
  lea    -0x61(%rdx),%esi
  cmp    $0x5,%sil
  ja     L301
  lea    -0x57(%rax,%rdx,1),%eax
  jmp    L12
  xchg   %ax,%ax
L570:
  lea    -0x61(%rdx),%eax
  cmp    $0x5,%al
  ja     L301
  lea    -0x57(%rdx),%eax
  jmp    L318
  nopl   0x0(%rax,%rax,1)
L208:
  lea    -0x37(%rax,%rdx,1),%eax
  jmp    L94
  nopl   0x0(%rax)
L414:
  lea    -0x37(%rdx),%eax
  jmp    L99
L535:
  lea    -0x37(%rax,%rdx,1),%eax
  jmp    L110
  nopl   0x0(%rax)
L32:
  lea    -0x61(%rdx),%ecx
  lea    -0x57(%rdx),%eax
  cmp    $0x5,%cl
  jbe    L207
  jmp    L301
  nopl   0x0(%rax)
L366:
  lea    -0x61(%rdx),%ecx
  lea    -0x57(%rax,%rdx,1),%eax
  cmp    $0x5,%cl
  jbe    L214
  jmp    L301
L581:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int mac_aton(const char *mac_in, unsigned char *mac) {
  int err = 0;
  int i, j;
  const char *p;
  char sep = 0;
  unsigned char d;
  if (!mac_in || strlen(mac_in) != 17) {
    err = -1;
    goto exit;
  }
  for (i = 0, p = mac_in; i < 6; i++) {
    d = 0;
    if (i) {
      if (!sep) {
        if (*p == ':' || *p == '-')
          sep = *p;
      }
      if (sep && *p == sep) {
        p++;
      } else {
        err = -1;
        goto exit;
      }
    }
    for (j = 0; j < 2; j++, p++) {
      if (j)
        d <<= 4;
      if (*p >= '0' && *p <= '9') {
        d += (*p - '0');
      } else if (*p >= 'A' && *p <= 'F') {
        d += (*p - 'A') + 10;
      } else if (*p >= 'a' && *p <= 'f') {
        d += (*p - 'a') + 10;
      } else {
        err = -1;
        goto exit;
      }
    }
    mac[i] = d;
  }
exit:
  return err;
}
```