// File: 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
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0xc(%rbp)
movl -0x8(%rbp), %ecx
leaq 0x24d2c9(%rip), %rax    # 0x29e0a8
movl %ecx, (%rax)
leaq 0x24d350(%rip), %rax    # 0x29e138
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x10(%rbp)
leaq 0x22953e(%rip), %rax    # 0x27a338
movb $0x0, (%rax)
leaq 0x24d294(%rip), %rax    # 0x29e098
cmpq $0x0, (%rax)
je 0x50e60
cmpl $0xd, -0x8(%rbp)
je 0x50e16
cmpl $0xa, -0x8(%rbp)
jne 0x50e2d
leaq 0x24d293(%rip), %rax    # 0x29e0b0
movb $0x0, (%rax)
callq 0x37720
movl %eax, -0x4(%rbp)
jmp 0x50fa8
cmpl $0x20, -0x8(%rbp)
jne 0x50e40
callq 0x37720
movl %eax, -0x4(%rbp)
jmp 0x50fa8
cmpl $0x9, -0x8(%rbp)
jne 0x50e53
callq 0x37720
movl %eax, -0x4(%rbp)
jmp 0x50fa8
movl $0x3f, -0x8(%rbp)
jmp 0x50e5c
jmp 0x50e5e
jmp 0x50e67
movl $0x3f, -0x8(%rbp)
movl -0x8(%rbp), %edi
callq 0x37970
cmpl -0x8(%rbp), %eax
je 0x50e80
movl $0x0, -0x4(%rbp)
jmp 0x50fa8
leaq 0x24d211(%rip), %rax    # 0x29e098
cmpq $0x0, (%rax)
je 0x50e99
movl $0x0, -0x4(%rbp)
jmp 0x50fa8
jmp 0x50e9b
cmpl $0x3f, -0x14(%rbp)
jne 0x50ea6
jmp 0x50fa0
cmpl $0x0, -0x14(%rbp)
je 0x50f9e
cmpl $0x0, -0x10(%rbp)
je 0x50f9e
movl $0x136, %edi            # imm = 0x136
callq 0x9ec0
callq 0x117e0
cmpl $0x100, -0x14(%rbp)     # imm = 0x100
jge 0x50edb
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
jl 0x50ef2
leaq 0x34a51e(%rip), %rdi    # 0x39b400
leaq 0x12a354(%rip), %rsi    # 0x17b23d
movb $0x0, %al
callq 0x9060
jmp 0x50f6d
cmpl $0x20, -0x14(%rbp)
jl 0x50efe
cmpl $0x20, -0x10(%rbp)
jge 0x50f15
leaq 0x34a4fb(%rip), %rdi    # 0x39b400
leaq 0x12a331(%rip), %rsi    # 0x17b23d
movb $0x0, %al
callq 0x9060
jmp 0x50f6b
cmpl $0x20, -0x10(%rbp)
jne 0x50f3c
movl -0x14(%rbp), %edi
callq 0x96e0
movl %eax, %edx
leaq 0x34a4d4(%rip), %rdi    # 0x39b400
leaq 0x12a31a(%rip), %rsi    # 0x17b24d
movb $0x0, %al
callq 0x9060
jmp 0x50f69
movl -0x14(%rbp), %edi
callq 0x96e0
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %edi
callq 0x96e0
movl -0x18(%rbp), %edx
movl %eax, %ecx
leaq 0x34a4a5(%rip), %rdi    # 0x39b400
leaq 0x12a304(%rip), %rsi    # 0x17b266
movb $0x0, %al
callq 0x9060
jmp 0x50f6b
jmp 0x50f6d
xorl %esi, %esi
movl $0xe, %edx
leaq 0x34a485(%rip), %rcx    # 0x39b400
movl %esi, %edi
callq 0x10ee0
callq 0xb0d0
leaq 0x226a96(%rip), %rax    # 0x277a24
movl $0xe02, (%rax)          # imm = 0xE02
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xb8b0
jmp 0x50fa0
callq 0x37720
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)