// File: /workspace/github_c_makefile_star2_O0/ajpaulson[P]srogue11/misc.c
// Function: look
void look(bool wakeup)
{
	char ch;
	int oldx, oldy, y, x;
	struct room *rp;
	int ey, ex, oex, oey;
	int passcount = 0;
	bool inpass, blind;

	getyx(cw, oldy, oldx);
	oex = player.t_oldpos.x;
	oey = player.t_oldpos.y;
	blind = pl_on(ISBLIND);
	if ((oldrp != NULL && rf_on(oldrp,ISDARK)) || blind) {
		for (x = oex - 1; x <= oex + 1; x += 1)
			for (y = oey - 1; y <= oey + 1; y += 1)
				if ((y != hero.y || x != hero.x) && show(y, x) == FLOOR)
					mvwaddch(cw, y, x, ' ');
	}
	rp = player.t_room;
	inpass = (rp == NULL);				/* TRUE when not in a room */
	ey = hero.y + 1;
	ex = hero.x + 1;
	for (x = hero.x - 1; x <= ex; x += 1) {
		if (x >= 0 && x <= COLS - 1) {
			for (y = hero.y - 1; y <= ey; y += 1) {
				if (y <= 0 || y >= LINES - 2)
					continue;
				if (isalpha(mvwinch(mw, y, x))) {
					struct linked_list *it;
					struct thing *tp;

					if (wakeup || (!inpass && rf_on(rp, ISTREAS)))
						it = wake_monster(y, x);
					else
						it = find_mons(y, x);
					if (it == NULL)				/* lost monster */
						mvaddch(y, x, FLOOR);
					else {
						tp = THINGPTR(it);
						if (isatrap(tp->t_oldch = mvinch(y, x))) {
							struct trap *trp;

							if ((trp = trap_at(y,x)) == NULL)
								break;
							if (trp->tr_flags & ISFOUND)
								tp->t_oldch = trp->tr_type;
							else
								tp->t_oldch = FLOOR;
						}
						if (tp->t_oldch == FLOOR && rf_on(rp,ISDARK))
							if (!blind)
								tp->t_oldch = ' ';
					}
				}
				/*
				 * Secret doors show as walls
				 */
				if ((ch = show(y, x)) == SECRETDOOR) {
					if (inpass || y == rp->r_pos.y || y == rp->r_pos.y + rp->r_max.y - 1)
						ch = '-';
					else
						ch = '|';
				}
				/*
				 * Don't show room walls if he is in a passage
				 */
				if (!blind) {
					if ((y == hero.y && x == hero.x) || (inpass && (ch == '-' || ch == '|')))
						continue;
				}
				else
					ch = ' ';
				wmove(cw, y, x);
				waddch(cw, ch);
				if (door_stop && !firstmove && running) {
					switch (runch) {
						case 'h':
							if (x == ex)
								continue;
						when 'j':
							if (y == hero.y - 1)
								continue;
						when 'k':
							if (y == ey)
								continue;
						when 'l':
							if (x == hero.x - 1)
								continue;
						when 'y':
							if ((x + y) - (hero.x + hero.y) >= 1)
								continue;
						when 'u':
							if ((y - x) - (hero.y - hero.x) >= 1)
								continue;
						when 'n':
							if ((x + y) - (hero.x + hero.y) <= -1)
								continue;
						when 'b':
							if ((y - x) - (hero.y - hero.x) <= -1)
								continue;
					}
					switch (ch) {
						case DOOR:
							if (x == hero.x || y == hero.y)
								running = FALSE;
							break;
						case PASSAGE:
							if (x == hero.x || y == hero.y)
								passcount += 1;
							break;
						case FLOOR:
						case '|':
						case '-':
						case ' ':
							break;
						default:
							running = FALSE;
							break;
					}
				}
			}
		}
	}
	if (door_stop && !firstmove && passcount > 1)
		running = FALSE;
	mvwaddch(cw, hero.y, hero.x, PLAYER);
	wmove(cw, oldy, oldx);
	player.t_oldpos = hero;
	oldrp = rp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movl $0x0, -0x34(%rbp)
xorl %eax, %eax
leaq 0x2a8ed(%rip), %rcx     # 0x39e50
cmpq (%rcx), %rax
je 0xf57a
leaq 0x2a8e1(%rip), %rax     # 0x39e50
movq (%rax), %rax
movswl (%rax), %eax
movl %eax, -0x54(%rbp)
jmp 0xf584
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x54(%rbp)
jmp 0xf584
movl -0x54(%rbp), %eax
movl %eax, -0xc(%rbp)
xorl %eax, %eax
leaq 0x2a8bd(%rip), %rcx     # 0x39e50
cmpq (%rcx), %rax
je 0xf5ab
leaq 0x2a8b1(%rip), %rax     # 0x39e50
movq (%rax), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x58(%rbp)
jmp 0xf5b5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x58(%rbp)
jmp 0xf5b5
movl -0x58(%rbp), %eax
movl %eax, -0x8(%rbp)
leaq 0x27b0e(%rip), %rax     # 0x370d0
movl 0x58(%rax), %eax
movl %eax, -0x2c(%rbp)
leaq 0x27b01(%rip), %rax     # 0x370d0
movl 0x5c(%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x1, %edi
callq 0xaa60
andb $0x1, %al
movb %al, -0x36(%rbp)
leaq 0x27add(%rip), %rax     # 0x370c8
cmpq $0x0, (%rax)
je 0xf60a
leaq 0x27ad0(%rip), %rax     # 0x370c8
movq (%rax), %rdi
movl $0x1, %esi
callq 0x19950
cmpl $0x0, %eax
jne 0xf614
testb $0x1, -0x36(%rbp)
je 0xf6c4
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0xf6c2
movl -0x30(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jg 0xf6b2
movl -0x10(%rbp), %eax
leaq 0x27a82(%rip), %rcx     # 0x370d0
cmpl 0x54(%rcx), %eax
jne 0xf662
movl -0x14(%rbp), %eax
leaq 0x27a73(%rip), %rcx     # 0x370d0
cmpl 0x50(%rcx), %eax
je 0xf6a5
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %esi
callq 0x118c0
movsbl %al, %eax
cmpl $0x2e, %eax
jne 0xf6a5
leaq 0x2a7d4(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0xf691
jmp 0xf6a5
leaq 0x2a7b8(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl $0x20, %esi
callq 0x64c0
jmp 0xf6a7
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xf637
jmp 0xf6b4
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xf61d
jmp 0xf6c4
leaq 0x27a05(%rip), %rax     # 0x370d0
movq 0x70(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
sete %al
andb $0x1, %al
movb %al, -0x35(%rbp)
leaq 0x279e9(%rip), %rax     # 0x370d0
movl 0x54(%rax), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
leaq 0x279d9(%rip), %rax     # 0x370d0
movl 0x50(%rax), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
leaq 0x279c9(%rip), %rax     # 0x370d0
movl 0x50(%rax), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x28(%rbp), %eax
jg 0xfc0f
cmpl $0x0, -0x14(%rbp)
jl 0xfbff
movl -0x14(%rbp), %eax
movq 0x238a8(%rip), %rcx     # 0x32fd8
movl (%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jg 0xfbff
leaq 0x2798c(%rip), %rax     # 0x370d0
movl 0x54(%rax), %eax
subl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x24(%rbp), %eax
jg 0xfbfd
cmpl $0x0, -0x10(%rbp)
jle 0xf772
movl -0x10(%rbp), %eax
movq 0x23877(%rip), %rcx     # 0x32fe0
movl (%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jl 0xf777
jmp 0xfbef
callq 0x65b0
movq (%rax), %rax
movq %rax, -0x60(%rbp)
leaq 0x2a6d6(%rip), %rax     # 0x39e60
movq (%rax), %rdi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0xf7a7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x64(%rbp)
jmp 0xf7b9
leaq 0x2a6b2(%rip), %rax     # 0x39e60
movq (%rax), %rdi
callq 0x6340
movl %eax, -0x64(%rbp)
movq -0x60(%rbp), %rax
movl -0x64(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xf934
testb $0x1, -0x1(%rbp)
jne 0xf7f4
testb $0x1, -0x35(%rbp)
jne 0xf807
movq -0x20(%rbp), %rdi
movl $0x4, %esi
callq 0x19950
cmpl $0x0, %eax
je 0xf807
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %esi
movb $0x0, %al
callq 0x10a00
movq %rax, -0x40(%rbp)
jmp 0xf816
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %esi
callq 0x7c90
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xf852
movq 0x2379c(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0xf839
jmp 0xf84d
movq 0x23780(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movl $0x2e, %esi
callq 0x64c0
jmp 0xf932
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq 0x2375b(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0xf882
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x68(%rbp)
jmp 0xf894
movq 0x23737(%rip), %rax     # 0x32fc0
movq (%rax), %rdi
callq 0x6340
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movq -0x48(%rbp), %rcx
movb %al, 0x8f(%rcx)
movsbl %al, %edi
callq 0x11a80
testb $0x1, %al
jne 0xf8af
jmp 0xf8fa
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %esi
movb $0x0, %al
callq 0x12e80
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0xf8cb
jmp 0xfbfd
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xf8ed
movq -0x50(%rbp), %rax
movb 0x14(%rax), %cl
movq -0x48(%rbp), %rax
movb %cl, 0x8f(%rax)
jmp 0xf8f8
movq -0x48(%rbp), %rax
movb $0x2e, 0x8f(%rax)
jmp 0xf8fa
movq -0x48(%rbp), %rax
movsbl 0x8f(%rax), %eax
cmpl $0x2e, %eax
jne 0xf930
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x19950
cmpl $0x0, %eax
je 0xf930
testb $0x1, -0x36(%rbp)
jne 0xf92e
movq -0x48(%rbp), %rax
movb $0x20, 0x8f(%rax)
jmp 0xf930
jmp 0xf932
jmp 0xf934
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %esi
callq 0x118c0
movb %al, -0x2(%rbp)
movsbl %al, %eax
cmpl $0x26, %eax
jne 0xf980
testb $0x1, -0x35(%rbp)
jne 0xf974
movl -0x10(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x4(%rcx), %eax
je 0xf974
movl -0x10(%rbp), %eax
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
movq -0x20(%rbp), %rdx
addl 0xc(%rdx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xf97a
movb $0x2d, -0x2(%rbp)
jmp 0xf97e
movb $0x7c, -0x2(%rbp)
jmp 0xf980
testb $0x1, -0x36(%rbp)
jne 0xf9c3
movl -0x10(%rbp), %eax
leaq 0x27740(%rip), %rcx     # 0x370d0
cmpl 0x54(%rcx), %eax
jne 0xf9a4
movl -0x14(%rbp), %eax
leaq 0x27731(%rip), %rcx     # 0x370d0
cmpl 0x50(%rcx), %eax
je 0xf9bc
testb $0x1, -0x35(%rbp)
je 0xf9c1
movsbl -0x2(%rbp), %eax
cmpl $0x2d, %eax
je 0xf9bc
movsbl -0x2(%rbp), %eax
cmpl $0x7c, %eax
jne 0xf9c1
jmp 0xfbef
jmp 0xf9c7
movb $0x20, -0x2(%rbp)
leaq 0x2a482(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x6490
leaq 0x2a46d(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movsbl -0x2(%rbp), %esi
callq 0x64c0
leaq 0x27318(%rip), %rax     # 0x36d0e
testb $0x1, (%rax)
je 0xfbed
leaq 0x27309(%rip), %rax     # 0x36d0f
testb $0x1, (%rax)
jne 0xfbed
leaq 0x272f6(%rip), %rax     # 0x36d0c
testb $0x1, (%rax)
je 0xfbed
leaq 0x278bf(%rip), %rax     # 0x372e5
movsbl (%rax), %eax
addl $-0x62, %eax
movl %eax, %ecx
movq %rcx, -0x70(%rbp)
subl $0x17, %eax
ja 0xfb4f
movq -0x70(%rbp), %rax
leaq 0x1b80a(%rip), %rcx     # 0x2b250
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x14(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0xfa5c
jmp 0xfbef
jmp 0xfb4f
movl -0x10(%rbp), %eax
leaq 0x27665(%rip), %rcx     # 0x370d0
movl 0x54(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xfa7a
jmp 0xfbef
jmp 0xfb4f
movl -0x10(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0xfa8c
jmp 0xfbef
jmp 0xfb4f
movl -0x14(%rbp), %eax
leaq 0x27635(%rip), %rcx     # 0x370d0
movl 0x50(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0xfaaa
jmp 0xfbef
jmp 0xfb4f
movl -0x14(%rbp), %eax
addl -0x10(%rbp), %eax
leaq 0x27614(%rip), %rcx     # 0x370d0
movl 0x50(%rcx), %ecx
leaq 0x2760a(%rip), %rdx     # 0x370d0
addl 0x54(%rdx), %ecx
subl %ecx, %eax
cmpl $0x1, %eax
jl 0xfad5
jmp 0xfbef
jmp 0xfb4f
movl -0x10(%rbp), %eax
subl -0x14(%rbp), %eax
leaq 0x275ec(%rip), %rcx     # 0x370d0
movl 0x54(%rcx), %ecx
leaq 0x275e2(%rip), %rdx     # 0x370d0
subl 0x50(%rdx), %ecx
subl %ecx, %eax
cmpl $0x1, %eax
jl 0xfafd
jmp 0xfbef
jmp 0xfb4f
movl -0x14(%rbp), %eax
addl -0x10(%rbp), %eax
leaq 0x275c4(%rip), %rcx     # 0x370d0
movl 0x50(%rcx), %ecx
leaq 0x275ba(%rip), %rdx     # 0x370d0
addl 0x54(%rdx), %ecx
subl %ecx, %eax
cmpl $-0x1, %eax
jg 0xfb25
jmp 0xfbef
jmp 0xfb4f
movl -0x10(%rbp), %eax
subl -0x14(%rbp), %eax
leaq 0x2759c(%rip), %rcx     # 0x370d0
movl 0x54(%rcx), %ecx
leaq 0x27592(%rip), %rdx     # 0x370d0
subl 0x50(%rdx), %ecx
subl %ecx, %eax
cmpl $-0x1, %eax
jg 0xfb4d
jmp 0xfbef
jmp 0xfb4f
movsbl -0x2(%rbp), %eax
movl %eax, -0x74(%rbp)
subl $0x20, %eax
je 0xfbdf
jmp 0xfb61
movl -0x74(%rbp), %eax
subl $0x23, %eax
je 0xfbb6
jmp 0xfb6b
movl -0x74(%rbp), %eax
subl $0x2b, %eax
je 0xfb8c
jmp 0xfb75
movl -0x74(%rbp), %eax
addl $-0x2d, %eax
subl $0x2, %eax
jb 0xfbdf
jmp 0xfb82
movl -0x74(%rbp), %eax
subl $0x7c, %eax
je 0xfbdf
jmp 0xfbe1
movl -0x14(%rbp), %eax
leaq 0x2753a(%rip), %rcx     # 0x370d0
cmpl 0x50(%rcx), %eax
je 0xfbaa
movl -0x10(%rbp), %eax
leaq 0x2752b(%rip), %rcx     # 0x370d0
cmpl 0x54(%rcx), %eax
jne 0xfbb4
leaq 0x2715b(%rip), %rax     # 0x36d0c
movb $0x0, (%rax)
jmp 0xfbeb
movl -0x14(%rbp), %eax
leaq 0x27510(%rip), %rcx     # 0x370d0
cmpl 0x50(%rcx), %eax
je 0xfbd4
movl -0x10(%rbp), %eax
leaq 0x27501(%rip), %rcx     # 0x370d0
cmpl 0x54(%rcx), %eax
jne 0xfbdd
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xfbeb
jmp 0xfbeb
leaq 0x27124(%rip), %rax     # 0x36d0c
movb $0x0, (%rax)
jmp 0xfbed
jmp 0xfbef
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xf74d
jmp 0xfbff
jmp 0xfc01
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xf710
leaq 0x270f8(%rip), %rax     # 0x36d0e
testb $0x1, (%rax)
je 0xfc37
leaq 0x270ed(%rip), %rax     # 0x36d0f
testb $0x1, (%rax)
jne 0xfc37
cmpl $0x1, -0x34(%rbp)
jle 0xfc37
leaq 0x270d8(%rip), %rax     # 0x36d0c
movb $0x0, (%rax)
leaq 0x2a212(%rip), %rax     # 0x39e50
movq (%rax), %rdi
leaq 0x27488(%rip), %rax     # 0x370d0
movl 0x54(%rax), %esi
leaq 0x2747e(%rip), %rax     # 0x370d0
movl 0x50(%rax), %edx
callq 0x6490
cmpl $-0x1, %eax
jne 0xfc61
jmp 0xfc75
leaq 0x2a1e8(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl $0x40, %esi
callq 0x64c0
leaq 0x2a1d4(%rip), %rax     # 0x39e50
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x8(%rbp), %edx
callq 0x6490
leaq 0x2743f(%rip), %rax     # 0x370d0
movq 0x50(%rax), %rcx
movq %rcx, 0x58(%rax)
movq -0x20(%rbp), %rcx
leaq 0x27424(%rip), %rax     # 0x370c8
movq %rcx, (%rax)
addq $0x80, %rsp
popq %rbp
retq