user: Translate the below assembly code into C programming language:

```asm
<create_dir>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0xa0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  jmp    L39
  nopl   (%rax)
L49:
  cltq
  lea    -0x1(%rbp,%rax,1),%rax
  cmpb   $0x2f,(%rax)
  jne    L117
  movb   $0x0,(%rax)
L39:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0x1,%eax
  jg     L49
L117:
  lea    0x4(%rsp),%r14
  mov    %rbp,%rdi
  mov    %r14,%rsi
  call   <stat@plt>
  test   %rax,%rax
  jne    L159
  mov    0xc(%rsp),%edi
  call   <S_ISDIR@plt>
  test   %eax,%eax
  jne    L128
L159:
  lea    0x10(%rsp),%r13
  mov    %rbp,%rsi
  mov    $0x80,%edx
  mov    %r13,%rdi
  call   <strncpy@plt>
  mov    $0x2f,%esi
  mov    %r13,%rdi
  call   <strrchr@plt>
  cmp    %r13,%rax
  je     L32
  movb   $0x0,(%rax)
L132:
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <create_dir>
  mov    %eax,%r12d
  test   %eax,%eax
  je     L58
L37:
  mov    $0x1,%r12d
L169:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  add    $0xa0,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L58:
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  mov    0xc(%rsp),%esi
  mov    %rbp,%rdi
  call   <mkdir@plt>
  test   %rax,%rax
  jne    L64
  test   %ebx,%ebx
  je     L29
  mov    0x4(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    %rbp,%rdi
  call   <chown@plt>
  jmp    L169
L29:
  mov    %rbp,%rdx
  lea    D29(%rip),%rsi
  mov    $0x2,%edi
  call   <log_event@plt>
  mov    0x4(%rsp),%edx
  mov    0x8(%rsp),%esi
  mov    %rbp,%rdi
  call   <chown@plt>
  test   %rax,%rax
  jne    L43
  nopl   0x0(%rax,%rax,1)
L128:
  xor    %r12d,%r12d
  jmp    L169
L32:
  movb   $0x0,0x11(%rsp)
  jmp    L132
  nopw   0x0(%rax,%rax,1)
L64:
  test   %ebx,%ebx
  jne    L37
  mov    %rbp,%rdx
  lea    D12(%rip),%rsi
  mov    $0x1,%edi
  call   <log_event@plt>
  jmp    L37
L43:
  mov    %rbp,%rdx
  lea    D25(%rip),%rsi
  mov    $0x4,%edi
  call   <log_event@plt>
  jmp    L169
L30:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D29
type_guessed: string
name: extract_symbolic_data
arguments: label: D12
type_guessed: string
name: extract_symbolic_data
arguments: label: D25
type_guessed: string

tool: D29: directory created

tool: D12: failed to create directory

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