user: Translate the below assembly code into C programming language:

```asm
<uuencode>:
  endbr64
  push   %r15
  mov    %rcx,%r10
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  test   %rcx,%rcx
  jne    L137
  mov    %rdx,%rdi
  call   <strlen@plt>
  mov    %rax,%r10
L137:
  cmp    $0x2,%rbp
  jbe    L73
  mov    $0x3,%r14d
  lea    -0x3(%rbp),%r11
  xor    %eax,%eax
  xor    %r8d,%r8d
  mov    $0x60,%r9d
  sub    %r12,%r14
L16:
  cmp    %r8,%r10
  setae  %dl
  cmp    %r11,%rax
  setb   %cl
  and    %cl,%dl
  je     L22
  lea    0x2d(%r8),%rcx
  cmp    %r10,%rcx
  jbe    L36
  mov    %r10,%rbp
  sub    %r8,%rbp
  je     L43
  add    $0x20,%rbp
  mov    %ebp,%ecx
  setne  %dl
L10:
  lea    0x1(%rax),%rsi
  mov    %cl,(%rbx,%rax,1)
  cmp    %rsi,%r11
  seta   %cl
  cmp    %r8,%r10
  seta   %al
  test   %al,%cl
  je     L59
  test   %dl,%dl
  je     L59
  mov    %r14,%r13
  lea    (%r12,%r8,1),%rdx
  lea    (%rbx,%rsi,1),%rcx
  mov    %rsi,%rax
  sub    %r8,%r13
  nopw   0x0(%rax,%rax,1)
L96:
  movzbl (%rdx),%esi
  sar    $0x2,%sil
  lea    0x20(%rsi),%edi
  cmove  %r9d,%edi
  mov    %dil,(%rcx)
  movsbl (%rdx),%edi
  shl    $0x4,%edi
  and    $0x30,%edi
  mov    %dil,0x1(%rcx)
  movzbl 0x1(%rdx),%esi
  sar    $0x4,%sil
  or     %edi,%esi
  test   %sil,%sil
  lea    0x20(%rsi),%edi
  cmove  %r9d,%edi
  mov    %dil,0x1(%rcx)
  movsbl 0x1(%rdx),%edi
  shl    $0x2,%edi
  and    $0x3c,%edi
  mov    %dil,0x2(%rcx)
  movzbl 0x2(%rdx),%esi
  sar    $0x6,%sil
  or     %edi,%esi
  test   %sil,%sil
  lea    0x20(%rsi),%edi
  cmove  %r9d,%edi
  add    $0x3,%r8
  mov    %dil,0x2(%rcx)
  movzbl 0x2(%rdx),%esi
  and    $0x3f,%esi
  test   %sil,%sil
  lea    0x20(%rsi),%edi
  lea    0x0(%r13,%rdx,1),%rsi
  cmove  %r9d,%edi
  add    $0x4,%rax
  cmp    %rbp,%rsi
  mov    %dil,0x3(%rcx)
  setb   %dil
  cmp    %rax,%r11
  seta   %sil
  cmp    %r8,%r10
  seta   %r15b
  add    $0x3,%rdx
  add    $0x4,%rcx
  and    %r15d,%esi
  test   %sil,%dil
  jne    L96
L147:
  cmp    %rax,%r11
  jbe    L2
  lea    0x1(%rax),%rdx
  movb   $0xd,(%rbx,%rax,1)
  add    $0x2,%rax
  movb   $0xa,(%rbx,%rdx,1)
L2:
  cmp    %r8,%r10
  ja     L16
L22:
  cmp    %r11,%rax
  jae    L29
  movb   $0x0,(%rbx,%rax,1)
  add    $0x1,%rax
L29:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L36:
  mov    $0x4d,%ecx
  mov    $0x4d,%ebp
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L43:
  mov    $0x60,%ecx
  mov    $0x60,%ebp
  jmp    L10
  nop
L59:
  mov    %rsi,%rax
  jmp    L147
L73:
  mov    $0xffffffff,%eax
  jmp    L29
```

assistant: ```c
int uuencode(char *target, size_t tlen, const char *source, size_t slen) {
  size_t rd = 0;
  size_t wr = 0;
  size_t block;
  size_t len;
  if (slen == 0)
    slen = strlen(source);
  if (tlen < 3)
    return (-1);
  tlen -= 3;
  while (rd <= slen && wr < tlen) {
    len = 45;
    if (rd + len > slen)
      len = slen - rd;
    if ((len) == 0)
      (len) = '`';
    else
      (len) += ' ';
    ;
    target[wr++] = len;
    block = 0;
    while (block < len && wr < tlen && rd < slen) {
      target[wr] = source[rd] >> 2;
      if ((target[wr]) == 0)
        (target[wr]) = '`';
      else
        (target[wr]) += ' ';
      ;
      wr++;
      target[wr] = (source[rd++] & 0x03) << 4;
      target[wr] |= source[rd] >> 4;
      if ((target[wr]) == 0)
        (target[wr]) = '`';
      else
        (target[wr]) += ' ';
      ;
      wr++;
      target[wr] = (source[rd++] & 0x0f) << 2;
      target[wr] |= source[rd] >> 6;
      if ((target[wr]) == 0)
        (target[wr]) = '`';
      else
        (target[wr]) += ' ';
      ;
      wr++;
      target[wr] = source[rd++] & 0x3f;
      if ((target[wr]) == 0)
        (target[wr]) = '`';
      else
        (target[wr]) += ' ';
      ;
      wr++;
      block += 3;
    }
    if (wr < tlen) {
      target[wr++] = '\r';
      target[wr++] = '\n';
    }
    if (rd >= slen)
      break;
  }
  if (wr < tlen)
    target[wr++] = 0;
  return (wr);
}
```