user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<Base64Encode>:
  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
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x28(%rbp)
  lea    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L112
L47:
  movl   $0x0,-0x28(%rbp)
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  mov    $0x2,%esi
  mov    %eax,%edi
  call   <min@plt>
  mov    %eax,-0x14(%rbp)
  movl   $0x2,-0x1c(%rbp)
  jmp    L31
L94:
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addq   $0x4,-0x38(%rbp)
  subl   $0x1,-0x3c(%rbp)
  subl   $0x1,-0x1c(%rbp)
L31:
  cmpl   $0x0,-0x1c(%rbp)
  js     L162
  cmpl   $0x0,-0x3c(%rbp)
  jg     L94
L162:
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  add    %eax,-0x14(%rbp)
  mov    -0x24(%rbp),%eax
  add    $0x3,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L66
L139:
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jle    L170
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x3d,(%rax)
  jmp    L98
L170:
  mov    -0x28(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  and    $0x3f,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x19,%al
  jg     L101
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  lea    0x41(%rax),%ecx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L98
L101:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x33,%al
  jg     L164
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  lea    0x47(%rax),%ecx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L98
L164:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jg     L38
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  lea    -0x4(%rax),%ecx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L98
L38:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3f,%al
  jne    L53
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2f,(%rax)
  jmp    L98
L53:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2b,(%rax)
L98:
  mov    -0x28(%rbp),%eax
  sar    $0x6,%eax
  mov    %eax,-0x28(%rbp)
  addl   $0x1,-0x20(%rbp)
  subl   $0x1,-0x18(%rbp)
L66:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L115
  mov    -0x40(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x20(%rbp)
  jl     L139
L115:
  addl   $0x4,-0x24(%rbp)
L112:
  cmpl   $0x0,-0x3c(%rbp)
  jg     L47
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L145
  call   <__stack_chk_fail@plt>
L145:
  leave
  ret
```

assistant: ```c
int Base64Encode(uint8_t *pSrc, int SrcLen, char *pDest, int DstLen) {
  int idx = 0;
  uint32_t d = 0;
  uint8_t *p = (uint8_t *)&d;
  int len;
  int cnt = 0;
  while (SrcLen > 0) {
    d = 0;
    len = min(SrcLen - 1, 2);
    for (int i = 2; i >= 0 && SrcLen > 0; i--) {
      p[i] = *pSrc;
      pSrc++;
      SrcLen--;
    }
    len += 1 + idx;
    for (int i = idx + 3; i >= idx && cnt < DstLen - 1; i--) {
      if (i > len)
        pDest[i] = '=';
      else {
        pDest[i] = d & 0x3f;
        if (pDest[i] < 26)
          pDest[i] += 'A';
        else if (pDest[i] < 52)
          pDest[i] += 'a' - 26;
        else if (pDest[i] < 62)
          pDest[i] += '0' - 52;
        else if (pDest[i] == 63)
          pDest[i] = '/';
        else
          pDest[i] = '+';
      }
      d >>= 6;
      cnt++;
    }
    idx += 4;
  }
  pDest[cnt] = '\0';
  return cnt;
}
```