user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<base64_decode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r13
  mov    %rdx,0x8(%rsp)
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%r14d
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  movzbl (%rbx),%esi
  test   %sil,%sil
  je     L166
  mov    %r12,%rbp
  lea    D12(%rip),%r15
  jmp    L226
L109:
  cmp    $0x39,%sil
  jg     L143
  cmp    $0x2f,%sil
  jg     L64
  cmp    $0x2b,%sil
  je     L174
  cmp    $0x2f,%sil
  jne    L116
  movb   $0x3f,0x0(%rbp)
  jmp    L97
L143:
  cmp    $0x3d,%sil
  je     L85
  lea    -0x61(%rax),%edx
  cmp    $0x19,%dl
  jbe    L193
L116:
  movsbl %sil,%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L97
L193:
  sub    $0x47,%eax
  mov    %al,0x0(%rbp)
L97:
  add    $0x1,%rbx
  add    $0x1,%rbp
  movzbl (%rbx),%esi
  test   %sil,%sil
  je     L166
L226:
  mov    %esi,%eax
  lea    -0x41(%rsi),%edx
  cmp    $0x19,%dl
  ja     L109
  mov    %dl,0x0(%rbp)
  jmp    L97
L64:
  add    $0x4,%eax
  mov    %al,0x0(%rbp)
  jmp    L97
L174:
  movb   $0x3e,0x0(%rbp)
  jmp    L97
L85:
  movb   $0xff,0x0(%rbp)
  jmp    L97
L166:
  cmp    $0x4,%r14d
  jle    L167
  mov    %r12,%rax
  lea    -0x5(%r14),%r8d
  shr    $0x2,%r8d
  mov    %r8d,%r9d
  lea    0x4(%r12,%r9,4),%rdi
  mov    %r13,%rcx
L17:
  movzbl (%rax),%edx
  movzbl 0x1(%rax),%esi
  sar    $0x4,%sil
  lea    (%rsi,%rdx,4),%edx
  mov    %dl,(%rcx)
  movzbl 0x1(%rax),%edx
  shl    $0x4,%edx
  movzbl 0x2(%rax),%esi
  sar    $0x2,%sil
  add    %esi,%edx
  mov    %dl,0x1(%rcx)
  add    $0x3,%rcx
  movzbl 0x2(%rax),%edx
  shl    $0x6,%edx
  add    0x3(%rax),%dl
  mov    %dl,-0x1(%rcx)
  add    $0x4,%rax
  cmp    %rdi,%rax
  jne    L17
  lea    0x3(%r9,%r9,2),%rax
  add    %rax,%r13
  lea    0x4(,%r8,4),%eax
L247:
  cltq
  lea    0x3(%r12,%rax,1),%rdx
  cmpb   $0xff,(%rdx)
  je     L52
  lea    0x1(%r12,%rax,1),%rdi
  movzbl (%r12,%rax,1),%ecx
  movzbl (%rdi),%esi
  sar    $0x4,%sil
  lea    (%rsi,%rcx,4),%ecx
  mov    %cl,0x0(%r13)
  lea    0x2(%r12,%rax,1),%rsi
  movzbl (%rdi),%eax
  shl    $0x4,%eax
  movzbl (%rsi),%ecx
  sar    $0x2,%cl
  add    %ecx,%eax
  mov    %al,0x1(%r13)
  lea    0x3(%r13),%rcx
  movzbl (%rsi),%eax
  shl    $0x6,%eax
  add    (%rdx),%al
  mov    %al,0x2(%r13)
L197:
  movb   $0x0,(%rcx)
  lea    (%r14,%r14,2),%edx
  add    %edx,%edx
  lea    0x7(%rdx),%eax
  cmovns %edx,%eax
  sar    $0x3,%eax
  mov    0x8(%rsp),%rbx
  mov    %eax,(%rbx)
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L167:
  mov    $0x0,%eax
  jmp    L247
L52:
  lea    0x2(%r12,%rax,1),%rdx
  cmpb   $0xff,(%rdx)
  je     L229
  lea    0x1(%r12,%rax,1),%rsi
  movzbl (%r12,%rax,1),%eax
  movzbl (%rsi),%ecx
  sar    $0x4,%cl
  lea    (%rcx,%rax,4),%eax
  mov    %al,0x0(%r13)
  movzbl (%rsi),%eax
  shl    $0x4,%eax
  movzbl (%rdx),%ecx
  sar    $0x2,%cl
  add    %ecx,%eax
  mov    %al,0x1(%r13)
  lea    0x3(%r13),%rcx
  movsbl (%rdx),%eax
  shl    $0x6,%eax
  mov    %al,0x2(%r13)
  jmp    L197
L229:
  lea    0x1(%r12,%rax,1),%rsi
  movzbl (%rsi),%edx
  cmp    $0xff,%dl
  je     L181
  movzbl (%r12,%rax,1),%eax
  sar    $0x4,%dl
  lea    (%rdx,%rax,4),%eax
  mov    %al,0x0(%r13)
  lea    0x2(%r13),%rcx
  movsbl (%rsi),%eax
  shl    $0x4,%eax
  mov    %al,0x1(%r13)
  jmp    L197
L181:
  lea    D5(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  mov    %r13,%rcx
  jmp    L197
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D12
type_infered: string
name: extract_symbolic_data
arguments: data_label: D5
type_infered: string

tool: D12: 
%c:Not a valid base64 string


tool: D5: Not a valid base64 string

assistant: ```c
void base64_decode(char *src, char *dst, int *decode_len) {
  char *q = malloc(strlen(src) + 1);
  char *p = dst;
  char *temp = q;
  char *s = src;
  int len = strlen(src), i;
  memset(q, 0, strlen(src) + 1);
  while (*s) {
    if (*s >= 'A' && *s <= 'Z')
      *temp = *s - 'A';
    else if (*s >= 'a' && *s <= 'z')
      *temp = *s - 'a' + 26;
    else if (*s >= '0' && *s <= '9')
      *temp = *s - '0' + 52;
    else if (*s == '+')
      *temp = 62;
    else if (*s == '/')
      *temp = 63;
    else if (*s == '=')
      *temp = -1;
    else {
      printf("\n%c:Not a valid base64 string\n", *s);
      exit(0);
    }
    ++s;
    ++temp;
  }
  for (i = 0; i < len - 4; i += 4) {
    *p++ = (*(q + i) << 2) + (*(q + i + 1) >> 4);
    *p++ = (*(q + i + 1) << 4) + (*(q + i + 2) >> 2);
    *p++ = (*(q + i + 2) << 6) + (*(q + i + 3));
  }
  if (*(q + i + 3) != -1) {
    *p++ = (*(q + i) << 2) + (*(q + i + 1) >> 4);
    *p++ = (*(q + i + 1) << 4) + (*(q + i + 2) >> 2);
    *p++ = (*(q + i + 2) << 6) + *(q + i + 3);
  } else if (*(q + i + 2) != -1) {
    *p++ = (*(q + i) << 2) + (*(q + i + 1) >> 4);
    *p++ = (*(q + i + 1) << 4) + (*(q + i + 2) >> 2);
    *p++ = (*(q + i + 2) << 6);
  } else if (*(q + i + 1) != -1) {
    *p++ = (*(q + i) << 2) + (*(q + i + 1) >> 4);
    *p++ = (*(q + i + 1) << 4);
  } else {
    printf("Not a valid base64 string\n");
    exit(0);
  }
  *p = 0;
  *decode_len = len * 6 / 8;
  free(q);
}
```