user: Converte this assembly snippet into its equivalent C code:

```asm
<decode_base64>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movsbl (%rsi),%eax
  movl   $0x0,0x14(%rsp)
  test   %al,%al
  je     L126
  mov    (%rdx),%edx
  test   %edx,%edx
  jle    L126
  lea    0x14(%rsp),%rdi
  mov    %rsi,%r14
  xor    %ebp,%ebp
  xor    %r15d,%r15d
  mov    %rdi,0x8(%rsp)
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L201:
  lea    -0x41(%rax),%r8d
  add    $0x1,%r14
  mov    %r8d,%r12d
  cmp    $0x19,%r8d
  jbe    L162
  lea    -0x61(%rax),%edx
  lea    -0x47(%rax),%r12d
  cmp    $0x19,%edx
  jbe    L162
  lea    -0x30(%rax),%edx
  lea    0x4(%rax),%r12d
  cmp    $0x9,%edx
  jbe    L162
  mov    $0x1,%edi
  cmp    $0x2f,%eax
  je     L31
  cmp    $0x2b,%eax
  je     L81
  call   <assert@plt>
L159:
  test   %r15d,%r15d
  je     L175
  mov    %ebx,%eax
  and    $0x80000003,%eax
  cmp    $0x3,%eax
  je     L55
  cs nopw 0x0(%rax,%rax,1)
L174:
  add    $0x1,%ebx
  mov    %ebx,%edx
  sar    $0x1f,%edx
  shr    $0x1e,%edx
  lea    (%rbx,%rdx,1),%eax
  and    $0x3,%eax
  sub    %edx,%eax
  movslq %eax,%rdx
  movb   $0x0,0x14(%rsp,%rdx,1)
  cmp    $0x3,%eax
  jne    L174
L55:
  mov    $0xffffffff,%r12d
L93:
  movsbl 0x15(%rsp),%esi
  movsbl 0x14(%rsp),%edx
  mov    (%rsp),%rcx
  mov    0x8(%rsp),%rdi
  mov    %esi,%eax
  shl    $0x2,%edx
  sar    $0x4,%eax
  shl    $0x4,%esi
  lea    0x3(%rcx),%r15
  and    $0x3,%eax
  or     %edx,%eax
  movsbl 0x16(%rsp),%edx
  mov    %al,(%rcx)
  mov    %edx,%eax
  shl    $0x6,%edx
  sar    $0x2,%eax
  and    $0xf,%eax
  or     %esi,%eax
  xor    %esi,%esi
  mov    %al,0x1(%rcx)
  movzbl 0x17(%rsp),%eax
  and    $0x3f,%eax
  or     %edx,%eax
  mov    $0x4,%edx
  mov    %al,0x2(%rcx)
  call   <memset@plt>
  mov    %r15,(%rsp)
L160:
  movsbl (%r14),%eax
  add    $0x1,%ebx
  test   %al,%al
  je     L72
  mov    $0x1,%r15d
  cmp    0x0(%r13),%ebx
  jge    L72
  cmp    $0xffffffff,%r12d
  jne    L201
L72:
  mov    %rbp,%rax
  and    $0x3,%ebp
  shr    $0x2,%rax
  lea    (%rax,%rax,2),%eax
  cltq
  cmp    $0x2,%rbp
  je     L59
  cmp    $0x3,%rbp
  jne    L50
  add    $0x2,%rax
L50:
  mov    %rax,0x0(%r13)
  mov    (%rsp),%rax
L95:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L127
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L162:
  xor    %edi,%edi
  cmp    $0x3f,%r12d
  setle  %dil
  call   <assert@plt>
  mov    %r12d,%esi
  cmp    $0xffffffff,%r12d
  je     L159
L107:
  mov    %ebx,%edx
  add    $0x1,%rbp
  sar    $0x1f,%edx
  shr    $0x1e,%edx
  lea    (%rbx,%rdx,1),%eax
  and    $0x3,%eax
  sub    %edx,%eax
  movslq %eax,%rdx
  mov    %sil,0x14(%rsp,%rdx,1)
  cmp    $0x3,%eax
  jne    L160
  jmp    L93
  cs nopw 0x0(%rax,%rax,1)
L31:
  call   <assert@plt>
  mov    $0x3f,%r12d
  mov    $0x3f,%esi
  jmp    L107
  nopw   0x0(%rax,%rax,1)
L59:
  add    $0x1,%rax
  mov    %rax,0x0(%r13)
  mov    (%rsp),%rax
  jmp    L95
  nopl   0x0(%rax)
L81:
  call   <assert@plt>
  mov    $0x3e,%r12d
  mov    $0x3e,%esi
  jmp    L107
L126:
  movq   $0x0,0x0(%r13)
  mov    (%rsp),%rax
  jmp    L95
L175:
  xor    %eax,%eax
  jmp    L95
L127:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *decode_base64(char *dest, char *src, size_t *size) {
  int cc = 0;
  char buf[4] = {0, 0, 0, 0};
  int p = 0;
  int valid_data = 0;
  size_t size_out = 0;
  while (*src && p < (int)*size && (cc != -1)) {
    cc = *src++;
    if ((cc >= 'A') && (cc <= 'Z'))
      cc = cc - 'A';
    else if ((cc >= 'a') && (cc <= 'z'))
      cc = cc - 'a' + 26;
    else if ((cc >= '0') && (cc <= '9'))
      cc = cc - '0' + 52;
    else if (cc == '/')
      cc = 63;
    else if (cc == '+')
      cc = 62;
    else
      cc = -1;
    assert(cc < 64);
    if (cc == -1) {
      if (valid_data == 0) {
        return 0;
      }
      while (p % 4 != 3) {
        p++;
        buf[p % 4] = 0;
      }
    } else {
      buf[p % 4] = cc;
      size_out++;
      valid_data = 1;
    }
    if (p % 4 == 3) {
      *dest++ = (buf[0] << 2) | ((buf[1] & 0x30) >> 4);
      *dest++ = ((buf[1] & 0x0F) << 4) | ((buf[2] & 0x3C) >> 2);
      *dest++ = ((buf[2] & 0x03) << 6) | (buf[3] & 0x3F);
      memset(buf, 0, 4);
    }
    p++;
  }
  *size = ((int)(size_out / 4)) * 3;
  if (size_out % 4 == 2)
    *size += 1;
  if (size_out % 4 == 3)
    *size += 2;
  return (dest);
}
```