user: 请将以下的汇编代码转换成C语言代码:

```asm
<base64decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    -0x40(%rbp),%rax
  lea    -0x3(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L9
  mov    -0x40(%rbp),%rax
  sub    $0x3,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L1
L9:
  mov    -0x40(%rbp),%rax
  lea    -0x2(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L103
  mov    -0x40(%rbp),%rax
  sub    $0x2,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L1
L103:
  mov    -0x40(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L118
  mov    -0x40(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x18(%rbp)
  jmp    L1
L118:
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x18(%rbp)
L1:
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  add    %rax,%rax
  lea    0x7(%rax),%rdx
  test   %rax,%rax
  cmovs  %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  add    %rax,%rax
  lea    0x7(%rax),%rdx
  test   %rax,%rax
  cmovs  %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x8,-0x1c(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L22
L15:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  sub    %rdx,%rax
  cmp    $0x2,%rax
  je     L47
  cmp    $0x3,%rax
  je     L19
  jmp    L74
L47:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <b2n@plt>
  mov    %al,-0x24(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <b2n@plt>
  mov    %al,-0x23(%rbp)
  movzbl -0x24(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edx
  movzbl -0x23(%rbp),%eax
  sar    $0x4,%eax
  and    $0x3,%eax
  or     %edx,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  addq   $0x1,-0x10(%rbp)
  jmp    L68
L19:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <b2n@plt>
  mov    %al,-0x24(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <b2n@plt>
  mov    %al,-0x23(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <b2n@plt>
  mov    %al,-0x22(%rbp)
  movzbl -0x24(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edx
  movzbl -0x23(%rbp),%eax
  sar    $0x4,%eax
  and    $0x3,%eax
  or     %edx,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  movzbl -0x23(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  movzbl -0x22(%rbp),%eax
  sar    $0x2,%eax
  and    $0xf,%eax
  or     %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  addq   $0x2,-0x10(%rbp)
  jmp    L68
L74:
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <b2n@plt>
  mov    %al,-0x24(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <b2n@plt>
  mov    %al,-0x23(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x2(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <b2n@plt>
  mov    %al,-0x22(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x3(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <b2n@plt>
  mov    %al,-0x21(%rbp)
  movzbl -0x24(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edx
  movzbl -0x23(%rbp),%eax
  sar    $0x4,%eax
  and    $0x3,%eax
  or     %edx,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dl,(%rax)
  movzbl -0x23(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  movzbl -0x22(%rbp),%eax
  sar    $0x2,%eax
  and    $0xf,%eax
  or     %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %dl,(%rax)
  movzbl -0x22(%rbp),%eax
  shl    $0x6,%eax
  mov    %eax,%edx
  movzbl -0x21(%rbp),%eax
  or     %eax,%edx
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  mov    %dl,(%rax)
  addq   $0x3,-0x10(%rbp)
  nop
L68:
  addl   $0x4,-0x20(%rbp)
L22:
  mov    -0x20(%rbp),%eax
  cltq
  cmp    %rax,-0x18(%rbp)
  jg     L15
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
unsigned char *base64decode(char *base64, long size, long *outsize) {
  long real_size;
  unsigned char c0, c1, c2, c3;
  if (base64[size - 1 - 2] == '=')
    real_size = size - 3;
  else if (base64[size - 1 - 1] == '=')
    real_size = size - 2;
  else if (base64[size - 1] == '=')
    real_size = size - 1;
  else
    real_size = size;
  *outsize = real_size * 6 / 8;
  unsigned char *res = (unsigned char *)malloc(real_size * 6 / 8);
  unsigned char *res_p = res;
  int rest_bit = 8;
  int idx;
  for (idx = 0; idx < real_size; idx += 4) {
    switch (real_size - idx) {
    case 2:
      c0 = b2n(base64[idx + 0]);
      c1 = b2n(base64[idx + 1]);
      res_p[0] = c0 << 2 | (c1 & 0x30) >> 4;
      res_p += 1;
      break;
    case 3:
      c0 = b2n(base64[idx + 0]);
      c1 = b2n(base64[idx + 1]);
      c2 = b2n(base64[idx + 2]);
      res_p[0] = c0 << 2 | (c1 & 0x30) >> 4;
      res_p[1] = c1 << 4 | (c2 & 0x3c) >> 2;
      res_p += 2;
      break;
    default:
      c0 = b2n(base64[idx + 0]);
      c1 = b2n(base64[idx + 1]);
      c2 = b2n(base64[idx + 2]);
      c3 = b2n(base64[idx + 3]);
      res_p[0] = c0 << 2 | (c1 & 0x30) >> 4;
      res_p[1] = c1 << 4 | (c2 & 0x3c) >> 2;
      res_p[2] = c2 << 6 | c3;
      res_p += 3;
      break;
    }
  }
  *res_p = 0;
  return res;
}
```