// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x8aac
leaq 0x20d40(%rip), %rdi     # 0x297a8
movb $0x0, %al
callq 0xd8f0
movb $0x0, %al
callq 0xdce0
movb %al, -0xd(%rbp)
leaq 0x2e260(%rip), %rax     # 0x36ce0
movl $0x0, (%rax)
movsbl -0xd(%rbp), %eax
cmpl $0x1b, %eax
jne 0x8aaa
leaq 0x25819(%rip), %rdi     # 0x2e2af
movb $0x0, %al
callq 0xd8f0
movq $0x0, -0x8(%rbp)
jmp 0x8ce5
jmp 0x8ab2
movl -0xc(%rbp), %eax
movb %al, -0xd(%rbp)
callq 0x65b0
movq (%rax), %rax
movsbl -0xd(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x8af5
movsbl -0xd(%rbp), %edi
callq 0x10400
movslq %eax, %rcx
leaq 0x2a8de(%rip), %rax     # 0x333c0
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x8cb9
movsbl -0xd(%rbp), %eax
addl $-0x20, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x5e, %eax
ja 0x8c97
movq -0x20(%rbp), %rax
leaq 0x209a6(%rip), %rcx     # 0x294bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x20ca0(%rip), %rax     # 0x297c6
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x254d9(%rip), %rax     # 0x2e00f
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c93(%rip), %rax     # 0x297d9
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x216e8(%rip), %rax     # 0x2a23e
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c8b(%rip), %rax     # 0x297f1
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x211d6(%rip), %rax     # 0x29d4c
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c76(%rip), %rax     # 0x297fc
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c6e(%rip), %rax     # 0x29804
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c6b(%rip), %rax     # 0x29811
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c65(%rip), %rax     # 0x2981b
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c5e(%rip), %rax     # 0x29824
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c59(%rip), %rax     # 0x2982f
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c5b(%rip), %rax     # 0x29841
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c55(%rip), %rax     # 0x2984b
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c53(%rip), %rax     # 0x29859
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c4d(%rip), %rax     # 0x29863
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x21663(%rip), %rax     # 0x2a289
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x21662(%rip), %rax     # 0x2a298
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x21661(%rip), %rax     # 0x2a2a4
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x21662(%rip), %rax     # 0x2a2b2
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c11(%rip), %rax     # 0x2986e
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x2175c(%rip), %rax     # 0x2a3c6
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x20c02(%rip), %rax     # 0x29879
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x21666(%rip), %rax     # 0x2a2ea
movq %rax, -0x18(%rbp)
jmp 0x8cb7
leaq 0x21572(%rip), %rax     # 0x2a203
movq %rax, -0x18(%rbp)
jmp 0x8cb7
cmpl $0x0, -0xc(%rbp)
jne 0x8caa
leaq 0x20bea(%rip), %rax     # 0x2988e
movq %rax, -0x18(%rbp)
jmp 0x8cb5
leaq 0x20bef(%rip), %rax     # 0x298a0
movq %rax, -0x18(%rbp)
jmp 0x8cb7
jmp 0x8cb9
cmpl $0x0, -0xc(%rbp)
jne 0x8cdd
movsbl -0xd(%rbp), %edi
callq 0x6420
movq %rax, %rsi
movq -0x18(%rbp), %rdx
leaq 0x20bda(%rip), %rdi     # 0x298b0
movb $0x0, %al
callq 0xd8f0
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop