// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/command.c
// Function: help
int help()
{
	extern struct h_list helpstr[];
	struct h_list *strp;
	char helpch;
	int cnt;

	strp = &helpstr[0];
	msg("Character you want help for (* for all): ");
	helpch = readchar();
	mpos = 0;
	/*
	 * If its not a *, print the right help string
	 * or an error if he typed a funny character.
	 */
	if (helpch != '*') {
		wmove(cw, 0, 0);
		while (strp->h_ch) {
			if (strp->h_ch == helpch) {
				msg("%s%s", unctrl(strp->h_ch), strp->h_desc);
				break;
			}
			strp++;
		}
		if (strp->h_ch != helpch)
			msg("Unknown character '%s'", unctrl(helpch));
		return 0;
	}
	/*
	 * Here we print help for everything.
	 * Then wait before we return to command mode
	 */
	wclear(hw);
	cnt = 0;
	while (strp->h_ch) {
		mvwaddstr(hw, cnt % 23, cnt > 22 ? 40 : 0, unctrl(strp->h_ch));
		waddstr(hw, strp->h_desc);
		cnt++;
		strp++;
	}
	wmove(hw, LINES-1, 0);
	wprintw(hw,spacemsg);
	draw(hw);
	wait_for(hw,' ');
	wclear(hw);
	draw(hw);
	wmove(cw, 0, 0);
	wclrtoeol(cw);
	touchwin(cw);
	nochange = FALSE;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x16f84(%rip), %rdi     # 0x1f40f
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
callq 0xb94c
movl %eax, %ebx
leaq 0x253ce(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
cmpb $0x2a, %bl
jne 0x85bc
leaq 0x28530(%rip), %r14     # 0x309e8
movq (%r14), %rdi
callq 0x6120
leaq 0x23629(%rip), %r15     # 0x2baf0
cmpb $0x0, (%r15)
je 0x8546
addq $0x10, %r15
xorl %ebp, %ebp
movl $0xb21642c9, %r12d      # imm = 0xB21642C9
movl $0x28, %r13d
movl %ebp, %esi
imulq %r12, %rsi
shrq $0x24, %rsi
leal (%rsi,%rsi,2), %eax
shll $0x3, %eax
subl %eax, %esi
addl %ebp, %esi
movq (%r14), %rdi
cmpl $0x17, %ebp
movl $0x0, %edx
cmovael %r13d, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0x8529
movq (%r14), %rbx
movsbl -0x10(%r15), %edi
callq 0x6420
movq %rbx, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
movq (%r14), %rdi
movq -0x8(%r15), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
incl %ebp
cmpb $0x0, (%r15)
leaq 0x10(%r15), %r15
jne 0x84df
movq (%r14), %rdi
movq 0x21a60(%rip), %rax     # 0x29fb0
movl (%rax), %esi
decl %esi
xorl %edx, %edx
callq 0x6490
movq (%r14), %rdi
leaq 0x21dab(%rip), %rsi     # 0x2a310
xorl %eax, %eax
callq 0x6510
movq (%r14), %rdi
callq 0x6200
movq (%r14), %rdi
movl $0x20, %esi
callq 0xb89e
movq (%r14), %rdi
callq 0x6120
movq (%r14), %rdi
callq 0x6200
leaq 0x28448(%rip), %rbx     # 0x309e0
movq (%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6490
movq (%rbx), %rdi
callq 0x64a0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x85fb
movswl 0x4(%rdi), %edx
incl %edx
jmp 0x8600
movsbl %bl, %ebp
leaq 0x2841a(%rip), %rax     # 0x309e0
movq (%rax), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
xorl %edx, %edx
callq 0x6490
leaq 0x23514(%rip), %r14     # 0x2baf0
movb (%r14), %al
testb %al, %al
je 0x8638
addq $0x10, %r14
cmpb %bl, %al
je 0x8618
movb (%r14), %al
addq $0x10, %r14
testb %al, %al
jne 0x85e7
xorl %r15d, %r15d
jmp 0x8638
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0x1, %ecx
callq 0x61b0
leaq 0x25290(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
jmp 0x8655
movl %ebp, %edi
callq 0x6420
movq -0x8(%r14), %rdx
leaq 0x1aeda(%rip), %rdi     # 0x23504
movq %rax, %rsi
xorl %eax, %eax
callq 0xb620
movb -0x10(%r14), %r15b
cmpb %bl, %r15b
je 0x8655
movl %ebp, %edi
callq 0x6420
leaq 0x16dee(%rip), %rdi     # 0x1f439
movq %rax, %rsi
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq