// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/converters/fsio/dosmt.c
// Function: dosmtSet
static void dosmtSet(
  struct mountedFS *mount,
  uint8_t UNUSED(unit),
  uint8_t UNUSED(present)
)
{
  struct DOSMTdata *data = &mount->dosmtdata;
  int idx = 0;
  uint8_t prog, proj, prot;

  while (setCmds[idx] != NULL) {
    if (strcmp(words[1], setCmds[idx]) == 0) {
      switch (idx) {
        case DOSMTSET_UIC:
          if (args == 3) {
            if (sscanf(words[2], "[%hho,%hho]", &proj, &prog) == 2) {
              data->proj = proj;
              data->prog = prog;
            } else fprintf(stderr,
                           "dosmt: UIC syntax error \"%s\"\n", words[2]);
          } else fprintf(stderr, "dosmt: Invalid syntax for \"set uic\"\n");
          return;

        case DOSMTSET_PROT:
          if (args == 3) {
            if (sscanf(words[2], "<%hho>", &prot) == 1) {
              data->prot = prot;
            } else fprintf(stderr,
                           "dosmt: Protection syntax error \"%s\"\n", words[2]);
          } else fprintf(stderr, "dosmt: Invalid syntax for \"set prot\"\n");
          return;
      }
    }
    idx++;
  }
  fprintf(stderr, "dosmt: Unknown set command \"%s\"\n", words[1]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xcffd(%rip), %r15      # 0x180b8
movq (%r15), %r12
movq 0x8(%r12), %r14
leaq 0xbcc6(%rip), %r13      # 0x16d90
xorl %ebp, %ebp
cmpq $0x2, %rbp
je 0xb18e
movq (%r13), %rsi
movq %r14, %rdi
callq 0x31d0
testl %eax, %eax
jne 0xb0ef
cmpl $0x1, %ebp
je 0xb0f8
testl %ebp, %ebp
je 0xb135
incq %rbp
addq $0x8, %r13
jmp 0xb0cc
leaq 0xcfb1(%rip), %rax      # 0x180b0
cmpl $0x3, (%rax)
jne 0xb1b7
movq 0x10(%r12), %rdi
leaq 0x63cc(%rip), %rsi      # 0x114e0
leaq 0x5(%rsp), %rdx
xorl %eax, %eax
callq 0x3230
cmpl $0x1, %eax
jne 0xb1f6
movb 0x5(%rsp), %al
movb %al, 0x252(%rbx)
jmp 0xb17f
leaq 0xcf74(%rip), %rax      # 0x180b0
cmpl $0x3, (%rax)
jne 0xb1cc
movq 0x10(%r12), %rdi
leaq 0x5a1f(%rip), %rsi      # 0x10b70
leaq 0x6(%rsp), %rdx
leaq 0x7(%rsp), %rcx
xorl %eax, %eax
callq 0x3230
cmpl $0x2, %eax
jne 0xb210
movb 0x6(%rsp), %al
movb %al, 0x250(%rbx)
movb 0x7(%rsp), %al
movb %al, 0x251(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xbe63(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
leaq 0x6393(%rip), %rsi      # 0x11532
movq %r14, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31e0
movq 0xbe3a(%rip), %rax      # 0x16ff8
movq (%rax), %rcx
leaq 0x6344(%rip), %rdi      # 0x1150c
pushq $0x25
jmp 0xb1df
movq 0xbe25(%rip), %rax      # 0x16ff8
movq (%rax), %rcx
leaq 0x62de(%rip), %rdi      # 0x114bb
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32d0
movq 0xbdfb(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
movq (%r15), %rax
movq 0x10(%rax), %rdx
leaq 0x62d9(%rip), %rsi      # 0x114e7
jmp 0xb228
movq 0xbde1(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
movq (%r15), %rax
movq 0x10(%rax), %rdx
leaq 0x6275(%rip), %rsi      # 0x1149d
xorl %eax, %eax
callq 0x31e0
jmp 0xb17f