// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathui.cpp
// Function: help_exit(int, int)
int help_exit(int c, int reason)
{
int help_c, help_first;
   // There was an error in the keyboard command.
   // Exit the keystroke processor with a help message
   reason = 0;       // shut up compiler warning
   script_err = c;
   help_first = first_key;
   help_c = c;
   prot_menu = 0;

   // if reading from a script file,  CR, LF, SPACE, TAB do not bring up help menu
   if(script_file) {   // script file is active
      if((c == 0x0D) || (c == 0x0A)) {  // end-of line reached
         script_pause = 0;
         return sure_exit();
      }
      else if(c == ' ') return sure_exit();
      else if(c == '\t') return sure_exit();
      else c = '?';
   }
   else c = '?';

   if(are_you_sure(c) != c) return 0;
   else if(script_file) return 0;

   if(help_first == '?') ;            // invalid command
   else if(help_first && help_c) {
      BEEP(310);
      erase_screen();

      if((help_first >= 0x0100) || (help_c >= 0x0100)) {
         sprintf(out, "Unknown command");
      }
      else if((help_first < ' ') || (help_c < ' ')) {
         sprintf(out, "Unknown command");
      }
      else if(help_c == ' ') {
         sprintf(out, "Unknown command: %c <sp>", toupper(help_first));
      }
      else {
         sprintf(out, "Unknown command: %c %c", toupper(help_first), toupper(help_c));
      }
      vidstr(0,0, YELLOW, out);
      refresh_page();
      need_redraw = 3586;
      Sleep(1000);
   }

   return sure_exit();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x2057c7(%rip), %rax    # 0x23eec8
movl %edi, (%rax)
leaq 0x20584e(%rip), %rax    # 0x23ef58
movl (%rax), %r14d
leaq 0x1e1a44(%rip), %rax    # 0x21b158
movb $0x0, (%rax)
leaq 0x20579a(%rip), %r15    # 0x23eeb8
cmpq $0x0, (%r15)
je 0x3973f
cmpl $0xc, %ebx
jg 0x397f1
cmpl $0x9, %ebx
je 0x39809
cmpl $0xa, %ebx
je 0x397ff
movl $0x3f, %edi
callq 0x27777
cmpl $0x3f, %eax
jne 0x3980e
cmpq $0x0, (%r15)
jne 0x3980e
cmpl $0x3f, %r14d
je 0x39809
testl %r14d, %r14d
sete %al
testl %ebx, %ebx
sete %cl
orb %al, %cl
jne 0x39809
movl $0x136, %edi            # imm = 0x136
callq 0x9d78
callq 0xeceb
movl $0x100, %eax            # imm = 0x100
cmpl %eax, %r14d
setl %cl
cmpl %eax, %ebx
setl %al
testb %cl, %al
je 0x397ad
cmpl $0x20, %r14d
setge %al
cmpl $0x20, %ebx
setge %cl
testb %al, %cl
jne 0x3981b
movups 0xdd0c4(%rip), %xmm0    # 0x116878
leaq 0x302a65(%rip), %rax    # 0x33c220
movaps %xmm0, (%rax)
leaq 0x302a5b(%rip), %rcx    # 0x33c220
xorl %edi, %edi
xorl %esi, %esi
movl $0xe, %edx
callq 0xe787
callq 0xab54
leaq 0x1df065(%rip), %rax    # 0x218844
movl $0xe02, (%rax)          # imm = 0xE02
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xafe8
jmp 0x39809
cmpl $0x20, %ebx
je 0x39809
cmpl $0xd, %ebx
jne 0x3973f
leaq 0x2056ca(%rip), %rax    # 0x23eed0
movb $0x0, (%rax)
callq 0x27570
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, %edi
callq 0x9700
movl %eax, %r14d
cmpl $0x20, %ebx
jne 0x39848
leaq 0x3029ee(%rip), %rdi    # 0x33c220
leaq 0xdd04f(%rip), %rsi     # 0x116888
movl %r14d, %edx
xorl %eax, %eax
callq 0x9060
jmp 0x397be
movl %ebx, %edi
callq 0x9700
leaq 0x3029ca(%rip), %rdi    # 0x33c220
leaq 0xdd044(%rip), %rsi     # 0x1168a1
movl %r14d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x9060
jmp 0x397be