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

```asm
<cdel_decode_from_base64_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  movb   $0x0,-0x2d(%rbp)
  movb   $0x0,-0x30(%rbp)
  movb   $0x0,-0x2f(%rbp)
  movb   $0x0,-0x2e(%rbp)
  movb   $0x0,-0x2c(%rbp)
  movb   $0x0,-0x2b(%rbp)
  movb   $0x0,-0x2a(%rbp)
  movb   $0x0,-0x29(%rbp)
  movq   $0x0,-0x10(%rbp)
  movq   $0x0,-0x28(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  cltq
  mov    %rax,-0x18(%rbp)
  movq   $0x0,-0x8(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  jne    L111
  cmpq   $0x0,-0x48(%rbp)
  je     L149
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
L149:
  mov    $0x0,%eax
  jmp    L167
L111:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L1
  cmpq   $0x0,-0x48(%rbp)
  je     L145
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
L145:
  mov    $0x0,%eax
  jmp    L167
L1:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L148
  cmpq   $0x0,-0x48(%rbp)
  je     L16
  mov    D6(%rip),%rax
  mov    (%rax),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
L16:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L167
L148:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  jmp    L184
L84:
  mov    -0x38(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_base64@plt>
  cmp    $0x1,%eax
  jne    L20
  mov    -0x38(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%ecx
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x10(%rbp),%rdx
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
L20:
  addq   $0x1,-0x20(%rbp)
L184:
  mov    -0x38(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L84
  movq   $0x0,-0x20(%rbp)
  jmp    L176
L144:
  movb   $0x41,-0x2d(%rbp)
  movb   $0x41,-0x30(%rbp)
  movb   $0x41,-0x2f(%rbp)
  movb   $0x41,-0x2e(%rbp)
  movb   $0x0,-0x2c(%rbp)
  movb   $0x0,-0x2b(%rbp)
  movb   $0x0,-0x2a(%rbp)
  movb   $0x0,-0x29(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x2d(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,-0x18(%rbp)
  jbe    L72
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x30(%rbp)
L72:
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  cmp    %rax,-0x18(%rbp)
  jbe    L9
  mov    -0x20(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x2f(%rbp)
L9:
  mov    -0x20(%rbp),%rax
  add    $0x3,%rax
  cmp    %rax,-0x18(%rbp)
  jbe    L115
  mov    -0x20(%rbp),%rax
  lea    0x3(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x2e(%rbp)
L115:
  movsbl -0x2d(%rbp),%eax
  mov    %eax,%edi
  call   <base64_decode_byte@plt>
  mov    %al,-0x2c(%rbp)
  movsbl -0x30(%rbp),%eax
  mov    %eax,%edi
  call   <base64_decode_byte@plt>
  mov    %al,-0x2b(%rbp)
  movsbl -0x2f(%rbp),%eax
  mov    %eax,%edi
  call   <base64_decode_byte@plt>
  mov    %al,-0x2a(%rbp)
  movsbl -0x2e(%rbp),%eax
  mov    %eax,%edi
  call   <base64_decode_byte@plt>
  mov    %al,-0x29(%rbp)
  movzbl -0x2c(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edx
  movzbl -0x2b(%rbp),%eax
  shr    $0x4,%al
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  cmpb   $0x3d,-0x2f(%rbp)
  je     L182
  movzbl -0x2b(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  movzbl -0x2a(%rbp),%eax
  shr    $0x2,%al
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L182:
  cmpb   $0x3d,-0x2e(%rbp)
  je     L121
  movzbl -0x2a(%rbp),%eax
  shl    $0x6,%eax
  mov    %eax,%edx
  movzbl -0x29(%rbp),%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
L121:
  addq   $0x4,-0x20(%rbp)
L176:
  mov    -0x20(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L144
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  sub    -0x8(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%rax
L167:
  leave
  ret
```

assistant: ```c
unsigned char *cdel_decode_from_base64_string(const char *in_string, size_t *buff_len, int *error) {
  char c1 = 0;
  char c2 = 0;
  char c3 = 0;
  char c4 = 0;
  unsigned char b1 = 0;
  unsigned char b2 = 0;
  unsigned char b3 = 0;
  unsigned char b4 = 0;
  unsigned char *buf = NULL;
  unsigned char *out_buffer = NULL;
  size_t k;
  size_t l = strlen(in_string) + 1;
  unsigned char *dest = NULL;
  if (buff_len == NULL) {
    if (error != NULL)
      *error = EINVAL;
    return NULL;
  }
  buf = (unsigned char *)malloc(l);
  if (buf == NULL) {
    if (error != NULL)
      *error = ENOMEM;
    return NULL;
  }
  out_buffer = (unsigned char *)malloc(l);
  if (out_buffer == NULL) {
    if (error != NULL)
      *error = ENOMEM;
    free(buf);
    return NULL;
  }
  memset(buf, 0, l);
  memset(out_buffer, 0, l);
  dest = out_buffer;
  for (k = 0, l = 0; in_string[k]; k++) {
    if (is_base64(in_string[k]) == 1)
      buf[l++] = in_string[k];
  }
  for (k = 0; k < l; k += 4) {
    c1 = 'A';
    c2 = 'A';
    c3 = 'A';
    c4 = 'A';
    b1 = 0;
    b2 = 0;
    b3 = 0;
    b4 = 0;
    c1 = buf[k];
    if (k + 1 < l) {
      c2 = buf[k + 1];
    }
    if (k + 2 < l) {
      c3 = buf[k + 2];
    }
    if (k + 3 < l) {
      c4 = buf[k + 3];
    }
    b1 = base64_decode_byte(c1);
    b2 = base64_decode_byte(c2);
    b3 = base64_decode_byte(c3);
    b4 = base64_decode_byte(c4);
    *out_buffer++ = ((b1 << 2) | (b2 >> 4));
    if (c3 != '=') {
      *out_buffer++ = (((b2 & 0xf) << 4) | (b3 >> 2));
    }
    if (c4 != '=') {
      *out_buffer++ = (((b3 & 0x3) << 6) | b4);
    }
  }
  free(buf);
  *buff_len = (size_t)(out_buffer - dest);
  return out_buffer;
}
```