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    L329
  cmpb   $0x2f,(%r12)
  mov    %r12,%r13
  jne    L254
  lea    -0x40(%rbp),%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L303
L33:
  mov    -0x38(%rbp),%edi
  call   <S_ISBLK@plt>
  test   %rax,%rax
  jne    L114
L303:
  mov    $0x5,%edx
  lea    D49(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L175
  add    $0x5,%r12
L252:
  lea    D19(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L142
  lea    D12(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L286
  mov    $0x3,%edx
  lea    D4(%rip),%rsi
  mov    %r12,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L355
  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,%rcx
  test   %al,%al
  jne    L150
  jmp    L266
  nopl   0x0(%rax)
L171:
  lea    0x1(%rcx),%rdx
  mov    %rdx,-0x58(%rbp)
  movzbl 0x1(%rcx),%eax
  test   %al,%al
  je     L266
L181:
  mov    %rdx,%rcx
L150:
  cmp    $0x2f,%al
  jne    L171
  movb   $0x21,(%rcx)
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movzbl 0x1(%rax),%eax
  test   %al,%al
  jne    L181
L266:
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <try_name@plt>
  mov    %rax,%r12
  test   %rax,%rax
  jne    L84
  mov    -0x58(%rbp),%rdi
  cmp    %rdi,%r13
  jb     L172
  jmp    L397
  nop
L308:
  mov    -0x58(%rbp),%rax
  lea    -0x1(%rax),%rdi
  mov    %rdi,-0x58(%rbp)
  cmp    %r13,%rdi
  jbe    L397
L172:
  movsbl -0x1(%rdi),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L308
  mov    -0x58(%rbp),%rdi
L397:
  cmp    %rdi,%r13
  je     L84
  movzbl (%rdi),%eax
  test   %al,%al
  je     L84
  cmp    $0x30,%al
  je     L84
  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    L270
  mov    -0x58(%rbp),%rax
  lea    0x2(%r13),%rdx
  cmp    %rdx,%rax
  jb     L84
  movsbl -0x2(%rax),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L84
  mov    -0x58(%rbp),%rax
  cmpb   $0x70,-0x1(%rax)
  jne    L84
  movb   $0x0,-0x1(%rax)
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <try_name@plt>
  mov    %rax,%r12
  jmp    L84
  cs nopw 0x0(%rax,%rax,1)
L254:
  mov    %r12,%rdi
  call   <strlen@plt>
  lea    0x6(%rax),%edi
  call   <alloca@plt>
  lea    D30(%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    L303
  jmp    L33
  xchg   %ax,%ax
L329:
  mov    $0xfd,%esi
  xor    %edi,%edi
  call   <__makedev@plt>
  mov    %rax,%r12
L84:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L239
  lea    -0x18(%rbp),%rsp
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
  nopl   0x0(%rax)
L175:
  add    $0x5,%r13
  mov    $0x3a,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L311
  cmpb   $0x0,0x1(%rax)
  jne    L324
L311:
  mov    $0x10,%edx
  lea    -0x58(%rbp),%rsi
  mov    %r12,%rdi
  call   <strtoul@plt>
  mov    -0x58(%rbp),%rdx
  cmpb   $0x0,(%rdx)
  jne    L252
  movslq %eax,%r12
  jmp    L84
  xchg   %ax,%ax
L114:
  mov    -0x40(%rbp),%r12
  jmp    L84
  cs nopw 0x0(%rax,%rax,1)
L355:
  mov    $0xfe,%esi
  xor    %edi,%edi
  call   <__makedev@plt>
  mov    %rax,%r12
  jmp    L84
  nopl   0x0(%rax)
L286:
  xor    %esi,%esi
  mov    $0x1,%edi
  call   <__makedev@plt>
  mov    %rax,%r12
  jmp    L84
  nopl   0x0(%rax)
L142:
  mov    $0xff,%esi
  xor    %edi,%edi
  call   <__makedev@plt>
  mov    %rax,%r12
  jmp    L84
  nopl   0x0(%rax)
L324:
  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    L168
  mov    -0x48(%rbp),%rdx
  cmpb   $0x0,(%rdx)
  je     L417
L168:
  movb   $0x3a,(%r14)
  jmp    L252
L270:
  mov    %rax,%r12
  jmp    L84
L417:
  mov    %eax,%esi
  mov    %r13d,%edi
  call   <makedev@plt>
  mov    %rax,%r12
  jmp    L84
L239:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D49
type: string
name: unpack_data
arguments: data_label: D19
type: string
name: unpack_data
arguments: data_label: D12
type: string
name: unpack_data
arguments: data_label: D4
type: string
name: unpack_data
arguments: data_label: D30
type: string

tool: D49: /dev/

tool: D19: nfs

tool: D12: ram

tool: D4: mtd

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