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

```asm
<oauth_encode_base64>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  jne    L59
  mov    $0x0,%eax
  jmp    L10
L59:
  cmpl   $0x0,-0x24(%rbp)
  jne    L98
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x24(%rbp)
L98:
  mov    -0x24(%rbp),%eax
  shl    $0x2,%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    $0x4,%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <xcalloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L4
L77:
  movb   $0x0,-0x19(%rbp)
  movb   $0x0,-0x1b(%rbp)
  movb   $0x0,-0x1a(%rbp)
  movb   $0x0,-0x18(%rbp)
  movb   $0x0,-0x17(%rbp)
  movb   $0x0,-0x16(%rbp)
  movb   $0x0,-0x15(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x19(%rbp)
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x24(%rbp)
  jle    L35
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x1b(%rbp)
L35:
  mov    -0x14(%rbp),%eax
  add    $0x2,%eax
  cmp    %eax,-0x24(%rbp)
  jle    L49
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x1a(%rbp)
L49:
  movzbl -0x19(%rbp),%eax
  shr    $0x2,%al
  mov    %al,-0x18(%rbp)
  movzbl -0x19(%rbp),%eax
  shl    $0x4,%eax
  and    $0x30,%eax
  mov    %eax,%edx
  movzbl -0x1b(%rbp),%eax
  shr    $0x4,%al
  or     %edx,%eax
  mov    %al,-0x17(%rbp)
  movzbl -0x1b(%rbp),%eax
  shl    $0x2,%eax
  and    $0x3c,%eax
  mov    %eax,%edx
  movzbl -0x1a(%rbp),%eax
  shr    $0x6,%al
  or     %edx,%eax
  mov    %al,-0x16(%rbp)
  movzbl -0x1a(%rbp),%eax
  and    $0x3f,%eax
  mov    %al,-0x15(%rbp)
  movzbl -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <oauth_b64_encode@plt>
  mov    %rax,%rcx
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  movzbl -0x17(%rbp),%eax
  mov    %eax,%edi
  call   <oauth_b64_encode@plt>
  mov    %rax,%rcx
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x24(%rbp)
  jle    L96
  movzbl -0x16(%rbp),%eax
  mov    %eax,%edi
  call   <oauth_b64_encode@plt>
  mov    %rax,%rcx
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L23
L96:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x3d,(%rax)
L23:
  mov    -0x14(%rbp),%eax
  add    $0x2,%eax
  cmp    %eax,-0x24(%rbp)
  jle    L28
  movzbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <oauth_b64_encode@plt>
  mov    %rax,%rcx
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  jmp    L84
L28:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x3d,(%rax)
L84:
  addl   $0x3,-0x14(%rbp)
L4:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L77
  mov    -0x8(%rbp),%rax
L10:
  leave
  ret
```

assistant: ```c
char *oauth_encode_base64(int size, const unsigned char *src) {
  int i;
  char *out, *p;
  if (!src)
    return NULL;
  if (!size)
    size = strlen((char *)src);
  out = (char *)xcalloc(sizeof(char), size * 4 / 3 + 4);
  p = out;
  for (i = 0; i < size; i += 3) {
    unsigned char b1 = 0, b2 = 0, b3 = 0, b4 = 0, b5 = 0, b6 = 0, b7 = 0;
    b1 = src[i];
    if (i + 1 < size)
      b2 = src[i + 1];
    if (i + 2 < size)
      b3 = src[i + 2];
    b4 = b1 >> 2;
    b5 = ((b1 & 0x3) << 4) | (b2 >> 4);
    b6 = ((b2 & 0xf) << 2) | (b3 >> 6);
    b7 = b3 & 0x3f;
    *p++ = oauth_b64_encode(b4);
    *p++ = oauth_b64_encode(b5);
    if (i + 1 < size)
      *p++ = oauth_b64_encode(b6);
    else
      *p++ = '=';
    if (i + 2 < size)
      *p++ = oauth_b64_encode(b7);
    else
      *p++ = '=';
  }
  return out;
}
```