// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movb %sil, %cl
movq %rdi, -0x8(%rbp)
movb %cl, -0x9(%rbp)
movb %al, -0xa(%rbp)
movq -0x8(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rcx
leaq 0xde1b(%rip), %rax      # 0x1eda0
cmpq $0x0, (%rax,%rcx,8)
je 0x11100
leaq 0xe341(%rip), %rax      # 0x1f2d8
movq (%rax), %rax
movq 0x8(%rax), %rdi
movslq -0x1c(%rbp), %rcx
leaq 0xddf7(%rip), %rax      # 0x1eda0
movq (%rax,%rcx,8), %rsi
callq 0x31b0
cmpl $0x0, %eax
jne 0x110f2
movl -0x1c(%rbp), %eax
movl %eax, -0x24(%rbp)
testl %eax, %eax
je 0x10fd8
jmp 0x10fc7
movl -0x24(%rbp), %eax
subl $0x1, %eax
je 0x1106e
jmp 0x110f0
leaq 0xe2f1(%rip), %rax      # 0x1f2d0
cmpl $0x3, (%rax)
jne 0x11051
leaq 0xe2ed(%rip), %rax      # 0x1f2d8
movq (%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x8bc1(%rip), %rsi      # 0x19bba
leaq -0x1e(%rbp), %rdx
leaq -0x1d(%rbp), %rcx
movb $0x0, %al
callq 0x3210
cmpl $0x2, %eax
jne 0x11029
movb -0x1e(%rbp), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x208(%rax)
movb -0x1d(%rbp), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x209(%rax)
jmp 0x1104f
movq 0xcfc8(%rip), %rax      # 0x1dff8
movq (%rax), %rdi
leaq 0xe29e(%rip), %rax      # 0x1f2d8
movq (%rax), %rax
movq 0x10(%rax), %rdx
leaq 0x94a5(%rip), %rsi      # 0x1a4ed
movb $0x0, %al
callq 0x31c0
jmp 0x11069
movq 0xcfa0(%rip), %rax      # 0x1dff8
movq (%rax), %rdi
leaq 0x94a9(%rip), %rsi      # 0x1a50b
movb $0x0, %al
callq 0x31c0
jmp 0x11126
leaq 0xe25b(%rip), %rax      # 0x1f2d0
cmpl $0x3, (%rax)
jne 0x110d6
leaq 0xe257(%rip), %rax      # 0x1f2d8
movq (%rax), %rax
movq 0x10(%rax), %rdi
leaq 0x94a1(%rip), %rsi      # 0x1a530
leaq -0x1f(%rbp), %rdx
movb $0x0, %al
callq 0x3210
cmpl $0x1, %eax
jne 0x110ae
movb -0x1f(%rbp), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x20a(%rax)
jmp 0x110d4
movq 0xcf43(%rip), %rax      # 0x1dff8
movq (%rax), %rdi
leaq 0xe219(%rip), %rax      # 0x1f2d8
movq (%rax), %rax
movq 0x10(%rax), %rdx
leaq 0x946a(%rip), %rsi      # 0x1a537
movb $0x0, %al
callq 0x31c0
jmp 0x110ee
movq 0xcf1b(%rip), %rax      # 0x1dff8
movq (%rax), %rdi
leaq 0x9475(%rip), %rsi      # 0x1a55c
movb $0x0, %al
callq 0x31c0
jmp 0x11126
jmp 0x110f2
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x10f7a
movq 0xcef1(%rip), %rax      # 0x1dff8
movq (%rax), %rdi
leaq 0xe1c7(%rip), %rax      # 0x1f2d8
movq (%rax), %rax
movq 0x8(%rax), %rdx
leaq 0x9463(%rip), %rsi      # 0x1a582
movb $0x0, %al
callq 0x31c0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)