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

```asm
<base64decode>:
  endbr64
  mov    $0x0,%r8d
  mov    $0x3e,%r10d
  mov    $0x3f,%r9d
  movzbl (%rdi),%eax
  test   %al,%al
  je     L961
  cmp    $0x40,%al
  jle    L997
  lea    -0x41(%rax),%ecx
  cmp    $0x5a,%al
  jle    L285
  lea    -0x61(%rax),%edx
  cmp    $0x19,%dl
  ja     L347
  lea    -0x47(%rax),%ecx
L285:
  movzbl 0x1(%rdi),%eax
  test   %al,%al
  je     L102
  cmp    $0x40,%al
  jle    L692
  cmp    $0x5a,%al
  jg     L717
  sub    $0x41,%eax
L69:
  push   %rbx
  jmp    L505
L654:
  movb   $0x0,(%rsi)
  mov    $0x0,%eax
L759:
  pop    %rbx
  ret
L736:
  cmp    $0x39,%al
  jg     L607
  lea    0x4(%rax),%ecx
  cmp    $0x2f,%al
  jg     L770
  cmp    $0x2b,%al
  je     L432
  cmp    $0x2f,%al
  jne    L946
  mov    %r9d,%ecx
  jmp    L770
L946:
  mov    $0xffffffff,%eax
  jmp    L759
L607:
  cmp    $0x3d,%al
  jne    L615
  mov    %r8d,%ecx
L770:
  movzbl 0x1(%rdi),%eax
  test   %al,%al
  je     L562
  cmp    $0x40,%al
  jle    L374
  cmp    $0x5a,%al
  jg     L46
  sub    $0x41,%eax
L505:
  shl    $0x2,%ecx
  mov    %eax,%edx
  sar    $0x4,%dl
  or     %edx,%ecx
  movzbl 0x2(%rdi),%edx
  test   %dl,%dl
  je     L502
  cmp    $0x40,%dl
  jle    L694
  cmp    $0x5a,%dl
  jg     L461
  sub    $0x41,%edx
L915:
  shl    $0x4,%eax
  mov    %edx,%r11d
  sar    $0x2,%r11b
  or     %r11d,%eax
  add    $0x4,%rdi
  movzbl -0x1(%rdi),%r11d
  test   %r11b,%r11b
  je     L702
  cmp    $0x40,%r11b
  jle    L875
  cmp    $0x5a,%r11b
  jg     L746
  sub    $0x41,%r11d
L642:
  shl    $0x6,%edx
  or     %r11d,%edx
  mov    %cl,(%rsi)
  test   %cl,%cl
  je     L856
  mov    %al,0x1(%rsi)
  test   %al,%al
  je     L874
  add    $0x3,%rsi
  mov    %dl,-0x1(%rsi)
  test   %dl,%dl
  je     L614
  movzbl (%rdi),%eax
  test   %al,%al
  je     L654
  cmp    $0x40,%al
  jle    L736
  lea    -0x41(%rax),%ecx
  cmp    $0x5a,%al
  jle    L770
  lea    -0x61(%rax),%edx
  cmp    $0x19,%dl
  ja     L741
  lea    -0x47(%rax),%ecx
  jmp    L770
L615:
  mov    $0xffffffff,%eax
  jmp    L759
L432:
  mov    %r10d,%ecx
  jmp    L770
L46:
  lea    -0x61(%rax),%edx
  cmp    $0x19,%dl
  ja     L536
  sub    $0x47,%eax
  jmp    L505
L374:
  cmp    $0x39,%al
  jg     L51
  cmp    $0x2f,%al
  jle    L984
  add    $0x4,%eax
  jmp    L505
L984:
  cmp    $0x2b,%al
  je     L398
  cmp    $0x2f,%al
  jne    L361
  mov    %r9d,%eax
  jmp    L505
L361:
  mov    $0xffffffff,%eax
  jmp    L759
L51:
  cmp    $0x3d,%al
  jne    L600
  mov    %r8d,%eax
  jmp    L505
L600:
  mov    $0xffffffff,%eax
  jmp    L759
L398:
  mov    %r10d,%eax
  jmp    L505
L461:
  lea    -0x61(%rdx),%r11d
  cmp    $0x19,%r11b
  ja     L506
  sub    $0x47,%edx
  jmp    L915
L694:
  cmp    $0x39,%dl
  jg     L802
  cmp    $0x2f,%dl
  jle    L934
  add    $0x4,%edx
  jmp    L915
L934:
  cmp    $0x2b,%dl
  je     L391
  cmp    $0x2f,%dl
  jne    L67
  mov    %r9d,%edx
  jmp    L915
L67:
  mov    $0xffffffff,%eax
  jmp    L759
L802:
  cmp    $0x3d,%dl
  jne    L484
  mov    %r8d,%edx
  jmp    L915
L484:
  mov    $0xffffffff,%eax
  jmp    L759
L391:
  mov    %r10d,%edx
  jmp    L915
L746:
  lea    -0x61(%r11),%ebx
  cmp    $0x19,%bl
  ja     L825
  sub    $0x47,%r11d
  jmp    L642
L875:
  cmp    $0x39,%r11b
  jg     L38
  cmp    $0x2f,%r11b
  jle    L265
  add    $0x4,%r11d
  jmp    L642
L265:
  cmp    $0x2b,%r11b
  je     L309
  cmp    $0x2f,%r11b
  jne    L256
  mov    %r9d,%r11d
  jmp    L642
L256:
  mov    $0xffffffff,%eax
  jmp    L759
L38:
  cmp    $0x3d,%r11b
  jne    L969
  mov    %r8d,%r11d
  jmp    L642
L969:
  mov    $0xffffffff,%eax
  jmp    L759
L309:
  mov    %r10d,%r11d
  jmp    L642
L614:
  mov    $0x0,%eax
  jmp    L759
L741:
  mov    $0xffffffff,%eax
  jmp    L759
L562:
  mov    $0xffffffff,%eax
  jmp    L759
L536:
  mov    $0xffffffff,%eax
  jmp    L759
L502:
  mov    $0xffffffff,%eax
  jmp    L759
L506:
  mov    $0xffffffff,%eax
  jmp    L759
L702:
  mov    $0xffffffff,%eax
  jmp    L759
L825:
  mov    $0xffffffff,%eax
  jmp    L759
L856:
  mov    $0x0,%eax
  jmp    L759
L874:
  mov    $0x0,%eax
  jmp    L759
L961:
  movb   $0x0,(%rsi)
  mov    $0x0,%eax
  ret
L997:
  cmp    $0x39,%al
  jg     L550
  lea    0x4(%rax),%ecx
  cmp    $0x2f,%al
  jg     L285
  cmp    $0x2b,%al
  je     L326
  mov    %r9d,%ecx
  cmp    $0x2f,%al
  je     L285
  mov    $0xffffffff,%eax
  ret
L550:
  mov    %r8d,%ecx
  cmp    $0x3d,%al
  je     L285
  mov    $0xffffffff,%eax
  ret
L326:
  mov    %r10d,%ecx
  jmp    L285
L717:
  lea    -0x61(%rax),%edx
  cmp    $0x19,%dl
  ja     L40
  sub    $0x47,%eax
  jmp    L69
L692:
  cmp    $0x39,%al
  jg     L503
  cmp    $0x2f,%al
  jle    L162
  add    $0x4,%eax
  jmp    L69
L162:
  cmp    $0x2b,%al
  je     L373
  cmp    $0x2f,%al
  je     L740
  mov    $0xffffffff,%eax
  ret
L503:
  cmp    $0x3d,%al
  je     L994
  mov    $0xffffffff,%eax
  ret
L373:
  mov    %r10d,%eax
  jmp    L69
L740:
  mov    %r9d,%eax
  jmp    L69
L994:
  mov    %r8d,%eax
  jmp    L69
L347:
  mov    $0xffffffff,%eax
  ret
L102:
  mov    $0xffffffff,%eax
  ret
L40:
  mov    $0xffffffff,%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;
  }
}
```