// File: /workspace/github_c_makefile_star2_O1/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 0x8042
movl %ebx, %r14d
jmp 0x8080
leaq 0x17407(%rip), %rdi     # 0x1f450
xorl %eax, %eax
callq 0xb6e0
xorl %eax, %eax
callq 0xb9fd
movl %eax, %r14d
leaq 0x2580f(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
cmpb $0x1b, %r14b
jne 0x8080
leaq 0x1b89d(%rip), %rdi     # 0x23911
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xb6e0
jmp 0x80fa
callq 0x65b0
movq (%rax), %rax
movsbl %r14b, %ebp
movsbq %bpl, %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x80c3
movzbl %r14b, %eax
leaq 0x173cc(%rip), %r14     # 0x1f46e
leal -0x20(%rax), %ecx
cmpl $0x20, %ecx
ja 0x8102
leaq 0x17203(%rip), %rax     # 0x1f2b4
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x17455(%rip), %r14     # 0x1f516
jmp 0x80db
movl %ebp, %edi
callq 0xd60b
cltq
imulq $0x70, %rax, %rax
leaq 0x222e9(%rip), %rcx     # 0x2a3c0
movq (%rcx,%rax), %r14
testl %ebx, %ebx
jne 0x80fa
movl %ebp, %edi
callq 0x6420
leaq 0x1746b(%rip), %rdi     # 0x1f558
movq %rax, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xb6e0
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leal -0x5c(%rax), %ecx
cmpl $0x4, %ecx
jbe 0x812b
addl $-0x7b, %eax
cmpl $0x3, %eax
ja 0x8144
leaq 0x17233(%rip), %rcx     # 0x1f34c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x173a3(%rip), %r14     # 0x1f4cc
jmp 0x80db
leaq 0x17206(%rip), %rax     # 0x1f338
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x17377(%rip), %r14     # 0x1f4b9
jmp 0x80db
testl %ebx, %ebx
leaq 0x173e9(%rip), %rax     # 0x1f536
leaq 0x173f4(%rip), %r14     # 0x1f548
cmoveq %rax, %r14
jmp 0x80db
leaq 0x1734b(%rip), %r14     # 0x1f4ac
jmp 0x80db
leaq 0x17e8d(%rip), %r14     # 0x1fffa
jmp 0x80db
leaq 0x17388(%rip), %r14     # 0x1f501
jmp 0x80db
leaq 0x17ced(%rip), %r14     # 0x1fe72
jmp 0x80db
leaq 0x17ca6(%rip), %r14     # 0x1fe37
jmp 0x80db
leaq 0x17d3b(%rip), %r14     # 0x1fed8
jmp 0x80db
leaq 0x172d8(%rip), %r14     # 0x1f481
jmp 0x80db
leaq 0x1730e(%rip), %r14     # 0x1f4c3
jmp 0x80db
leaq 0x17cfc(%rip), %r14     # 0x1febd
jmp 0x80db
leaq 0x172cc(%rip), %r14     # 0x1f499
jmp 0x80db
leaq 0x172cb(%rip), %r14     # 0x1f4a4
jmp 0x80db
leaq 0x17d39(%rip), %r14     # 0x1ff1e
jmp 0x80db
leaq 0x172e6(%rip), %r14     # 0x1f4d7
jmp 0x80db
leaq 0x1b560(%rip), %r14     # 0x2375d
jmp 0x80db
leaq 0x17cc3(%rip), %r14     # 0x1fecc
jmp 0x80db
leaq 0x172f6(%rip), %r14     # 0x1f50b
jmp 0x80db
leaq 0x17cc5(%rip), %r14     # 0x1fee6
jmp 0x80db
leaq 0x172f4(%rip), %r14     # 0x1f521
jmp 0x80db
leaq 0x17747(%rip), %r14     # 0x1f980
jmp 0x80db
leaq 0x172a4(%rip), %r14     # 0x1f4e9
jmp 0x80db
leaq 0x172a2(%rip), %r14     # 0x1f4f3
jmp 0x80db