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

```asm
<validate_sys_macaddr>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L156
  mov    %rdi,%rbp
  call   <validate_macaddr@plt>
  test   %eax,%eax
  jne    L61
L156:
  xor    %r12d,%r12d
L127:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L52
  add    $0x20,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L61:
  lea    0x14(%rsp),%rax
  mov    %rsp,%rbx
  lea    0x4(%rsp),%rcx
  mov    %rbp,%rdi
  push   %rax
  mov    %rbx,%rdx
  lea    D11(%rip),%rsi
  lea    0x18(%rsp),%rax
  push   %rax
  lea    0x1c(%rsp),%r9
  lea    0x18(%rsp),%r8
  call   <sscanf@plt>
  mov    %rbx,%rsp
  cmp    $0x6,%eax
  jne    L85
  mov    (%rsp),%esi
  mov    0x4(%rsp),%edx
  mov    0x8(%rsp),%ecx
  mov    %esi,%r12d
  and    $0x1,%r12d
  jne    L53
  cmp    $0x5e,%ecx
  je     L93
L104:
  mov    %rbx,%rax
  lea    0x18(%rsp),%rdx
  jmp    L18
  nop
L137:
  mov    (%rax),%esi
L18:
  add    $0x4,%rax
  add    %esi,%r12d
  cmp    %rdx,%rax
  jne    L137
  test   %r12d,%r12d
  je     L8
  mov    $0x1,%r12d
  jmp    L127
  xchg   %ax,%ax
L85:
  lea    D24(%rip),%rdi
  call   <puts@plt>
  jmp    L156
  nopl   0x0(%rax)
L53:
  sub    $0x8,%rsp
  lea    D4(%rip),%rdi
  xor    %r12d,%r12d
  mov    0x1c(%rsp),%eax
  push   %rax
  mov    0x20(%rsp),%r9d
  xor    %eax,%eax
  mov    0x1c(%rsp),%r8d
  call   <printf@plt>
  pop    %rsi
  pop    %rdi
  jmp    L127
  nopl   0x0(%rax,%rax,1)
L8:
  lea    D2(%rip),%rdi
  call   <puts@plt>
  jmp    L127
  nopl   0x0(%rax)
L93:
  or     %esi,%edx
  or     0xc(%rsp),%edx
  jne    L104
  cmpl   $0x1,0x10(%rsp)
  jne    L104
  push   %rax
  mov    0x1c(%rsp),%eax
  xor    %edx,%edx
  mov    $0x1,%r9d
  xor    %r8d,%r8d
  xor    %esi,%esi
  lea    D3(%rip),%rdi
  push   %rax
  xor    %eax,%eax
  call   <printf@plt>
  pop    %rdx
  pop    %rcx
  jmp    L127
L52:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D11
data_type: string
name: retrieve_data
arguments: tag: D24
data_type: string
name: retrieve_data
arguments: tag: D4
data_type: string
name: retrieve_data
arguments: tag: D2
data_type: string
name: retrieve_data
arguments: tag: D3
data_type: string

tool: D11: %x:%x:%x:%x:%x:%x

tool: D24: Error: wrong number of octets

tool: D4: Error: %x:%x:%x:%x:%x:%x is a multicast address


tool: D2: Error: zero is not a valid address

tool: D3: Error: %x:%x:%x:%x:%x:%x is a vrrp mac address


assistant: ```c
int validate_sys_macaddr(const char *str) {
  if (!str)
    return 0;
  if (!validate_macaddr(str))
    return 0;
  int a[6];
  int sum = 0;
  if (sscanf(str, "%x:%x:%x:%x:%x:%x", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]) != 6) {
    printf("Error: wrong number of octets\n");
    return 0;
  }
  if (a[0] & 1) {
    printf("Error: %x:%x:%x:%x:%x:%x is a multicast address\n", a[0], a[1], a[2], a[3], a[4], a[5]);
    return 0;
  }
  if ((a[0] == 0) && (a[1] == 0) && (a[2] == 94) && (a[3] == 0) && (a[4] == 1)) {
    printf("Error: %x:%x:%x:%x:%x:%x is a vrrp mac address\n", a[0], a[1], a[2], a[3], a[4], a[5]);
    return 0;
  }
  int i;
  for (i = 0; i < 6; ++i) {
    sum += a[i];
  }
  if (sum == 0) {
    printf("Error: zero is not a valid address\n");
    return 0;
  }
  return 1;
}
```