// File: /workspace/github_c_makefile_star2_O1/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 0x16eb4(%rip), %rdi     # 0x1f40f
xorl %eax, %eax
callq 0xb6e0
xorl %eax, %eax
callq 0xb9fd
movl %eax, %ebx
leaq 0x252fe(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
cmpb $0x2a, %bl
jne 0x868c
leaq 0x28460(%rip), %r14     # 0x309e8
movq (%r14), %rdi
callq 0x6120
leaq 0x23559(%rip), %r15     # 0x2baf0
cmpb $0x0, (%r15)
je 0x8616
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 0x85f9
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 0x85af
movq (%r14), %rdi
movq 0x21990(%rip), %rax     # 0x29fb0
movl (%rax), %esi
decl %esi
xorl %edx, %edx
callq 0x6490
movq (%r14), %rdi
leaq 0x21cdb(%rip), %rsi     # 0x2a310
xorl %eax, %eax
callq 0x6510
movq (%r14), %rdi
callq 0x6200
movq (%r14), %rdi
movl $0x20, %esi
callq 0xb95e
movq (%r14), %rdi
callq 0x6120
movq (%r14), %rdi
callq 0x6200
leaq 0x28378(%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 0x86c6
movswl 0x4(%rdi), %edx
incl %edx
jmp 0x86cb
leaq 0x2834d(%rip), %rax     # 0x309e0
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6490
leaq 0x2344a(%rip), %r14     # 0x2baf0
movb (%r14), %al
testb %al, %al
je 0x8700
leaq 0x2343c(%rip), %r14     # 0x2baf0
cmpb %bl, %al
je 0x86e3
movb 0x10(%r14), %al
addq $0x10, %r14
testb %al, %al
jne 0x86b4
jmp 0x8700
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0x1, %ecx
callq 0x61b0
leaq 0x251c5(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
jmp 0x871e
movsbl %al, %edi
callq 0x6420
movq 0x8(%r14), %rdx
leaq 0x1ad96(%rip), %rdi     # 0x2348c
movq %rax, %rsi
xorl %eax, %eax
callq 0xb6e0
cmpb %bl, (%r14)
je 0x871e
movsbl %bl, %edi
callq 0x6420
leaq 0x16d25(%rip), %rdi     # 0x1f439
movq %rax, %rsi
xorl %eax, %eax
callq 0xb6e0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq