// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x1, %edi
callq 0xaa60
testb $0x1, %al
jne 0x8e78
jmp 0x8e84
movl $0x0, -0x4(%rbp)
jmp 0x90d9
leaq 0x2e245(%rip), %rax     # 0x370d0
movl 0x50(%rax), %eax
subl $0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
leaq 0x2e232(%rip), %rcx     # 0x370d0
movl 0x50(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x90d2
leaq 0x2e21d(%rip), %rax     # 0x370d0
movl 0x54(%rax), %eax
subl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
leaq 0x2e20a(%rip), %rcx     # 0x370d0
movl 0x54(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0x90c2
movl -0xc(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0xa960
movb %al, -0xd(%rbp)
movsbl -0xd(%rbp), %edi
callq 0x11a80
testb $0x1, %al
jne 0x8ef4
jmp 0x9022
movl -0xc(%rbp), %edi
movl -0x8(%rbp), %esi
movb $0x0, %al
callq 0x12e80
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x8f10
jmp 0x90c2
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x8f24
jmp 0x90c2
leaq 0x30f25(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x8(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x8f48
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x1c(%rbp)
jmp 0x8f5a
leaq 0x30f01(%rip), %rax     # 0x39e50
movq (%rax), %rdi
callq 0x6340
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movsbl -0xd(%rbp), %ecx
cmpl %ecx, %eax
jne 0x8f6a
jmp 0x90c2
movl $0x64, %edi
movb $0x0, %al
callq 0xef20
movl %eax, -0x20(%rbp)
leaq 0x2e250(%rip), %rax     # 0x371d0
movq (%rax), %rax
imull $0x9, 0x28(%rax), %eax
movl %eax, -0x24(%rbp)
leaq 0x2e23f(%rip), %rax     # 0x371d0
movq (%rax), %rdi
callq 0x16da0
movl -0x24(%rbp), %ecx
movl %eax, %edx
movl -0x20(%rbp), %eax
imull $0x5, %edx, %edx
addl %edx, %ecx
cmpl %ecx, %eax
jle 0x8faf
jmp 0x90c2
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x10(%rax)
leaq 0x30e8d(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x8(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x8fd8
jmp 0x8fef
leaq 0x30e71(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movsbl 0x14(%rax), %esi
callq 0x64c0
leaq 0x2dcfe(%rip), %rax     # 0x36cf4
movl $0x0, (%rax)
leaq 0x2dd09(%rip), %rax     # 0x36d0c
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
movsbl 0x14(%rax), %edi
callq 0xf440
movq %rax, %rdi
movb $0x0, %al
callq 0xd8f0
jmp 0x90b2
movsbl -0xd(%rbp), %eax
cmpl $0x26, %eax
jne 0x90b0
movl $0x64, %edi
movb $0x0, %al
callq 0xef20
movl %eax, -0x28(%rbp)
leaq 0x2e18b(%rip), %rax     # 0x371d0
movq (%rax), %rax
movl 0x28(%rax), %eax
shll $0x2, %eax
movl %eax, -0x2c(%rbp)
leaq 0x2e178(%rip), %rax     # 0x371d0
movq (%rax), %rdi
callq 0x16da0
movl -0x2c(%rbp), %ecx
movl %eax, %edx
movl -0x28(%rbp), %eax
imull $0x5, %edx, %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x90ae
movq 0x29f48(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x8(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0x908d
jmp 0x90a1
movq 0x29f2c(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movl $0x2b, %esi
callq 0x64c0
leaq 0x2dc4c(%rip), %rax     # 0x36cf4
movl $0x0, (%rax)
jmp 0x90b0
jmp 0x90b2
jmp 0x90b4
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x8ebc
jmp 0x90c4
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x8e94
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)