user: 请将以下的汇编代码转换成C语言代码:

```asm
<name_to_dev_t_real>:
  endbr64
  push   %rbp
  mov    $0x2c,%esi
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  call   <strchr@plt>
  test   %rax,%rax
  jne    L149
  cmpb   $0x2f,(%r12)
  mov    %r12,%r13
  jne    L10
  lea    -0x40(%rbp),%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L166
L330:
  mov    -0x38(%rbp),%edi
  call   <S_ISBLK@plt>
  test   %rax,%rax
  jne    L275
L166:
  mov    $0x5,%edx
  lea    D48(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L332
  add    $0x5,%r12
L272:
  lea    D11(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L89
  lea    D22(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L280
  mov    $0x3,%edx
  lea    D29(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L186
  mov    %r12,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%r14d
  mov    %r14d,%edi
  call   <alloca@plt>
  mov    %r14d,%edx
  mov    %r12,%rsi
  mov    %rax,%r13
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    %r13,-0x58(%rbp)
  movzbl 0x0(%r13),%eax
  mov    %r13,%rdx
  test   %al,%al
  je     L90
  nopw   0x0(%rax,%rax,1)
L43:
  cmp    $0x2f,%al
  jne    L368
  movb   $0x21,(%rdx)
L368:
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movzbl 0x1(%rax),%eax
  test   %al,%al
  jne    L43
L90:
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <try_name@plt>
  mov    %rax,%r12
  test   %rax,%rax
  jne    L137
  mov    -0x58(%rbp),%rdi
  cmp    %rdi,%r13
  jb     L395
  jmp    L111
  nopl   0x0(%rax)
L271:
  mov    -0x58(%rbp),%rax
  lea    -0x1(%rax),%rdi
  mov    %rdi,-0x58(%rbp)
  cmp    %r13,%rdi
  jbe    L111
L395:
  movsbl -0x1(%rdi),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L271
  mov    -0x58(%rbp),%rdi
L111:
  cmp    %r13,%rdi
  je     L137
  movzbl (%rdi),%eax
  test   %al,%al
  je     L137
  cmp    $0x30,%al
  je     L137
  xor    %esi,%esi
  mov    $0xa,%edx
  call   <strtoul@plt>
  mov    %r13,%rdi
  mov    %eax,%r14d
  mov    -0x58(%rbp),%rax
  mov    %r14d,%esi
  movb   $0x0,(%rax)
  call   <try_name@plt>
  test   %rax,%rax
  jne    L139
  mov    -0x58(%rbp),%rax
  lea    0x2(%r13),%rdx
  cmp    %rdx,%rax
  jb     L137
  movsbl -0x2(%rax),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L137
  mov    -0x58(%rbp),%rax
  cmpb   $0x70,-0x1(%rax)
  jne    L137
  movb   $0x0,-0x1(%rax)
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <try_name@plt>
  mov    %rax,%r12
  jmp    L137
  cs nopw 0x0(%rax,%rax,1)
L10:
  mov    %r12,%rdi
  call   <strlen@plt>
  lea    0x6(%rax),%edi
  call   <alloca@plt>
  lea    D10(%rip),%rsi
  mov    %r12,%rdx
  mov    %rax,%r13
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x40(%rbp),%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L166
  jmp    L330
  xchg   %ax,%ax
L149:
  mov    $0xfd,%esi
  xor    %edi,%edi
  call   <__makedev@plt>
  mov    %rax,%r12
L137:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L339
  lea    -0x18(%rbp),%rsp
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
  nopl   0x0(%rax)
L332:
  add    $0x5,%r13
  mov    $0x3a,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L204
  cmpb   $0x0,0x1(%rax)
  jne    L164
L204:
  mov    $0x10,%edx
  lea    -0x58(%rbp),%rsi
  mov    %r12,%rdi
  call   <strtoul@plt>
  mov    -0x58(%rbp),%rdx
  cmpb   $0x0,(%rdx)
  jne    L272
  movslq %eax,%r12
  jmp    L137
  xchg   %ax,%ax
L275:
  mov    -0x40(%rbp),%r12
  jmp    L137
  cs nopw 0x0(%rax,%rax,1)
L186:
  mov    $0xfe,%esi
  xor    %edi,%edi
  call   <__makedev@plt>
  mov    %rax,%r12
  jmp    L137
  nopl   0x0(%rax)
L280:
  xor    %esi,%esi
  mov    $0x1,%edi
  call   <__makedev@plt>
  mov    %rax,%r12
  jmp    L137
  nopl   0x0(%rax)
L89:
  mov    $0xff,%esi
  xor    %edi,%edi
  call   <__makedev@plt>
  mov    %rax,%r12
  jmp    L137
  nopl   0x0(%rax)
L164:
  movb   $0x0,(%rax)
  mov    %r13,%rdi
  lea    -0x50(%rbp),%rsi
  mov    $0xa,%edx
  call   <strtoul@plt>
  mov    $0xa,%edx
  lea    -0x48(%rbp),%rsi
  lea    0x1(%r14),%rdi
  mov    %eax,%r13d
  call   <strtoul@plt>
  mov    -0x50(%rbp),%rdx
  cmpb   $0x0,(%rdx)
  jne    L187
  mov    -0x48(%rbp),%rdx
  cmpb   $0x0,(%rdx)
  je     L94
L187:
  movb   $0x3a,(%r14)
  jmp    L272
L139:
  mov    %rax,%r12
  jmp    L137
L94:
  mov    %eax,%esi
  mov    %r13d,%edi
  call   <makedev@plt>
  mov    %rax,%r12
  jmp    L137
L339:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D48
type_guessed: string
name: read_data
arguments: label: D11
type_guessed: string
name: read_data
arguments: label: D22
type_guessed: string
name: read_data
arguments: label: D29
type_guessed: string
name: read_data
arguments: label: D10
type_guessed: string

tool: D48: /dev/

tool: D11: nfs

tool: D22: ram

tool: D29: mtd

tool: D10: /dev/%s

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;
}
```