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

```asm
<try_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x20000(%rsp),%r11
L45:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L45
  sub    $0x50,%rsp
  mov    %rdi,-0x20048(%rbp)
  mov    %esi,-0x2004c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x20048(%rbp),%rdx
  lea    -0x20010(%rbp),%rax
  mov    %rdx,%rcx
  lea    D17(%rip),%rdx
  mov    $0x10000,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0x20010(%rbp),%rax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <open@plt>
  mov    %eax,-0x20034(%rbp)
  cmpl   $0x0,-0x20034(%rbp)
  js     L162
  lea    -0x10010(%rbp),%rcx
  mov    -0x20034(%rbp),%eax
  mov    $0x10000,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x20030(%rbp)
  mov    -0x20034(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  cmpl   $0x0,-0x20030(%rbp)
  jle    L132
  cmpl   $0x10000,-0x20030(%rbp)
  je     L132
  mov    -0x20030(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0x10010(%rbp,%rax,1),%eax
  cmp    $0xa,%al
  jne    L132
  mov    -0x20030(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0x10010(%rbp,%rax,1)
  lea    -0x20020(%rbp),%rcx
  lea    -0x10010(%rbp),%rax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x2002c(%rbp)
  mov    -0x20020(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L204
  mov    -0x20020(%rbp),%rax
  lea    0x1(%rax),%rcx
  lea    -0x20020(%rbp),%rax
  mov    $0xa,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x20028(%rbp)
  mov    -0x20020(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L235
  mov    -0x20028(%rbp),%edx
  mov    -0x2002c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <makedev@plt>
  mov    %rax,-0x20018(%rbp)
  cmpl   $0x0,-0x2004c(%rbp)
  jne    L120
  mov    -0x20018(%rbp),%rax
  jmp    L180
L120:
  mov    -0x20048(%rbp),%rdx
  lea    -0x20010(%rbp),%rax
  mov    %rdx,%rcx
  lea    D2(%rip),%rdx
  mov    $0x10000,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0x20010(%rbp),%rax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <open@plt>
  mov    %eax,-0x20034(%rbp)
  cmpl   $0x0,-0x20034(%rbp)
  js     L77
  lea    -0x10010(%rbp),%rcx
  mov    -0x20034(%rbp),%eax
  mov    $0x20,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x20030(%rbp)
  mov    -0x20034(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  cmpl   $0x0,-0x20030(%rbp)
  jle    L94
  cmpl   $0x20,-0x20030(%rbp)
  je     L94
  mov    -0x20030(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0x10010(%rbp,%rax,1),%eax
  cmp    $0xa,%al
  jne    L94
  mov    -0x20030(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0x10010(%rbp,%rax,1)
  lea    -0x20020(%rbp),%rcx
  lea    -0x10010(%rbp),%rax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x20024(%rbp)
  mov    -0x20020(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L121
  mov    -0x2004c(%rbp),%eax
  cmp    -0x20024(%rbp),%eax
  jge    L172
  mov    -0x2004c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20018(%rbp),%rax
  add    %rdx,%rax
  jmp    L180
L162:
  nop
  jmp    L86
L132:
  nop
  jmp    L86
L204:
  nop
  jmp    L86
L235:
  nop
  jmp    L86
L77:
  nop
  jmp    L86
L94:
  nop
  jmp    L86
L121:
  nop
  jmp    L86
L172:
  nop
L86:
  mov    $0x0,%eax
L180:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L232
  call   <__stack_chk_fail@plt>
L232:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D17
type_infered: string
name: parse_data
arguments: tag: D2
type_infered: string

tool: D17: /sys/block/%s/dev

tool: D2: /sys/block/%s/range

assistant: ```c
dev_t try_name(char *name, int part) {
  char path[65536];
  char buf[65536];
  int range;
  unsigned int major_num, minor_num;
  dev_t res;
  char *s;
  int len;
  int fd;
  snprintf(path, sizeof(path), "/sys/block/%s/dev", name);
  fd = open(path, 0, 0);
  if (fd < 0)
    goto fail;
  len = read(fd, buf, 65536);
  close(fd);
  if (len <= 0 || len == 65536 || buf[len - 1] != '\n')
    goto fail;
  buf[len - 1] = '\0';
  major_num = strtoul(buf, &s, 10);
  if (*s != ':')
    goto fail;
  minor_num = strtoul(s + 1, &s, 10);
  if (*s)
    goto fail;
  res = makedev(major_num, minor_num);
  if (!part)
    return res;
  snprintf(path, sizeof(path), "/sys/block/%s/range", name);
  fd = open(path, 0, 0);
  if (fd < 0)
    goto fail;
  len = read(fd, buf, 32);
  close(fd);
  if (len <= 0 || len == 32 || buf[len - 1] != '\n')
    goto fail;
  buf[len - 1] = '\0';
  range = strtoul(buf, &s, 10);
  if (*s)
    goto fail;
  if (part < range) {
    ((void)0);
    return res + part;
  }
fail:
  return (dev_t)0;
}
```