user: Converte this assembly snippet into its equivalent C code:

```asm
<mc_path_mkdir>:
  endbr64
  push   %r13
  pxor   %xmm0,%xmm0
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x238,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x228(%rsp)
  xor    %eax,%eax
  mov    $0x5c2f,%eax
  movb   $0x0,0x1f(%rsp)
  movq   $0x0,0x10(%rsp)
  mov    %ax,0x1d(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm0,0x30(%rsp)
  movaps %xmm0,0x40(%rsp)
  movaps %xmm0,0x50(%rsp)
  movaps %xmm0,0x60(%rsp)
  movaps %xmm0,0x70(%rsp)
  movaps %xmm0,0x80(%rsp)
  movaps %xmm0,0x90(%rsp)
  movaps %xmm0,0xa0(%rsp)
  movaps %xmm0,0xb0(%rsp)
  movaps %xmm0,0xc0(%rsp)
  movaps %xmm0,0xd0(%rsp)
  movaps %xmm0,0xe0(%rsp)
  movaps %xmm0,0xf0(%rsp)
  movaps %xmm0,0x100(%rsp)
  movaps %xmm0,0x110(%rsp)
  movaps %xmm0,0x120(%rsp)
  movaps %xmm0,0x130(%rsp)
  movaps %xmm0,0x140(%rsp)
  movaps %xmm0,0x150(%rsp)
  movaps %xmm0,0x160(%rsp)
  movaps %xmm0,0x170(%rsp)
  movaps %xmm0,0x180(%rsp)
  movaps %xmm0,0x190(%rsp)
  movaps %xmm0,0x1a0(%rsp)
  movaps %xmm0,0x1b0(%rsp)
  movaps %xmm0,0x1c0(%rsp)
  movaps %xmm0,0x1d0(%rsp)
  movaps %xmm0,0x1e0(%rsp)
  movaps %xmm0,0x1f0(%rsp)
  movaps %xmm0,0x200(%rsp)
  movaps %xmm0,0x210(%rsp)
  call   <mc_path_valid@plt>
  test   %eax,%eax
  je     L29
  lea    0x20(%rsp),%r13
  mov    $0x100,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strncpy@plt>
  movzbl 0x20(%rsp),%eax
  cmp    $0x2f,%al
  je     L104
  cmp    $0x5c,%al
  je     L104
L119:
  lea    0x10(%rsp),%r12
  lea    0x1d(%rsp),%rbp
  mov    %r13,%rdi
  mov    %rbp,%rsi
  mov    %r12,%rdx
  lea    0x120(%rsp),%rbx
  call   <strtok_r@plt>
  lea    D0(%rip),%r13
  mov    %rax,%rsi
  test   %rax,%rax
  jne    L18
  jmp    L0
  nopl   0x0(%rax)
L49:
  mov    $0x1ed,%esi
  mov    %rbx,%rdi
  call   <mkdir@plt>
  test   %rax,%rax
  jne    L29
  mov    $0x1ed,%esi
  mov    %rbx,%rdi
  call   <chmod@plt>
L6:
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdx
  xor    %edi,%edi
  call   <strtok_r@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L0
L18:
  mov    %rbx,%rdi
  call   <strcat@plt>
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <access@plt>
  test   %rax,%rax
  jne    L49
  lea    0xc(%rsp),%rsi
  mov    %rbx,%rdi
  call   <lstat@plt>
  test   %rax,%rax
  jne    L29
  mov    0xc(%rsp),%edi
  call   <S_ISDIR@plt>
  test   %eax,%eax
  jne    L6
L29:
  mov    $0xffffffff,%eax
L108:
  mov    0x228(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L123
  add    $0x238,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L104:
  mov    %al,0x120(%rsp)
  jmp    L119
  nopl   0x0(%rax)
L0:
  xor    %eax,%eax
  jmp    L108
L123:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D0
datatype: string

tool: D0: /

assistant: ```c
int mc_path_mkdir(const char *path) {
  char *token;
  char *last_buf = NULL;
  char seps[] = "/\\";
  char src[256] = {0};
  char dir[256] = {0};
  int depth = 0;
  if (!mc_path_valid(path)) {
    return -1;
  }
  strncpy(src, path, sizeof(src));
  if ('/' == src[0] || '\\' == src[0]) {
    dir[0] = src[0];
  }
  token = strtok_r(src, seps, &last_buf);
  while (token) {
    int is_driver = 0;
    strcat(dir, token);
    if (!is_driver) {
      if (0 != access(dir, 0)) {
        if (0 != mkdir(dir, 0755)) {
          return -1;
        }
        chmod(dir, (7 * 8 * 8) + (5 * 8) + 5);
      } else {
        struct stat st;
        if (0 != lstat(dir, &st)) {
          return -1;
        }
        if (!S_ISDIR(st.st_mode)) {
          return -1;
        }
      }
    }
    strcat(dir, "/");
    depth += 1;
    token = strtok_r(0, seps, &last_buf);
  }
  return 0;
}
```