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

```asm
<udev_device_new_from_subsystem_sysname>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x628,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x618(%rsp)
  xor    %eax,%eax
  lea    0x210(%rsp),%r15
  mov    %r15,0x8(%rsp)
  call   <udev_get_sys_path@plt>
  lea    0x8(%rsp),%rdi
  xor    %ecx,%ecx
  mov    $0x400,%esi
  mov    %eax,%edx
  call   <util_strpcpyl@plt>
  lea    D92(%rip),%rsi
  mov    %r12,%rdi
  mov    %rax,%r13
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L58
  mov    0x8(%rsp),%rdi
  xor    %r8d,%r8d
  mov    %r13,%rsi
  mov    %r14,%rcx
  lea    D14(%rip),%rdx
  lea    0x4(%rsp),%r12
  call   <util_strscpyl@plt>
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <stat@plt>
  test   %rax,%rax
  jne    L123
L100:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <udev_device_new_from_syspath@plt>
L90:
  mov    0x618(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L42
  add    $0x628,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L123:
  mov    0x8(%rsp),%rdi
  xor    %r8d,%r8d
  mov    %r13,%rsi
  xor    %eax,%eax
  mov    %r14,%rcx
  lea    D56(%rip),%rdx
  call   <util_strscpyl@plt>
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L100
  mov    0x8(%rsp),%rdi
  xor    %r8d,%r8d
  mov    %r13,%rsi
  xor    %eax,%eax
  mov    %r14,%rcx
  lea    D135(%rip),%rdx
  call   <util_strscpyl@plt>
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L100
L4:
  xor    %eax,%eax
  jmp    L90
  nopl   0x0(%rax,%rax,1)
L58:
  lea    D7(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L155
  mov    0x8(%rsp),%rdi
  xor    %r8d,%r8d
  mov    %r13,%rsi
  mov    %r14,%rcx
  lea    D71(%rip),%rdx
  call   <util_strscpyl@plt>
  lea    0x4(%rsp),%rsi
  mov    %r15,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L100
  xor    %eax,%eax
  jmp    L90
  nopl   0x0(%rax,%rax,1)
L155:
  lea    D50(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L39
  lea    0x10(%rsp),%rbx
  mov    $0x200,%esi
  mov    %r14,%rdx
  mov    %rbx,%rdi
  call   <util_strscpy@plt>
  mov    $0x3a,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L4
  sub    $0x8,%rsp
  movb   $0x0,(%rax)
  lea    0x1(%rax),%r12
  mov    %rbx,%rcx
  push   $0x0
  mov    0x18(%rsp),%rdi
  mov    %r12,%r9
  mov    %r13,%rsi
  lea    D83(%rip),%r8
  lea    D14(%rip),%rdx
  xor    %eax,%eax
  call   <util_strscpyl@plt>
  lea    0x14(%rsp),%r14
  mov    %r15,%rdi
  mov    %r14,%rsi
  call   <stat@plt>
  pop    %r10
  pop    %r11
  test   %rax,%rax
  je     L100
  sub    $0x8,%rsp
  mov    %r13,%rsi
  mov    %r12,%r9
  mov    %rbx,%rcx
  push   $0x0
  mov    0x18(%rsp),%rdi
  lea    D83(%rip),%r8
  xor    %eax,%eax
  lea    D56(%rip),%rdx
  call   <util_strscpyl@plt>
  mov    %r14,%rsi
L66:
  mov    %r15,%rdi
  call   <stat@plt>
  pop    %rdx
  pop    %rcx
  test   %rax,%rax
  je     L100
  xor    %eax,%eax
  jmp    L90
  cs nopw 0x0(%rax,%rax,1)
L39:
  sub    $0x8,%rsp
  mov    %r14,%r9
  lea    D18(%rip),%r8
  xor    %eax,%eax
  push   $0x0
  mov    0x18(%rsp),%rdi
  mov    %r12,%rcx
  mov    %r13,%rsi
  lea    D14(%rip),%rdx
  call   <util_strscpyl@plt>
  lea    0x14(%rsp),%rbx
  mov    %r15,%rdi
  mov    %rbx,%rsi
  call   <stat@plt>
  pop    %r8
  pop    %r9
  test   %rax,%rax
  je     L100
  sub    $0x8,%rsp
  mov    %r14,%r9
  lea    D18(%rip),%r8
  xor    %eax,%eax
  push   $0x0
  mov    0x18(%rsp),%rdi
  mov    %r12,%rcx
  mov    %r13,%rsi
  lea    D56(%rip),%rdx
  call   <util_strscpyl@plt>
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <stat@plt>
  pop    %rsi
  pop    %rdi
  test   %rax,%rax
  je     L100
  sub    $0x8,%rsp
  mov    %r13,%rsi
  mov    %r14,%r9
  mov    %r12,%rcx
  push   $0x0
  mov    0x18(%rsp),%rdi
  lea    D80(%rip),%r8
  xor    %eax,%eax
  lea    D135(%rip),%rdx
  call   <util_strscpyl@plt>
  mov    %rbx,%rsi
  jmp    L66
L42:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D92
type_guessed: string
name: read_data
arguments: tag: D14
type_guessed: string
name: read_data
arguments: tag: D56
type_guessed: string
name: read_data
arguments: tag: D135
type_guessed: string
name: read_data
arguments: tag: D7
type_guessed: string
name: read_data
arguments: tag: D71
type_guessed: string
name: read_data
arguments: tag: D50
type_guessed: string
name: read_data
arguments: tag: D83
type_guessed: string
name: read_data
arguments: tag: D18
type_guessed: string
name: read_data
arguments: tag: D80
type_guessed: string

tool: D92: subsystem

tool: D14: /subsystem/

tool: D56: /bus/

tool: D135: /class/

tool: D7: module

tool: D71: /module/

tool: D50: drivers

tool: D83: /drivers/

tool: D18: /devices/

tool: D80: /

assistant: ```c
struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname) {
  char path_full[1024];
  char *path;
  size_t l;
  struct stat statbuf;
  path = path_full;
  l = util_strpcpyl(&path, sizeof(path_full), udev_get_sys_path(udev), NULL);
  if (strcmp(subsystem, "subsystem") == 0) {
    util_strscpyl(path, l, "/subsystem/", sysname, NULL);
    if (stat(path_full, &statbuf) == 0)
      goto found;
    util_strscpyl(path, l, "/bus/", sysname, NULL);
    if (stat(path_full, &statbuf) == 0)
      goto found;
    util_strscpyl(path, l, "/class/", sysname, NULL);
    if (stat(path_full, &statbuf) == 0)
      goto found;
    goto out;
  }
  if (strcmp(subsystem, "module") == 0) {
    util_strscpyl(path, l, "/module/", sysname, NULL);
    if (stat(path_full, &statbuf) == 0)
      goto found;
    goto out;
  }
  if (strcmp(subsystem, "drivers") == 0) {
    char subsys[512];
    char *driver;
    util_strscpy(subsys, sizeof(subsys), sysname);
    driver = strchr(subsys, ':');
    if (driver != NULL) {
      driver[0] = '\0';
      driver = &driver[1];
      util_strscpyl(path, l, "/subsystem/", subsys, "/drivers/", driver, NULL);
      if (stat(path_full, &statbuf) == 0)
        goto found;
      util_strscpyl(path, l, "/bus/", subsys, "/drivers/", driver, NULL);
      if (stat(path_full, &statbuf) == 0)
        goto found;
    }
    goto out;
  }
  util_strscpyl(path, l, "/subsystem/", subsystem, "/devices/", sysname, NULL);
  if (stat(path_full, &statbuf) == 0)
    goto found;
  util_strscpyl(path, l, "/bus/", subsystem, "/devices/", sysname, NULL);
  if (stat(path_full, &statbuf) == 0)
    goto found;
  util_strscpyl(path, l, "/class/", subsystem, "/", sysname, NULL);
  if (stat(path_full, &statbuf) == 0)
    goto found;
out:
  return NULL;
found:
  return udev_device_new_from_syspath(udev, path_full);
}
```