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

```asm
<create_dir>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa0,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  jmp    L112
L101:
  movb   $0x0,(%rax)
L112:
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x1,%eax
  jle    L153
  cltq
  lea    -0x1(%rbx,%rax,1),%rax
  cmpb   $0x2f,(%rax)
  je     L101
L153:
  lea    0x4(%rsp),%rsi
  mov    %rbx,%rdi
  call   <stat@plt>
  test   %rax,%rax
  jne    L16
  mov    0xc(%rsp),%edi
  call   <S_ISDIR@plt>
  mov    $0x0,%r12d
  test   %eax,%eax
  jne    L130
L16:
  lea    0x10(%rsp),%r12
  mov    $0x80,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <strncpy@plt>
  mov    $0x2f,%esi
  mov    %r12,%rdi
  call   <strrchr@plt>
  cmp    %r12,%rax
  je     L136
  movb   $0x0,(%rax)
L50:
  lea    0x10(%rsp),%rdi
  mov    %ebp,%esi
  call   <create_dir>
  mov    %eax,%r12d
  test   %eax,%eax
  je     L81
  mov    $0x1,%r12d
L130:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L115
  mov    %r12d,%eax
  add    $0xa0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L136:
  movb   $0x0,0x11(%rsp)
  jmp    L50
L81:
  lea    0x4(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  call   <stat@plt>
  mov    0xc(%rsp),%esi
  mov    %rbx,%rdi
  call   <mkdir@plt>
  test   %rax,%rax
  jne    L131
  test   %ebp,%ebp
  je     L156
  mov    0x4(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    %rbx,%rdi
  call   <chown@plt>
  jmp    L130
L131:
  mov    $0x1,%r12d
  test   %ebp,%ebp
  jne    L130
  mov    %rbx,%rdx
  lea    D25(%rip),%rsi
  mov    $0x1,%edi
  call   <log_event@plt>
  jmp    L130
L156:
  mov    %rbx,%rdx
  lea    D7(%rip),%rsi
  mov    $0x2,%edi
  call   <log_event@plt>
  mov    0x4(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    %rbx,%rdi
  call   <chown@plt>
  mov    %ebp,%r12d
  test   %rax,%rax
  je     L130
  mov    %rbx,%rdx
  lea    D23(%rip),%rsi
  mov    $0x4,%edi
  call   <log_event@plt>
  jmp    L130
L115:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D25
type_infered: string
name: read_data
arguments: data_label: D7
type_infered: string
name: read_data
arguments: data_label: D23
type_infered: string

tool: D25: failed to create directory

tool: D7: directory created

tool: D23: failed to set owner on directory (non fatal)

assistant: ```c
int create_dir(char *dirname, int nolog) {
  struct stat fstatus;
  char buffer[128], *delim;
  int i;
  while ((i = strlen(dirname)) > 1 && dirname[i - 1] == '/')
    dirname[i - 1] = '\0';
  if (stat(dirname, &fstatus) || !S_ISDIR(fstatus.st_mode)) {
    strncpy(buffer, dirname, 128);
    delim = strrchr(buffer, '/');
    if (delim != buffer)
      delim[0] = '\0';
    else
      delim[1] = '\0';
    if (create_dir(buffer, nolog) != 0)
      return 1;
    stat(buffer, &fstatus);
    if (mkdir(dirname, fstatus.st_mode) != 0) {
      if (!nolog)
        log_event(1, "failed to create directory", dirname);
      return 1;
    } else if (!nolog)
      log_event(2, "directory created", dirname);
    if (chown(dirname, fstatus.st_uid, fstatus.st_gid) != 0)
      if (!nolog)
        log_event(4, "failed to set owner on directory (non fatal)", dirname);
  }
  return 0;
}
```