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

```asm
<name_to_dev_t_real>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x40(%rbp)
  mov    -0x78(%rbp),%rax
  mov    $0x2c,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L37
  mov    $0xfd,%esi
  mov    $0x0,%edi
  call   <__makedev@plt>
  jmp    L381
L37:
  mov    -0x78(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L4
  mov    -0x78(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  jmp    L179
L4:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x6,%eax
  mov    %eax,%edi
  call   <alloca@plt>
  mov    %rax,-0x38(%rbp)
  mov    -0x78(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  lea    D26(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x48(%rbp)
L179:
  lea    -0x20(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L332
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISBLK@plt>
  test   %rax,%rax
  je     L332
  mov    -0x20(%rbp),%rax
  jmp    L381
L332:
  mov    -0x78(%rbp),%rax
  mov    $0x5,%edx
  lea    D9(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L23
  mov    -0x48(%rbp),%rax
  add    $0x5,%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L152
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L152
  mov    -0x30(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x48(%rbp),%rax
  lea    0x5(%rax),%rcx
  lea    -0x58(%rbp),%rax
  mov    $0xa,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x70(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rcx
  lea    -0x50(%rbp),%rax
  mov    $0xa,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x6c(%rbp)
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L215
  mov    -0x50(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L215
  mov    -0x6c(%rbp),%edx
  mov    -0x70(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <makedev@plt>
  jmp    L381
L215:
  mov    -0x30(%rbp),%rax
  movb   $0x3a,(%rax)
  jmp    L365
L152:
  lea    -0x60(%rbp),%rcx
  mov    -0x78(%rbp),%rax
  mov    $0x10,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  cltq
  mov    %rax,-0x40(%rbp)
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L365
  mov    -0x40(%rbp),%rax
  jmp    L381
L23:
  addq   $0x5,-0x78(%rbp)
L365:
  mov    -0x78(%rbp),%rax
  lea    D49(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L70
  mov    $0xff,%esi
  mov    $0x0,%edi
  call   <__makedev@plt>
  jmp    L381
L70:
  mov    -0x78(%rbp),%rax
  lea    D47(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L237
  mov    $0x0,%esi
  mov    $0x1,%edi
  call   <__makedev@plt>
  jmp    L381
L237:
  mov    -0x78(%rbp),%rax
  mov    $0x3,%edx
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L247
  mov    $0xfe,%esi
  mov    $0x0,%edi
  call   <__makedev@plt>
  jmp    L381
L247:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x68(%rbp)
  mov    -0x68(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <alloca@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x78(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  jmp    L243
L337:
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L299
  mov    -0x60(%rbp),%rax
  movb   $0x21,(%rax)
L299:
  mov    -0x60(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x60(%rbp)
L243:
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L337
  mov    -0x28(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <try_name@plt>
  mov    %rax,-0x40(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  je     L351
  mov    -0x40(%rbp),%rax
  jmp    L381
L150:
  mov    -0x60(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x60(%rbp)
L351:
  mov    -0x60(%rbp),%rax
  cmp    %rax,-0x28(%rbp)
  jae    L40
  mov    -0x60(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L150
L40:
  mov    -0x60(%rbp),%rax
  cmp    %rax,-0x28(%rbp)
  je     L21
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L21
  mov    -0x60(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  je     L21
  mov    -0x60(%rbp),%rax
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x64(%rbp)
  mov    -0x60(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x64(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <try_name@plt>
  mov    %rax,-0x40(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  je     L172
  mov    -0x40(%rbp),%rax
  jmp    L381
L172:
  mov    -0x28(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    -0x60(%rbp),%rax
  cmp    %rax,%rdx
  ja     L147
  mov    -0x60(%rbp),%rax
  sub    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L147
  mov    -0x60(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x70,%al
  jne    L147
  mov    -0x60(%rbp),%rax
  sub    $0x1,%rax
  movb   $0x0,(%rax)
  mov    -0x64(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <try_name@plt>
  mov    %rax,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  jmp    L381
L21:
  nop
  jmp    L43
L147:
  nop
L43:
  mov    $0x0,%eax
L381:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L98
  call   <__stack_chk_fail@plt>
L98:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D26
datatype: string
name: retrieve_data
arguments: data_tag: D9
datatype: string
name: retrieve_data
arguments: data_tag: D49
datatype: string
name: retrieve_data
arguments: data_tag: D47
datatype: string
name: retrieve_data
arguments: data_tag: D27
datatype: string

tool: D26: /dev/%s

tool: D9: /dev/

tool: D49: nfs

tool: D47: ram

tool: D27: mtd

assistant: ```c
dev_t name_to_dev_t_real(const char *name) {
  char *p;
  dev_t res = 0;
  char *s;
  int part;
  struct stat st;
  int len;
  const char *devname;
  char *cptr, *e1, *e2;
  int major_num, minor_num;
  if (strchr(name, ','))
    return __makedev(0, 253);
  if (name[0] == '/') {
    devname = name;
  } else {
    char *dname = alloca(strlen(name) + 6);
    sprintf(dname, "/dev/%s", name);
    devname = dname;
  }
  if (!stat(devname, &st) && S_ISBLK(st.st_mode))
    return st.st_rdev;
  if (strncmp(name, "/dev/", 5)) {
    cptr = strchr(devname + 5, ':');
    if (cptr && cptr[1] != '\0') {
      *cptr = '\0';
      major_num = strtoul(devname + 5, &e1, 10);
      minor_num = strtoul(cptr + 1, &e2, 10);
      if (!*e1 && !*e2)
        return makedev(major_num, minor_num);
      *cptr = ':';
    } else {
      res = (dev_t)strtoul(name, &p, 16);
      if (!*p)
        return res;
    }
  } else {
    name += 5;
  }
  if (!strcmp(name, "nfs"))
    return __makedev(0, 255);
  if (!strcmp(name, "ram"))
    return __makedev(1, 0);
  if (!strncmp(name, "mtd", 3))
    return __makedev(0, 254);
  len = strlen(name);
  s = alloca(len + 1);
  memcpy(s, name, len + 1);
  for (p = s; *p; p++)
    if (*p == '/')
      *p = '!';
  res = try_name(s, 0);
  if (res)
    return res;
  while (p > s && isdigit(p[-1]))
    p--;
  if (p == s || !*p || *p == '0')
    goto fail;
  part = strtoul(p, NULL, 10);
  *p = '\0';
  res = try_name(s, part);
  if (res)
    return res;
  if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p')
    goto fail;
  p[-1] = '\0';
  res = try_name(s, part);
  return res;
fail:
  return (dev_t)0;
}
```