user: 这段汇编代码用C语言表示是什么样的:

```asm
<base64_decode>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  lea    0x3(%rsi),%eax
  cmovns %esi,%eax
  xor    %ebx,%ebx
  sar    $0x2,%eax
  lea    (%rax,%rax,2),%edx
  movslq %esi,%rax
  cmpb   $0x3d,-0x1(%rdi,%rax,1)
  sete   %bl
  cmpb   $0x3d,-0x2(%rdi,%rax,1)
  je     L56
  cmpb   $0x3d,-0x3(%rdi,%rax,1)
  je     L107
L48:
  lea    0x4(%rdx),%r12d
L217:
  mov    %r12d,%edi
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  test   %rax,%rax
  je     L164
L29:
  mov    %r12d,%edx
  mov    0x18(%rsp),%r12
  xor    %esi,%esi
  sub    %ebx,%ebp
  mov    %r12,%rdi
  call   <memset@plt>
  test   %ebp,%ebp
  jle    L155
  lea    0x25(%rsp),%rax
  xor    %ebx,%ebx
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax)
L14:
  mov    0x10(%rsp),%rdi
  mov    $0x4,%edx
  xor    %esi,%esi
  movslq %ebx,%r13
  mov    %r13,%r15
  xor    %r14d,%r14d
  call   <memset@plt>
  xor    %eax,%eax
L5:
  cmp    %r15d,%ebp
  jle    L148
  shl    $0x6,%eax
  add    $0x1,%r15d
  mov    %eax,%ebx
  mov    0x8(%rsp),%rax
  add    %r13,%rax
  movsbl (%rax,%r14,1),%edi
  add    $0x1,%r14
  call   <find_pos@plt>
  or     %ebx,%eax
  cmp    $0x4,%r14
  jne    L5
  mov    %eax,%edx
  movzbl %ah,%ecx
  mov    %r15d,%ebx
  sar    $0x10,%edx
  mov    %cl,0x1(%r12)
  mov    %dl,(%r12)
L214:
  mov    %al,0x2(%r12)
  add    $0x3,%r12
  cmp    %r15d,%ebp
  jg     L14
  nopw   0x0(%rax,%rax,1)
L212:
  movb   $0x0,(%r12)
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L159
  mov    0x18(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L148:
  mov    $0x4,%edx
  sub    %r14d,%edx
  lea    (%rdx,%rdx,2),%ecx
  add    %ecx,%ecx
  shl    %cl,%eax
  test   %r14d,%r14d
  je     L212
  mov    %eax,%edx
  sar    $0x10,%edx
  mov    %dl,(%r12)
  cmp    $0x1,%r14d
  je     L88
  movzbl %ah,%ecx
  mov    %cl,0x1(%r12)
  cmp    $0x2,%r14d
  jne    L36
  add    $0x2,%r12
  jmp    L212
  nopl   0x0(%rax,%rax,1)
L36:
  mov    %r15d,%ebx
  jmp    L214
  nopl   0x0(%rax,%rax,1)
L107:
  add    $0x1,%ebx
  cmp    $0x2,%ebx
  je     L175
  lea    0x2(%rdx),%r12d
  cmp    $0x3,%ebx
  je     L217
  jmp    L48
  nopw   0x0(%rax,%rax,1)
L56:
  add    $0x1,%ebx
  cmpb   $0x3d,-0x3(%rdi,%rax,1)
  je     L107
  cmp    $0x2,%ebx
  jne    L48
L175:
  lea    0x3(%rdx),%r12d
  mov    $0x2,%ebx
  jmp    L217
L164:
  lea    D7(%rip),%rdi
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L29
L88:
  add    $0x1,%r12
  jmp    L212
L155:
  mov    0x18(%rsp),%r12
  jmp    L212
L159:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D7
type_guessed: string

tool: D7: No enough memory.


assistant: ```c
char *base64_decode(const char *data, int data_len) {
  int ret_len = (data_len / 4) * 3;
  int equal_count = 0;
  char *ret = NULL;
  char *f = NULL;
  int tmp = 0;
  int temp = 0;
  char need[3];
  int prepare = 0;
  int i = 0;
  if (*(data + data_len - 1) == '=') {
    equal_count += 1;
  }
  if (*(data + data_len - 2) == '=') {
    equal_count += 1;
  }
  if (*(data + data_len - 3) == '=') {
    equal_count += 1;
  }
  switch (equal_count) {
  case 0:
    ret_len += 4;
    break;
  case 1:
    ret_len += 4;
    break;
  case 2:
    ret_len += 3;
    break;
  case 3:
    ret_len += 2;
    break;
  }
  ret = (char *)malloc(ret_len);
  if (ret == NULL) {
    printf("No enough memory.\n");
    exit(0);
  }
  memset(ret, 0, ret_len);
  f = ret;
  while (tmp < (data_len - equal_count)) {
    temp = 0;
    prepare = 0;
    memset(need, 0, 4);
    while (temp < 4) {
      if (tmp >= (data_len - equal_count)) {
        break;
      }
      prepare = (prepare << 6) | (find_pos(data[tmp]));
      temp++;
      tmp++;
    }
    prepare = prepare << ((4 - temp) * 6);
    for (i = 0; i < 3; i++) {
      if (i == temp) {
        break;
      }
      *f = (char)((prepare >> ((2 - i) * 8)) & 0xFF);
      f++;
    }
  }
  *f = '\0';
  return ret;
}
```