user: Translate the below assembly code into C programming language:

```asm
<base64decode>:
  endbr64
  test   %rdi,%rdi
  je     L239
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  test   %rsi,%rsi
  je     L148
  mov    %rdi,%rbx
  mov    %rsi,%rdi
  mov    %edx,%ebp
  call   <strlen@plt>
  test   %eax,%eax
  jle    L206
  sub    $0x1,%eax
  mov    %r12,%rdi
  xor    %r8d,%r8d
  xor    %r9d,%r9d
  lea    0x1(%r12,%rax,1),%r10
  mov    $0x1,%esi
  xor    %eax,%eax
  jmp    L236
  nopl   0x0(%rax)
L123:
  lea    -0x61(%rdx),%ecx
  cmp    $0x19,%cl
  jbe    L130
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  jbe    L233
  cmp    $0x2b,%dl
  je     L78
  mov    $0x3f,%ecx
  cmp    $0x2d,%dl
  je     L202
L98:
  add    $0x1,%rdi
  cmp    %rdi,%r10
  je     L43
L236:
  movzbl (%rdi),%edx
  lea    -0x41(%rdx),%ecx
  cmp    $0x19,%cl
  ja     L123
  movsbl %cl,%ecx
L202:
  shl    $0x6,%eax
  add    %ecx,%eax
  lea    0x6(%r9),%ecx
  cmp    $0x7,%ecx
  jle    L48
  nopl   0x0(%rax)
L175:
  sub    $0x8,%ecx
  cmp    %r8d,%ebp
  jle    L29
  mov    %eax,%edx
  lea    0x1(%r8),%r11d
  sar    %cl,%edx
  mov    %dl,(%rbx,%r8,1)
  mov    %esi,%edx
  movslq %r11d,%r8
  shl    %cl,%edx
  sub    $0x1,%edx
  and    %edx,%eax
  cmp    $0x7,%ecx
  jg     L175
L179:
  sub    $0x2,%r9d
  and    $0x7,%r9d
  nopl   (%rax)
L128:
  add    $0x1,%rdi
  cmp    %rdi,%r10
  jne    L236
L43:
  cmp    %r8d,%ebp
  jle    L104
L38:
  movslq %r8d,%rax
  add    $0x1,%r8d
  movb   $0x0,(%rbx,%rax,1)
L104:
  pop    %rbx
  mov    %r8d,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L29:
  mov    %esi,%edx
  shl    %cl,%edx
  sub    $0x1,%edx
  and    %edx,%eax
  cmp    $0x7,%ecx
  jle    L179
L180:
  sub    $0x8,%ecx
  mov    %esi,%edx
  shl    %cl,%edx
  sub    $0x1,%edx
  and    %edx,%eax
  cmp    $0x7,%ecx
  jg     L180
  sub    $0x2,%r9d
  and    $0x7,%r9d
  jmp    L128
  nopl   0x0(%rax)
L130:
  sub    $0x47,%edx
  shl    $0x6,%eax
  movsbl %dl,%ecx
  add    %ecx,%eax
  lea    0x6(%r9),%ecx
  cmp    $0x7,%ecx
  jg     L175
L48:
  mov    %ecx,%r9d
  jmp    L98
L233:
  add    $0x4,%edx
  movsbl %dl,%ecx
  jmp    L202
L78:
  mov    $0x3e,%ecx
  jmp    L202
L206:
  xor    %r8d,%r8d
  cmp    %r8d,%ebp
  jle    L104
  jmp    L38
L148:
  mov    $0xffffffff,%r8d
  jmp    L104
L239:
  or     $0xffffffff,%eax
  ret
```

assistant: ```c
int base64decode(void *dst, char *src, int maxlen) {
  int bitval;
  int bits;
  int val;
  int len;
  int x;
  int y;
  if (!dst || !src)
    return -1;
  len = strlen(src);
  bitval = 0;
  bits = 0;
  y = 0;
  for (x = 0; x < len; x++) {
    if ((src[x] >= 'A') && (src[x] <= 'Z'))
      val = src[x] - 'A';
    else if ((src[x] >= 'a') && (src[x] <= 'z'))
      val = src[x] - 'a' + 26;
    else if ((src[x] >= '0') && (src[x] <= '9'))
      val = src[x] - '0' + 52;
    else if ('+' == src[x])
      val = 62;
    else if ('-' == src[x])
      val = 63;
    else
      val = -1;
    if (val >= 0) {
      bitval <<= 6;
      bitval += val;
      bits += 6;
      while (bits >= 8) {
        if (y < maxlen)
          ((char *)dst)[y++] = (bitval >> (bits - 8)) & 0xff;
        bits -= 8;
        bitval &= (1 << bits) - 1;
      }
    }
  }
  if (y < maxlen)
    ((char *)dst)[y++] = 0;
  return y;
}
```