user: Translate the below assembly code into C programming language:

```asm
<udev_node_add>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x458,%rsp
  mov    %rdi,-0x458(%rbp)
  mov    %esi,-0x45c(%rbp)
  mov    %edx,-0x460(%rbp)
  mov    %ecx,-0x464(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_udev@plt>
  mov    %rax,-0x438(%rbp)
  movl   $0x0,-0x444(%rbp)
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_devnum@plt>
  mov    %eax,%edi
  call   <minor@plt>
  mov    %eax,%r12d
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_devnum@plt>
  mov    %eax,%edi
  call   <major@plt>
  mov    %eax,%ebx
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_devnode@plt>
  mov    %eax,%esi
  mov    -0x45c(%rbp),%ecx
  mov    -0x438(%rbp),%rax
  mov    -0x464(%rbp),%edx
  push   %rdx
  mov    -0x460(%rbp),%edx
  push   %rdx
  mov    %ecx,%r9d
  mov    %r12d,%r8d
  mov    %ebx,%ecx
  mov    %esi,%edx
  lea    D47(%rip),%rsi
  mov    %rax,%rdi
  call   <udev_log_null@plt>
  add    $0x10,%rsp
  mov    -0x464(%rbp),%esi
  mov    -0x460(%rbp),%ecx
  mov    -0x45c(%rbp),%edx
  mov    -0x458(%rbp),%rax
  mov    %esi,%r8d
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <udev_node_mknod@plt>
  test   %rax,%rax
  je     L82
  movl   $0xffffffff,-0x444(%rbp)
  jmp    L61
L82:
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_devnum@plt>
  mov    %eax,%edi
  call   <minor@plt>
  mov    %eax,%r12d
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_devnum@plt>
  mov    %eax,%edi
  call   <major@plt>
  mov    %eax,%r13d
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_subsystem@plt>
  mov    %eax,%edx
  lea    D43(%rip),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L86
  lea    D43(%rip),%rbx
  jmp    L30
L86:
  lea    D31(%rip),%rbx
L30:
  mov    -0x438(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_get_dev_path@plt>
  mov    %rax,%rdx
  lea    -0x430(%rbp),%rax
  sub    $0x8,%rsp
  push   %r12
  mov    %r13d,%r9d
  mov    %rbx,%r8
  mov    %rdx,%rcx
  lea    D28(%rip),%rdx
  mov    $0x400,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  add    $0x10,%rsp
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_devnode@plt>
  mov    %eax,%ecx
  lea    -0x430(%rbp),%rdx
  mov    -0x438(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <node_symlink@plt>
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_devlinks_list_entry@plt>
  mov    %rax,-0x440(%rbp)
  jmp    L45
L51:
  mov    -0x440(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_list_entry_get_num@plt>
  test   %rax,%rax
  je     L27
  mov    -0x440(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_list_entry_get_name@plt>
  mov    %rax,%rbx
  mov    -0x458(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_device_get_devnode@plt>
  mov    %eax,%ecx
  mov    -0x438(%rbp),%rax
  mov    %rbx,%rdx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <node_symlink@plt>
  jmp    L68
L27:
  mov    -0x440(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_list_entry_get_name@plt>
  mov    %rax,%rcx
  mov    -0x458(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <link_update@plt>
L68:
  mov    -0x440(%rbp),%rax
  mov    %rax,%rdi
  call   <udev_list_entry_get_next@plt>
  mov    %rax,-0x440(%rbp)
L45:
  cmpq   $0x0,-0x440(%rbp)
  jne    L51
  nop
L61:
  mov    -0x444(%rbp),%eax
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L54
  call   <__stack_chk_fail@plt>
L54:
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: label: D47
data_type: string
name: parse_data
arguments: label: D43
data_type: string
name: parse_data
arguments: label: D31
data_type: string
name: parse_data
arguments: label: D28
data_type: string

tool: D47: creating device node '%s', devnum=%d:%d, mode=%#o, uid=%d, gid=%d


tool: D43: block

tool: D31: char

tool: D28: %s/%s/%u:%u

assistant: ```c
int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid) {
  struct udev *udev = udev_device_get_udev(dev);
  char filename[1024];
  struct udev_list_entry *list_entry;
  int err = 0;
  udev_log_null(udev, "creating device node '%s', devnum=%d:%d, mode=%#o, uid=%d, gid=%d\n", udev_device_get_devnode(dev), major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev)), mode, uid, gid);
  if (udev_node_mknod(dev, NULL, mode, uid, gid) != 0) {
    err = -1;
    goto exit;
  }
  snprintf(filename, sizeof(filename), "%s/%s/%u:%u", udev_get_dev_path(udev), strcmp(udev_device_get_subsystem(dev), "block") == 0 ? "block" : "char", major(udev_device_get_devnum(dev)), minor(udev_device_get_devnum(dev)));
  node_symlink(udev, udev_device_get_devnode(dev), filename);
  for (list_entry = udev_device_get_devlinks_list_entry(dev); list_entry != NULL; list_entry = udev_list_entry_get_next(list_entry)) {
    if (udev_list_entry_get_num(list_entry))
      node_symlink(udev, udev_device_get_devnode(dev), udev_list_entry_get_name(list_entry));
    else
      link_update(dev, udev_list_entry_get_name(list_entry), 1);
  }
exit:
  return err;
}
```