// File: /workspace/github_c_makefile_star2_O0/simh[P]simtools/converters/fsio/rt11.c
// Function: info
static void info(
  struct mountedFS *mount,
  uint8_t unit
)
{
  struct RT11data *data = &mount->rt11data;
  uint16_t entrysz, startblk, dsseg = 1;
  char temp[32];

  printf("%s%o:\n\n", mount->name, unit);

  do {
    uint16_t off = RT11_DH_SIZE;

    if (rt11ReadDirSegment(mount, unit, dsseg) == 0)
      return;

    printf("\nDirectory Segment %2d:\n\n", dsseg);
    printf(" File  Type     Date     Status   Class   Length    Disk Region\n\n");

    entrysz = RT11_DI_SIZE + (le16toh(data->buf[RT11_DH_EXTRA]) >> 1);
    startblk = le16toh(data->buf[RT11_DH_START]);

    /*
     * Loop until we see and end-of-segment marker or there is no room for
     * another directory entry.
     */
    while (!RT11EOS(le16toh(data->buf[off + RT11_DI_STATUS])) &&
           ((RT11_DS_SIZE - off) >= entrysz)) {
      uint16_t status = le16toh(data->buf[off + RT11_DI_STATUS]);

      /*
       * Tentative and empty files are reported as "UNUSED"
       */
      if ((status & (RT11_E_TENT | RT11_E_MPTY)) == 0) {
        r50Asc(le16toh(data->buf[off + RT11_DI_FNAME1]), &temp[0]);
        r50Asc(le16toh(data->buf[off + RT11_DI_FNAME2]), &temp[3]);
        temp[6] = '.';
        r50Asc(le16toh(data->buf[off + RT11_DI_FTYPE]), &temp[7]);
        temp[10] = ' ';
        temp[11] = ' ';
        rt11Date(le16toh(data->buf[off + RT11_DI_CREATE]), &temp[12]);

        printf("%s  %07o  %s     %5d     %5d-%5d\n",
               temp, status,
               (status & RT11_E_PRE) != 0 ? "PRE" : "   ",
               le16toh(data->buf[off + RT11_DI_LENGTH]),
               startblk,
               startblk + le16toh(data->buf[off + RT11_DI_LENGTH]) - 1);
      } else {
        printf("< UNUSED >                                %5d     %5d-%5d\n",
               le16toh(data->buf[off + RT11_DI_LENGTH]),
               startblk,
               le16toh(data->buf[off + RT11_DI_LENGTH]) == 0 ? startblk :
                 startblk + le16toh(data->buf[off + RT11_DI_LENGTH]) - 1);
      }
      startblk += le16toh(data->buf[off + RT11_DI_LENGTH]);

      off += entrysz;
    }

    dsseg = le16toh(data->buf[RT11_DH_NEXT]);
  } while (dsseg != 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x18(%rbp)
movw $0x1, -0x1e(%rbp)
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
movzbl -0x9(%rbp), %edx
leaq 0xafec(%rip), %rdi      # 0x1aab6
movb $0x0, %al
callq 0x3160
movw $0x5, -0x42(%rbp)
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movzbl %al, %esi
movzwl -0x1e(%rbp), %edx
callq 0xc3e0
cmpl $0x0, %eax
jne 0xfaf4
jmp 0xfe24
movzwl -0x1e(%rbp), %esi
leaq 0xa8a8(%rip), %rdi      # 0x1a3a7
movb $0x0, %al
callq 0x3160
leaq 0xa8b4(%rip), %rdi      # 0x1a3c1
movb $0x0, %al
callq 0x3160
movq -0x18(%rbp), %rax
movzwl 0x430(%rax), %edi
callq 0xc6b0
movzwl %ax, %eax
sarl %eax
addl $0x7, %eax
movw %ax, -0x1a(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x432(%rax), %edi
callq 0xc6b0
movw %ax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
movzwl %ax, %ecx
andl $0x800, %ecx            # imm = 0x800
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x45(%rbp)
jne 0xfb89
movzwl -0x42(%rbp), %ecx
movl $0x200, %eax            # imm = 0x200
subl %ecx, %eax
movzwl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
setge %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0xfb95
jmp 0xfe03
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
movw %ax, -0x44(%rbp)
movzwl -0x44(%rbp), %eax
andl $0x300, %eax            # imm = 0x300
cmpl $0x0, %eax
jne 0xfd2a
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
leaq -0x40(%rbp), %rsi
movzwl %ax, %edi
callq 0x5bf0
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
leaq -0x40(%rbp), %rsi
addq $0x3, %rsi
movzwl %ax, %edi
callq 0x5bf0
movb $0x2e, -0x3a(%rbp)
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
leaq -0x40(%rbp), %rsi
addq $0x7, %rsi
movzwl %ax, %edi
callq 0x5bf0
movb $0x20, -0x36(%rbp)
movb $0x20, -0x35(%rbp)
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x6, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
leaq -0x40(%rbp), %rsi
addq $0xc, %rsi
movzwl %ax, %edi
callq 0xc6d0
leaq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
movzwl -0x44(%rbp), %eax
movl %eax, -0x64(%rbp)
movzwl -0x44(%rbp), %edx
andl $0x10, %edx
leaq 0xa70c(%rip), %rax      # 0x1a3a3
leaq 0xa787(%rip), %rcx      # 0x1a425
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
movzwl %ax, %eax
movl %eax, -0x54(%rbp)
movzwl -0x1c(%rbp), %eax
movl %eax, -0x50(%rbp)
movzwl -0x1c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
movq -0x70(%rbp), %rsi
movl -0x64(%rbp), %edx
movq -0x60(%rbp), %rcx
movl -0x54(%rbp), %r8d
movl -0x50(%rbp), %r9d
movw %ax, %di
movl -0x4c(%rbp), %eax
movzwl %di, %edi
addl %edi, %eax
subl $0x1, %eax
leaq 0xa6e8(%rip), %rdi      # 0x1a403
movl %eax, (%rsp)
movb $0x0, %al
callq 0x3160
jmp 0xfdc8
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
movzwl %ax, %eax
movl %eax, -0x78(%rbp)
movzwl -0x1c(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0xfd7e
movzwl -0x1c(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0xfdb1
movzwl -0x1c(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
movw %ax, %cx
movl -0x80(%rbp), %eax
movzwl %cx, %ecx
addl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x7c(%rbp)
movl -0x74(%rbp), %edx
movl -0x78(%rbp), %esi
movl -0x7c(%rbp), %ecx
leaq 0xa668(%rip), %rdi      # 0x1a429
movb $0x0, %al
callq 0x3160
movq -0x18(%rbp), %rax
movzwl -0x42(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl 0x42a(%rax,%rcx,2), %edi
callq 0xc6b0
movzwl %ax, %ecx
movzwl -0x1c(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x1c(%rbp)
movzwl -0x1a(%rbp), %ecx
movzwl -0x42(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x42(%rbp)
jmp 0xfb44
movq -0x18(%rbp), %rax
movzwl 0x42c(%rax), %edi
callq 0xc6b0
movw %ax, -0x1e(%rbp)
movzwl -0x1e(%rbp), %eax
cmpl $0x0, %eax
jne 0xfad1
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)