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

```asm
<udev_node_add>:
  endbr64
  push   %r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %ecx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x428,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  call   <udev_device_get_udev@plt>
  mov    %rbx,%rdi
  mov    %rax,%r12
  call   <udev_device_get_devnum@plt>
  mov    %eax,%edi
  call   <minor@plt>
  mov    %rbx,%rdi
  mov    %eax,0xc(%rsp)
  call   <udev_device_get_devnum@plt>
  mov    %eax,%edi
  call   <major@plt>
  mov    %rbx,%rdi
  mov    %eax,%r15d
  call   <udev_device_get_devnode@plt>
  push   %rbp
  mov    %r13d,%r9d
  mov    %r15d,%ecx
  push   %r14
  mov    0x1c(%rsp),%r8d
  mov    %eax,%edx
  lea    D1(%rip),%rsi
  mov    %r12,%rdi
  call   <udev_log_null@plt>
  mov    %r14d,%ecx
  xor    %esi,%esi
  mov    %ebp,%r8d
  mov    %r13d,%edx
  mov    %rbx,%rdi
  call   <udev_node_mknod@plt>
  pop    %rcx
  pop    %rsi
  test   %rax,%rax
  jne    L74
  mov    %rbx,%rdi
  lea    D38(%rip),%rbp
  lea    0x10(%rsp),%r14
  call   <udev_device_get_devnum@plt>
  mov    %eax,%edi
  call   <minor@plt>
  mov    %rbx,%rdi
  mov    %eax,%r15d
  call   <udev_device_get_devnum@plt>
  mov    %eax,%edi
  call   <major@plt>
  mov    %rbx,%rdi
  mov    %eax,%r13d
  call   <udev_device_get_subsystem@plt>
  mov    %rbp,%rsi
  mov    %eax,%edi
  call   <strcmp@plt>
  mov    %r12,%rdi
  test   %rax,%rax
  lea    D19(%rip),%rax
  cmovne %rax,%rbp
  call   <udev_get_dev_path@plt>
  sub    $0x8,%rsp
  mov    %r13d,%r9d
  mov    %r14,%rdi
  push   %r15
  mov    %rbp,%r8
  mov    %rax,%rcx
  lea    D23(%rip),%rdx
  mov    $0x400,%esi
  call   <snprintf@plt>
  mov    %rbx,%rdi
  call   <udev_device_get_devnode@plt>
  mov    %r14,%rdx
  mov    %r12,%rdi
  mov    %eax,%esi
  call   <node_symlink@plt>
  mov    %rbx,%rdi
  call   <udev_device_get_devlinks_list_entry@plt>
  mov    %rax,%rbp
  pop    %rax
  pop    %rdx
  test   %rbp,%rbp
  jne    L68
  jmp    L21
  nopl   0x0(%rax)
L75:
  call   <udev_list_entry_get_name@plt>
  mov    %rbx,%rdi
  mov    %rax,%r13
  call   <udev_device_get_devnode@plt>
  mov    %r13,%rdx
  mov    %r12,%rdi
  mov    %eax,%esi
  call   <node_symlink@plt>
  mov    %rbp,%rdi
  call   <udev_list_entry_get_next@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L21
L68:
  mov    %rbp,%rdi
  call   <udev_list_entry_get_num@plt>
  mov    %rbp,%rdi
  test   %rax,%rax
  jne    L75
  call   <udev_list_entry_get_name@plt>
  mov    $0x1,%edx
  mov    %rbx,%rdi
  mov    %rax,%rsi
  call   <link_update@plt>
  mov    %rbp,%rdi
  call   <udev_list_entry_get_next@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L68
L21:
  xor    %eax,%eax
L27:
  mov    0x418(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L74:
  mov    $0xffffffff,%eax
  jmp    L27
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D1
type_guessed: string
name: disassemble_data
arguments: data_label: D38
type_guessed: string
name: disassemble_data
arguments: data_label: D19
type_guessed: string
name: disassemble_data
arguments: data_label: D23
type_guessed: string

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


tool: D38: block

tool: D19: char

tool: D23: %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;
}
```