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

```asm
<base32_encode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %edx,-0x64(%rbp)
  mov    %ecx,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movabs $0x38676672646e6279,%rax
  movabs $0x787170636d6b6a65,%rdx
  mov    %rax,-0x30(%rbp)
  mov    %rdx,-0x28(%rbp)
  movabs $0x7a7369777531746f,%rax
  movabs $0x3936376835343361,%rdx
  mov    %rax,-0x20(%rbp)
  mov    %rdx,-0x18(%rbp)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movb   $0x0,-0x46(%rbp)
  movb   $0x0,-0x45(%rbp)
  movb   $0x0,-0x44(%rbp)
  movb   $0x0,-0x43(%rbp)
  movb   $0x0,-0x42(%rbp)
  mov    -0x64(%rbp),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x2,%eax
  mov    %eax,%edx
  shl    $0x2,%edx
  add    %eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  mov    %al,-0x41(%rbp)
  movb   $0x0,-0x47(%rbp)
  movb   $0x3d,-0x31(%rbp)
  mov    -0x64(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x2,%eax
  mov    %eax,-0x38(%rbp)
  jmp    L19
L172:
  mov    -0x40(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jae    L8
  mov    -0x40(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  mov    %eax,%edx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <uchar@plt>
  jmp    L67
L8:
  mov    $0x0,%eax
L67:
  mov    %al,-0x46(%rbp)
  mov    -0x40(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jae    L185
  mov    -0x40(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  mov    %eax,%edx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <uchar@plt>
  jmp    L28
L185:
  mov    $0x0,%eax
L28:
  mov    %al,-0x45(%rbp)
  mov    -0x40(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jae    L119
  mov    -0x40(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  mov    %eax,%edx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <uchar@plt>
  jmp    L209
L119:
  mov    $0x0,%eax
L209:
  mov    %al,-0x44(%rbp)
  mov    -0x40(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jae    L116
  mov    -0x40(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  mov    %eax,%edx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <uchar@plt>
  jmp    L186
L116:
  mov    $0x0,%eax
L186:
  mov    %al,-0x43(%rbp)
  mov    -0x40(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jae    L13
  mov    -0x40(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x40(%rbp)
  mov    %eax,%edx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <uchar@plt>
  jmp    L4
L13:
  mov    $0x0,%eax
L4:
  mov    %al,-0x42(%rbp)
  movzbl -0x46(%rbp),%eax
  shr    $0x3,%al
  movzbl %al,%ecx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  movzbl -0x46(%rbp),%eax
  shl    $0x2,%eax
  and    $0x1c,%eax
  mov    %eax,%edx
  movzbl -0x45(%rbp),%eax
  shr    $0x6,%al
  movzbl %al,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  movzbl -0x45(%rbp),%eax
  sar    %eax
  and    $0x1f,%eax
  mov    %eax,%ecx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  movzbl -0x45(%rbp),%eax
  shl    $0x4,%eax
  and    $0x10,%eax
  mov    %eax,%edx
  movzbl -0x44(%rbp),%eax
  shr    $0x4,%al
  movzbl %al,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  movzbl -0x44(%rbp),%eax
  add    %eax,%eax
  and    $0x1e,%eax
  mov    %eax,%edx
  movzbl -0x43(%rbp),%eax
  shr    $0x7,%al
  movzbl %al,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  movzbl -0x43(%rbp),%eax
  sar    $0x2,%eax
  and    $0x1f,%eax
  mov    %eax,%ecx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  movzbl -0x43(%rbp),%eax
  shl    $0x3,%eax
  and    $0x18,%eax
  mov    %eax,%edx
  movzbl -0x42(%rbp),%eax
  shr    $0x5,%al
  movzbl %al,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  movzbl -0x42(%rbp),%eax
  and    $0x1f,%eax
  mov    %eax,%ecx
  mov    -0x3c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movslq %ecx,%rax
  movzbl -0x30(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
L19:
  mov    -0x40(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jae    L71
  mov    -0x3c(%rbp),%eax
  cmp    -0x68(%rbp),%eax
  jb     L172
L71:
  cmpb   $0x1,-0x41(%rbp)
  jne    L114
  movb   $0x6,-0x47(%rbp)
  jmp    L11
L114:
  cmpb   $0x2,-0x41(%rbp)
  jne    L131
  movb   $0x4,-0x47(%rbp)
  jmp    L11
L131:
  cmpb   $0x3,-0x41(%rbp)
  jne    L200
  movb   $0x3,-0x47(%rbp)
  jmp    L11
L200:
  cmpb   $0x4,-0x41(%rbp)
  jne    L11
  movb   $0x1,-0x47(%rbp)
L11:
  subl   $0x1,-0x3c(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L45
L142:
  mov    -0x3c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x3c(%rbp)
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x31(%rbp),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x40(%rbp)
L45:
  movzbl -0x47(%rbp),%eax
  cmp    %eax,-0x40(%rbp)
  jb     L142
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L163
  call   <__stack_chk_fail@plt>
L163:
  leave
  ret
```

assistant: ```c
int base32_encode(char *dest, const char *src, unsigned int srclen, unsigned int outlen) {
  const char table[32] = "ybndrfg8ejkmcpqxot1uwisza345h769";
  unsigned int i = 0;
  unsigned int j = 0;
  unsigned char a = 0;
  unsigned char b = 0;
  unsigned char c = 0;
  unsigned char d = 0;
  unsigned char e = 0;
  unsigned char leftover_bytes = (srclen % 5);
  unsigned char replace_bytes = 0;
  const char padding[1] = "=";
  unsigned int iters = (srclen / 5);
  while (i < srclen && j < outlen) {
    a = i < srclen ? uchar(src[i++]) : 0;
    b = i < srclen ? uchar(src[i++]) : 0;
    c = i < srclen ? uchar(src[i++]) : 0;
    d = i < srclen ? uchar(src[i++]) : 0;
    e = i < srclen ? uchar(src[i++]) : 0;
    dest[j++] = table[(a >> 3)];
    dest[j++] = table[(((a & 0x07) << 2) | (b >> 6))];
    dest[j++] = table[(((b & 0x3F) >> 1))];
    dest[j++] = table[(((b & 0x01) << 4) | (c >> 4))];
    dest[j++] = table[(((c & 0x0F) << 1) | (d >> 7))];
    dest[j++] = table[(((d & 0x7F) >> 2))];
    dest[j++] = table[(((d & 0x03) << 3) | (e >> 5))];
    dest[j++] = table[(((e & 0x1F)))];
  }
  if (leftover_bytes == 1)
    replace_bytes = 6;
  else if (leftover_bytes == 2)
    replace_bytes = 4;
  else if (leftover_bytes == 3)
    replace_bytes = 3;
  else if (leftover_bytes == 4)
    replace_bytes = 1;
  j--;
  for (i = 0; i < replace_bytes; i++) {
    dest[j--] = padding[0];
  }
  return 0;
}
```