user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<dir_media_check>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  mov    %rdi,-0xb8(%rbp)
  mov    %rsi,-0xc0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D133(%rip),%rax
  mov    %rax,-0x90(%rbp)
  lea    D157(%rip),%rax
  mov    %rax,-0x88(%rbp)
  lea    D144(%rip),%rax
  mov    %rax,-0x80(%rbp)
  lea    D1(%rip),%rax
  mov    %rax,-0x78(%rbp)
  lea    D89(%rip),%rax
  mov    %rax,-0x70(%rbp)
  lea    D90(%rip),%rax
  mov    %rax,-0x68(%rbp)
  lea    D85(%rip),%rax
  mov    %rax,-0x60(%rbp)
  lea    D45(%rip),%rax
  mov    %rax,-0x58(%rbp)
  lea    D92(%rip),%rax
  mov    %rax,-0x50(%rbp)
  lea    D61(%rip),%rax
  mov    %rax,-0x48(%rbp)
  lea    D86(%rip),%rax
  mov    %rax,-0x40(%rbp)
  lea    D36(%rip),%rax
  mov    %rax,-0x38(%rbp)
  lea    D94(%rip),%rax
  mov    %rax,-0x30(%rbp)
  lea    D52(%rip),%rax
  mov    %rax,-0x28(%rbp)
  lea    D79(%rip),%rax
  mov    %rax,-0x20(%rbp)
  lea    D26(%rip),%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x10,-0x9c(%rbp)
  movl   $0x0,-0xa4(%rbp)
  jmp    L55
L86:
  mov    -0xa4(%rbp),%eax
  cltq
  mov    -0x90(%rbp,%rax,8),%rax
  mov    -0xb8(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <dir_get@plt>
  mov    %eax,-0xa0(%rbp)
  cmpl   $0x0,-0xa0(%rbp)
  jg     L13
  addl   $0x1,-0xa4(%rbp)
L55:
  mov    -0xa4(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L86
  jmp    L68
L13:
  nop
L68:
  cmpl   $0x0,-0xa0(%rbp)
  jle    L95
  mov    -0xb8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  mov    %eax,-0xa4(%rbp)
  mov    -0xa4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xb8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0xc0(%rbp),%rdx
  mov    -0xb8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0xb8(%rbp),%rax
  mov    %rax,%rdi
  call   <opendir@plt>
  mov    %rax,-0x98(%rbp)
  cmpq   $0x0,-0x98(%rbp)
  je     L28
  jmp    L79
L95:
  mov    $0xffffffff,%eax
  jmp    L54
L79:
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
  mov    $0x1,%eax
  jmp    L54
L28:
  mov    -0xb8(%rbp),%rax
  mov    %rax,%rsi
  lea    D91(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0xb8(%rbp),%rax
  mov    $0x1ed,%esi
  mov    %rax,%rdi
  call   <mkdir@plt>
  mov    $0xfffffffe,%eax
L54:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L34
  call   <__stack_chk_fail@plt>
L34:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D133
type: string
name: retrieve_data
arguments: data_tag: D157
type: string
name: retrieve_data
arguments: data_tag: D144
type: string
name: retrieve_data
arguments: data_tag: D1
type: string
name: retrieve_data
arguments: data_tag: D89
type: string
name: retrieve_data
arguments: data_tag: D90
type: string
name: retrieve_data
arguments: data_tag: D85
type: string
name: retrieve_data
arguments: data_tag: D45
type: string
name: retrieve_data
arguments: data_tag: D92
type: string
name: retrieve_data
arguments: data_tag: D61
type: string
name: retrieve_data
arguments: data_tag: D86
type: string
name: retrieve_data
arguments: data_tag: D36
type: string
name: retrieve_data
arguments: data_tag: D94
type: string
name: retrieve_data
arguments: data_tag: D52
type: string
name: retrieve_data
arguments: data_tag: D79
type: string
name: retrieve_data
arguments: data_tag: D26
type: string
name: retrieve_data
arguments: data_tag: D91
type: string

tool: D133: sda1

tool: D157: sda2

tool: D144: sda3

tool: D1: sda4

tool: D89: sdb1

tool: D90: sdb2

tool: D85: sdb3

tool: D45: sdb4

tool: D92: sdc1

tool: D61: sdc2

tool: D86: sdc3

tool: D36: sdc4

tool: D94: sdd1

tool: D52: sdd2

tool: D79: sdd3

tool: D26: sdd4

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