user: Please show me the C implementation that matches the assembly code listed below:

```asm
<zrpc_util_str2mac>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x48(%rbp)
  cmpq   $0x0,-0x58(%rbp)
  jne    L71
  mov    $0x0,%eax
  jmp    L269
L71:
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L106
  mov    -0x58(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L106
  mov    $0x1,%eax
  jmp    L269
L106:
  movl   $0x0,-0x44(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  jmp    L237
L45:
  movl   $0x0,-0x4c(%rbp)
  mov    -0x38(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L284
  cmpl   $0x5,-0x44(%rbp)
  je     L16
  mov    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <zrpc_log@plt>
  mov    $0x0,%eax
  jmp    L269
L16:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x30(%rbp)
  jmp    L139
L284:
  mov    -0x28(%rbp),%rax
  sub    -0x38(%rbp),%rax
  sar    $0x2,%rax
  mov    %rax,-0x30(%rbp)
L139:
  cmpq   $0x5,-0x30(%rbp)
  jbe    L275
  mov    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <zrpc_log@plt>
  mov    $0x0,%eax
  jmp    L269
L275:
  mov    -0x30(%rbp),%rdx
  mov    -0x38(%rbp),%rcx
  lea    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movl   $0x0,-0x40(%rbp)
  jmp    L253
L37:
  cmpl   $0x5,-0x48(%rbp)
  jbe    L26
  mov    $0x0,%eax
  jmp    L269
L26:
  cmpq   $0x0,-0x60(%rbp)
  je     L215
  mov    -0x48(%rbp),%edx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L215:
  lea    -0x20(%rbp),%rdx
  mov    -0x40(%rbp),%eax
  shl    $0x2,%rax
  add    %rax,%rdx
  lea    -0x4c(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <zrpc_util_convertchartohexa@plt>
  mov    %eax,-0x3c(%rbp)
  mov    -0x4c(%rbp),%eax
  test   %eax,%eax
  je     L53
  mov    $0x0,%eax
  jmp    L269
L53:
  cmpq   $0x0,-0x60(%rbp)
  je     L234
  mov    -0x3c(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%ecx
  mov    -0x48(%rbp),%edx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
L234:
  addl   $0x1,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  cmp    %rax,-0x30(%rbp)
  jne    L158
  mov    $0x0,%eax
  jmp    L269
L158:
  lea    -0x20(%rbp),%rdx
  mov    -0x40(%rbp),%eax
  shl    $0x2,%rax
  add    %rax,%rdx
  lea    -0x4c(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <zrpc_util_convertchartohexa@plt>
  and    $0xf,%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x4c(%rbp),%eax
  test   %eax,%eax
  je     L14
  mov    $0x0,%eax
  jmp    L269
L14:
  cmpq   $0x0,-0x60(%rbp)
  je     L153
  mov    -0x48(%rbp),%edx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x3c(%rbp),%eax
  and    $0xf,%eax
  mov    %eax,%esi
  mov    -0x48(%rbp),%ecx
  mov    -0x60(%rbp),%rax
  add    %rcx,%rax
  or     %esi,%edx
  mov    %dl,(%rax)
L153:
  addl   $0x1,-0x48(%rbp)
  addl   $0x1,-0x44(%rbp)
  addl   $0x1,-0x40(%rbp)
L253:
  mov    -0x40(%rbp),%eax
  cmp    %rax,-0x30(%rbp)
  ja     L37
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L195
  addq   $0x4,-0x38(%rbp)
L237:
  cmpl   $0x5,-0x44(%rbp)
  jbe    L45
  jmp    L56
L195:
  nop
L56:
  mov    $0x1,%eax
L269:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L260
  call   <__stack_chk_fail@plt>
L260:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D14
data_type: string

tool: D14: [%s]: format non recognized

assistant: ```c
int zrpc_util_str2mac(const char *str, char *mac) {
  unsigned int k = 0, i, j;
  uint8_t *ptr, *ptr2;
  size_t len;
  uint8_t car;
  if (!str)
    return 0;
  if (str[0] == ':' && str[1] == '\0')
    return 1;
  i = 0;
  ptr = (uint8_t *)str;
  while (i < 6) {
    uint8_t temp[5];
    int error = 0;
    ptr2 = (uint8_t *)strchr((const char *)ptr, ':');
    if (ptr2 == NULL) {
      if (i != 5) {
        zrpc_log("[%s]: format non recognized", mac);
        return 0;
      }
      len = strlen((char *)ptr);
    } else {
      len = ptr2 - ptr;
    }
    if (len > 5) {
      zrpc_log("[%s]: format non recognized", mac);
      return 0;
    }
    memcpy(temp, ptr, len);
    for (j = 0; j < len; j++) {
      if (k >= 6)
        return 0;
      if (mac)
        mac[k] = 0;
      car = zrpc_util_convertchartohexa(&temp[j], &error);
      if (error)
        return 0;
      if (mac)
        mac[k] = car << 4;
      j++;
      if (j == len)
        return 0;
      car = zrpc_util_convertchartohexa(&temp[j], &error) & 0xf;
      if (error)
        return 0;
      if (mac)
        mac[k] |= car & 0xf;
      k++;
      i++;
    }
    ptr = ptr2;
    if (ptr == NULL)
      break;
    ptr++;
  }
  if (mac && 0) {
    zrpc_log("leave correct : %02x:%02x:%02x:%02x:%02x:%02x", mac[0] & 0xff, mac[1] & 0xff, mac[2] & 0xff, mac[3] & 0xff, mac[4] & 0xff, mac[5] & 0xff);
  }
  return 1;
}
```