// File: /workspace/github_c_makefile_star2_O0/simh[P]simtools/converters/fsio/fsio.c
// Function: FSioExecute
static void FSioExecute(
  char *in
)
{
  char quote;

  words = wds;
  args = 0;

  /*
   * Split the command line into individual words
   */
  while (*in != '\0') {
    switch (*in) {
      case ' ':
      case '\t':
        in++;
        continue;

      case '\'':
      case '\"':
        quote = *in++;
        words[args++] = in;
        while (*in != quote) {
          if (*in == '\0') {
            fprintf(stderr, "Missing terminating quote - %c%s\n",
                    quote, words[args - 1]);
            return;
          }
          in++;
        }
        *in++ = '\0';
        break;
        
      case '#':
        if (args == 0)
          return;
        /* FALLTHROUGH */

      default:
        words[args++] = in++;
        while ((*in != ' ') && (*in != '\t') && (*in != '\0'))
          in++;

        if (*in != '\0')
          *in++ = '\0';
        break;
    }
  }

  if (args != 0) {
    struct command *cmds = cmdTable;
    int i, len, idx = -1;

    len = strlen(words[0]);

    for (cmds = cmdTable, i = 0; cmds->name != NULL; cmds++, i++) {
      if (strncmp(cmds->name, words[0], len) == 0) {
        if (idx != -1) {
          idx = -1;
          break;
        }
        idx = i;
      }
    }

    if (idx != -1) {
      char *switches = cmdTable[idx].switches;

      swPresent = 0;
      for (i = 0; i < 26; i++)
        swValue[i] = NULL;

      /*
       * Parse any switches associated with the command
       */
      if (switches != NULL) {
        int ch;
        char *ptr;

        while ((ch = getopt(args, words, switches)) != -1) {
          if ((ch == '?') || ((ptr = strchr(switches, ch)) == NULL)) {
#if !defined(__linux__)
            optreset = 1;
#endif
            optind = 1;
            return;
          }
          SWSET(ch);

          if (ptr[1] == ':')
            SWSETVAL(ch, optarg);
        }
        args -= optind;
        words += optind;

        /*
         * Reset getopt() for subsequent uses.
         */
#if !defined(__linux__)
        optreset = 1;
#endif
        optind = 1;
      } else args--, words++;

      if ((args < cmdTable[idx].minargs) || (args > cmdTable[idx].maxargs)) {
        fprintf(stderr, "%s: Too %s arguments\n",
                wds[0], args < cmdTable[idx].minargs ? "few" : "many");
        return;
      }

      /*
       * Execute the command.
       */
      (*cmdTable[idx].func)();
    } else fprintf(stderr, "Unknown command \"%s\"\n", words[0]);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x1a30d(%rip), %rax     # 0x1f2e0
movq %rax, 0x1a2fe(%rip)     # 0x1f2d8
movl $0x0, 0x1a2ec(%rip)     # 0x1f2d0
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x518a
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
addl $-0x9, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x1e, %eax
ja 0x50ee
movq -0x48(%rbp), %rax
leaq 0x12fec(%rip), %rcx     # 0x18004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x4fe4
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb (%rax), %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rdx
movq 0x1a28a(%rip), %rax     # 0x1f2d8
movl 0x1a27c(%rip), %ecx     # 0x1f2d0
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x1a271(%rip)     # 0x1f2d0
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movsbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
je 0x50c7
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x50b9
movq 0x18f70(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
movsbl -0x9(%rbp), %edx
movq 0x1a242(%rip), %rax     # 0x1f2d8
movl 0x1a234(%rip), %ecx     # 0x1f2d0
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x14542(%rip), %rsi     # 0x195ef
movb $0x0, %al
callq 0x31c0
jmp 0x544e
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x5066
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb $0x0, (%rax)
jmp 0x5185
cmpl $0x0, 0x1a1eb(%rip)     # 0x1f2d0
jne 0x50ec
jmp 0x544e
jmp 0x50ee
movq -0x8(%rbp), %rdx
movq %rdx, %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq 0x1a1d4(%rip), %rax     # 0x1f2d8
movl 0x1a1c6(%rip), %ecx     # 0x1f2d0
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x1a1bb(%rip)     # 0x1f2d0
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x49(%rbp)
je 0x514e
movq -0x8(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x9, %ecx
movb %al, -0x49(%rbp)
je 0x514e
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x5157
jmp 0x5165
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x511c
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x5183
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb $0x0, (%rax)
jmp 0x5185
jmp 0x4fe4
cmpl $0x0, 0x1a13f(%rip)     # 0x1f2d0
je 0x544e
leaq 0x18ff2(%rip), %rax     # 0x1e190
movq %rax, -0x18(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movq 0x1a128(%rip), %rax     # 0x1f2d8
movq (%rax), %rdi
callq 0x3130
movl %eax, -0x20(%rbp)
leaq 0x18fce(%rip), %rax     # 0x1e190
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0x5224
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq 0x1a0f3(%rip), %rax     # 0x1f2d8
movq (%rax), %rsi
movslq -0x20(%rbp), %rdx
callq 0x3090
cmpl $0x0, %eax
jne 0x520b
cmpl $-0x1, -0x24(%rbp)
je 0x5205
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
jmp 0x5224
movl -0x1c(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x520d
movq -0x18(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x51cd
cmpl $-0x1, -0x24(%rbp)
je 0x542a
movslq -0x24(%rbp), %rcx
leaq 0x18f57(%rip), %rax     # 0x1e190
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x0, 0x19fa6(%rip)     # 0x1f1f8
movl $0x0, -0x1c(%rbp)
cmpl $0x1a, -0x1c(%rbp)
jge 0x527d
movslq -0x1c(%rbp), %rcx
leaq 0x19f96(%rip), %rax     # 0x1f200
movq $0x0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x5259
cmpq $0x0, -0x30(%rbp)
je 0x5366
jmp 0x528a
movl 0x1a040(%rip), %edi     # 0x1f2d0
movq 0x1a041(%rip), %rsi     # 0x1f2d8
movq -0x30(%rbp), %rdx
callq 0x3270
movl %eax, -0x34(%rbp)
cmpl $-0x1, %eax
je 0x531f
cmpl $0x3f, -0x34(%rbp)
je 0x52c4
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x3150
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x52d6
movq 0x18d05(%rip), %rax     # 0x1dfd0
movl $0x1, (%rax)
jmp 0x544e
movl -0x34(%rbp), %ecx
subl $0x61, %ecx
movl $0x1, %eax
shll %cl, %eax
orl 0x19f0f(%rip), %eax     # 0x1f1f8
movl %eax, 0x19f09(%rip)     # 0x1f1f8
movq -0x40(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x3a, %eax
jne 0x531a
movq 0x18cd5(%rip), %rax     # 0x1dfd8
movq (%rax), %rdx
movl -0x34(%rbp), %eax
subl $0x61, %eax
movslq %eax, %rcx
leaq 0x19eea(%rip), %rax     # 0x1f200
movq %rdx, (%rax,%rcx,8)
jmp 0x528a
movq 0x18caa(%rip), %rax     # 0x1dfd0
movl (%rax), %ecx
movl 0x19fa2(%rip), %eax     # 0x1f2d0
subl %ecx, %eax
movl %eax, 0x19f9a(%rip)     # 0x1f2d0
movq 0x18c93(%rip), %rax     # 0x1dfd0
movl (%rax), %ecx
movq 0x19f92(%rip), %rax     # 0x1f2d8
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x19f81(%rip)     # 0x1f2d8
movq 0x18c72(%rip), %rax     # 0x1dfd0
movl $0x1, (%rax)
jmp 0x5387
movl 0x19f64(%rip), %eax     # 0x1f2d0
addl $-0x1, %eax
movl %eax, 0x19f5b(%rip)     # 0x1f2d0
movq 0x19f5c(%rip), %rax     # 0x1f2d8
addq $0x8, %rax
movq %rax, 0x19f51(%rip)     # 0x1f2d8
movl 0x19f43(%rip), %eax     # 0x1f2d0
movslq -0x24(%rbp), %rdx
leaq 0x18df8(%rip), %rcx     # 0x1e190
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jl 0x53c1
movl 0x19f26(%rip), %eax     # 0x1f2d0
movslq -0x24(%rbp), %rdx
leaq 0x18ddb(%rip), %rcx     # 0x1e190
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jle 0x5413
movq 0x18c30(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
movq 0x19f0e(%rip), %rdx     # 0x1f2e0
movl 0x19ef8(%rip), %esi     # 0x1f2d0
movslq -0x24(%rbp), %rcx
leaq 0x18dad(%rip), %rax     # 0x1e190
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %r8d
leaq 0x14236(%rip), %rcx     # 0x1962b
leaq 0x1422b(%rip), %rax     # 0x19627
cmpl %r8d, %esi
cmovlq %rax, %rcx
leaq 0x14207(%rip), %rsi     # 0x19611
movb $0x0, %al
callq 0x31c0
jmp 0x544e
movslq -0x24(%rbp), %rcx
leaq 0x18d72(%rip), %rax     # 0x1e190
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
callq *0x20(%rax)
jmp 0x544c
movq 0x18bc7(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
movq 0x19e9d(%rip), %rax     # 0x1f2d8
movq (%rax), %rdx
leaq 0x141eb(%rip), %rsi     # 0x19630
movb $0x0, %al
callq 0x31c0
jmp 0x544e
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)