user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<base32_encode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdx,%rbx
  mov    %rcx,%rbp
  test   %rsi,%rsi
  je     L325
  mov    %rdi,%r13
  mov    %rsi,%r14
  test   %rcx,%rcx
  je     L325
  lea    D8(%rip),%r15
  jmp    L199
L238:
  movsbl 0x1(%r13),%edi
  call   <to_uchar@plt>
  sar    $0x6,%eax
  add    0xc(%rsp),%eax
  and    $0x1f,%eax
  movzbl (%r15,%rax,1),%eax
  mov    %al,0x1(%rbx)
  cmp    $0x2,%rbp
  je     L243
L24:
  movsbl 0x1(%r13),%edi
  call   <to_uchar@plt>
  sar    %eax
  and    $0x1f,%eax
  movzbl (%r15,%rax,1),%eax
  mov    %al,0x2(%rbx)
  cmp    $0x3,%rbp
  je     L243
  movsbl 0x1(%r13),%edi
  call   <to_uchar@plt>
  shl    $0x4,%eax
  mov    %eax,%r12d
  cmp    $0x2,%r14
  jne    L284
  and    $0x10,%r12d
  movzbl (%r15,%r12,1),%eax
  mov    %al,0x3(%rbx)
  cmp    $0x4,%rbp
  jne    L191
L243:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L284:
  movsbl 0x2(%r13),%edi
  call   <to_uchar@plt>
  sar    $0x4,%eax
  add    %r12d,%eax
  and    $0x1f,%eax
  movzbl (%r15,%rax,1),%eax
  mov    %al,0x3(%rbx)
  cmp    $0x4,%rbp
  je     L243
  movsbl 0x2(%r13),%edi
  call   <to_uchar@plt>
  add    %eax,%eax
  mov    %eax,0xc(%rsp)
  mov    $0x0,%eax
  sub    $0x3,%r14
  mov    %r14,%r12
  jne    L334
L274:
  add    0xc(%rsp),%eax
  and    $0x1f,%eax
  movzbl (%r15,%rax,1),%eax
  jmp    L182
L334:
  movsbl 0x3(%r13),%edi
  call   <to_uchar@plt>
  sar    $0x7,%eax
  jmp    L274
L93:
  movsbl 0x3(%r13),%edi
  call   <to_uchar@plt>
  sar    $0x2,%eax
  and    $0x1f,%eax
  movzbl (%r15,%rax,1),%eax
  mov    %al,0x5(%rbx)
  cmp    $0x6,%rbp
  je     L243
L309:
  movsbl 0x3(%r13),%edi
  call   <to_uchar@plt>
  lea    0x0(,%rax,8),%r14d
  mov    $0x0,%eax
  sub    $0x1,%r12
  jne    L136
L128:
  add    %eax,%r14d
  and    $0x1f,%r14d
  movzbl (%r15,%r14,1),%eax
  jmp    L226
L136:
  movsbl 0x4(%r13),%edi
  call   <to_uchar@plt>
  sar    $0x5,%eax
  jmp    L128
L89:
  movsbl 0x4(%r13),%edi
  call   <to_uchar@plt>
  add    $0x8,%rbx
  and    $0x1f,%eax
  movzbl (%r15,%rax,1),%eax
  mov    %al,-0x1(%rbx)
  sub    $0x8,%rbp
  je     L243
  mov    %r12,%r14
  sub    $0x1,%r14
  je     L203
  add    $0x5,%r13
L199:
  movsbl 0x0(%r13),%edi
  call   <to_uchar@plt>
  sar    $0x3,%eax
  and    $0x1f,%eax
  movzbl (%r15,%rax,1),%eax
  mov    %al,(%rbx)
  cmp    $0x1,%rbp
  je     L243
  movsbl 0x0(%r13),%edi
  call   <to_uchar@plt>
  shl    $0x2,%eax
  mov    %eax,0xc(%rsp)
  mov    %r14,%r12
  sub    $0x1,%r12
  jne    L238
  mov    0xc(%rsp),%eax
  and    $0x1c,%eax
  movzbl (%r15,%rax,1),%eax
  mov    %al,0x1(%rbx)
  cmp    $0x2,%rbp
  je     L243
  test   %r12,%r12
  jne    L24
  movb   $0x3d,0x2(%rbx)
  cmp    $0x3,%rbp
  je     L243
  movb   $0x3d,0x3(%rbx)
  cmp    $0x4,%rbp
  je     L243
  mov    $0x3d,%eax
L182:
  mov    %al,0x4(%rbx)
  cmp    $0x5,%rbp
  je     L243
  test   %r12,%r12
  jne    L93
  movb   $0x3d,0x5(%rbx)
  cmp    $0x6,%rbp
  je     L243
  test   %r12,%r12
  jne    L309
  mov    $0x3d,%eax
L226:
  mov    %al,0x6(%rbx)
  cmp    $0x7,%rbp
  je     L243
  test   %r12,%r12
  jne    L89
  add    $0x8,%rbx
  movb   $0x3d,-0x1(%rbx)
  cmp    $0x8,%rbp
  je     L243
L203:
  movb   $0x0,(%rbx)
  jmp    L243
L325:
  test   %rbp,%rbp
  jne    L203
  jmp    L243
L191:
  mov    $0x3d,%eax
  mov    $0x0,%r12d
  jmp    L182
```

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';
}
```