// File: /workspace/github_c_makefile_star2_O3/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 0x7f72
movl %ebx, %r14d
jmp 0x7fb0
leaq 0x174d7(%rip), %rdi     # 0x1f450
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
callq 0xb94c
movl %eax, %r14d
leaq 0x258df(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
cmpb $0x1b, %r14b
jne 0x7fb0
leaq 0x1b9e5(%rip), %rdi     # 0x23989
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xb620
jmp 0x802a
callq 0x65b0
movq (%rax), %rax
movsbl %r14b, %ebp
movsbq %bpl, %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x7ff3
movzbl %r14b, %eax
leaq 0x1749c(%rip), %r14     # 0x1f46e
leal -0x20(%rax), %ecx
cmpl $0x20, %ecx
ja 0x8032
leaq 0x172d3(%rip), %rax     # 0x1f2b4
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x17525(%rip), %r14     # 0x1f516
jmp 0x800b
movl %ebp, %edi
callq 0xd595
cltq
imulq $0x70, %rax, %rax
leaq 0x223b9(%rip), %rcx     # 0x2a3c0
movq (%rcx,%rax), %r14
testl %ebx, %ebx
jne 0x802a
movl %ebp, %edi
callq 0x6420
leaq 0x1753b(%rip), %rdi     # 0x1f558
movq %rax, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xb620
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leal -0x5c(%rax), %ecx
cmpl $0x4, %ecx
jbe 0x805b
addl $-0x7b, %eax
cmpl $0x3, %eax
ja 0x8074
leaq 0x17303(%rip), %rcx     # 0x1f34c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x17473(%rip), %r14     # 0x1f4cc
jmp 0x800b
leaq 0x172d6(%rip), %rax     # 0x1f338
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x17447(%rip), %r14     # 0x1f4b9
jmp 0x800b
testl %ebx, %ebx
leaq 0x174b9(%rip), %rax     # 0x1f536
leaq 0x174c4(%rip), %r14     # 0x1f548
cmoveq %rax, %r14
jmp 0x800b
leaq 0x1741b(%rip), %r14     # 0x1f4ac
jmp 0x800b
leaq 0x17f5d(%rip), %r14     # 0x1fffa
jmp 0x800b
leaq 0x17458(%rip), %r14     # 0x1f501
jmp 0x800b
leaq 0x17dbd(%rip), %r14     # 0x1fe72
jmp 0x800b
leaq 0x17d76(%rip), %r14     # 0x1fe37
jmp 0x800b
leaq 0x17e0b(%rip), %r14     # 0x1fed8
jmp 0x800b
leaq 0x173a8(%rip), %r14     # 0x1f481
jmp 0x800b
leaq 0x173de(%rip), %r14     # 0x1f4c3
jmp 0x800b
leaq 0x17dcc(%rip), %r14     # 0x1febd
jmp 0x800b
leaq 0x1739c(%rip), %r14     # 0x1f499
jmp 0x800b
leaq 0x1739b(%rip), %r14     # 0x1f4a4
jmp 0x800b
leaq 0x17e09(%rip), %r14     # 0x1ff1e
jmp 0x800b
leaq 0x173b6(%rip), %r14     # 0x1f4d7
jmp 0x800b
leaq 0x1b6a8(%rip), %r14     # 0x237d5
jmp 0x800b
leaq 0x17d93(%rip), %r14     # 0x1fecc
jmp 0x800b
leaq 0x173c6(%rip), %r14     # 0x1f50b
jmp 0x800b
leaq 0x17d95(%rip), %r14     # 0x1fee6
jmp 0x800b
leaq 0x173c4(%rip), %r14     # 0x1f521
jmp 0x800b
leaq 0x17817(%rip), %r14     # 0x1f980
jmp 0x800b
leaq 0x17374(%rip), %r14     # 0x1f4e9
jmp 0x800b
leaq 0x17372(%rip), %r14     # 0x1f4f3
jmp 0x800b