user: Converte this assembly snippet into its equivalent C code:

```asm
<uudecode>:
  endbr64
  push   %r15
  movslq %esi,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x10(%rsp)
  movzbl (%rdi,%rax,1),%edi
  mov    %rdx,0x18(%rsp)
  test   $0xdf,%dil
  je     L97
  movl   $0x0,0xc(%rsp)
  mov    %rax,%rbx
  nopl   0x0(%rax,%rax,1)
L51:
  call   <decode_char@plt>
  mov    %eax,%r13d
  lea    0x1(%rbx),%eax
  mov    %eax,0x8(%rsp)
  test   %r13d,%r13d
  jle    L24
  movslq 0xc(%rsp),%rbp
  movslq %eax,%r14
  mov    0x10(%rsp),%rax
  mov    %rbp,%r15
  lea    0x1(%rax,%r14,1),%rbx
  add    0x18(%rsp),%rbp
  jmp    L14
  nopw   0x0(%rax,%rax,1)
L2:
  add    $0x3,%r15d
  add    $0x4,%r14
  add    $0x4,%rbx
  add    $0x3,%rbp
  call   <decode_char@plt>
  movzbl -0x4(%rbx),%edi
  mov    %eax,%r12d
  call   <decode_char@plt>
  shl    $0x2,%r12d
  sar    $0x4,%eax
  or     %eax,%r12d
  mov    %r12b,-0x3(%rbp)
  movzbl -0x4(%rbx),%edi
  call   <decode_char@plt>
  movzbl -0x3(%rbx),%edi
  mov    %eax,%r12d
  call   <decode_char@plt>
  shl    $0x4,%r12d
  sar    $0x2,%eax
  or     %eax,%r12d
  mov    %r12b,-0x2(%rbp)
  movzbl -0x3(%rbx),%edi
  call   <decode_char@plt>
  movzbl -0x2(%rbx),%edi
  mov    %eax,%r12d
  call   <decode_char@plt>
  shl    $0x6,%r12d
  or     %eax,%r12d
  mov    %r12b,-0x1(%rbp)
  sub    $0x3,%r13d
  je     L114
L14:
  lea    0x1(%r15),%eax
  movzbl -0x1(%rbx),%edi
  mov    %eax,0xc(%rsp)
  lea    0x4(%r14),%eax
  mov    %eax,0x8(%rsp)
  cmp    $0x2,%r13d
  jg     L2
  call   <decode_char@plt>
  movzbl (%rbx),%edi
  mov    %eax,%r12d
  call   <decode_char@plt>
  shl    $0x2,%r12d
  sar    $0x4,%eax
  or     %eax,%r12d
  mov    %r12b,0x0(%rbp)
  cmp    $0x2,%r13d
  je     L11
L24:
  movslq 0x8(%rsp),%r12
  mov    %r12,%rax
  add    0x10(%rsp),%r12
  sub    %r12d,%eax
  mov    %eax,%r13d
  nopl   0x0(%rax)
L109:
  movzbl (%r12),%edi
  lea    0x0(%r13,%r12,1),%ebx
  mov    %r12,%rbp
  add    $0x1,%r12
  call   <isblanks@plt>
  test   %rax,%rax
  jne    L109
  movzbl 0x0(%rbp),%edi
  test   $0xdf,%dil
  jne    L51
  movslq %ebx,%rax
L77:
  mov    0x10(%rsp),%r15
  add    %rax,%r15
  nopl   0x0(%rax)
L13:
  movzbl (%r15),%edi
  add    $0x1,%r15
  call   <isblanks@plt>
  test   %rax,%rax
  jne    L13
  mov    0xc(%rsp),%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L11:
  movzbl (%rbx),%edi
  call   <decode_char@plt>
  mov    %eax,%ebx
  mov    0x10(%rsp),%rax
  shl    $0x4,%ebx
  movzbl 0x2(%rax,%r14,1),%edi
  call   <decode_char@plt>
  movslq 0xc(%rsp),%r14
  sar    $0x2,%eax
  or     %eax,%ebx
  mov    0x18(%rsp),%rax
  mov    %bl,(%rax,%r14,1)
  lea    0x2(%r15),%eax
  mov    %eax,0xc(%rsp)
  jmp    L24
L97:
  movl   $0x0,0xc(%rsp)
  jmp    L77
L114:
  mov    %r15d,0xc(%rsp)
  jmp    L24
```

assistant: ```c
int uudecode(unsigned char *input, int offset, unsigned char *output) {
  int ooffset = 0;
  while (input[offset] != 32 && input[offset] != '\0') {
    int encodedoctets;
    encodedoctets = decode_char(input[offset]);
    for (++offset; encodedoctets > 0; offset += 4, encodedoctets -= 3) {
      char ch;
      if (encodedoctets >= 3) {
        ch = decode_char(input[offset]) << 2 | decode_char(input[offset + 1]) >> 4;
        output[ooffset++] = ch;
        ch = decode_char(input[offset + 1]) << 4 | decode_char(input[offset + 2]) >> 2;
        output[ooffset++] = ch;
        ch = decode_char(input[offset + 2]) << 6 | decode_char(input[offset + 3]);
        output[ooffset++] = ch;
      } else {
        if (encodedoctets >= 1) {
          ch = decode_char(input[offset]) << 2 | decode_char(input[offset + 1]) >> 4;
          output[ooffset++] = ch;
        }
        if (encodedoctets >= 2) {
          ch = decode_char(input[offset + 1]) << 4 | decode_char(input[offset + 2]) >> 2;
          output[ooffset++] = ch;
        }
      }
    }
    while (isblanks(input[offset]))
      offset++;
  }
  while (isblanks(input[offset]))
    offset++;
  return ooffset;
}
```