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

```asm
<Base64Encode>:
  endbr64
  push   %rbx
  sub    $0x50,%rsp
  mov    %rdi,%rbx
  mov    %rdx,%r8
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movabs $0x4847464544434241,%rax
  movabs $0x504f4e4d4c4b4a49,%rdx
  mov    %rax,(%rsp)
  mov    %rdx,0x8(%rsp)
  movabs $0x5857565554535251,%rax
  movabs $0x6665646362615a59,%rdx
  mov    %rax,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  movabs $0x6e6d6c6b6a696867,%rax
  movabs $0x767574737271706f,%rdx
  mov    %rax,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  movabs $0x333231307a797877,%rax
  movabs $0x2f2b393837363534,%rdx
  mov    %rax,0x30(%rsp)
  mov    %rdx,0x38(%rsp)
  movb   $0x0,0x40(%rsp)
  mov    $0x0,%edi
  test   %r8,%r8
  je     L113
  mov    %rsi,%r9
  mov    %rbx,%rdi
  mov    $0x0,%esi
  mov    $0x0,%ecx
  movabs $0xaaaaaaaaaaaaaaab,%r10
  jmp    L23
L102:
  cmp    $0x1,%rax
  je     L49
  mov    %esi,%eax
  shl    $0x8,%eax
  movzbl (%r9,%rcx,1),%esi
  or     %eax,%esi
  mov    %eax,%edx
  shr    $0x12,%edx
  and    $0x3f,%edx
  movzbl (%rsp,%rdx,1),%edx
  mov    %dl,(%rdi)
  shr    $0xc,%eax
  and    $0x3f,%eax
  movzbl (%rsp,%rax,1),%eax
  mov    %al,0x1(%rdi)
  mov    %esi,%eax
  shr    $0x6,%eax
  and    $0x3f,%eax
  movzbl (%rsp,%rax,1),%eax
  mov    %al,0x2(%rdi)
  mov    %esi,%eax
  and    $0x3f,%eax
  movzbl (%rsp,%rax,1),%eax
  mov    %al,0x3(%rdi)
  lea    0x4(%rdi),%rdi
L37:
  add    $0x1,%rcx
  cmp    %rcx,%r8
  je     L63
L23:
  mov    %rcx,%rax
  mul    %r10
  mov    %rdx,%rax
  shr    %rax
  and    $0xfffffffffffffffe,%rdx
  add    %rax,%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  jne    L102
  movzbl (%r9,%rcx,1),%esi
  jmp    L37
L49:
  shl    $0x8,%esi
  movzbl (%r9,%rcx,1),%eax
  or     %eax,%esi
  jmp    L37
L63:
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mov    %rcx,%rax
  mul    %rdx
  mov    %rdx,%rax
  shr    %rax
  and    $0xfffffffffffffffe,%rdx
  add    %rax,%rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  je     L113
  cmp    $0x1,%rax
  sete   %r9b
  movzbl %r9b,%r9d
  add    $0x1,%r9
  movabs $0xaaaaaaaaaaaaaaab,%r8
L152:
  shl    $0x8,%esi
  add    $0x1,%rcx
  mov    %rcx,%rax
  mul    %r8
  mov    %rdx,%rax
  shr    %rax
  and    $0xfffffffffffffffe,%rdx
  add    %rax,%rdx
  cmp    %rdx,%rcx
  jne    L152
  mov    %esi,%eax
  shr    $0x12,%eax
  and    $0x3f,%eax
  movzbl (%rsp,%rax,1),%eax
  mov    %al,(%rdi)
  mov    %esi,%eax
  shr    $0xc,%eax
  and    $0x3f,%eax
  movzbl (%rsp,%rax,1),%eax
  mov    %al,0x1(%rdi)
  cmp    $0x1,%r9
  jbe    L4
  lea    0x2(%rdi),%rax
  movb   $0x3d,0x2(%rdi)
  movb   $0x3d,0x3(%rdi)
L103:
  lea    (%rax,%r9,1),%rdi
L113:
  movb   $0x0,(%rdi)
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L88
L1:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L159
  add    $0x50,%rsp
  pop    %rbx
  ret
L4:
  lea    0x3(%rdi),%rax
  shr    $0x6,%esi
  and    $0x3f,%esi
  movzbl (%rsp,%rsi,1),%edx
  mov    %dl,0x2(%rdi)
  movb   $0x3d,0x3(%rdi)
  jmp    L103
L72:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L1
L88:
  add    $0x1,%rbx
  test   %al,%al
  jns    L72
  mov    $0x0,%eax
  call   <abort@plt>
  jmp    L72
L159:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void Base64Encode(char *outbuf, const void *inbuf, size_t inlen) {
  const unsigned char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  const unsigned char *inb = inbuf;
  unsigned char *out = NULL;
  size_t numb;
  size_t endcnt;
  size_t i;
  numb = inlen;
  if (numb > 0) {
    unsigned int acc = 0;
    out = (unsigned char *)outbuf;
    for (i = 0; i < numb; i++) {
      if (i % 3 == 0) {
        acc = inb[i];
      } else if (i % 3 == 1) {
        acc <<= 8;
        acc |= inb[i];
      } else {
        acc <<= 8;
        acc |= inb[i];
        *out++ = b64[(acc >> 18) & 0x3f];
        *out++ = b64[(acc >> 12) & 0x3f];
        *out++ = b64[(acc >> 6) & 0x3f];
        *out++ = b64[acc & 0x3f];
      }
    }
    if (i % 3 == 0) {
      endcnt = 0;
    } else if (i % 3 == 1) {
      endcnt = 2;
    } else {
      endcnt = 1;
    }
    for (; i % 3; i++) {
      acc <<= 8;
    }
    if (endcnt > 0) {
      *out++ = b64[(acc >> 18) & 0x3f];
      *out++ = b64[(acc >> 12) & 0x3f];
      if (endcnt < 2)
        *out++ = b64[(acc >> 6) & 0x3f];
      if (endcnt < 1)
        *out++ = b64[acc & 0x3f];
      while (endcnt-- > 0)
        *out++ = '=';
    }
  }
  *out++ = '\0';
  out = (unsigned char *)outbuf;
  while (*out) {
    if (*out++ > 127)
      abort();
  }
}
```