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

```asm
<Base64_Decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x3c(%rbp)
  jne    L45
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  jmp    L91
L45:
  mov    -0x3c(%rbp),%eax
L91:
  mov    %eax,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L96
  cmpq   $0x0,-0x20(%rbp)
  jne    L15
L96:
  mov    $0x0,%eax
  jmp    L70
L15:
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L13
  subl   $0x1,-0x28(%rbp)
L13:
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L95
  subl   $0x1,-0x28(%rbp)
L95:
  mov    -0x40(%rbp),%eax
  mov    %eax,%edi
  call   <Base64_EncodeLength@plt>
  sub    $0x1,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x40(%rbp),%ecx
  mov    %ecx,%edx
  mov    $0xaaaaaaab,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    %eax
  mov    %eax,%edx
  add    %edx,%edx
  add    %eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  test   %eax,%eax
  je     L93
  mov    -0x40(%rbp),%ecx
  mov    %ecx,%edx
  mov    $0xaaaaaaab,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    %edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  sub    $0x3,%eax
  mov    %eax,-0x24(%rbp)
L93:
  mov    -0x24(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jae    L1
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  jmp    L1
L41:
  cmpl   $0x3,-0x28(%rbp)
  jbe    L105
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <decodeblock@plt>
  subl   $0x4,-0x28(%rbp)
  addq   $0x4,-0x20(%rbp)
  addq   $0x3,-0x18(%rbp)
  jmp    L1
L105:
  lea    -0xb(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <decodeblock@plt>
  mov    -0x28(%rbp),%eax
  lea    -0x1(%rax),%edx
  lea    -0xb(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movl   $0x0,-0x28(%rbp)
L1:
  cmpl   $0x0,-0x28(%rbp)
  jne    L41
  mov    $0x1,%eax
L70:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L138
  call   <__stack_chk_fail@plt>
L138:
  leave
  ret
```

assistant: ```c
int Base64_Decode(const char *base64, unsigned int b64len, char *data, unsigned int length) {
  unsigned char output[3];
  unsigned int base64len = b64len ? b64len : strlen(base64);
  unsigned int maxchars;
  unsigned char *r = (unsigned char *)base64;
  unsigned char *w = (unsigned char *)data;
  if (!w || !r) {
    return 0;
  }
  if (base64[base64len - 1] == '=')
    base64len--;
  if (base64[base64len - 1] == '=')
    base64len--;
  maxchars = (Base64_EncodeLength(length) - 1);
  if (length % 3) {
    maxchars -= (3 - (length % 3));
  }
  if (maxchars < base64len) {
    base64len = maxchars;
  }
  while (base64len) {
    if (base64len > 3) {
      decodeblock(r, w);
      base64len -= 4;
      r += 4;
      w += 3;
    } else {
      decodeblock(r, output);
      memcpy(w, output, base64len - 1);
      base64len = 0;
    }
  }
  return 1;
}
```