user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<decode_base64>:
  endbr64
  push   %r15
  lea    0x3(%rsi),%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  test   %esi,%esi
  cmovns %esi,%eax
  movslq %esi,%rsi
  mov    %rdi,0x10(%rsp)
  mov    %rdx,0x28(%rsp)
  sar    $0x2,%eax
  cmpb   $0x3d,-0x1(%rdi,%rsi,1)
  lea    (%rax,%rax,2),%eax
  mov    %eax,0x18(%rsp)
  jne    L26
  subl   $0x1,0x18(%rsp)
L26:
  mov    0x10(%rsp),%rax
  cmpb   $0x3d,-0x2(%rax,%rsi,1)
  jne    L86
  subl   $0x1,0x18(%rsp)
L86:
  mov    0x18(%rsp),%ebx
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,0x20(%rsp)
  mov    %rax,%r12
  test   %rax,%rax
  je     L73
  movslq %ebx,%rax
  mov    %rax,%rcx
  imul   $0x55555556,%rax,%rax
  mov    %ecx,%edx
  sar    $0x1f,%edx
  shr    $0x20,%rax
  sub    %edx,%eax
  lea    (%rax,%rax,2),%r13d
  sub    %r13d,%ecx
  mov    %r13d,0xc(%rsp)
  mov    %ecx,0x1c(%rsp)
  test   %r13d,%r13d
  jle    L7
  mov    0x10(%rsp),%rax
  mov    $0x4,%r14d
  xor    %r13d,%r13d
  mov    %rax,%rbx
  sub    %eax,%r14d
  nop
L50:
  movzbl (%rbx),%edi
  lea    (%r14,%rbx,1),%r15d
  add    $0x3,%r13d
  add    $0x4,%rbx
  add    $0x3,%r12
  call   <b64_2_byte@plt>
  movzbl -0x3(%rbx),%edi
  mov    %eax,%ebp
  call   <b64_2_byte@plt>
  sar    $0x4,%eax
  and    $0x3,%eax
  lea    (%rax,%rbp,4),%ebp
  mov    %bpl,-0x3(%r12)
  movzbl -0x3(%rbx),%edi
  call   <b64_2_byte@plt>
  movzbl -0x2(%rbx),%edi
  mov    %eax,%ebp
  call   <b64_2_byte@plt>
  shl    $0x4,%ebp
  sar    $0x2,%eax
  and    $0xf,%eax
  add    %eax,%ebp
  mov    %bpl,-0x2(%r12)
  movzbl -0x2(%rbx),%edi
  call   <b64_2_byte@plt>
  movzbl -0x1(%rbx),%edi
  mov    %eax,%ebp
  call   <b64_2_byte@plt>
  shl    $0x6,%ebp
  add    %eax,%ebp
  mov    %bpl,-0x1(%r12)
  cmp    %r13d,0xc(%rsp)
  jg     L50
L59:
  cmpl   $0x1,0x1c(%rsp)
  je     L35
  cmpl   $0x2,0x1c(%rsp)
  je     L46
L76:
  mov    0x28(%rsp),%rax
  mov    0x18(%rsp),%edx
  mov    %edx,(%rax)
L73:
  mov    0x20(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L35:
  mov    0x10(%rsp),%r14
  movslq %r15d,%rax
  add    $0x1,%r15d
  movslq %r15d,%r15
  movzbl (%r14,%rax,1),%edi
  call   <b64_2_byte@plt>
  movzbl (%r14,%r15,1),%edi
  mov    %eax,%ebx
  call   <b64_2_byte@plt>
  movslq %r13d,%rdx
  sar    $0x4,%eax
  and    $0x3,%eax
  lea    (%rax,%rbx,4),%ebx
  mov    0x20(%rsp),%rax
  mov    %bl,(%rax,%rdx,1)
  jmp    L76
  nopl   0x0(%rax,%rax,1)
L46:
  mov    0x10(%rsp),%r14
  movslq %r15d,%rax
  lea    0x1(%r15),%ebx
  add    $0x2,%r15d
  movslq %ebx,%rbx
  movslq %r15d,%r15
  movzbl (%r14,%rax,1),%edi
  add    %r14,%rbx
  call   <b64_2_byte@plt>
  movzbl (%rbx),%edi
  mov    %eax,%ebp
  call   <b64_2_byte@plt>
  movslq %r13d,%rcx
  sar    $0x4,%eax
  and    $0x3,%eax
  lea    (%rax,%rbp,4),%eax
  mov    0x20(%rsp),%rbp
  mov    %al,0x0(%rbp,%rcx,1)
  movzbl (%rbx),%edi
  call   <b64_2_byte@plt>
  movzbl (%r14,%r15,1),%edi
  mov    %eax,%ebx
  call   <b64_2_byte@plt>
  shl    $0x4,%ebx
  lea    0x1(%r13),%edx
  sar    $0x2,%eax
  movslq %edx,%rdx
  and    $0xf,%eax
  add    %ebx,%eax
  mov    %al,0x0(%rbp,%rdx,1)
  jmp    L76
  nopl   0x0(%rax)
L7:
  xor    %r15d,%r15d
  xor    %r13d,%r13d
  jmp    L59
```

assistant: ```c
unsigned char *decode_base64(unsigned char *src, int size, int *dest_sz) {
  int i, j, oct_cnt = 0;
  unsigned char *dest = 0;
  int dest_size;
  int iter = 0;
  dest_size = (size / 4) * 3;
  if (src[size - 1] == '=') {
    dest_size -= 1;
  }
  if (src[size - 2] == '=') {
    dest_size -= 1;
  }
  dest = (unsigned char *)malloc(dest_size * sizeof(unsigned char));
  if (!dest) {
    return 0;
  }
  i = 0;
  j = 0;
  oct_cnt = 0;
  iter = dest_size - (dest_size % 3);
  while (i < iter) {
    dest[i++] = (b64_2_byte(src[j++]) << 2) + ((b64_2_byte(src[j]) & 48) >> 4);
    dest[i++] = ((b64_2_byte(src[j++]) & 15) << 4) + ((b64_2_byte(src[j]) & 60) >> 2);
    dest[i++] = ((b64_2_byte(src[j++]) & 3) << 6) + b64_2_byte(src[j++]);
  }
  if (dest_size % 3 == 1) {
    dest[i++] = (b64_2_byte(src[j++]) << 2) + ((b64_2_byte(src[j]) & 48) >> 4);
  } else if (dest_size % 3 == 2) {
    dest[i++] = (b64_2_byte(src[j++]) << 2) + ((b64_2_byte(src[j]) & 48) >> 4);
    dest[i++] = ((b64_2_byte(src[j++]) & 15) << 4) + ((b64_2_byte(src[j]) & 60) >> 2);
  }
  *dest_sz = dest_size;
  return dest;
}
```