// File: /workspace/github_c_makefile_star2_O3/simh[P]simtools/converters/fsio/dos11.c
// Function: dos11Set
static void dos11Set(
  struct mountedFS *mount,
  uint8_t UNUSED(unit),
  uint8_t UNUSED(present)
)
{
  struct DOS11data *data = &mount->dos11data;
  int idx = 0;
  uint8_t user, group;

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

        case DOS11SET_UFD:
          if (args == 3) {
            if (sscanf(words[2], "[%hho,%hho]", &group, &user) == 2) {
              if (dos11CreateUFD(mount, group, user) != 0) {
                data->group = group;
                data->user = user;
              }
            } else fprintf(stderr,
                           "dos11: UIC syntax error \"%s\"\n", words[2]);
          } else fprintf(stderr, "dos11: Invalid syntax for \"set ufd\"\n");
          return;

        default:
          fprintf(stderr, "dos11: \"%s\" not implemented\n", words[1]);
          return;
      }
    }
    idx++;
  }
  fprintf(stderr, "dos11: Unknown set command \"%s\"\n", words[1]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rdi, %rbx
leaq 0x109b1(%rip), %rax     # 0x190b8
movq (%rax), %r15
movq 0x8(%r15), %r14
leaq 0xf60b(%rip), %r13      # 0x17d20
xorl %r12d, %r12d
movq (%r13), %rsi
movq %r14, %rdi
callq 0x31d0
testl %eax, %eax
je 0x874b
incq %r12
addq $0x8, %r13
cmpq $0x2, %r12
jne 0x8718
movq 0xf8b4(%rip), %rax      # 0x17ff0
movq (%rax), %rdi
leaq 0x94bb(%rip), %rsi      # 0x11c01
jmp 0x895c
cmpl $0x1, %r12d
je 0x87b5
testl %r12d, %r12d
jne 0x894b
leaq 0x1094f(%rip), %rax     # 0x190b0
cmpl $0x3, (%rax)
jne 0x8977
movq 0x10(%r15), %rdi
leaq 0x93fb(%rip), %rsi      # 0x11b70
leaq 0xe(%rsp), %rdx
leaq 0xf(%rsp), %rcx
xorl %eax, %eax
callq 0x3230
cmpl $0x2, %eax
jne 0x898b
movb 0xe(%rsp), %al
movb %al, 0x954(%rbx)
movb 0xf(%rsp), %al
movb %al, 0x955(%rbx)
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x108f4(%rip), %rax     # 0x190b0
cmpl $0x3, (%rax)
jne 0x8981
movq 0x10(%r15), %rdi
leaq 0x93a0(%rip), %rsi      # 0x11b70
leaq 0xe(%rsp), %rdx
leaq 0xf(%rsp), %rcx
xorl %eax, %eax
callq 0x3230
cmpl $0x2, %eax
jne 0x8995
movzbl 0xf(%rsp), %ebp
movzbl 0xe(%rsp), %r13d
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7621
testl %eax, %eax
je 0x87a3
shll $0x8, %r13d
orl %ebp, %r13d
movzwl 0x554(%rbx), %eax
movzwl %ax, %ebp
movzwl %ax, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x7621
testl %eax, %eax
je 0x87a3
movq 0x28(%rbx), %rax
shrq %rax
addq $-0x3, %rax
cmpq $0x2, %rax
jb 0x886a
movl $0x1, %edx
movl $0x5, %ecx
movzwl 0x554(%rbx,%rdx,2), %edx
testw %dx, %dx
je 0x8860
cmpw %r13w, %dx
je 0x878f
movl %ecx, %edx
addl $0x4, %ecx
cmpq %rdx, %rax
ja 0x8849
movzwl 0x554(%rbx), %eax
testw %ax, %ax
jne 0x8819
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x7621
testl %eax, %eax
je 0x87a3
leaq 0x10(%rsp), %r14
movq 0x28(%rbx), %rcx
shrq %rcx
addq $-0x3, %rcx
cmpq $0x2, %rcx
jb 0x88c3
movl $0x1, %edx
movl $0x5, %eax
cmpw $0x0, 0x554(%rbx,%rdx,2)
je 0x899f
movl %eax, %edx
addl $0x4, %eax
cmpq %rdx, %rcx
ja 0x88aa
movzwl 0x554(%rbx), %eax
testw %ax, %ax
jne 0x892f
movq %rbx, %rdi
callq 0x7ac2
testw %ax, %ax
je 0x89dd
movl %eax, %r15d
movzwl %ax, %r12d
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3170
movq %rbx, %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x7700
testl %eax, %eax
je 0x87a3
movw %r15w, 0x554(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x7700
testl %eax, %eax
je 0x87a3
movzwl 0x554(%rbx), %eax
movzwl %ax, %ebp
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x7621
testl %eax, %eax
jne 0x888f
jmp 0x87a3
movq 0xf69e(%rip), %rax      # 0x17ff0
movq (%rax), %rdi
leaq 0x9288(%rip), %rsi      # 0x11be4
movq %r14, %rdx
xorl %eax, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31e0
callq 0x3bc4
jmp 0x87a3
callq 0x3b2b
jmp 0x87a3
callq 0x3be0
jmp 0x87a3
callq 0x3b47
jmp 0x87a3
movw %r13w, 0x554(%rbx,%rdx,2)
leal -0x3(%rax), %ecx
xorl %edx, %edx
movw %dx, 0x554(%rbx,%rcx,2)
leal -0x2(%rax), %ecx
movw $0x9, 0x554(%rbx,%rcx,2)
decl %eax
movw %dx, 0x554(%rbx,%rax,2)
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x7700
jmp 0x878f
movq %rbx, %rdi
callq 0x3b73
jmp 0x87a3