user: What is the c source code of the assembly code below?

```asm
<get_user_cache_folder>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x1c(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L34
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L4
  mov    -0x28(%rbp),%rax
  movb   $0x0,(%rax)
  jmp    L48
L4:
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x1c(%rbp)
L34:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  add    $0x3,%eax
  cmp    %eax,-0x2c(%rbp)
  jae    L33
  mov    -0x28(%rbp),%rax
  movb   $0x0,(%rax)
  jmp    L48
L33:
  mov    -0x18(%rbp),%edx
  mov    -0x10(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x18(%rbp),%eax
  add    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movb   $0x2f,(%rax)
  addq   $0x1,-0x28(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L44
  mov    -0x1c(%rbp),%edx
  mov    -0x28(%rbp),%rax
  lea    D8(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x1c(%rbp),%eax
  add    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  mov    $0x1ed,%esi
  mov    %rax,%rdi
  call   <mkdir@plt>
L44:
  mov    -0x14(%rbp),%edx
  mov    -0x38(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x14(%rbp),%eax
  add    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  mov    $0x1ed,%esi
  mov    %rax,%rdi
  call   <mkdir@plt>
  mov    -0x28(%rbp),%rax
  movb   $0x2f,(%rax)
  addq   $0x1,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  movb   $0x0,(%rax)
L48:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D13
type_infered: string
name: parse_data
arguments: data_label: D16
type_infered: string
name: parse_data
arguments: data_label: D8
type_infered: string

tool: D13: XDG_CACHE_HOME

tool: D16: HOME

tool: D8: .cache/

assistant: ```c
void get_user_cache_folder(char *out, unsigned int maxlen, const char *appname) {
  const char *out_orig = out;
  char *home = getenv("XDG_CACHE_HOME");
  unsigned int config_len = 0;
  if (!home) {
    home = getenv("HOME");
    if (!home) {
      out[0] = 0;
      return;
    }
    config_len = strlen(".cache/");
  }
  unsigned int home_len = strlen(home);
  unsigned int appname_len = strlen(appname);
  if (home_len + 1 + config_len + appname_len + 1 + 1 > maxlen) {
    out[0] = 0;
    return;
  }
  memcpy(out, home, home_len);
  out += home_len;
  *out = '/';
  out++;
  if (config_len) {
    memcpy(out, ".cache/", config_len);
    out += config_len;
    *out = '\0';
    mkdir(out_orig, 0755);
  }
  memcpy(out, appname, appname_len);
  out += appname_len;
  *out = '\0';
  mkdir(out_orig, 0755);
  *out = '/';
  out++;
  *out = 0;
}
```