user: What would the C source look like for the assembly code provided here?

```asm
<base64_encode>:
  endbr64
  push   %rbp
  mov    %rdi,%r8
  mov    %esi,%r9d
  mov    %rdx,%rbp
  push   %rbx
  xor    %ecx,%ecx
  lea    D6(%rip),%rdi
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    D18(%rip),%rax
  movl   $0x1,0x10(%rsp)
  mov    %rax,0x8(%rsp)
  lea    0x2(%rsi),%eax
  movslq %eax,%rbx
  sar    $0x1f,%eax
  imul   $0x55555556,%rbx,%rbx
  shr    $0x20,%rbx
  sub    %eax,%ebx
  shl    $0x2,%ebx
  test   %esi,%esi
  jg     L65
  jmp    L56
  nopw   0x0(%rax,%rax,1)
L69:
  movslq %esi,%rsi
  lea    0x2(%rcx),%r10d
  movzbl (%r8,%rsi,1),%esi
  shl    $0x8,%esi
  cmp    %r10d,%r9d
  jle    L78
  movslq %r10d,%r10
  add    $0x3,%ecx
  movzbl (%r8,%r10,1),%r10d
L75:
  shl    $0x10,%eax
  add    $0x4,%rdx
  add    %esi,%eax
  lea    (%rax,%r10,1),%esi
  mov    %eax,%r10d
  shr    $0xc,%eax
  and    $0x3f,%eax
  shr    $0x12,%r10d
  movzbl (%rdi,%rax,1),%eax
  movzbl (%rdi,%r10,1),%r10d
  mov    %al,-0x3(%rdx)
  mov    %esi,%eax
  and    $0x3f,%esi
  sar    $0x6,%eax
  mov    %r10b,-0x4(%rdx)
  and    $0x3f,%eax
  movzbl (%rdi,%rax,1),%eax
  mov    %al,-0x2(%rdx)
  movzbl (%rdi,%rsi,1),%eax
  mov    %al,-0x1(%rdx)
  cmp    %r9d,%ecx
  jge    L56
L65:
  movslq %ecx,%rax
  lea    0x1(%rcx),%esi
  movzbl (%r8,%rax,1),%eax
  cmp    %esi,%r9d
  jg     L69
  mov    %esi,%ecx
  xor    %r10d,%r10d
  xor    %esi,%esi
  jmp    L75
  nopl   0x0(%rax)
L56:
  movslq %r9d,%rax
  mov    %r9d,%edx
  imul   $0x55555556,%rax,%rax
  sar    $0x1f,%edx
  shr    $0x20,%rax
  sub    %edx,%eax
  lea    (%rax,%rax,2),%eax
  sub    %eax,%r9d
  movslq %r9d,%r9
  mov    0x8(%rsp,%r9,4),%eax
  test   %eax,%eax
  jle    L38
  lea    -0x1(%rbx),%edi
  mov    %eax,%edx
  sub    $0x1,%eax
  mov    $0x3d,%esi
  movslq %edi,%rdi
  sub    %rax,%rdi
  add    %rbp,%rdi
  call   <memset@plt>
L38:
  movslq %ebx,%rbx
  movb   $0x0,0x0(%rbp,%rbx,1)
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L72
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
L78:
  mov    %r10d,%ecx
  xor    %r10d,%r10d
  jmp    L75
L72:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D6
datatype: string
name: parse_data
arguments: data_tag: D18
datatype: byte[8]

tool: D6: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/

tool: {"D18": [0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00]}

assistant: ```c
void base64_encode(unsigned char *data, int len, char *out) {
  char *lookup = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  int mod_table[] = {0, 2, 1};
  int out_len = 4 * ((len + 2) / 3);
  int i, j;
  for (i = 0, j = 0; i < len;) {
    uint32_t octet_a = i < len ? (unsigned char)data[i++] : 0;
    uint32_t octet_b = i < len ? (unsigned char)data[i++] : 0;
    uint32_t octet_c = i < len ? (unsigned char)data[i++] : 0;
    uint32_t triple = (octet_a << 0x10) + (octet_b << 0x08) + octet_c;
    out[j++] = lookup[(triple >> 3 * 6) & 0x3F];
    out[j++] = lookup[(triple >> 2 * 6) & 0x3F];
    out[j++] = lookup[(triple >> 1 * 6) & 0x3F];
    out[j++] = lookup[(triple >> 0 * 6) & 0x3F];
  }
  for (i = 0; i < mod_table[len % 3]; i++)
    out[out_len - 1 - i] = '=';
  out[out_len] = '\0';
}
```