user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<base64decode>:
  endbr64
  mov    %rsi,%r8
  jmp    L572
  nopl   0x0(%rax)
L543:
  lea    -0x41(%rax),%edx
  cmp    $0x5a,%al
  jle    L241
  lea    -0x61(%rax),%edx
  cmp    $0x19,%dl
  ja     L417
  lea    -0x47(%rax),%edx
L241:
  movzbl 0x1(%rdi),%eax
  test   %al,%al
  je     L417
L557:
  cmp    $0x40,%al
  jle    L472
  cmp    $0x5a,%al
  jg     L291
  sub    $0x41,%eax
  mov    %eax,%ecx
  sar    $0x4,%cl
L206:
  shl    $0x2,%edx
  or     %ecx,%edx
  movzbl 0x2(%rdi),%ecx
  test   %cl,%cl
  je     L417
  cmp    $0x40,%cl
  jle    L542
  cmp    $0x5a,%cl
  jg     L125
  sub    $0x41,%ecx
  mov    %ecx,%esi
  sar    $0x2,%sil
L178:
  shl    $0x4,%eax
  add    $0x4,%rdi
  or     %esi,%eax
  movzbl -0x1(%rdi),%esi
  test   %sil,%sil
  je     L417
  cmp    $0x40,%sil
  jle    L364
  cmp    $0x5a,%sil
  jg     L129
  sub    $0x41,%esi
L252:
  shl    $0x6,%ecx
  mov    %dl,(%r8)
  or     %esi,%ecx
  test   %dl,%dl
  je     L256
  mov    %al,0x1(%r8)
  test   %al,%al
  je     L256
  add    $0x3,%r8
  mov    %cl,-0x1(%r8)
  test   %cl,%cl
  je     L256
L572:
  movzbl (%rdi),%eax
  test   %al,%al
  je     L122
  cmp    $0x40,%al
  jg     L543
  cmp    $0x39,%al
  jg     L369
  lea    0x4(%rax),%edx
  cmp    $0x2f,%al
  jg     L241
  cmp    $0x2b,%al
  je     L562
  cmp    $0x2f,%al
  jne    L417
  movzbl 0x1(%rdi),%eax
  mov    $0x3f,%edx
  test   %al,%al
  jne    L557
L417:
  mov    $0xffffffff,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L472:
  cmp    $0x39,%al
  jg     L312
  cmp    $0x2f,%al
  jle    L251
  add    $0x4,%eax
  mov    $0x3,%ecx
  jmp    L206
  nopl   (%rax)
L542:
  cmp    $0x39,%cl
  jg     L245
  cmp    $0x2f,%cl
  jle    L162
  add    $0x4,%ecx
  mov    %ecx,%esi
  sar    $0x2,%sil
  jmp    L178
L364:
  cmp    $0x39,%sil
  jg     L246
  cmp    $0x2f,%sil
  jle    L483
  add    $0x4,%esi
  jmp    L252
  nopl   0x0(%rax)
L369:
  cmp    $0x3d,%al
  jne    L417
  xor    %edx,%edx
  jmp    L241
  nopl   0x0(%rax,%rax,1)
L291:
  lea    -0x61(%rax),%ecx
  cmp    $0x19,%cl
  ja     L417
  sub    $0x47,%eax
  mov    %eax,%ecx
  sar    $0x4,%cl
  jmp    L206
  nopl   0x0(%rax)
L312:
  cmp    $0x3d,%al
  jne    L417
  xor    %ecx,%ecx
  xor    %eax,%eax
  jmp    L206
  nopl   0x0(%rax)
L125:
  lea    -0x61(%rcx),%esi
  cmp    $0x19,%sil
  ja     L417
  sub    $0x47,%ecx
  mov    %ecx,%esi
  sar    $0x2,%sil
  jmp    L178
  nopl   0x0(%rax,%rax,1)
L245:
  cmp    $0x3d,%cl
  jne    L417
  xor    %esi,%esi
  xor    %ecx,%ecx
  jmp    L178
  nopw   0x0(%rax,%rax,1)
L129:
  lea    -0x61(%rsi),%r9d
  cmp    $0x19,%r9b
  ja     L417
  sub    $0x47,%esi
  jmp    L252
  cs nopw 0x0(%rax,%rax,1)
L246:
  cmp    $0x3d,%sil
  jne    L417
  xor    %esi,%esi
  jmp    L252
  nopl   0x0(%rax)
L251:
  cmp    $0x2b,%al
  je     L6
  cmp    $0x2f,%al
  jne    L417
  mov    $0x3,%ecx
  mov    $0x3f,%eax
  jmp    L206
  nopl   0x0(%rax,%rax,1)
L162:
  cmp    $0x2b,%cl
  je     L268
  cmp    $0x2f,%cl
  jne    L417
  mov    $0xf,%esi
  mov    $0x3f,%ecx
  jmp    L178
  nopl   (%rax)
L483:
  cmp    $0x2b,%sil
  je     L466
  cmp    $0x2f,%sil
  jne    L417
  mov    $0x3f,%esi
  jmp    L252
  nopw   0x0(%rax,%rax,1)
L562:
  mov    $0x3e,%edx
  jmp    L241
  nopw   0x0(%rax,%rax,1)
L6:
  mov    $0x3,%ecx
  mov    $0x3e,%eax
  jmp    L206
  nopw   0x0(%rax,%rax,1)
L268:
  mov    $0xf,%esi
  mov    $0x3e,%ecx
  jmp    L178
  nop
L256:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L466:
  mov    $0x3e,%esi
  jmp    L252
  nopw   0x0(%rax,%rax,1)
L122:
  movb   $0x0,(%r8)
  xor    %eax,%eax
  ret
```

assistant: ```c
int base64decode(const char *encoded, char *decoded) {
  char c, t1, t2, u1, u2, u3;
  while (1) {
    c = *encoded++;
    if (c == 0) {
      *decoded = 0;
      return 0;
    }
    t1 = ((c) >= 'A' ? ((c) <= 'Z' ? (c) - 'A' : (c) >= 'a' ? (c <= 'z' ? (c) - 'a' + 26 : 64) : 64) : (c) <= '9' ? ((c) >= '0' ? (c) - '0' + 52 : (c) == '+' ? 62 : (c) == '/' ? 63 : 64) : (c) == '=' ? 0 : 64);
    if (t1 == 64)
      return -1;
    c = *encoded++;
    if (c == 0)
      return -1;
    t2 = ((c) >= 'A' ? ((c) <= 'Z' ? (c) - 'A' : (c) >= 'a' ? (c <= 'z' ? (c) - 'a' + 26 : 64) : 64) : (c) <= '9' ? ((c) >= '0' ? (c) - '0' + 52 : (c) == '+' ? 62 : (c) == '/' ? 63 : 64) : (c) == '=' ? 0 : 64);
    if (t2 == 64)
      return -1;
    u1 = t1 << 2 | t2 >> 4;
    c = *encoded++;
    if (c == 0)
      return -1;
    t1 = ((c) >= 'A' ? ((c) <= 'Z' ? (c) - 'A' : (c) >= 'a' ? (c <= 'z' ? (c) - 'a' + 26 : 64) : 64) : (c) <= '9' ? ((c) >= '0' ? (c) - '0' + 52 : (c) == '+' ? 62 : (c) == '/' ? 63 : 64) : (c) == '=' ? 0 : 64);
    if (t1 == 64)
      return -1;
    u2 = (t2 & 0xf) << 4 | t1 >> 2;
    c = *encoded++;
    if (c == 0)
      return -1;
    t2 = ((c) >= 'A' ? ((c) <= 'Z' ? (c) - 'A' : (c) >= 'a' ? (c <= 'z' ? (c) - 'a' + 26 : 64) : 64) : (c) <= '9' ? ((c) >= '0' ? (c) - '0' + 52 : (c) == '+' ? 62 : (c) == '/' ? 63 : 64) : (c) == '=' ? 0 : 64);
    if (t2 == 64)
      return -1;
    u3 = (t1 & 0x3) << 6 | t2;
    *decoded++ = u1;
    if (u1 == 0)
      return 0;
    *decoded++ = u2;
    if (u2 == 0)
      return 0;
    *decoded++ = u3;
    if (u3 == 0)
      return 0;
  }
}
```