// File: /workspace/github_c_makefile_star2_O0/simh[P]simtools/converters/fsio/fsio.c
// Function: doDump
static void doDump(void)
{
  struct mountedFS *mount;
  char *fname;
  void *file;
  uint8_t unit, present;

  if ((mount = findMount("dump", words[0], &unit, &present, &fname)) != NULL) {
    if ((file = (*mount->filesys->openFileR)(mount, unit, fname)) != NULL) {
      unsigned int offset = 0, datasz = 2;
      uint8_t data1;
      uint16_t data2;
      uint32_t data4;
      char output[128];

      if (SWISSET('b') || SWISSET('c'))
        datasz = 1;
      else if (SWISSET('d'))
        datasz = 4;
      else if (SWISSET('w'))
        datasz = 2;

      output[0] = '\0';

      switch (datasz) {
        case 1:
          while ((*mount->filesys->readFile)(file, &data1, 1) != 0) {
            if (SWISSET('b'))
              sprintf(&output[strlen(output)],
                      SWISSET('x') ? " 0x%02X" : " 0%03o", data1);
            else sprintf(&output[strlen(output)], " %s ", Ascii[data1 & 0177]);

            if ((offset & 07) == 07) {
              if (mount->blocksz != 0)
                printf("%s%011o %s\n",
                       ((offset & ~07) % mount->blocksz) == 0 ? "\n" : "",
                       offset & ~07, output);
              else printf("%011o %s\n", offset & ~07, output);
              output[0] = '\0';
            }
            offset++;
          }

          if (output[0] != '\0')
            printf("%011o %s\n", offset & ~07, output);
          break;

        case 2:
          while ((*mount->filesys->readFile)(file, &data2, 2) != 0) {
            sprintf(&output[strlen(output)],
                    SWISSET('x') ? " 0x%04X" : " %07o", data2);

            if ((offset & 017) == 016) {
              if (mount->blocksz != 0)
                printf("%s%011o %s\n",
                       ((offset & ~017) % mount->blocksz) == 0 ? "\n" : "",
                       offset & ~017, output);
              else printf("%011o %s\n", offset & ~017, output);
              output[0] = '\0';
            }
            offset += 2;
            data2 = 0;
          }

          if (output[0] != '\0')
            printf("%011o %s\n", offset & ~07, output);
          break;

        case 4:
          while ((*mount->filesys->readFile)(file, &data4, 4) != 0) {
            sprintf(&output[strlen(output)],
                    SWISSET('x') ? " 0x%08X" : " %011o", data2);

            if ((offset & 017) == 014) {
              if (mount->blocksz != 0)
                printf("%s%011o %s\n",
                       ((offset & ~017) % mount->blocksz) == 0 ? "\n" : "",
                       offset & ~017, output);
              else printf("%011o %s\n", offset & ~017, output);
              output[0] = '\0';
            }
            offset += 4;
            data2 = 0;
          }

          if (output[0] != '\0')
            printf("%011o %s\n", offset & ~07, output);
          break;
      }
      /*
       * Close the file
       */
      (*mount->filesys->closeFile)(file);
    } else fprintf(stderr, "dump: \"%s\" no such file\n", fname);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq 0x1b6a6(%rip), %rax     # 0x1f2d8
movq (%rax), %rsi
leaq 0x14470(%rip), %rdi     # 0x180ac
leaq -0x19(%rbp), %rdx
leaq -0x1a(%rbp), %rcx
leaq -0x10(%rbp), %r8
callq 0x58f0
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
je 0x4113
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x60(%rax), %rax
movq -0x8(%rbp), %rdi
movb -0x19(%rbp), %cl
movq -0x10(%rbp), %rdx
movzbl %cl, %esi
callq *%rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x40f5
movl $0x0, -0x20(%rbp)
movl $0x2, -0x24(%rbp)
movl 0x1b55f(%rip), %eax     # 0x1f1f8
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x3caf
movl 0x1b551(%rip), %eax     # 0x1f1f8
andl $0x4, %eax
cmpl $0x0, %eax
je 0x3cb8
movl $0x1, -0x24(%rbp)
jmp 0x3cea
movl 0x1b53a(%rip), %eax     # 0x1f1f8
andl $0x8, %eax
cmpl $0x0, %eax
je 0x3ccf
movl $0x4, -0x24(%rbp)
jmp 0x3ce8
movl 0x1b523(%rip), %eax     # 0x1f1f8
andl $0x400000, %eax         # imm = 0x400000
cmpl $0x0, %eax
je 0x3ce6
movl $0x2, -0x24(%rbp)
jmp 0x3ce8
jmp 0x3cea
movb $0x0, -0xb0(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0xb4(%rbp)
subl $0x1, %eax
je 0x3d26
jmp 0x3d01
movl -0xb4(%rbp), %eax
subl $0x2, %eax
je 0x3e92
jmp 0x3d12
movl -0xb4(%rbp), %eax
subl $0x4, %eax
je 0x3fbb
jmp 0x40e1
jmp 0x3d28
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x80(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x25(%rbp), %rsi
movl $0x1, %edx
callq *%rax
cmpq $0x0, %rax
je 0x3e66
movl 0x1b4a2(%rip), %eax     # 0x1f1f8
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3da2
leaq -0xb0(%rbp), %rdi
callq 0x3130
leaq -0xb0(%rbp), %rdi
addq %rax, %rdi
movl 0x1b47e(%rip), %ecx     # 0x1f1f8
andl $0x800000, %ecx         # imm = 0x800000
leaq 0x1477e(%rip), %rsi     # 0x18505
leaq 0x1476f(%rip), %rax     # 0x184fd
cmpl $0x0, %ecx
cmovneq %rax, %rsi
movzbl -0x25(%rbp), %edx
movb $0x0, %al
callq 0x3290
jmp 0x3ddb
leaq -0xb0(%rbp), %rdi
callq 0x3130
leaq -0xb0(%rbp), %rdi
addq %rax, %rdi
movzbl -0x25(%rbp), %eax
andl $0x7f, %eax
movslq %eax, %rcx
leaq 0x1a917(%rip), %rax     # 0x1e6e0
movq (%rax,%rcx,8), %rdx
leaq 0x14738(%rip), %rsi     # 0x1850c
movb $0x0, %al
callq 0x3290
movl -0x20(%rbp), %eax
andl $0x7, %eax
cmpl $0x7, %eax
jne 0x3e58
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x3e36
movl -0x20(%rbp), %eax
andl $-0x8, %eax
movl %eax, %eax
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x28(%rcx)
leaq 0x16b96(%rip), %rsi     # 0x1a9a0
leaq 0x16b8e(%rip), %rax     # 0x1a99f
cmpq $0x0, %rdx
cmoveq %rax, %rsi
movl -0x20(%rbp), %edx
andl $-0x8, %edx
leaq -0xb0(%rbp), %rcx
leaq 0x146e4(%rip), %rdi     # 0x18511
movb $0x0, %al
callq 0x3160
jmp 0x3e51
movl -0x20(%rbp), %esi
andl $-0x8, %esi
leaq -0xb0(%rbp), %rdx
leaq 0x146c9(%rip), %rdi     # 0x18513
movb $0x0, %al
callq 0x3160
movb $0x0, -0xb0(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3d28
movsbl -0xb0(%rbp), %eax
cmpl $0x0, %eax
je 0x3e8d
movl -0x20(%rbp), %esi
andl $-0x8, %esi
leaq -0xb0(%rbp), %rdx
leaq 0x1468d(%rip), %rdi     # 0x18513
movb $0x0, %al
callq 0x3160
jmp 0x40e1
jmp 0x3e94
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x80(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x2, %edx
callq *%rax
cmpq $0x0, %rax
je 0x3f8f
leaq -0xb0(%rbp), %rdi
callq 0x3130
leaq -0xb0(%rbp), %rdi
addq %rax, %rdi
movl 0x1b320(%rip), %ecx     # 0x1f1f8
andl $0x800000, %ecx         # imm = 0x800000
leaq 0x14640(%rip), %rsi     # 0x18525
leaq 0x14631(%rip), %rax     # 0x1851d
cmpl $0x0, %ecx
cmovneq %rax, %rsi
movzwl -0x28(%rbp), %edx
movb $0x0, %al
callq 0x3290
movl -0x20(%rbp), %eax
andl $0xf, %eax
cmpl $0xe, %eax
jne 0x3f7b
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x3f59
movl -0x20(%rbp), %eax
andl $-0x10, %eax
movl %eax, %eax
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x28(%rcx)
leaq 0x16a73(%rip), %rsi     # 0x1a9a0
leaq 0x16a6b(%rip), %rax     # 0x1a99f
cmpq $0x0, %rdx
cmoveq %rax, %rsi
movl -0x20(%rbp), %edx
andl $-0x10, %edx
leaq -0xb0(%rbp), %rcx
leaq 0x145c1(%rip), %rdi     # 0x18511
movb $0x0, %al
callq 0x3160
jmp 0x3f74
movl -0x20(%rbp), %esi
andl $-0x10, %esi
leaq -0xb0(%rbp), %rdx
leaq 0x145a6(%rip), %rdi     # 0x18513
movb $0x0, %al
callq 0x3160
movb $0x0, -0xb0(%rbp)
movl -0x20(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x20(%rbp)
movw $0x0, -0x28(%rbp)
jmp 0x3e94
movsbl -0xb0(%rbp), %eax
cmpl $0x0, %eax
je 0x3fb6
movl -0x20(%rbp), %esi
andl $-0x8, %esi
leaq -0xb0(%rbp), %rdx
leaq 0x14564(%rip), %rdi     # 0x18513
movb $0x0, %al
callq 0x3160
jmp 0x40e1
jmp 0x3fbd
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x80(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
callq *%rax
cmpq $0x0, %rax
je 0x40b8
leaq -0xb0(%rbp), %rdi
callq 0x3130
leaq -0xb0(%rbp), %rdi
addq %rax, %rdi
movl 0x1b1f7(%rip), %ecx     # 0x1f1f8
andl $0x800000, %ecx         # imm = 0x800000
leaq 0x14525(%rip), %rsi     # 0x18533
leaq 0x14516(%rip), %rax     # 0x1852b
cmpl $0x0, %ecx
cmovneq %rax, %rsi
movzwl -0x28(%rbp), %edx
movb $0x0, %al
callq 0x3290
movl -0x20(%rbp), %eax
andl $0xf, %eax
cmpl $0xc, %eax
jne 0x40a4
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x4082
movl -0x20(%rbp), %eax
andl $-0x10, %eax
movl %eax, %eax
movq -0x8(%rbp), %rcx
xorl %edx, %edx
divq 0x28(%rcx)
leaq 0x1694a(%rip), %rsi     # 0x1a9a0
leaq 0x16942(%rip), %rax     # 0x1a99f
cmpq $0x0, %rdx
cmoveq %rax, %rsi
movl -0x20(%rbp), %edx
andl $-0x10, %edx
leaq -0xb0(%rbp), %rcx
leaq 0x14498(%rip), %rdi     # 0x18511
movb $0x0, %al
callq 0x3160
jmp 0x409d
movl -0x20(%rbp), %esi
andl $-0x10, %esi
leaq -0xb0(%rbp), %rdx
leaq 0x1447d(%rip), %rdi     # 0x18513
movb $0x0, %al
callq 0x3160
movb $0x0, -0xb0(%rbp)
movl -0x20(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x20(%rbp)
movw $0x0, -0x28(%rbp)
jmp 0x3fbd
movsbl -0xb0(%rbp), %eax
cmpl $0x0, %eax
je 0x40df
movl -0x20(%rbp), %esi
andl $-0x8, %esi
leaq -0xb0(%rbp), %rdx
leaq 0x1443b(%rip), %rdi     # 0x18513
movb $0x0, %al
callq 0x3160
jmp 0x40e1
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x78(%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
jmp 0x4111
movq 0x19efc(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x14430(%rip), %rsi     # 0x1853a
movb $0x0, %al
callq 0x31c0
jmp 0x4113
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)