// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/command.c
// Function: search
int search()
{
	int x, y;
	char ch;

	/*
	 * Look all around the hero, if there is something hidden there,
	 * give him a chance to find it.  If its found, display it.
	 */
	if (pl_on(ISBLIND))
		return 0;
	for (x = hero.x - 1; x <= hero.x + 1; x++) {
		for (y = hero.y - 1; y <= hero.y + 1; y++) {
			ch = winat(y, x);
			if (isatrap(ch)) {		/* see if its a trap */
				struct trap *tp;

				if ((tp = trap_at(y, x)) == NULL)
					break;
				if (tp->tr_flags & ISFOUND)
					break;		/* no message if its seen */
				if (mvwinch(cw, y, x) == ch)
					break;
				if (rnd(100) > (him->s_lvl * 9 + herowis() * 5))
					 break;
				tp->tr_flags |= ISFOUND;
				mvwaddch(cw, y, x, tp->tr_type);
				count = 0;
				running = FALSE;
				msg(tr_name(tp->tr_type));
			}
			else if(ch == SECRETDOOR) {
				if (rnd(100) < (him->s_lvl * 4 + herowis() * 5)) {
					mvaddch(y, x, DOOR);
					count = 0;
				}
			}
		}
	}
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $0x1
popq %rdi
callq 0x932c
testb %al, %al
je 0x81b2
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25a97(%rip), %rax     # 0x2dc50
movl 0x50(%rax), %eax
leal -0x1(%rax), %ebx
leaq 0x2880a(%rip), %rbp     # 0x309d0
incl %eax
cmpl %eax, %ebx
jg 0x81a1
leaq 0x25a7d(%rip), %rax     # 0x2dc50
movl 0x54(%rax), %eax
leal -0x1(%rax), %r15d
incl %eax
cmpl %eax, %r15d
jg 0x8347
movl %r15d, %edi
movl %ebx, %esi
callq 0x92ab
movl %eax, %r12d
movsbl %al, %r13d
movl %r13d, %edi
callq 0xdbbb
testb %al, %al
je 0x82d5
movl %r15d, %edi
movl %ebx, %esi
xorl %eax, %eax
callq 0xea05
testq %rax, %rax
je 0x8347
movq %rax, %r12
testb $0x8, 0x10(%rax)
jne 0x8347
movq (%rbp), %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x6470
movl %eax, %ecx
pushq $-0x1
popq %rax
cmpl $-0x1, %ecx
je 0x8249
movq (%rbp), %rdi
callq 0x6320
cmpl %r13d, %eax
je 0x8347
pushq $0x64
popq %rdi
xorl %eax, %eax
callq 0xc004
movl %eax, %r13d
leaq 0x25aea(%rip), %rax     # 0x2dd50
movq (%rax), %rdi
imull $0x9, 0x28(%rdi), %r14d
callq 0x113b1
leal (%rax,%rax,4), %eax
addl %r14d, %eax
cmpl %eax, %r13d
jg 0x8347
orb $0x8, 0x10(%r12)
movq (%rbp), %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0x82aa
movq (%rbp), %rdi
movsbl 0x14(%r12), %esi
callq 0x64a0
leaq 0x255c3(%rip), %rax     # 0x2d874
andl $0x0, (%rax)
leaq 0x255d1(%rip), %rax     # 0x2d88c
movb $0x0, (%rax)
movsbl 0x14(%r12), %edi
callq 0xc2fa
movq %rax, %rdi
xorl %eax, %eax
callq 0xb178
jmp 0x8335
cmpb $0x26, %r12b
jne 0x8335
pushq $0x64
popq %rdi
xorl %eax, %eax
callq 0xc004
movl %eax, %r12d
leaq 0x25a61(%rip), %rax     # 0x2dd50
movq (%rax), %rdi
movl 0x28(%rdi), %r14d
callq 0x113b1
leal (%rax,%rax,4), %eax
leal (%rax,%r14,4), %eax
cmpl %eax, %r12d
jge 0x8335
movq 0x21c2a(%rip), %r14     # 0x29f38
movq (%r14), %rdi
movl %r15d, %esi
movl %ebx, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0x832b
movq (%r14), %rdi
pushq $0x2b
popq %rsi
callq 0x64a0
leaq 0x25542(%rip), %rax     # 0x2d874
andl $0x0, (%rax)
incl %r15d
leaq 0x25911(%rip), %rax     # 0x2dc50
movl 0x54(%rax), %eax
jmp 0x81da
incl %ebx
leaq 0x25900(%rip), %rax     # 0x2dc50
movl 0x50(%rax), %eax
jmp 0x81c6