user: What would the C source look like for the assembly code provided here:

```asm
<dir_media_check>:
  endbr64
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  lea    D105(%rip),%rdi
  push   %rbx
  sub    $0x98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  lea    D129(%rip),%rax
  lea    0x8(%rsp),%rbx
  lea    0x80(%rsp),%r12
  mov    %rax,0x8(%rsp)
  lea    D5(%rip),%rax
  mov    %rax,0x10(%rsp)
  lea    D73(%rip),%rax
  mov    %rax,0x18(%rsp)
  lea    D67(%rip),%rax
  mov    %rax,0x20(%rsp)
  lea    D1(%rip),%rax
  mov    %rax,0x28(%rsp)
  lea    D13(%rip),%rax
  mov    %rax,0x30(%rsp)
  lea    D90(%rip),%rax
  mov    %rax,0x38(%rsp)
  lea    D70(%rip),%rax
  mov    %rax,0x40(%rsp)
  lea    D117(%rip),%rax
  mov    %rax,0x48(%rsp)
  lea    D112(%rip),%rax
  mov    %rax,0x50(%rsp)
  lea    D10(%rip),%rax
  mov    %rax,0x58(%rsp)
  lea    D2(%rip),%rax
  mov    %rax,0x60(%rsp)
  lea    D80(%rip),%rax
  mov    %rax,0x68(%rsp)
  lea    D68(%rip),%rax
  mov    %rax,0x70(%rsp)
  lea    D0(%rip),%rax
  mov    %rax,0x78(%rsp)
  jmp    L21
  nopw   0x0(%rax,%rax,1)
L17:
  mov    (%rbx),%rdi
  add    $0x8,%rbx
L21:
  mov    %rbp,%rsi
  call   <dir_get@plt>
  test   %eax,%eax
  jg     L23
  cmp    %r12,%rbx
  jne    L17
  mov    $0xffffffff,%eax
L57:
  mov    0x88(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L24
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  cs nopw 0x0(%rax,%rax,1)
L23:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  sub    $0x1,%eax
  cltq
  movb   $0x0,0x0(%rbp,%rax,1)
  call   <strcat@plt>
  mov    %rbp,%rdi
  call   <opendir@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L46
  call   <closedir@plt>
  mov    $0x1,%eax
  jmp    L57
L46:
  mov    %rbp,%rsi
  lea    D94(%rip),%rdi
  call   <printf@plt>
  mov    $0x1ed,%esi
  mov    %rbp,%rdi
  call   <mkdir@plt>
  mov    $0xfffffffe,%eax
  jmp    L57
L24:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D105
type_guessed: string
name: retrieve_data
arguments: label: D129
type_guessed: string
name: retrieve_data
arguments: label: D5
type_guessed: string
name: retrieve_data
arguments: label: D73
type_guessed: string
name: retrieve_data
arguments: label: D67
type_guessed: string
name: retrieve_data
arguments: label: D1
type_guessed: string
name: retrieve_data
arguments: label: D13
type_guessed: string
name: retrieve_data
arguments: label: D90
type_guessed: string
name: retrieve_data
arguments: label: D70
type_guessed: string
name: retrieve_data
arguments: label: D117
type_guessed: string
name: retrieve_data
arguments: label: D112
type_guessed: string
name: retrieve_data
arguments: label: D10
type_guessed: string
name: retrieve_data
arguments: label: D2
type_guessed: string
name: retrieve_data
arguments: label: D80
type_guessed: string
name: retrieve_data
arguments: label: D68
type_guessed: string
name: retrieve_data
arguments: label: D0
type_guessed: string
name: retrieve_data
arguments: label: D94
type_guessed: string

tool: D105: sda1

tool: D129: sda2

tool: D5: sda3

tool: D73: sda4

tool: D67: sdb1

tool: D1: sdb2

tool: D13: sdb3

tool: D90: sdb4

tool: D70: sdc1

tool: D117: sdc2

tool: D112: sdc3

tool: D10: sdc4

tool: D2: sdd1

tool: D80: sdd2

tool: D68: sdd3

tool: D0: sdd4

tool: D94: Do not find media directory(%s)


assistant: ```c
int dir_media_check(char *path, char *subdir) {
  char *arg[] = {"sda1", "sda2", "sda3", "sda4", "sdb1", "sdb2", "sdb3", "sdb4", "sdc1", "sdc2", "sdc3", "sdc4", "sdd1", "sdd2", "sdd3", "sdd4"};
  DIR *dir;
  int i, found, cnt;
  cnt = (sizeof(arg) / sizeof((arg)[0]));
  for (i = 0; i < cnt; i++) {
    found = dir_get(arg[i], path);
    if (found > 0)
      break;
  }
  if (found > 0) {
    i = strlen(path) - 1;
    path[i] = '\0';
    strcat(path, subdir);
  } else {
    return -1;
  }
  dir = opendir(path);
  if (dir) {
    closedir(dir);
    return 1;
  } else {
    printf("Do not find media directory(%s)\r\n", path);
    mkdir(path, 0755);
    return -2;
  }
}
```