user: Converte this assembly snippet into its equivalent C code:

```asm
<show_short_lun_info>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb50,%rsp
  mov    %edi,-0xb44(%rbp)
  mov    %esi,-0xb48(%rbp)
  mov    %edx,-0xb4c(%rbp)
  mov    %ecx,-0xb50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xb3c(%rbp)
  lea    D93(%rip),%rax
  mov    %rax,-0xb28(%rbp)
  lea    D93(%rip),%rax
  mov    %rax,-0xb30(%rbp)
  movl   $0x0,-0xb38(%rbp)
  mov    -0xb4c(%rbp),%edi
  mov    -0xb48(%rbp),%esi
  mov    -0xb44(%rbp),%edx
  lea    -0x810(%rbp),%rax
  sub    $0x8,%rsp
  mov    -0xb50(%rbp),%ecx
  push   %rcx
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %edx,%ecx
  lea    D80(%rip),%rdx
  mov    $0x400,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  add    $0x10,%rsp
  mov    %eax,-0xb34(%rbp)
  cmpl   $0x0,-0xb34(%rbp)
  js     L42
  mov    -0xb34(%rbp),%eax
  cmp    $0x3ff,%eax
  ja     L42
  lea    -0x910(%rbp),%rdx
  lea    -0x810(%rbp),%rax
  mov    $0x100,%ecx
  lea    D27(%rip),%rsi
  mov    %rax,%rdi
  call   <sa_sys_read_line@plt>
  lea    -0xa10(%rbp),%rdx
  lea    -0x810(%rbp),%rax
  mov    $0x100,%ecx
  lea    D16(%rip),%rsi
  mov    %rax,%rdi
  call   <sa_sys_read_line@plt>
  lea    -0xb10(%rbp),%rdx
  lea    -0x810(%rbp),%rax
  mov    $0x100,%ecx
  lea    D84(%rip),%rsi
  mov    %rax,%rdi
  call   <sa_sys_read_line@plt>
  lea    -0x810(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    $0x3ff,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  lea    -0x810(%rbp),%rax
  lea    D68(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncat@plt>
  lea    -0x810(%rbp),%rax
  mov    %rax,%rdi
  call   <opendir@plt>
  mov    %rax,-0xb20(%rbp)
  cmpq   $0x0,-0xb20(%rbp)
  je     L161
  jmp    L22
L177:
  mov    -0xb18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L120
  mov    -0xb18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L22
  mov    -0xb18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L120
  mov    -0xb18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L120
  jmp    L22
L120:
  mov    -0xb18(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0xb30(%rbp)
  mov    -0xb30(%rbp),%rcx
  lea    -0x810(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  lea    D119(%rip),%rdx
  mov    $0x400,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %eax,-0xb34(%rbp)
  cmpl   $0x0,-0xb34(%rbp)
  js     L22
  mov    -0xb34(%rbp),%eax
  cmp    $0x3ff,%eax
  jbe    L67
  jmp    L22
L67:
  lea    -0xb38(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  lea    D39(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sa_sys_read_u64@plt>
  mov    -0xb30(%rbp),%rcx
  lea    -0x810(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  lea    D32(%rip),%rdx
  mov    $0x400,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %eax,-0xb34(%rbp)
  cmpl   $0x0,-0xb34(%rbp)
  js     L22
  mov    -0xb34(%rbp),%eax
  cmp    $0x3ff,%eax
  jbe    L96
  jmp    L22
L96:
  lea    -0xb3c(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  lea    D60(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sa_sys_read_u32@plt>
L22:
  mov    -0xb20(%rbp),%rax
  mov    %rax,%rdi
  call   <readdir@plt>
  mov    %rax,-0xb18(%rbp)
  cmpq   $0x0,-0xb18(%rbp)
  jne    L177
  mov    -0xb20(%rbp),%rax
  mov    %rax,%rdi
  call   <closedir@plt>
  mov    -0xb3c(%rbp),%edx
  mov    -0xb38(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <format_capstr@plt>
  mov    %rax,-0xb28(%rbp)
  mov    -0xb3c(%rbp),%edi
  lea    -0xb10(%rbp),%r8
  mov    -0xb28(%rbp),%rcx
  mov    -0xb30(%rbp),%rdx
  mov    -0xb50(%rbp),%eax
  lea    -0x910(%rbp),%rsi
  push   %rsi
  lea    -0xa10(%rbp),%rsi
  push   %rsi
  mov    %r8,%r9
  mov    %edi,%r8d
  mov    %eax,%esi
  lea    D110(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  add    $0x10,%rsp
  mov    -0xb28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  jmp    L71
L42:
  nop
  jmp    L71
L161:
  nop
L71:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L189
  call   <__stack_chk_fail@plt>
L189:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D93
datatype: string
name: unpack_data
arguments: data_tag: D80
datatype: string
name: unpack_data
arguments: data_tag: D27
datatype: string
name: unpack_data
arguments: data_tag: D16
datatype: string
name: unpack_data
arguments: data_tag: D84
datatype: string
name: unpack_data
arguments: data_tag: D68
datatype: string
name: unpack_data
arguments: data_tag: D119
datatype: string
name: unpack_data
arguments: data_tag: D39
datatype: string
name: unpack_data
arguments: data_tag: D32
datatype: string
name: unpack_data
arguments: data_tag: D60
datatype: string
name: unpack_data
arguments: data_tag: D110
datatype: string

tool: D93: Unknown

tool: D80: /sys/class/scsi_device/%u:%u:%u:%u/device/

tool: D27: rev

tool: D16: model

tool: D84: vendor

tool: D68: block

tool: D119: %s/%s/

tool: D39: size

tool: D32: %s/%s/queue/

tool: D60: hw_sector_size

tool: D110: %10d  %-11s  %10s  %7d     %s %s (rev %s)


assistant: ```c
void show_short_lun_info(unsigned int hba, unsigned int port, unsigned int tgt, unsigned int lun) {
  struct dirent *dp;
  char vendor[256];
  char path[1024];
  char npath[1024];
  char model[256];
  char rev[256];
  DIR *dir;
  uint32_t blksize = 0;
  char *capstr = "Unknown";
  char *osname = "Unknown";
  uint64_t size = 0;
  int rc;
  rc = snprintf(path, sizeof(path), "/sys/class/scsi_device/%u:%u:%u:%u/device/", hba, port, tgt, lun);
  if (rc < 0 || (size_t)rc >= sizeof(path))
    return;
  sa_sys_read_line(path, "rev", rev, sizeof(rev));
  sa_sys_read_line(path, "model", model, sizeof(model));
  sa_sys_read_line(path, "vendor", vendor, sizeof(vendor));
  strncat(path, "block", sizeof(path) - strlen(path) - 1);
  dir = opendir(path);
  if (!dir)
    return;
  while ((dp = readdir(dir)) != NULL) {
    if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
      continue;
    osname = dp->d_name;
    rc = snprintf(npath, sizeof(npath), "%s/%s/", path, osname);
    if (rc < 0 || (size_t)rc >= sizeof(npath))
      continue;
    sa_sys_read_u64(npath, "size", &size);
    rc = snprintf(npath, sizeof(npath), "%s/%s/queue/", path, osname);
    if (rc < 0 || (size_t)rc >= sizeof(npath))
      continue;
    sa_sys_read_u32(npath, "hw_sector_size", &blksize);
  }
  closedir(dir);
  capstr = format_capstr(size, blksize);
  printf("%10d  %-11s  %10s  %7d     %s %s (rev %s)\n", lun, osname, capstr, blksize, vendor, model, rev);
  free(capstr);
  return;
}
```