// File: /workspace/github_c_makefile_star2_O2/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 0x10e9f(%rip), %r15     # 0x180b8
movq (%r15), %r12
movq 0x8(%r12), %r14
leaq 0xfae8(%rip), %rbp      # 0x16d10
xorl %r13d, %r13d
cmpq $0x2, %r13
je 0x7433
movq (%rbp), %rsi
movq %r14, %rdi
callq 0x31d0
testl %eax, %eax
je 0x724e
incq %r13
addq $0x8, %rbp
jmp 0x722b
cmpl $0x1, %r13d
je 0x72b9
testl %r13d, %r13d
jne 0x746a
leaq 0x10e4c(%rip), %rax     # 0x180b0
cmpl $0x3, (%rax)
jne 0x7496
movq 0x10(%r12), %rdi
leaq 0x98f7(%rip), %rsi      # 0x10b70
leaq 0xa(%rsp), %rdx
leaq 0xb(%rsp), %rcx
xorl %eax, %eax
callq 0x3230
cmpl $0x2, %eax
jne 0x7446
movb 0xa(%rsp), %al
movb %al, 0x954(%rbx)
movb 0xb(%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 0x10df0(%rip), %rax     # 0x180b0
cmpl $0x3, (%rax)
jne 0x74a9
movq 0x10(%r12), %rdi
leaq 0x989b(%rip), %rsi      # 0x10b70
leaq 0xa(%rsp), %rdx
leaq 0xb(%rsp), %rcx
xorl %eax, %eax
callq 0x3230
cmpl $0x2, %eax
jne 0x7446
movzbl 0xb(%rsp), %r14d
movzbl 0xa(%rsp), %r13d
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x5ffa
testl %eax, %eax
je 0x72a7
shll $0x8, %r13d
orl %r14d, %r13d
movzwl 0x554(%rbx), %r15d
movl %r15d, %eax
movzwl %ax, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x5ffa
testl %eax, %eax
je 0x72a7
movq 0x28(%rbx), %rax
shrq %rax
addq $-0x3, %rax
movl %ebp, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jbe 0x7364
movzwl 0x554(%rbx,%rcx,2), %edx
addl $0x4, %ecx
testw %dx, %dx
je 0x7342
cmpw %r13w, %dx
jne 0x7342
jmp 0x7293
movzwl 0x554(%rbx), %eax
testw %ax, %ax
jne 0x7320
pushq $0x4
popq %r14
leaq 0x10(%rsp), %r12
movzwl %r15w, %ebp
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x5ffa
testl %eax, %eax
je 0x72a7
movq 0x28(%rbx), %rcx
shrq %rcx
addq $-0x3, %rcx
movl %r14d, %eax
leal -0x3(%rax), %edx
cmpq %rdx, %rcx
jbe 0x73bb
cmpw $0x0, 0x554(%rbx,%rdx,2)
je 0x74d6
addl $0x4, %eax
jmp 0x739f
movzwl 0x554(%rbx), %r15d
testw %r15w, %r15w
jne 0x7379
movq %rbx, %rdi
callq 0x6597
testw %ax, %ax
je 0x7514
movl %eax, %r15d
movzwl %ax, %eax
movl %eax, 0xc(%rsp)
movl $0x400, %edx            # imm = 0x400
movq %r12, %rdi
xorl %esi, %esi
callq 0x3170
movq %rbx, %rdi
movl 0xc(%rsp), %esi
movq %r12, %rdx
callq 0x616b
testl %eax, %eax
je 0x72a7
movw %r15w, 0x554(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x616b
testl %eax, %eax
je 0x72a7
movzwl 0x554(%rbx), %r15d
jmp 0x7379
movq 0xfbbe(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
leaq 0x97bd(%rip), %rsi      # 0x10c01
jmp 0x747b
movq 0xfbab(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
movq (%r15), %rax
movq 0x10(%rax), %rdx
leaq 0x971e(%rip), %rsi      # 0x10b7c
xorl %eax, %eax
callq 0x31e0
jmp 0x72a7
movq 0xfb87(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
leaq 0x9769(%rip), %rsi      # 0x10be4
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
movq 0xfb5b(%rip), %rax      # 0x16ff8
movq (%rax), %rcx
leaq 0x96f3(%rip), %rdi      # 0x10b9a
jmp 0x74ba
movq 0xfb48(%rip), %rax      # 0x16ff8
movq (%rax), %rcx
leaq 0x9705(%rip), %rdi      # 0x10bbf
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32d0
movw %r13w, 0x554(%rbx,%rdx,2)
leal -0x2(%rax), %ecx
andw $0x0, 0x554(%rbx,%rcx,2)
leal -0x1(%rax), %ecx
movw $0x9, 0x554(%rbx,%rcx,2)
movl %eax, %eax
andw $0x0, 0x554(%rbx,%rax,2)
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x616b
jmp 0x7293
movq 0xfadd(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
addq $0x8, %rbx
leaq 0x9701(%rip), %rsi      # 0x10c2a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x31e0
leaq 0x10a8e(%rip), %rax     # 0x17fc8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x72a7
movq 0xfa73(%rip), %rax      # 0x16fc0
cmpq (%rax), %rdi
je 0x72a7
leaq 0x96cd(%rip), %rsi      # 0x10c2a
movq %rbx, %rdx
jmp 0x745e