// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/command.c
// Function: identify
char *identify(int what)
{
	char ch, *str;

	if (what == 0) {
		msg("What do you want identified? ");
		ch = readchar();
		mpos = 0;
		if (ch == ESCAPE) {
			msg("");
			return NULL;
		}
	}
	else
		ch = what;
	if (isalpha(ch))
		str = monsters[midx(ch)].m_name;
	else {
		switch(ch) {
			case '|':
			case '-':	str = "the wall of a room";
			when GOLD:	str = "gold";
			when STAIRS:	str = "passage leading up/down";
			when DOOR:	str = "door";
			when FLOOR:	str = "room floor";
			when PLAYER:	str = "you";
			when PASSAGE:	str = "passage";
			when POST:	str = "trading post";
			when MAZETRAP:	str = "maze trap";
			when TRAPDOOR:	str = "trapdoor";
			when ARROWTRAP:	str = "arrow trap";
			when SLEEPTRAP:	str = "sleeping gas trap";
			when BEARTRAP:	str = "bear trap";
			when TELTRAP:	str = "teleport trap";
			when DARTTRAP:	str = "dart trap";
			when POOL:	str = "magic pool";
			when POTION:	str = "potion";
			when SCROLL:	str = "scroll";
			when FOOD:	str = "food";
			when WEAPON:	str = "weapon";
			when ' ' :	str = "solid rock";
			when ARMOR:	str = "armor";
			when AMULET:	str = "The Amulet of Yendor";
			when RING:	str = "ring";
			when STICK:	str = "wand or staff";
			otherwise:
				if (what == 0)
					str = "unknown character";
				else
					str = "a magical ghost";
		}
	}
	if (what == 0)
		msg("'%s' : %s", unctrl(ch), str);
	return str;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
testl %edi, %edi
je 0x7e72
movl %ebx, %r14d
jmp 0x7ead
leaq 0x155d7(%rip), %rdi     # 0x1d450
xorl %eax, %eax
callq 0xb178
xorl %eax, %eax
callq 0xb447
movl %eax, %r14d
leaq 0x259cf(%rip), %rax     # 0x2d860
andl $0x0, (%rax)
cmpb $0x1b, %r14b
jne 0x7ead
leaq 0x19ae8(%rip), %rdi     # 0x21989
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xb178
jmp 0x7f27
callq 0x6590
movq (%rax), %rax
movsbl %r14b, %ebp
movsbq %bpl, %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x7ef0
movzbl %r14b, %eax
leaq 0x1559f(%rip), %r14     # 0x1d46e
leal -0x20(%rax), %ecx
cmpl $0x20, %ecx
ja 0x7f2f
leaq 0x153d6(%rip), %rax     # 0x1d2b4
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x15628(%rip), %r14     # 0x1d516
jmp 0x7f08
movl %ebp, %edi
callq 0xcdec
cltq
imulq $0x70, %rax, %rax
leaq 0x224ac(%rip), %rcx     # 0x2a3b0
movq (%rcx,%rax), %r14
testl %ebx, %ebx
jne 0x7f27
movl %ebp, %edi
callq 0x6400
leaq 0x1563e(%rip), %rdi     # 0x1d558
movq %rax, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xb178
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leal -0x5c(%rax), %ecx
cmpl $0x4, %ecx
jbe 0x7f58
addl $-0x7b, %eax
cmpl $0x3, %eax
ja 0x7f71
leaq 0x15406(%rip), %rcx     # 0x1d34c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x15576(%rip), %r14     # 0x1d4cc
jmp 0x7f08
leaq 0x153d9(%rip), %rax     # 0x1d338
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x1554a(%rip), %r14     # 0x1d4b9
jmp 0x7f08
testl %ebx, %ebx
leaq 0x155bc(%rip), %rax     # 0x1d536
leaq 0x155c7(%rip), %r14     # 0x1d548
cmoveq %rax, %r14
jmp 0x7f08
leaq 0x1551e(%rip), %r14     # 0x1d4ac
jmp 0x7f08
leaq 0x16060(%rip), %r14     # 0x1dffa
jmp 0x7f08
leaq 0x1555b(%rip), %r14     # 0x1d501
jmp 0x7f08
leaq 0x15ec0(%rip), %r14     # 0x1de72
jmp 0x7f08
leaq 0x15e79(%rip), %r14     # 0x1de37
jmp 0x7f08
leaq 0x15f0e(%rip), %r14     # 0x1ded8
jmp 0x7f08
leaq 0x154ab(%rip), %r14     # 0x1d481
jmp 0x7f08
leaq 0x154e1(%rip), %r14     # 0x1d4c3
jmp 0x7f08
leaq 0x15ecf(%rip), %r14     # 0x1debd
jmp 0x7f08
leaq 0x1549f(%rip), %r14     # 0x1d499
jmp 0x7f08
leaq 0x1549e(%rip), %r14     # 0x1d4a4
jmp 0x7f08
leaq 0x15f0c(%rip), %r14     # 0x1df1e
jmp 0x7f08
leaq 0x154b9(%rip), %r14     # 0x1d4d7
jmp 0x7f08
leaq 0x197ab(%rip), %r14     # 0x217d5
jmp 0x7f08
leaq 0x15e96(%rip), %r14     # 0x1decc
jmp 0x7f08
leaq 0x154c9(%rip), %r14     # 0x1d50b
jmp 0x7f08
leaq 0x15e98(%rip), %r14     # 0x1dee6
jmp 0x7f08
leaq 0x154c7(%rip), %r14     # 0x1d521
jmp 0x7f08
leaq 0x1591a(%rip), %r14     # 0x1d980
jmp 0x7f08
leaq 0x15477(%rip), %r14     # 0x1d4e9
jmp 0x7f08
leaq 0x15475(%rip), %r14     # 0x1d4f3
jmp 0x7f08