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

```asm
<BaseDecode>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  je     L7
  mov    %eax,%edi
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L87:
  movzbl 0x0(%rbp,%rdx,1),%esi
  xor    %eax,%eax
  jmp    L78
  nopl   0x0(%rax)
L70:
  add    $0x1,%rax
  cmp    $0x41,%rax
  je     L88
L78:
  mov    %eax,%ecx
  cmp    %sil,(%rbx,%rax,1)
  jne    L70
  shl    $0x2,%ecx
  mov    %cl,(%r12,%rdx,1)
L88:
  add    $0x1,%rdx
  cmp    %rdi,%rdx
  jne    L87
L7:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%r13d
  mov    %eax,%ebx
  shr    $0x2,%r13d
  je     L66
  lea    -0x1(%r13),%edx
  mov    %r12,%rax
  lea    (%rdx,%rdx,2),%rdx
  lea    0x3(%r12,%rdx,1),%rdi
  mov    %r12,%rdx
  nopl   0x0(%rax)
L92:
  movzbl 0x1(%rax),%ecx
  add    $0x3,%rdx
  add    $0x4,%rax
  shr    $0x6,%cl
  or     -0x4(%rax),%cl
  mov    %cl,-0x3(%rdx)
  movzbl -0x2(%rax),%ecx
  movzbl -0x3(%rax),%esi
  shr    $0x4,%cl
  shl    $0x2,%esi
  or     %esi,%ecx
  mov    %cl,-0x2(%rdx)
  movzbl -0x1(%rax),%ecx
  movzbl -0x2(%rax),%esi
  shr    $0x2,%cl
  shl    $0x4,%esi
  or     %esi,%ecx
  mov    %cl,-0x1(%rdx)
  cmp    %rdx,%rdi
  jne    L92
  lea    0x0(%r13,%r13,2),%r14d
L22:
  mov    %rbp,%rdi
  and    $0xfffffffc,%ebx
  call   <strlen@plt>
  sub    %ebx,%eax
  cmp    $0x2,%eax
  je     L93
  cmp    $0x3,%eax
  jne    L80
  lea    0x0(,%r13,4),%esi
  mov    %r14d,%ecx
  lea    0x1(%rsi),%edx
  add    %r12,%rdx
  movzbl (%rdx),%eax
  shr    $0x6,%al
  or     (%r12,%rsi,1),%al
  mov    %al,(%r12,%rcx,1)
  lea    0x2(%rsi),%eax
  movzbl (%rdx),%edx
  lea    0x1(%r14),%ecx
  movzbl (%r12,%rax,1),%eax
  add    $0x2,%r14d
  shl    $0x2,%edx
  shr    $0x4,%al
  or     %edx,%eax
  mov    %al,(%r12,%rcx,1)
L80:
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L93:
  shl    $0x2,%r13d
  mov    %r14d,%edx
  add    $0x1,%r14d
  pop    %rbx
  lea    0x1(%r13),%eax
  pop    %rbp
  movzbl (%r12,%rax,1),%eax
  shr    $0x6,%al
  or     (%r12,%r13,1),%al
  mov    %al,(%r12,%rdx,1)
  mov    %r14d,%eax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L66:
  xor    %r14d,%r14d
  jmp    L22
```

assistant: ```c
unsigned int BaseDecode(unsigned char *hstr, unsigned char *bstr, unsigned char *Bs64) {
  unsigned int i, n, c = 0;
  unsigned char m;
  n = strlen(hstr);
  for (i = 0; i < n; i++) {
    for (m = 0; m < 65; m++) {
      if (Bs64[m] == hstr[i]) {
        bstr[i] = (m << 2);
        break;
      }
    }
  }
  n = (strlen(hstr) / 4);
  for (i = 0; i < n; i++) {
    bstr[c] = bstr[i * 4] | (bstr[(i * 4) + 1] >> 6);
    c++;
    bstr[c] = (bstr[(i * 4) + 1] << 2) | (bstr[(i * 4) + 2] >> 4);
    c++;
    bstr[c] = (bstr[(i * 4) + 2] << 4) | (bstr[(i * 4) + 3] >> 2);
    c++;
  }
  switch (strlen(hstr) - (n * 4)) {
  case 2:
    bstr[c] = bstr[i * 4] | (bstr[(i * 4) + 1] >> 6);
    c++;
    break;
  case 3:
    bstr[c] = bstr[i * 4] | (bstr[(i * 4) + 1] >> 6);
    c++;
    bstr[c] = (bstr[(i * 4) + 1] << 2) | (bstr[(i * 4) + 2] >> 4);
    c++;
    break;
  }
  return c;
}
```