user: 这段汇编代码用C语言表示是什么样的:

```asm
<find_busid_in_sysfs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x160,%rsp
  mov    %rdi,-0x158(%rbp)
  mov    %rsi,-0x160(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x14c(%rbp)
  movq   $0x0,-0x148(%rbp)
  lea    -0x110(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <opendir@plt>
  mov    %rax,-0x140(%rbp)
  cmpq   $0x0,-0x140(%rbp)
  jne    L50
  mov    $0xffffffff,%eax
  jmp    L112
L50:
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x110(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,-0x138(%rbp)
  jmp    L148
L193:
  mov    -0x130(%rbp),%rdx
  mov    -0x138(%rbp),%rcx
  lea    -0x110(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <append_if_directory@plt>
  mov    %rax,-0x148(%rbp)
  cmpq   $0x0,-0x148(%rbp)
  jne    L126
  jmp    L148
L126:
  mov    -0x158(%rbp),%rdx
  lea    -0x110(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <check_directory@plt>
  mov    %eax,-0x14c(%rbp)
  cmpl   $0x0,-0x14c(%rbp)
  jne    L135
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <opendir@plt>
  mov    %rax,-0x128(%rbp)
  cmpq   $0x0,-0x128(%rbp)
  jne    L21
  jmp    L148
L168:
  mov    -0x120(%rbp),%rdx
  mov    -0x148(%rbp),%rcx
  lea    -0x110(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <append_if_directory@plt>
  mov    %rax,-0x118(%rbp)
  cmpq   $0x0,-0x118(%rbp)
  jne    L160
  jmp    L21
L160:
  mov    -0x158(%rbp),%rdx
  lea    -0x110(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <check_directory@plt>
  mov    %eax,-0x14c(%rbp)
  cmpl   $0x0,-0x14c(%rbp)
  jne    L106
L21:
  mov    -0x128(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0x120(%rbp)
  cmpq   $0x0,-0x120(%rbp)
  jne    L168
  jmp    L177
L106:
  nop
L177:
  mov    -0x128(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
  cmpl   $0x0,-0x14c(%rbp)
  jne    L154
L148:
  mov    -0x140(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0x130(%rbp)
  cmpq   $0x0,-0x130(%rbp)
  jne    L193
  jmp    L52
L135:
  nop
  jmp    L52
L154:
  nop
L52:
  mov    -0x140(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
  cmpl   $0x0,-0x14c(%rbp)
  je     L108
  mov    -0x148(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x160(%rbp),%rdx
  lea    -0x110(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <extract_busid@plt>
  jmp    L112
L108:
  mov    $0xffffffff,%eax
L112:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L46
  call   <__stack_chk_fail@plt>
L46:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D3
type_infered: string

tool: D3: /sys/block/

assistant: ```c
int find_busid_in_sysfs(char *dev, char *busid) {
  DIR *blockdir, *diskdir;
  struct dirent *blockde, *diskde;
  int found = 0;
  char namebuffer[256];
  char *blockend, *diskend = NULL, *partend;
  strcpy(namebuffer, "/sys/block/");
  blockdir = opendir(namebuffer);
  if (!blockdir)
    return -1;
  blockend = namebuffer + strlen(namebuffer);
  while ((blockde = readdir(blockdir))) {
    diskend = append_if_directory(namebuffer, blockend, blockde);
    if (!diskend)
      continue;
    found = check_directory(namebuffer, dev);
    if (found)
      break;
    diskdir = opendir(namebuffer);
    if (!diskdir)
      continue;
    while ((diskde = readdir(diskdir))) {
      partend = append_if_directory(namebuffer, diskend, diskde);
      if (!partend)
        continue;
      found = check_directory(namebuffer, dev);
      if (found)
        break;
    }
    closedir(diskdir);
    if (found)
      break;
  }
  closedir(blockdir);
  if (found) {
    *diskend = 0;
    return extract_busid(namebuffer, busid);
  } else
    return -1;
}
```