user: What is the c source code of the assembly code below:

```asm
<base32_encode>:
  endbr64
  test   %rcx,%rcx
  je     L196
  push   %r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
  test   %rsi,%rsi
  je     L238
  mov    %rdi,%r12
  lea    D3(%rip),%r13
L183:
  movsbl (%r12),%edi
  call   <to_uchar@plt>
  sar    $0x3,%eax
  and    $0x1f,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,(%rbx)
  cmp    $0x1,%rbp
  je     L188
  movsbl (%r12),%edi
  call   <to_uchar@plt>
  lea    0x0(,%rax,4),%r15d
  cmp    $0x1,%r14
  jne    L22
  mov    %r15d,%eax
  and    $0x1c,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x1(%rbx)
  cmp    $0x2,%rbp
  je     L188
  movb   $0x3d,0x2(%rbx)
  cmp    $0x3,%rbp
  je     L188
  movb   $0x3d,0x3(%rbx)
  cmp    $0x4,%rbp
  je     L188
L107:
  movb   $0x3d,0x4(%rbx)
  cmp    $0x5,%rbp
  je     L188
L102:
  movb   $0x3d,0x5(%rbx)
  cmp    $0x6,%rbp
  je     L188
  movb   $0x3d,0x6(%rbx)
  cmp    $0x7,%rbp
  je     L188
L211:
  movb   $0x3d,0x7(%rbx)
  add    $0x8,%rbx
  cmp    $0x8,%rbp
  je     L188
L229:
  movb   $0x0,(%rbx)
L188:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L22:
  movsbl 0x1(%r12),%edi
  call   <to_uchar@plt>
  sar    $0x6,%eax
  add    %r15d,%eax
  and    $0x1f,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x1(%rbx)
  cmp    $0x2,%rbp
  je     L188
  movsbl 0x1(%r12),%edi
  call   <to_uchar@plt>
  sar    %eax
  and    $0x1f,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x2(%rbx)
  cmp    $0x3,%rbp
  je     L188
  movsbl 0x1(%r12),%edi
  call   <to_uchar@plt>
  shl    $0x4,%eax
  mov    %eax,%r15d
  cmp    $0x2,%r14
  jne    L260
  and    $0x10,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x3(%rbx)
  cmp    $0x4,%rbp
  jne    L107
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L260:
  movsbl 0x2(%r12),%edi
  call   <to_uchar@plt>
  sar    $0x4,%eax
  add    %r15d,%eax
  and    $0x1f,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x3(%rbx)
  cmp    $0x4,%rbp
  je     L188
  movsbl 0x2(%r12),%edi
  call   <to_uchar@plt>
  lea    (%rax,%rax,1),%r15d
  cmp    $0x3,%r14
  jne    L179
  mov    %r15d,%eax
  and    $0x1e,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x4(%rbx)
  cmp    $0x5,%rbp
  je     L188
  jmp    L102
  nopw   0x0(%rax,%rax,1)
L179:
  movsbl 0x3(%r12),%edi
  call   <to_uchar@plt>
  sar    $0x7,%eax
  add    %r15d,%eax
  and    $0x1f,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x4(%rbx)
  cmp    $0x5,%rbp
  je     L188
  movsbl 0x3(%r12),%edi
  call   <to_uchar@plt>
  sar    $0x2,%eax
  and    $0x1f,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x5(%rbx)
  cmp    $0x6,%rbp
  je     L188
  movsbl 0x3(%r12),%edi
  call   <to_uchar@plt>
  lea    0x0(,%rax,8),%r15d
  cmp    $0x4,%r14
  jne    L67
  mov    %r15d,%eax
  and    $0x18,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x6(%rbx)
  cmp    $0x7,%rbp
  jne    L211
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L67:
  movsbl 0x4(%r12),%edi
  call   <to_uchar@plt>
  sar    $0x5,%eax
  add    %r15d,%eax
  and    $0x1f,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,0x6(%rbx)
  cmp    $0x7,%rbp
  je     L188
  movsbl 0x4(%r12),%edi
  add    $0x8,%rbx
  call   <to_uchar@plt>
  and    $0x1f,%eax
  movzbl 0x0(%r13,%rax,1),%eax
  mov    %al,-0x1(%rbx)
  sub    $0x8,%rbp
  je     L188
  sub    $0x5,%r14
  je     L229
  add    $0x5,%r12
  jmp    L183
L238:
  test   %rcx,%rcx
  jne    L229
  jmp    L188
  nopl   (%rax)
L196:
  ret
```

assistant: ```c
void base32_encode(const char *restrict in, size_t inlen, char *restrict out, size_t outlen) {
  static const char b32str[32] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
  while (inlen && outlen) {
    *out++ = b32str[(to_uchar(in[0]) >> 3) & 0x1f];
    if (!--outlen)
      break;
    *out++ = b32str[((to_uchar(in[0]) << 2) + (--inlen ? to_uchar(in[1]) >> 6 : 0)) & 0x1f];
    if (!--outlen)
      break;
    *out++ = (inlen ? b32str[(to_uchar(in[1]) >> 1) & 0x1f] : '=');
    if (!--outlen)
      break;
    *out++ = (inlen ? b32str[((to_uchar(in[1]) << 4) + (--inlen ? to_uchar(in[2]) >> 4 : 0)) & 0x1f] : '=');
    if (!--outlen)
      break;
    *out++ = (inlen ? b32str[((to_uchar(in[2]) << 1) + (--inlen ? to_uchar(in[3]) >> 7 : 0)) & 0x1f] : '=');
    if (!--outlen)
      break;
    *out++ = (inlen ? b32str[(to_uchar(in[3]) >> 2) & 0x1f] : '=');
    if (!--outlen)
      break;
    *out++ = (inlen ? b32str[((to_uchar(in[3]) << 3) + (--inlen ? to_uchar(in[4]) >> 5 : 0)) & 0x1f] : '=');
    if (!--outlen)
      break;
    *out++ = inlen ? b32str[to_uchar(in[4]) & 0x1f] : '=';
    if (!--outlen)
      break;
    if (inlen)
      inlen--;
    if (inlen)
      in += 5;
  }
  if (outlen)
    *out = '\0';
}
```