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

```asm
<base64_decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    -0x5c(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,-0x48(%rbp)
  movl   $0x0,-0x44(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x30(%rbp)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L188
  addl   $0x1,-0x44(%rbp)
L188:
  mov    -0x5c(%rbp),%eax
  cltq
  lea    -0x2(%rax),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L177
  addl   $0x1,-0x44(%rbp)
L177:
  mov    -0x5c(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  jne    L243
  addl   $0x1,-0x44(%rbp)
L243:
  cmpl   $0x3,-0x44(%rbp)
  je     L31
  cmpl   $0x3,-0x44(%rbp)
  jg     L138
  cmpl   $0x2,-0x44(%rbp)
  je     L83
  cmpl   $0x2,-0x44(%rbp)
  jg     L138
  cmpl   $0x0,-0x44(%rbp)
  je     L29
  cmpl   $0x1,-0x44(%rbp)
  je     L8
  jmp    L138
L29:
  addl   $0x4,-0x48(%rbp)
  jmp    L138
L8:
  addl   $0x4,-0x48(%rbp)
  jmp    L138
L83:
  addl   $0x3,-0x48(%rbp)
  jmp    L138
L31:
  addl   $0x2,-0x48(%rbp)
  nop
L138:
  mov    -0x48(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L115
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L115:
  mov    -0x48(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  jmp    L94
L184:
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
  lea    -0x1b(%rbp),%rax
  mov    $0x4,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  jmp    L212
L81:
  mov    -0x5c(%rbp),%eax
  sub    -0x44(%rbp),%eax
  cmp    %eax,-0x40(%rbp)
  jge    L3
  mov    -0x38(%rbp),%eax
  shl    $0x6,%eax
  mov    %eax,%ebx
  mov    -0x40(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <find_pos@plt>
  or     %ebx,%eax
  mov    %eax,-0x38(%rbp)
  addl   $0x1,-0x3c(%rbp)
  addl   $0x1,-0x40(%rbp)
L212:
  cmpl   $0x3,-0x3c(%rbp)
  jle    L81
  jmp    L48
L3:
  nop
L48:
  mov    $0x4,%eax
  sub    -0x3c(%rbp),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  shll   %cl,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L55
L174:
  mov    -0x34(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jne    L79
  jmp    L94
L79:
  mov    $0x2,%eax
  sub    -0x34(%rbp),%eax
  shl    $0x3,%eax
  mov    -0x38(%rbp),%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  addq   $0x1,-0x30(%rbp)
  addl   $0x1,-0x34(%rbp)
L55:
  cmpl   $0x2,-0x34(%rbp)
  jle    L174
L94:
  mov    -0x5c(%rbp),%eax
  sub    -0x44(%rbp),%eax
  cmp    %eax,-0x40(%rbp)
  jl     L184
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L38
  call   <__stack_chk_fail@plt>
L38:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D9
data_type: string

tool: D9: 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;
}
```