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

```asm
<name_to_dev_t_real>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    $0x2c,%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L185
  mov    %rbx,%r12
  cmpb   $0x2f,(%rbx)
  jne    L193
L247:
  lea    -0x40(%rbp),%rsi
  mov    %r12,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L64
  mov    -0x38(%rbp),%edi
  call   <S_ISBLK@plt>
  test   %rax,%rax
  jne    L165
L64:
  mov    $0x5,%edx
  lea    D26(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L386
  add    $0x5,%rbx
L138:
  lea    D15(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L109
  lea    D9(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L303
  mov    $0x3,%edx
  lea    D10(%rip),%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L146
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%r13d
  mov    %r13d,%edi
  call   <alloca@plt>
  mov    %rax,%r12
  mov    %r13d,%edx
  mov    %rbx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    %r12,-0x58(%rbp)
  movzbl (%r12),%eax
  test   %al,%al
  je     L330
  mov    %r12,%rdx
  jmp    L321
L185:
  mov    $0xfd,%esi
  mov    $0x0,%edi
  call   <__makedev@plt>
  mov    %rax,%rbx
L389:
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L70
  mov    %rbx,%rax
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
L193:
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x6(%rax),%edi
  call   <alloca@plt>
  mov    %rax,%r12
  mov    %rbx,%rdx
  lea    D7(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  jmp    L247
L165:
  mov    -0x40(%rbp),%rbx
  jmp    L389
L386:
  add    $0x5,%r12
  mov    $0x3a,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L22
  cmpb   $0x0,0x1(%rax)
  jne    L175
L22:
  lea    -0x58(%rbp),%rsi
  mov    $0x10,%edx
  mov    %rbx,%rdi
  call   <strtoul@plt>
  mov    -0x58(%rbp),%rdx
  cmpb   $0x0,(%rdx)
  jne    L138
  movslq %eax,%rbx
  jmp    L389
L175:
  movb   $0x0,(%rax)
  lea    -0x50(%rbp),%rsi
  mov    $0xa,%edx
  mov    %r12,%rdi
  call   <strtoul@plt>
  mov    %eax,%r12d
  lea    -0x48(%rbp),%rsi
  lea    0x1(%r13),%rdi
  mov    $0xa,%edx
  call   <strtoul@plt>
  mov    -0x50(%rbp),%rdx
  cmpb   $0x0,(%rdx)
  jne    L62
  mov    -0x48(%rbp),%rdx
  cmpb   $0x0,(%rdx)
  je     L320
L62:
  movb   $0x3a,0x0(%r13)
  jmp    L138
L320:
  mov    %eax,%esi
  mov    %r12d,%edi
  call   <makedev@plt>
  mov    %rax,%rbx
  jmp    L389
L109:
  mov    $0xff,%esi
  mov    $0x0,%edi
  call   <__makedev@plt>
  mov    %rax,%rbx
  jmp    L389
L303:
  mov    $0x0,%esi
  mov    $0x1,%edi
  call   <__makedev@plt>
  mov    %rax,%rbx
  jmp    L389
L146:
  mov    $0xfe,%esi
  mov    $0x0,%edi
  call   <__makedev@plt>
  mov    %rax,%rbx
  jmp    L389
L277:
  mov    -0x58(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movzbl 0x1(%rax),%eax
  test   %al,%al
  je     L330
L321:
  cmp    $0x2f,%al
  jne    L277
  movb   $0x21,(%rdx)
  jmp    L277
L330:
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <try_name@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L389
  mov    -0x58(%rbp),%rax
  cmp    %rax,%r12
  jae    L229
L356:
  movsbl -0x1(%rax),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L229
  mov    -0x58(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x58(%rbp)
  cmp    %r12,%rax
  ja     L356
L229:
  mov    -0x58(%rbp),%rdi
  cmp    %r12,%rdi
  je     L389
  movzbl (%rdi),%eax
  cmp    $0x30,%al
  je     L389
  test   %al,%al
  je     L389
  mov    $0xa,%edx
  mov    $0x0,%esi
  call   <strtoul@plt>
  mov    %eax,%r13d
  mov    -0x58(%rbp),%rax
  movb   $0x0,(%rax)
  mov    %r13d,%esi
  mov    %r12,%rdi
  call   <try_name@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L389
  mov    -0x58(%rbp),%rax
  lea    0x2(%r12),%rdx
  cmp    %rdx,%rax
  jb     L389
  movsbl -0x2(%rax),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L276
  mov    -0x58(%rbp),%rax
  cmpb   $0x70,-0x1(%rax)
  jne    L389
  movb   $0x0,-0x1(%rax)
  mov    %r13d,%esi
  mov    %r12,%rdi
  call   <try_name@plt>
  mov    %rax,%rbx
  jmp    L389
L276:
  mov    %rax,%rbx
  jmp    L389
L70:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D26
type: string
name: disassemble_data
arguments: data_tag: D15
type: string
name: disassemble_data
arguments: data_tag: D9
type: string
name: disassemble_data
arguments: data_tag: D10
type: string
name: disassemble_data
arguments: data_tag: D7
type: string

tool: D26: /dev/

tool: D15: nfs

tool: D9: ram

tool: D10: mtd

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