user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<udev_device_new_from_subsystem_sysname>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x638,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x628(%rsp)
  xor    %eax,%eax
  lea    0x220(%rsp),%rbp
  call   <udev_get_sys_path@plt>
  mov    %rbp,%rdi
  mov    $0x400,%edx
  mov    %rax,%rsi
  call   <util_strlcpy@plt>
  lea    D124(%rip),%rsi
  mov    %r12,%rdi
  mov    %rax,%rbx
  lea    0x0(%rbp,%rax,1),%r14
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L37
  mov    $0x400,%r12d
  lea    D10(%rip),%rsi
  mov    %r14,%rdi
  sub    %ebx,%r12d
  lea    0x1c(%rsp),%rbx
  mov    %r12d,%edx
  call   <util_strlcpy@plt>
  mov    %r15,%rsi
  mov    %r14,%rdi
  mov    %r12d,%edx
  call   <util_strlcat@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <stat@plt>
  test   %rax,%rax
  jne    L49
L125:
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <udev_device_new_from_syspath@plt>
L54:
  mov    0x628(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L126
  add    $0x638,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L49:
  mov    %r12d,%edx
  lea    D102(%rip),%rsi
  mov    %r14,%rdi
  call   <util_strlcpy@plt>
  mov    %r15,%rsi
  mov    %r14,%rdi
  mov    %r12d,%edx
  call   <util_strlcat@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L125
  mov    %r12d,%edx
  lea    D82(%rip),%rsi
  mov    %r14,%rdi
  call   <util_strlcpy@plt>
L45:
  mov    %r12d,%edx
  mov    %r15,%rsi
  jmp    L120
  nopl   (%rax)
L37:
  lea    D85(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L12
  mov    $0x400,%r12d
  lea    D69(%rip),%rsi
  mov    %r14,%rdi
  sub    %ebx,%r12d
  mov    %r12d,%edx
  call   <util_strlcpy@plt>
  mov    %r15,%rsi
  mov    %r14,%rdi
  mov    %r12d,%edx
  call   <util_strlcat@plt>
  lea    0x1c(%rsp),%rsi
  mov    %rbp,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L125
L42:
  xor    %eax,%eax
  jmp    L54
  nopw   0x0(%rax,%rax,1)
L12:
  lea    D72(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L15
  lea    0x20(%rsp),%r12
  mov    %r15,%rsi
  mov    $0x200,%edx
  mov    %r12,%rdi
  call   <util_strlcpy@plt>
  mov    $0x3a,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L42
  movb   $0x0,(%rax)
  mov    $0x400,%edx
  add    $0x1,%rax
  mov    %r14,%rdi
  sub    %ebx,%edx
  lea    D10(%rip),%rsi
  mov    %rax,0x8(%rsp)
  lea    0x1c(%rsp),%rbx
  mov    %edx,%r15d
  call   <util_strlcpy@plt>
  mov    %r15d,%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <util_strlcat@plt>
  lea    D25(%rip),%r8
  mov    %r15d,%edx
  mov    %r14,%rdi
  mov    %r8,%rsi
  call   <util_strlcat@plt>
  mov    0x8(%rsp),%rsi
  mov    %r14,%rdi
  mov    %r15d,%edx
  call   <util_strlcat@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L125
  mov    %r15d,%edx
  lea    D102(%rip),%rsi
  mov    %r14,%rdi
  call   <util_strlcpy@plt>
  mov    %r15d,%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <util_strlcat@plt>
  lea    D25(%rip),%r8
  mov    %r15d,%edx
  mov    %r14,%rdi
  mov    %r8,%rsi
  call   <util_strlcat@plt>
  mov    0x8(%rsp),%rsi
  mov    %r15d,%edx
L120:
  mov    %r14,%rdi
  call   <util_strlcat@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L125
  xor    %eax,%eax
  jmp    L54
L15:
  mov    $0x400,%eax
  lea    D10(%rip),%rsi
  mov    %r14,%rdi
  sub    %ebx,%eax
  mov    %eax,%ebx
  mov    %eax,%edx
  call   <util_strlcpy@plt>
  mov    %ebx,%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <util_strlcat@plt>
  lea    D144(%rip),%r8
  mov    %ebx,%edx
  mov    %r14,%rdi
  mov    %r8,%rsi
  call   <util_strlcat@plt>
  mov    %ebx,0x8(%rsp)
  mov    %ebx,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  lea    0x1c(%rsp),%rbx
  call   <util_strlcat@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L125
  mov    0x8(%rsp),%edx
  lea    D102(%rip),%rsi
  mov    %r14,%rdi
  call   <util_strlcpy@plt>
  mov    0x8(%rsp),%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <util_strlcat@plt>
  lea    D144(%rip),%r8
  mov    0x8(%rsp),%edx
  mov    %r14,%rdi
  mov    %r8,%rsi
  call   <util_strlcat@plt>
  mov    0x8(%rsp),%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <util_strlcat@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L125
  mov    0x8(%rsp),%edx
  mov    %r14,%rdi
  lea    D82(%rip),%rsi
  call   <util_strlcpy@plt>
  mov    0x8(%rsp),%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <util_strlcat@plt>
  mov    0x8(%rsp),%r12d
  lea    D2(%rip),%rsi
  mov    %r14,%rdi
  mov    %r12d,%edx
  call   <util_strlcat@plt>
  jmp    L45
L126:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D124
type: string
name: extract_symbolic_data
arguments: data_tag: D10
type: string
name: extract_symbolic_data
arguments: data_tag: D102
type: string
name: extract_symbolic_data
arguments: data_tag: D82
type: string
name: extract_symbolic_data
arguments: data_tag: D85
type: string
name: extract_symbolic_data
arguments: data_tag: D69
type: string
name: extract_symbolic_data
arguments: data_tag: D72
type: string
name: extract_symbolic_data
arguments: data_tag: D25
type: string
name: extract_symbolic_data
arguments: data_tag: D144
type: string
name: extract_symbolic_data
arguments: data_tag: D2
type: string

tool: D124: subsystem

tool: D10: /subsystem/

tool: D102: /bus/

tool: D82: /class/

tool: D85: module

tool: D69: /module/

tool: D72: drivers

tool: D25: /drivers/

tool: D144: /devices/

tool: D2: /

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