user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ASCII2BCD>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L134
  mov    $0xffffffff,%eax
  jmp    L22
L134:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  movl   $0x0,-0x10(%rbp)
  jmp    L51
L139:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  ja     L62
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jbe    L62
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  sub    $0x30,%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L83
L62:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  ja     L180
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jbe    L180
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  sub    $0x57,%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L83
L180:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  ja     L167
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jbe    L167
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  sub    $0x37,%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L83
L167:
  mov    $0xfffffffe,%eax
  jmp    L22
L83:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  ja     L156
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jbe    L156
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  and    $0xf,%eax
  or     %ecx,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L179
L156:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  ja     L4
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x60,%al
  jbe    L4
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  sub    $0x57,%eax
  and    $0xf,%eax
  or     %ecx,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L179
L4:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x46,%al
  ja     L149
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jbe    L149
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  sub    $0x37,%eax
  and    $0xf,%eax
  or     %ecx,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
  jmp    L179
L149:
  mov    $0xfffffffd,%eax
  jmp    L22
L179:
  addq   $0x1,-0x8(%rbp)
  addl   $0x2,-0x10(%rbp)
L51:
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jl     L139
  mov    $0x0,%eax
L22:
  leave
  ret
```

assistant: ```c
int ASCII2BCD(const unsigned char *ascii, unsigned char *bcd, int *bcdLen) {
  unsigned char *pbcd;
  int i;
  int len = strlen((char *)ascii);
  pbcd = bcd;
  if (len % 2)
    return -1;
  *bcdLen = len / 2;
  for (i = 0; i < len; i += 2) {
    if (ascii[i] <= '9' && ascii[i] >= '0') {
      *pbcd = ((ascii[i] - '0') << 4) & 0xf0;
    } else if (ascii[i] <= 'f' && ascii[i] >= 'a') {
      *pbcd = ((ascii[i] - 'a' + 0x0a) << 4) & 0xf0;
    } else if (ascii[i] <= 'F' && ascii[i] >= 'A') {
      *pbcd = ((ascii[i] - 'A' + 0x0a) << 4) & 0xf0;
    } else {
      return -2;
    }
    if (ascii[i + 1] <= '9' && ascii[i + 1] >= '0') {
      *pbcd |= (ascii[i + 1] - '0') & 0x0f;
    } else if (ascii[i + 1] <= 'f' && ascii[i + 1] >= 'a') {
      *pbcd |= (ascii[i + 1] - 'a' + 0x0a) & 0x0f;
    } else if (ascii[i + 1] <= 'F' && ascii[i + 1] >= 'A') {
      *pbcd |= (ascii[i + 1] - 'A' + 0x0a) & 0x0f;
    } else {
      return -3;
    }
    pbcd++;
  }
  return 0;
}
```