LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/monsters.c
// Function: wanderer
void wanderer()
{
	int ch;
	struct room *rp, *hr = player.t_room;
	struct linked_list *item;
	struct thing *tp;
	struct coord mp;

	do {
		rp = &rooms[rnd_room()];
		if (rp != hr || levtype == MAZELEV) {
			mp = *rnd_pos(rp);
			ch = mvinch(mp.y, mp.x);
		}
	} while (!step_ok(ch));
	item = new_monster(rnd_mon(TRUE,FALSE), &mp, FALSE);
	tp = THINGPTR(item);
	tp->t_flags |= ISRUN;
	tp->t_dest = &hero;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x203ce(%rip), %r14     # 0x2dc60
movq 0x70(%r14), %r15
leaq 0x20013(%rip), %r12     # 0x2d8b0
leaq 0x1ffc0(%rip), %r13     # 0x2d864
movq 0x1c685(%rip), %rbp     # 0x29f30
xorl %eax, %eax
callq 0xf913
cltq
imulq $0x68, %rax, %rdi
addq %r12, %rdi
cmpq %r15, %rdi
jne 0xd8c7
cmpl $0x2, (%r13)
jne 0xd8fa
callq 0x13f09
movq (%rax), %rdx
movq %rdx, (%rsp)
movq (%rbp), %rdi
movq %rdx, %rsi
shrq $0x20, %rsi
callq 0x6490
cmpl $-0x1, %eax
je 0xd8f5
movq (%rbp), %rdi
callq 0x6330
movl %eax, %ebx
jmp 0xd8fa
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movslq %ebx, %rdi
callq 0xb8d5
testb %al, %al
je 0xd8ab
movl $0x1, %edi
xorl %esi, %esi
callq 0xd4fc
movsbl %al, %edi
movq %rsp, %rsi
xorl %edx, %edx
callq 0xd635
movq 0x10(%rax), %rax
orq $0x4, 0x78(%rax)
addq $0x50, %r14
movq %r14, 0x60(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/monsters.c
// Function: genocide
int genocide()
{
	struct linked_list *ip, *nip;
	struct thing *mp;
	struct monster *mm;
	int i, ii, c;

	if (levcount == 0) {
		mpos = 0;
		msg("You cannot genocide Asmodeus !!");
		return 0;
	}
tryagain:
	i = TRUE;		/* assume an error now */
	while (i) {
		msg("Which monster (remember UPPER & lower case)?");
		c = readchar();		/* get a char */
		if (c == ESCAPE) {	/* he can abort (the fool) */
			msg("");
			return 0;
		}
		if (isalpha(c))		/* valid char here */
			i = FALSE;		/* exit the loop */
		else {				/* he didn't type a letter */
			mpos = 0;
			msg("Please specify a letter between 'A' and 'z'");
		}
	}
	i = midx(c);						/* get index to monster */
	mm = &monsters[i];
	if (mm->m_lev.l_lev < 0) {
		mpos = 0;
		msg("You have already eliminated the %s.",mm->m_name);
		goto tryagain;
	}
	for (ip = mlist; ip != NULL; ip = nip) {
		mp = THINGPTR(ip);
		nip = next(ip);
		if (mp->t_type == c)
			remove_monster(&mp->t_pos, ip);
	}
	mm->m_lev.l_lev = -1;				/* get rid of it */
	mm->m_lev.h_lev = -1;
	lev_mon();							/* redo monster list */
	mpos = 0;
	msg("You have wiped out the %s.",mm->m_name);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1fcfe(%rip), %rax     # 0x2d860
cmpl $0x0, (%rax)
je 0xdc1f
leaq 0x134e6(%rip), %rdi     # 0x21058
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
callq 0xb94c
cmpb $0x1b, %al
je 0xdc16
movl %eax, %ebx
callq 0x65b0
movq %rax, %r14
leaq 0x1fcd7(%rip), %rbp     # 0x2d870
leaq 0x134b8(%rip), %r12     # 0x21058
leaq 0x1c819(%rip), %r15     # 0x2a3c0
movq (%r14), %rax
movsbq %bl, %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0xdbcc
movl $0x0, (%rbp)
leaq 0x134c2(%rip), %rdi     # 0x21085
xorl %eax, %eax
callq 0xb620
jmp 0xdbff
movsbl %bl, %edi
callq 0xd595
cltq
imulq $0x70, %rax, %rax
leaq (%r15,%rax), %r13
cmpl $0x0, 0xc(%r15,%rax)
jns 0xdc4b
movl $0x0, (%rbp)
movq (%r13), %rsi
leaq 0x134b9(%rip), %rdi     # 0x210b1
xorl %eax, %eax
callq 0xb620
movq %r12, %rdi
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
callq 0xb94c
movl %eax, %ebx
cmpb $0x1b, %al
jne 0xdba7
leaq 0x15d6c(%rip), %rdi     # 0x23989
jmp 0xdc33
leaq 0x1fc4a(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
leaq 0x13405(%rip), %rdi     # 0x21038
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1fbee(%rip), %rax     # 0x2d840
movq (%rax), %rsi
testq %rsi, %rsi
je 0xdc7a
movq (%rsi), %r14
movq 0x10(%rsi), %rdi
cmpb 0x8d(%rdi), %bl
jne 0xdc72
addq $0x50, %rdi
callq 0xadd9
movq %r14, %rsi
testq %r14, %r14
jne 0xdc5a
movq $-0x1, 0xc(%r13)
callq 0xd5c5
movl $0x0, (%rbp)
movq (%r13), %rsi
leaq 0x1343c(%rip), %rdi     # 0x210d5
xorl %eax, %eax
callq 0xb620
jmp 0xdc3a
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/monsters.c
// Function: unhold
void unhold(char whichmon)
{
	switch (whichmon) {
		case 'F':
			fung_hit = 0;
			strcpy(monsters[midx('F')].m_stats.s_dmg, "000d0");
		case 'd':
			player.t_flags &= ~ISHELD;
	}
}

// Assembly:
pushq %rax
cmpl $0x64, %edi
je 0xdcfd
cmpl $0x46, %edi
jne 0xdd08
leaq 0x1fbd4(%rip), %rax     # 0x2d888
movl $0x0, (%rax)
callq 0x65b0
movq (%rax), %rax
movzwl 0x8c(%rax), %eax
xorl %ecx, %ecx
btl $0x9, %eax
sbbq %rcx, %rcx
orq $0x34, %rcx
btl $0x8, %eax
movl $0x5, %eax
cmovaeq %rcx, %rax
imulq $0x70, %rax, %rax
leaq 0x1c6d2(%rip), %rcx     # 0x2a3c0
movw $0x30, 0x64(%rcx,%rax)
movl $0x64303030, 0x60(%rcx,%rax) # imm = 0x64303030
leaq 0x1ff5c(%rip), %rax     # 0x2dc60
andb $-0x2, 0x79(%rax)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/move.c
// Function: show
char show(int y,int x)
{
	unsigned long ch = winat(y, x);
	struct linked_list *it;
	struct thing *tp;
	struct trap *ta;

	if (isatrap(ch)) {
		if ((ta = trap_at(y, x)) == NULL)
			return FLOOR;
		if (iswearing(R_FTRAPS))
			ta->tr_flags |= ISFOUND;
		return ((ta->tr_flags & ISFOUND) ? ta->tr_type : FLOOR);
	}
	if (ch == SECRETDOOR && iswearing(R_FTRAPS)) {
		mvaddch(y,x,DOOR);
		return DOOR;
	}
	if ((it = find_mons(y, x)) != NULL) {	/* maybe a monster */
		tp = THINGPTR(it);
		if (ch == 'M' || (tp->t_flags & ISINVIS)) {
			if (ch == 'M')
				ch = tp->t_disguise;
			else if (pl_off(CANSEE)) {
				if (ch == 's')
					ch = ' ';		/* shadows show as a blank */
				else
					ch = mvinch(y, x);	/* hide invisibles */
			}
		}
	}
	return ch;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %r14d
callq 0x9492
movl %eax, %ebx
movsbl %al, %edi
callq 0xe41e
testb %al, %al
je 0xe345
leaq 0x1fb64(%rip), %rax     # 0x2de68
movslq (%rax), %rax
movb $0x2e, %bl
testq %rax, %rax
jle 0xe40d
leaq (%rax,%rax,2), %rax
shlq $0x3, %rax
addq 0x1bc9f(%rip), %rax     # 0x29fc0
leaq 0x1fa48(%rip), %r15     # 0x2dd70
cmpl %r14d, 0x4(%r15)
jne 0xe337
cmpl %ebp, (%r15)
je 0xe3e9
addq $0x18, %r15
cmpq %rax, %r15
jb 0xe328
jmp 0xe40d
cmpb $0x26, %bl
jne 0xe389
movl $0xe, %edi
callq 0x12c34
testb %al, %al
je 0xe389
movq 0x1bbd1(%rip), %r15     # 0x29f30
movq (%r15), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x6490
movb $0x2b, %bl
cmpl $-0x1, %eax
je 0xe40d
movq (%r15), %rdi
movl $0x2b, %esi
callq 0x64c0
jmp 0xe40d
movl %r14d, %edi
movl %ebp, %esi
callq 0x7502
testq %rax, %rax
je 0xe40d
movq 0x10(%rax), %rax
cmpb $0x4d, %bl
jne 0xe3a9
movb 0x8e(%rax), %bl
jmp 0xe40d
testb $0x10, 0x78(%rax)
je 0xe40d
movl $0x1000, %edi           # imm = 0x1000
callq 0x9522
testb %al, %al
je 0xe40d
cmpb $0x73, %bl
movb $0x20, %bl
je 0xe40d
movq 0x1bb65(%rip), %rbx     # 0x29f30
movq (%rbx), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0xe41a
movq (%rbx), %rdi
callq 0x6330
movl %eax, %ebx
jmp 0xe40d
movl $0xe, %edi
callq 0x12c34
movl 0x10(%r15), %ecx
testb %al, %al
je 0xe404
orl $0x8, %ecx
movl %ecx, 0x10(%r15)
jmp 0xe409
testb $0x8, %cl
je 0xe40d
movb 0x14(%r15), %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movb $-0x1, %bl
jmp 0xe40d
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/new_leve.c
// Function: rnd_room
int rnd_room()
{
	int rm;

	if (levtype != NORMLEV)
		rm = 0;
	else
	{
		do {
			rm = rnd(MAXROOMS);
		} while (rf_on(&rooms[rm],ISGONE));
	}
	return rm;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1df46(%rip), %rax     # 0x2d864
xorl %ebx, %ebx
cmpl $0x0, (%rax)
jne 0xf951
leaq 0x1df84(%rip), %r14     # 0x2d8b0
movl $0x9, %edi
xorl %eax, %eax
callq 0xc674
movl %eax, %ebx
cltq
imulq $0x68, %rax, %rdi
addq %r14, %rdi
movl $0x2, %esi
callq 0x13d18
testl %eax, %eax
jne 0xf92c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/options.c
// Function: option
void option()
{
	OPTION	*op;
	int	wh;

	wclear(hw);
	touchwin(hw);
	/*
	 * Display current values of options
	 */
	for (op = optlist; op < &optlist[NUM_OPTS]; op++) {
		wh = op - optlist;
		mvwaddstr(hw, wh, 0, op->o_prompt);
		mvwaddstr(hw, wh, 16, op->o_opt);
	}
	/*
	 * Set values
	 */
	wmove(hw, 0, 0);
	for (op = optlist; op < &optlist[NUM_OPTS]; op++) {
		wmove(hw, op - optlist, 16);
		if ((wh = get_str(op->o_opt, hw))) {
			if (wh == QUIT)
				break;
			else if (op > optlist) {
				wmove(hw, op - optlist, 0);
				op -= 2;
			}
			else {
				putchar(7);
				wmove(hw, 0, 0);
				op -= 1;
			}
		}
	}
	/*
	 * Switch back to original screen
	 */
	dbotline(hw,spacemsg);
	restscr(cw);
	after = FALSE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x20df4(%rip), %r14     # 0x309e8
movq (%r14), %rdi
callq 0x6120
movq (%r14), %rdi
testq %rdi, %rdi
je 0xfc0c
movswl 0x4(%rdi), %edx
incl %edx
jmp 0xfc11
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ebx, %ebx
xorl %esi, %esi
movl $0x1, %ecx
callq 0x61b0
movq $-0x18, %r12
leaq 0x1d783(%rip), %r15     # 0x2d3b0
movq (%r14), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0xfc50
movq (%r14), %rdi
movq 0x20(%r12,%r15), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
movq (%r14), %rdi
movl %ebx, %esi
movl $0x10, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0xfc76
movq (%r14), %rdi
movq 0x28(%r12,%r15), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
addq $0x18, %r12
incl %ebx
cmpq $0x30, %r12
jb 0xfc2d
movq (%r14), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
xorl %edx, %edx
callq 0x6490
movq (%r14), %rdi
movq %r12, %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %ebx # imm = 0xAAAAAAAB
movl %ebx, %esi
movl $0x10, %edx
callq 0x6490
movq 0x10(%r12,%r15), %rdi
movq (%r14), %rsi
callq 0xfd31
testl %eax, %eax
je 0xfcf1
cmpl $0x1, %eax
je 0xfcff
movq $-0x30, %r13
testq %r12, %r12
jg 0xfce2
movl $0x7, %edi
callq 0x6060
movq $-0x18, %r13
xorl %ebx, %ebx
movq (%r14), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x6490
addq %r13, %r12
leaq 0x18(%r12), %rax
cmpq $0x30, %r12
movq %rax, %r12
jl 0xfc91
movq (%r14), %rdi
leaq 0x1a607(%rip), %rsi     # 0x2a310
callq 0xbcbb
leaq 0x20ccb(%rip), %rax     # 0x309e0
movq (%rax), %rdi
callq 0xbd09
leaq 0x1a5e9(%rip), %rax     # 0x2a30d
movb $0x0, (%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/options.c
// Function: strucpy
void strucpy(char *s1,char *s2,int len)
{
	char *sp;

	while (len-- > 0) {
		strcpy(s1, (sp = unctrl(*s2)));
		s1 += strlen(sp);
		s2++;
	}
	*s1 = '\0';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %edx, %edx
jle 0x10031
movl %edx, %ebp
movq %rsi, %r14
incl %ebp
movsbl (%r14), %edi
callq 0x6420
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x60e0
movq %r15, %rdi
callq 0x6170
addq %rax, %rbx
incq %r14
decl %ebp
cmpl $0x1, %ebp
ja 0x10005
movb $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/options.c
// Function: parse_opts
void parse_opts(char *str)
{
	char *sp;
	OPTION *op;
	int len;

	while (*str) {
		for (sp = str; isalpha(*sp); sp++)	/* get option name */
			continue;
		len = sp - str;
		for (op = optlist; op < &optlist[NUM_OPTS]; op++) {
			if (EQSTR(str, op->o_name, len)) {
				char *start;
	
				for (str = sp + 1; *str == '='; str++)
					continue;
				if (*str == '~') {
					strcpy(op->o_opt, home);
					start = op->o_opt + strlen(home);
					while (*++str == '/')
						continue;
				}
				else
					start = (char *) op->o_opt;
				for (sp = str + 1; *sp && *sp != ','; sp++)
					continue;
				strucpy(start, str, sp - str);
			}
		}
		/*
		 * skip to start of next option name
		 */
		while (*sp && !isalpha(*sp))
			sp++;
		str = sp;
	}
}

// Assembly:
cmpb $0x0, (%rdi)
je 0x1017e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r13
callq 0x65b0
movabsq $-0x100000000, %r12     # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %rdx      # imm = 0x100000000
leaq 0x1d33a(%rip), %r14     # 0x2d3b0
movq %rax, (%rsp)
movq (%rax), %rax
leaq -0x1(%r13), %r15
addq %rdx, %r12
movsbq 0x1(%r15), %rcx
incq %r15
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x10081
sarq $0x20, %r12
xorl %ebx, %ebx
movq (%rbx,%r14), %rsi
movq %r13, %rdi
movq %r12, %rdx
callq 0x60c0
testl %eax, %eax
jne 0x1011d
movzbl 0x1(%r15), %eax
incq %r15
cmpl $0x3d, %eax
je 0x100ac
cmpl $0x7e, %eax
jne 0x100ef
movq 0x10(%rbx,%r14), %rdi
leaq 0x1dfa6(%rip), %r13     # 0x2e070
movq %r13, %rsi
callq 0x60e0
movq 0x10(%rbx,%r14), %rbp
movq %r13, %rdi
callq 0x6170
cmpb $0x2f, 0x1(%r15)
leaq 0x1(%r15), %r15
je 0x100df
addq %rax, %rbp
jmp 0x100f4
movq 0x10(%rbx,%r14), %rbp
movq %r15, %r13
xorl %r15d, %r15d
movzbl 0x1(%r13,%r15), %eax
incq %r15
cmpl $0x2c, %eax
je 0x1010c
testl %eax, %eax
jne 0x100fa
movq %rbp, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0xfff0
addq %r13, %r15
leaq 0x18(%rbx), %rax
cmpq $0x30, %rbx
movq %rax, %rbx
jb 0x10099
movb (%r15), %dl
testb %dl, %dl
movq (%rsp), %rax
je 0x10170
movq (%rax), %rcx
movsbq %dl, %rdx
testb $0x4, 0x1(%rcx,%rdx,2)
jne 0x10154
movb 0x1(%r15), %dl
incq %r15
testb %dl, %dl
jne 0x1013c
jmp 0x10170
movq %r15, %r13
movabsq $-0x100000000, %r12     # imm = 0xFFFFFFFF00000000
movabsq $0x100000000, %rdx      # imm = 0x100000000
jmp 0x1007a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pack.c
// Function: pack_char
char pack_char(struct object *obj)
{
	struct linked_list *item;
	char c;

	c = 'a';
	for (item = pack; item != NULL; item = next(item))
		if (OBJPTR(item) == obj)
			return c;
		else
			c = npch(c);
	return '%';
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x1d7bf(%rip), %rax     # 0x2dc60
movq 0x68(%rax), %r15
movb $0x25, %bl
testq %r15, %r15
je 0x104cb
movq %rdi, %r14
movb $0x61, %al
cmpq %r14, 0x10(%r15)
je 0x104c9
movsbl %al, %edi
callq 0xbd39
movq (%r15), %r15
testq %r15, %r15
jne 0x104b1
jmp 0x104cb
movl %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pack.c
// Function: inventory
bool inventory(struct linked_list *list,int type)
{
	struct linked_list *pc;
	struct object *obj;
	char ch;
	int cnt;

	if (list == NULL) {			/* empty list */
		msg(type == 0 ? "Empty handed." : "Nothing appropriate.");
		return FALSE;
	}
	else if (next(list) == NULL) {	/* only 1 item in list */
		obj = OBJPTR(list);
		msg("a) %s", inv_name(obj, FALSE));
		return TRUE;
	}
	cnt = 0;
	wclear(hw);
	for (ch = 'a', pc = list; pc != NULL; pc = next(pc), ch = npch(ch)) {
		obj = OBJPTR(pc);
		wprintw(hw,"%c) %s\n\r",ch,inv_name(obj, FALSE));
		if (++cnt > LINES - 2 && next(pc) != NULL) {
			dbotline(hw, morestr);
			cnt = 0;
			wclear(hw);
		} 
	}
	dbotline(hw,spacemsg);
	restscr(cw);
	return TRUE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
testq %rdi, %rdi
je 0x10580
cmpq $0x0, (%r14)
je 0x1059d
leaq 0x204ed(%rip), %r13     # 0x309e8
movq (%r13), %rdi
callq 0x6120
movb $0x61, %al
movq 0x19aa3(%rip), %r15     # 0x29fb0
xorl %ebx, %ebx
movq %r14, (%rsp)
movq 0x10(%r14), %rdi
movq (%r13), %r12
movsbl %al, %ebp
xorl %esi, %esi
callq 0x1aa04
movq %r12, %rdi
leaq 0x1104f(%rip), %rsi     # 0x2157e
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x6510
movl (%r15), %eax
addl $-0x2, %eax
movq (%r14), %r12
cmpl %eax, %ebx
jge 0x1054c
incl %ebx
jmp 0x1056f
testq %r12, %r12
je 0x105bb
movq (%r13), %rdi
leaq 0x19dd2(%rip), %rsi     # 0x2a32e
callq 0xbcbb
movq (%r13), %rdi
callq 0x6120
movq (%r14), %r12
xorl %ebx, %ebx
movl %ebp, %edi
callq 0xbd39
movq %r12, %r14
testq %r12, %r12
jne 0x10513
jmp 0x105c2
testl %esi, %esi
leaq 0x10fcc(%rip), %rax     # 0x21555
leaq 0x10fd3(%rip), %rdi     # 0x21563
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0xb620
jmp 0x105e5
movq 0x10(%r14), %rdi
xorl %esi, %esi
callq 0x1aa04
leaq 0x10fc9(%rip), %rdi     # 0x21578
movq %rax, %rsi
xorl %eax, %eax
callq 0xb620
jmp 0x105e5
movl %ebp, %edi
callq 0xbd39
movq (%r13), %rdi
leaq 0x19d43(%rip), %rsi     # 0x2a310
callq 0xbcbb
leaq 0x20407(%rip), %rax     # 0x309e0
movq (%rax), %rdi
callq 0xbd09
movq (%rsp), %r14
testq %r14, %r14
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pack.c
// Function: pick_up
void pick_up(char ch)
{
	nochange = FALSE;
	switch(ch) {
		case GOLD:
			money();
		when ARMOR:
		case POTION:
		case FOOD:
		case WEAPON:
		case SCROLL:	
		case AMULET:
		case RING:
		case STICK:
			add_pack(NULL, FALSE);
		otherwise:
			msg("That item is ethereal !!!");
	}
}

// Assembly:
leaq 0x1d2a2(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
leal -0x29(%rdi), %eax
cmpl $0x6, %eax
jbe 0x1062b
leal -0x3a(%rdi), %eax
cmpl $0x23, %eax
ja 0x10624
movabsq $0x800000029, %rcx      # imm = 0x800000029
btq %rax, %rcx
jb 0x1063b
cmpl $0x21, %edi
je 0x1063b
jmp 0x10644
leaq 0x10e72(%rip), %rcx     # 0x214a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
xorl %esi, %esi
jmp 0x10180
leaq 0x10f3c(%rip), %rdi     # 0x21587
xorl %eax, %eax
jmp 0xb620
xorl %eax, %eax
jmp 0x1b228
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pack.c
// Function: picky_inven
int picky_inven()
{
	struct linked_list *item;
	char ch, mch;

	if (pack == NULL)
		msg("You aren't carrying anything.");
	else if (next(pack) == NULL)
		msg("a) %s", inv_name(OBJPTR(pack), FALSE));
	else {
		msg("Item: ");
		mpos = 0;
		if ((mch = readchar()) == ESCAPE) {
			msg("");
			return 0;
		}
		for (ch='a',item=pack; item != NULL; item=next(item),ch=npch(ch))
			if (ch == mch) {
				msg("%c) %s",ch,inv_name(OBJPTR(item), FALSE));
				return 0;
			}
		if (ch == 'A')
			ch = 'z';
		else
			ch -= 1;
		msg("Range is 'a' to '%c'", ch);
	}
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1d5fc(%rip), %r14     # 0x2dc60
movq 0x68(%r14), %rax
testq %rax, %rax
je 0x106a2
cmpq $0x0, (%rax)
je 0x106b5
leaq 0x10f45(%rip), %rdi     # 0x215bf
xorl %eax, %eax
callq 0xb620
leaq 0x1d1e8(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
xorl %eax, %eax
callq 0xb94c
cmpb $0x1b, %al
jne 0x106d3
leaq 0x132e9(%rip), %rdi     # 0x23989
jmp 0x106a9
leaq 0x10ef8(%rip), %rdi     # 0x215a1
xorl %eax, %eax
callq 0xb620
jmp 0x1073f
movq 0x10(%rax), %rdi
xorl %esi, %esi
callq 0x1aa04
leaq 0x10eb1(%rip), %rdi     # 0x21578
movq %rax, %rsi
xorl %eax, %eax
callq 0xb620
jmp 0x1073f
movq 0x68(%r14), %r14
testq %r14, %r14
je 0x10709
movl %eax, %ebx
movb $0x61, %al
cmpb %bl, %al
je 0x1071e
movq (%r14), %r14
movsbl %al, %edi
callq 0xbd39
testq %r14, %r14
jne 0x106e0
leal -0x1(%rax), %ecx
cmpb $0x41, %al
movzbl %cl, %eax
movl $0x7a, %ecx
cmovnel %eax, %ecx
movsbl %cl, %esi
jmp 0x1070e
movl $0x60, %esi
leaq 0x10eb1(%rip), %rdi     # 0x215c6
xorl %eax, %eax
callq 0xb620
jmp 0x1073f
movsbl %bl, %ebx
movq 0x10(%r14), %rdi
xorl %esi, %esi
callq 0x1aa04
leaq 0xe938(%rip), %rdi      # 0x1f06b
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pack.c
// Function: del_pack
void del_pack(struct linked_list *what)
{
	struct object *op;

	op = OBJPTR(what);
	cur_null(op);		/* check for current stuff */
	if (op->o_count > 1) {
		op->o_count--;
	}
	else {
		detach(pack,what);
		discard(what);
	}
	updpack();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rax
leaq 0x1ccde(%rip), %rcx     # 0x2d850
cmpq %rax, (%rcx)
je 0x10ba0
leaq 0x1ccda(%rip), %rcx     # 0x2d858
cmpq %rax, (%rcx)
je 0x10ba0
leaq 0x1d1c6(%rip), %rcx     # 0x2dd50
cmpq %rax, (%rcx)
je 0x10ba0
leaq 0x1d1ba(%rip), %rcx     # 0x2dd50
cmpq %rax, 0x8(%rcx)
jne 0x10ba7
addq $0x8, %rcx
movq $0x0, (%rcx)
movl 0x24(%rax), %ecx
cmpl $0x2, %ecx
jl 0x10bb6
decl %ecx
movl %ecx, 0x24(%rax)
jmp 0x10bd1
leaq 0x1d0a3(%rip), %rdi     # 0x2dc60
addq $0x68, %rdi
movq %rbx, %rsi
callq 0xbd4c
movq %rbx, %rdi
callq 0xbdda
xorl %eax, %eax
popq %rbx
jmp 0x9560
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pack.c
// Function: cur_null
void cur_null(struct object *op)
{
	if (op == cur_weapon)
		cur_weapon = NULL;
	else if (op == cur_armor)
		cur_armor = NULL;
	else if (op == cur_ring[LEFT])
		cur_ring[LEFT] = NULL;
	else if (op == cur_ring[RIGHT])
		cur_ring[RIGHT] = NULL;
}

// Assembly:
leaq 0x1cc70(%rip), %rax     # 0x2d850
cmpq %rdi, (%rax)
je 0x10c0f
leaq 0x1cc6c(%rip), %rax     # 0x2d858
cmpq %rdi, (%rax)
je 0x10c0f
leaq 0x1d158(%rip), %rax     # 0x2dd50
cmpq %rdi, (%rax)
je 0x10c0f
leaq 0x1d14c(%rip), %rax     # 0x2dd50
cmpq %rdi, 0x8(%rax)
je 0x10c0b
retq
addq $0x8, %rax
movq $0x0, (%rax)
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/passages.c
// Function: add_pass
void add_pass()
{
	int y, x, ch;

	for (y = 1; y < LINES - 3; y++)
		for (x = 0; x < COLS; x++)
			if ((ch = mvinch(y, x)) == PASSAGE || ch == DOOR ||
			  ch == SECRETDOOR)
				mvwaddch(cw, y, x, ch);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x18db3(%rip), %rax     # 0x29fb0
movl (%rax), %ecx
cmpl $0x5, %ecx
jl 0x11299
movq 0x18d89(%rip), %r12     # 0x29f98
movl (%r12), %eax
movl $0x1, %ebx
movq 0x18d11(%rip), %r13     # 0x29f30
leaq 0x1f7ba(%rip), %r15     # 0x309e0
testl %eax, %eax
jle 0x11290
xorl %ebp, %ebp
movq (%r13), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0x1127d
movq (%r13), %rdi
callq 0x6330
cmpl $0x2b, %eax
ja 0x1127d
movl %eax, %r14d
movl %eax, %eax
movabsq $0x84800000000, %rcx    # imm = 0x84800000000
btq %rax, %rcx
jae 0x1127d
movq (%r15), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0x1127d
movq (%r15), %rdi
movl %r14d, %esi
callq 0x64c0
incl %ebp
movl (%r12), %eax
cmpl %eax, %ebp
jl 0x1122c
movq 0x18d22(%rip), %rcx     # 0x29fb0
movl (%rcx), %ecx
incl %ebx
leal -0x3(%rcx), %edx
cmpl %edx, %ebx
jl 0x11226
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pstats.c
// Function: chg_hpt
void chg_hpt(int howmany,bool alsomax,char what)
{
	nochange = FALSE;
	if(alsomax)
		him->s_maxhp += howmany;
	him->s_hpt += howmany;
	if (him->s_hpt < 1) {
		msg(" ");
		death(what);
	}
}

// Assembly:
pushq %rbx
movl %edx, %ebx
leaq 0x1bb5d(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
leaq 0x1c010(%rip), %rax     # 0x2dd60
movq (%rax), %rax
testl %esi, %esi
je 0x11d5a
addl %edi, 0x34(%rax)
addl %edi, 0x30(%rax)
jle 0x11d61
popq %rbx
retq
leaq 0xf498(%rip), %rdi      # 0x21200
xorl %eax, %eax
callq 0xb620
movsbl %bl, %edi
popq %rbx
jmp 0x12c60
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pstats.c
// Function: chg_abil
int chg_abil(int what,int amt,int how)
{
	if (amt == 0)
		return 0;
	if (how == TRUE) {			/* real (must be 1st) */
		updabil(what,amt,&pstats.s_re,TRUE);
		how = FALSE;
	}
	updabil(what,amt,&pstats.s_ef,how);	/* effective */
	updpack();
	wghtchk(FALSE);
  return 0;
}

// Assembly:
testl %esi, %esi
je 0x11ddf
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ecx
movl %esi, %ebx
movl %edi, %ebp
cmpl $0x1, %edx
jne 0x11db7
leaq 0x1beb9(%rip), %rdx     # 0x2dc60
movl %ebp, %edi
movl %ebx, %esi
movl $0x1, %ecx
callq 0x11de2
xorl %ecx, %ecx
leaq 0x1bea2(%rip), %rdx     # 0x2dc60
addq $0x10, %rdx
movl %ebp, %edi
movl %ebx, %esi
callq 0x11de2
xorl %eax, %eax
callq 0x9560
xorl %edi, %edi
callq 0x9889
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pstats.c
// Function: updabil
int updabil(int what,int amt,struct real *pst,int how)
{
	int *wh, *mx, *mr;
	struct real *mst, *msr;
	bool is_str = FALSE;
	int rtype;

	msr = &him->s_re;
	if (how == TRUE)				/* max real abilities */
		mst = &max_stats.s_re;
	else							/* max effective abil */
		mst = &max_stats.s_ef;
	switch (what) {
		case STR:
			is_str = TRUE;
			wh = &pst->a_str;
			mx = &mst->a_str;
			mr = &msr->a_str;
			rtype = R_ADDSTR;
		when DEX:
			wh = &pst->a_dex;
			mx = &mst->a_dex;
			mr = &msr->a_dex;
			rtype = R_DEX;
		when CON:
			wh = &pst->a_con;
			mx = &mst->a_con;
			mr = &msr->a_con;
			rtype = R_CONST;
		when WIS:
			wh = &pst->a_wis;
			mx = &mst->a_wis;
			mr = &msr->a_wis;
			rtype = R_KNOW;
		otherwise:
			return 0;
	}
	*wh += amt;						/* update by amt */
	if (amt < 0) {					/* if decrement */
		if (*wh < MINABIL)			/* minimum = 3 */
			*wh = MINABIL;
		if (how == FALSE) {
			if (*wh < *mr)			/* if less than real abil */
				*wh = *mr;			/* make equal to real */
		}
	}
	else {							/* increment */
		int themax;

		themax = MAXOTHER;				/* default maximum */
		if (is_str)
			themax = MAXSTR;			/* strength maximum */
		if (how != TRUE)
			themax += ringex(rtype);	/* get ring extra */
		if (*wh > themax) {				/* see if > max (if real) */
			*wh = themax;				/* max = 18  (24 if str) */
		}
		/*
		 * Check for updating the max player stats.
		 */
		if (*wh > *mx)
			*mx = *wh;
	}
  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
leaq 0x1bf08(%rip), %rdx     # 0x2dcf8
leaq 0x10(%rdx), %r14
cmpl $0x1, %ecx
cmoveq %rdx, %r14
leal -0x1(%rdi), %r8d
cmpl $0x3, %r8d
ja 0x11edd
leaq 0x1bf50(%rip), %rax     # 0x2dd60
movq (%rax), %rax
leaq 0xfc6e(%rip), %r9       # 0x21a88
movslq (%r9,%r8,4), %r8
addq %r9, %r8
jmpq *%r8
movl $0x18, %ebp
jmp 0x11e97
xorl %edi, %edi
cmpl $0x1, %ecx
setne %dil
addq $0xc, %rbx
shll $0x4, %edi
leaq (%rdx,%rdi), %r14
addq $0xc, %r14
addq $0xc, %rax
movl $0x5, %edi
jmp 0x11e92
xorl %edi, %edi
cmpl $0x1, %ecx
setne %dil
addq $0x8, %rbx
shll $0x4, %edi
leaq (%rdx,%rdi), %r14
addq $0x8, %r14
addq $0x8, %rax
movl $0x18, %edi
jmp 0x11e92
xorl %edi, %edi
cmpl $0x1, %ecx
setne %dil
addq $0x4, %rbx
shll $0x4, %edi
leaq (%rdx,%rdi), %r14
addq $0x4, %r14
addq $0x4, %rax
movl $0x19, %edi
movl $0x12, %ebp
movl (%rbx), %edx
addl %esi, %edx
movl %edx, (%rbx)
testl %esi, %esi
js 0x11ec1
cmpl $0x1, %ecx
je 0x11eaf
callq 0x12bec
addl %eax, %ebp
movl (%rbx), %edx
cmpl %ebp, %edx
jle 0x11eb7
movl %ebp, (%rbx)
movl %ebp, %edx
cmpl (%r14), %edx
jle 0x11edd
movl %edx, (%r14)
jmp 0x11edd
cmpl $0x2, %edx
jg 0x11ed1
movl $0x3, (%rbx)
movl $0x3, %edx
testl %ecx, %ecx
jne 0x11edd
movl (%rax), %eax
cmpl %eax, %edx
jge 0x11edd
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pstats.c
// Function: add_haste
void add_haste(bool potion)
{
	if (pl_on(ISHASTE)) {
		msg("You faint from exhaustion.");
		player.t_nocmd += rnd(8);
		player.t_flags &= ~ISHASTE;
		extinguish(nohaste);
	}
	else {
		player.t_flags |= ISHASTE;
		if (potion)
			fuse(nohaste, TRUE, roll(10,10));
		else
			fuse(nohaste, TRUE, roll(40,20));
	}
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x8000, %edi           # imm = 0x8000
callq 0x9513
testb %al, %al
je 0x11f2d
leaq 0xfc8c(%rip), %rdi      # 0x21b88
xorl %eax, %eax
callq 0xb620
movl $0x8, %edi
xorl %eax, %eax
callq 0xc674
leaq 0x1bd4a(%rip), %rcx     # 0x2dc60
addl %eax, 0x88(%rcx)
andb $0x7f, 0x79(%rcx)
leaq -0x904a(%rip), %rdi     # 0x8edd
popq %rbx
jmp 0x8c14
leaq 0x1bd2c(%rip), %rax     # 0x2dc60
orb $-0x80, 0x79(%rax)
testb %bl, %bl
je 0x11f48
movl $0xa, %edi
movl $0xa, %esi
jmp 0x11f52
movl $0x28, %edi
movl $0x14, %esi
callq 0xc695
leaq -0x9081(%rip), %rdi     # 0x8edd
movl $0x1, %esi
movl %eax, %edx
popq %rbx
jmp 0x8ba7
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pstats.c
// Function: str_plus
int str_plus(struct stats *who)
{
	int hitplus, str;

	hitplus = 0;
	str = who->s_ef.a_str;
	if (str > 24)			/* > 24 */
		hitplus = str - 21;
	else if (str == 24)		/* 24 */
		hitplus = 3;
	else if (str > 20)		/* 21 to 23 */
		hitplus = 2;
	else if(str >= 17)		/* 17 to 20 */
		hitplus = 1;
	else if(str > 7)		/* 8 to 16 */
		hitplus = 0;
	else if(str > 5)		/* 6 to 7 */
		hitplus = -1;
	else if(str > 3)		/* 4 to 5 */
		hitplus = -2;
	else
		hitplus = -3;		/* < 4 */
	if (who == him)			/* add pack weight if hero */
		hitplus += hitweight();
	return hitplus;
}

// Assembly:
pushq %rbx
movl 0x10(%rdi), %eax
cmpl $0x19, %eax
jl 0x1201c
addl $-0x15, %eax
movl %eax, %ebx
jmp 0x12056
movl $0x3, %ebx
cmpl $0x18, %eax
je 0x12056
movl $0x2, %ebx
cmpl $0x14, %eax
jg 0x12056
movl $0x1, %ebx
cmpl $0x10, %eax
jg 0x12056
xorl %ebx, %ebx
cmpl $0x7, %eax
jg 0x12056
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x5, %eax
jg 0x12056
xorl %ebx, %ebx
cmpl $0x4, %eax
setge %bl
addl $-0x3, %ebx
leaq 0x1bd03(%rip), %rax     # 0x2dd60
cmpq %rdi, (%rax)
jne 0x1206b
xorl %eax, %eax
callq 0x9942
addl %eax, %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pstats.c
// Function: add_dam
int add_dam(struct stats *who)
{
	int exdam, str;

	exdam = 0;
	str = who->s_ef.a_str;
	if (str > 24)			/* > 24 */
		exdam = str - 18;
	else if (str == 24)		/* 24 */
		exdam = 6;
	else if (str == 23)		/* 23 */
		exdam = 5;
	else if (str > 20)		/* 21 to 22 */
		exdam = 4;
	else if (str > 18)		/* 19 to 20 */
		exdam = 3;
	else if (str == 18)		/* 18 */
		exdam = 2;
	else if (str > 15)		/* 16 to 17 */
		exdam = 1;
	else if (str > 6)		/* 7 to 14 */
		exdam = 0;
	else
		exdam = -1;			/* 3 to 6 */
	if (who == him)
		exdam += hungdam();		/* add hungry state if hero */
	return exdam;
}

// Assembly:
movl 0x10(%rdi), %ecx
cmpl $0x19, %ecx
jl 0x1207e
addl $-0x12, %ecx
movl %ecx, %eax
jmp 0x120c5
cmpl $0x18, %ecx
je 0x1208f
cmpl $0x17, %ecx
jne 0x12096
movl $0x5, %eax
jmp 0x120c5
movl $0x6, %eax
jmp 0x120c5
movl $0x4, %eax
cmpl $0x14, %ecx
jg 0x120c5
movl $0x3, %eax
cmpl $0x12, %ecx
jg 0x120c5
movl $0x2, %eax
je 0x120c5
movl $0x1, %eax
cmpl $0xf, %ecx
jg 0x120c5
xorl %eax, %eax
cmpl $0x7, %ecx
setl %al
negl %eax
leaq 0x1bc94(%rip), %rcx     # 0x2dd60
cmpq %rdi, (%rcx)
je 0x120d2
retq
leaq 0x1b7b7(%rip), %rcx     # 0x2d890
movl (%rcx), %ecx
xorl %edx, %edx
cmpl $0x2, %ecx
sete %dl
negl %edx
cmpl $0x3, %ecx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
cmovnel %edx, %ecx
addl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/pstats.c
// Function: heal_self
void heal_self(int factor,bool updmaxhp)
{
	him->s_hpt += roll(him->s_lvl + getpcon(him), factor);
	if (updmaxhp)
		him->s_maxhp += 1;
	if (him->s_hpt > him->s_maxhp)
		him->s_hpt = him->s_maxhp;
	nochange = FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
leaq 0x1bc3c(%rip), %r15     # 0x2dd60
movq (%r15), %rdi
movl 0x28(%rdi), %r14d
callq 0x11fe4
addl %eax, %r14d
movl %r14d, %edi
movl %ebp, %esi
callq 0xc695
movq (%r15), %rcx
addl 0x30(%rcx), %eax
movl %eax, 0x30(%rcx)
movl 0x34(%rcx), %edx
testl %ebx, %ebx
je 0x12152
incl %edx
movl %edx, 0x34(%rcx)
cmpl %edx, %eax
jle 0x12159
movl %edx, 0x30(%rcx)
leaq 0x1b743(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/rings.c
// Function: gethand
bool gethand(bool isrmv)
{
	int c;
	char *ptr;
	struct object *obj;

	while(1) {
		addmsg("Left or Right ring");
		if (isrmv)
			addmsg(starlist);
		addmsg("? ");
		endmsg();
		c = readchar();
		if (isupper(c))
			c = tolower(c);
		if (c == '*' && isrmv) {
			wclear(hw);
			obj = cur_ring[LEFT];
			if (obj != NULL)
				ptr = inv_name(obj, TRUE);
			else
				ptr = "none";
			wprintw(hw, "L)  %s\n\r",ptr);
			obj = cur_ring[RIGHT];
			if (obj != NULL)
				ptr = inv_name(obj, TRUE);
			else
				ptr = "none";
			wprintw(hw, "R)  %s\n\r", ptr);
			wprintw(hw, "\n\r\nWhich hand? ");
			draw(hw);
			c = readchar();
			if (isupper(c))
				c = tolower(c);
			restscr(cw);
		}
		if (c == 'l')
			return LEFT;
		else if (c == 'r')
			return RIGHT;
		else if (c == ESCAPE)
			return -1;
		mpos = 0;
		msg("L or R");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %ebx, %r13d
xorb $0x1, %r13b
leaq 0x1e4df(%rip), %r14     # 0x309e8
leaq 0xf8eb(%rip), %r12      # 0x21dfb
leaq 0xf8d1(%rip), %rdi      # 0x21de8
xorl %eax, %eax
callq 0xb737
testb %bl, %bl
je 0x12530
leaq 0x17e77(%rip), %rdi     # 0x2a3a0
xorl %eax, %eax
callq 0xb737
leaq 0x10093(%rip), %rdi     # 0x225ca
xorl %eax, %eax
callq 0xb737
xorl %eax, %eax
callq 0xb7e6
xorl %eax, %eax
callq 0xb94c
movsbl %al, %r15d
callq 0x65b0
movq %rax, %rbp
movq (%rax), %rax
movsbq %r15b, %rcx
testb $0x1, 0x1(%rax,%rcx,2)
je 0x12571
movl %r15d, %edi
callq 0x6310
movl %eax, %r15d
cmpl $0x2a, %r15d
setne %al
orb %r13b, %al
jne 0x12637
movq (%r14), %rdi
callq 0x6120
leaq 0x1b7c0(%rip), %rax     # 0x2dd50
movq (%rax), %rdi
movq %r12, %rdx
testq %rdi, %rdi
je 0x125a8
movl $0x1, %esi
callq 0x1aa04
movq %rax, %rdx
movq (%r14), %rdi
leaq 0xf84e(%rip), %rsi      # 0x21e00
xorl %eax, %eax
callq 0x6510
leaq 0x1b790(%rip), %rax     # 0x2dd50
movq 0x8(%rax), %rdi
movq %r12, %rdx
testq %rdi, %rdi
je 0x125d9
movl $0x1, %esi
callq 0x1aa04
movq %rax, %rdx
movq (%r14), %rdi
leaq 0xf826(%rip), %rsi      # 0x21e09
xorl %eax, %eax
callq 0x6510
movq (%r14), %rdi
leaq 0xf81e(%rip), %rsi      # 0x21e12
xorl %eax, %eax
callq 0x6510
movq (%r14), %rdi
callq 0x6200
xorl %eax, %eax
callq 0xb94c
movsbl %al, %r15d
movq (%rbp), %rax
movsbq %r15b, %rcx
testb $0x1, 0x1(%rax,%rcx,2)
je 0x12628
movl %r15d, %edi
callq 0x6310
movl %eax, %r15d
leaq 0x1e3b1(%rip), %rax     # 0x309e0
movq (%rax), %rdi
callq 0xbd09
cmpl $0x6c, %r15d
je 0x12669
cmpl $0x1b, %r15d
je 0x12669
cmpl $0x72, %r15d
je 0x12669
leaq 0x1b220(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
leaq 0xf7c5(%rip), %rdi      # 0x21e22
xorl %eax, %eax
callq 0xb620
jmp 0x12510
cmpl $0x6c, %r15d
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/rings.c
// Function: ring_off
int ring_off()
{
	int ring;
	struct object *obj;
	
	if (cur_ring[LEFT] == NULL && cur_ring[RIGHT] == NULL) {
		msg("You're not wearing any rings.");
		return 0;
	}
	else if (cur_ring[LEFT] == NULL)
		ring = RIGHT;
	else if (cur_ring[RIGHT] == NULL)
		ring = LEFT;
	else
		if ((ring = gethand(TRUE)))
			return 0;
	mpos = 0;
	obj = cur_ring[ring];
	if (obj == NULL) {
		msg("Not wearing such a ring.");
		return 0;
	}
	if (dropcheck(obj)) {
		msg("Was wearing %s", inv_name(obj, TRUE));
		nochange = FALSE;
		ringfood = ring_eat();
	}
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1b6c6(%rip), %r14     # 0x2dd50
movq (%r14), %rax
movq 0x8(%r14), %rbx
testq %rax, %rax
je 0x126ce
testq %rbx, %rbx
movq %rax, %rbx
je 0x126d3
movl $0x1, %edi
callq 0x124ee
testb %al, %al
jne 0x12732
movq (%r14), %rbx
leaq 0x1b1b6(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
testq %rbx, %rbx
jne 0x126e0
leaq 0xf6f4(%rip), %rdi      # 0x21dc0
jmp 0x1272b
testq %rbx, %rbx
je 0x12724
leaq 0x1b196(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x1b54e
testb %al, %al
je 0x12732
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1aa04
leaq 0xf6d9(%rip), %rdi      # 0x21dd9
movq %rax, %rsi
xorl %eax, %eax
callq 0xb620
leaq 0x1b192(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
callq 0x128e5
leaq 0x1b174(%rip), %rcx     # 0x2d894
movl %eax, (%rcx)
jmp 0x12732
leaq 0xf677(%rip), %rdi      # 0x21da2
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/rings.c
// Function: toss_ring
void toss_ring(struct object *what)
{
	bool okring;

	/*
	 * okring = FALSE when:
	 * 1) ring is cursed and benefit = plus
	 * 2) ring is blessed and benefit = minus
	 */
	okring = !((what->o_ac > 0 && o_on(what, ISCURSED)) ||
	          (what->o_ac < 0 && o_on(what, ISBLESS)));

	cur_ring[what == cur_ring[LEFT] ? LEFT : RIGHT] = NULL;
	if (okring) {
		switch (what->o_which) {
			case R_SPEED:
				extinguish(nohaste);
				nohaste(FALSE);
			when R_BLIND:
				sight(FALSE);
			when R_SLOW:
				player.t_flags &= ~ISSLOW;
			when R_SAPEM:
				extinguish(sapem);
			when R_GIANT:
				him->s_ef = him->s_re;
				ringabil();
			when R_ADDSTR:
				chg_abil(STR,-what->o_ac,FALSE);
			when R_KNOW:
				chg_abil(WIS,-what->o_ac,FALSE);
			when R_DEX:
				chg_abil(DEX,-what->o_ac,FALSE);
			when R_CONST:
				chg_abil(CON,-what->o_ac,FALSE);
			when R_SEEINVIS:
				player.t_flags &= ~CANSEE;
				extinguish(unsee);
				light(&hero);
				mvwaddch(cw, hero.y, hero.x, PLAYER);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x34(%rdi), %eax
testl %eax, %eax
jle 0x1277a
movl $0x1, %esi
movq %rbx, %rdi
callq 0x9531
testb %al, %al
je 0x12777
leaq 0x1b5ee(%rip), %rax     # 0x2dd50
xorl %ecx, %ecx
cmpq %rbx, (%rax)
setne %cl
movq $0x0, (%rax,%rcx,8)
jmp 0x1285d
movl 0x34(%rbx), %eax
testl %eax, %eax
js 0x12797
leaq 0x1b5cb(%rip), %rax     # 0x2dd50
xorl %ecx, %ecx
cmpq %rbx, (%rax)
setne %cl
movq $0x0, (%rax,%rcx,8)
jmp 0x127c3
movl $0x20, %esi
movq %rbx, %rdi
callq 0x9531
leaq 0x1b5a5(%rip), %rcx     # 0x2dd50
xorl %edx, %edx
cmpq %rbx, (%rcx)
setne %dl
movq $0x0, (%rcx,%rdx,8)
testb %al, %al
jne 0x1285d
movl 0x28(%rbx), %eax
decl %eax
cmpl $0x18, %eax
ja 0x1285d
leaq 0xf430(%rip), %rcx      # 0x21c08
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %esi, %esi
subl 0x34(%rbx), %esi
movl $0x1, %edi
jmp 0x128d7
xorl %esi, %esi
subl 0x34(%rbx), %esi
movl $0x3, %edi
jmp 0x128d7
leaq 0x1b45a(%rip), %rax     # 0x2dc60
andb $-0x41, 0x79(%rax)
jmp 0x1285d
leaq 0x1b44d(%rip), %r14     # 0x2dc60
andb $-0x11, 0x79(%r14)
leaq -0x9985(%rip), %rdi     # 0x8e9a
callq 0x8c14
leaq 0x50(%r14), %rdi
callq 0xeba8
leaq 0x1e1ac(%rip), %rbx     # 0x309e0
movq (%rbx), %rdi
movl 0x50(%r14), %edx
movl 0x54(%r14), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0x1285d
movq (%rbx), %rdi
movl $0x40, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x64c0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1b4f4(%rip), %rax     # 0x2dd60
movq (%rax), %rax
movups (%rax), %xmm0
movups %xmm0, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x12abb
leaq -0x9797(%rip), %rdi     # 0x90f2
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8c14
leaq -0x99bf(%rip), %rdi     # 0x8edd
callq 0x8c14
xorl %edi, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8edd
xorl %edi, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8ea8
xorl %esi, %esi
subl 0x34(%rbx), %esi
movl $0x2, %edi
jmp 0x128d7
xorl %esi, %esi
subl 0x34(%rbx), %esi
movl $0x4, %edi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11d8e
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/rings.c
// Function: ring_eat
int ring_eat()
{
	struct object *lb;
	int hand, i, howmuch;
	bool addit;

	howmuch = 0;
	addit = TRUE;
	for (i = LEFT; i <= RIGHT ; i += 1) {
		lb = cur_ring[i];
		if (lb != NULL) {
			switch (lb->o_which) {
				case R_REGEN:
				case R_GIANT:
					howmuch += 2;
				when R_SPEED:
				case R_SUSTSTR:
				case R_SUSAB:
					howmuch += 1;
				when R_SEARCH:
					howmuch += (rnd(100) < 33);
				when R_DIGEST:
					switch(lb->o_ac) {
						case -3: if (rnd(100) < 25)
									howmuch += 3;
						when -2: if (rnd(100) < 50)
									howmuch += 2;
						when -1: howmuch += 1;
						when  0: howmuch -= (rnd(100) < 50);
						when  3: if (rnd(100) < 25)
									howmuch -= 3;
						when  2: if (rnd(100) < 50)
									howmuch -= 2;
						default: howmuch -= 1;
					}
				otherwise:
					addit = FALSE;
			}
			if (addit) {
				if (o_on(lb, ISBLESS))
					howmuch -= 1;
				else if (o_on(lb, ISCURSED))
					howmuch += 1;
			}
		}
	}
	return howmuch;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, %bpl
leaq 0x1b456(%rip), %r15     # 0x2dd50
leaq 0xf36b(%rip), %r12      # 0x21c6c
xorl %eax, %eax
movb $0x1, %r13b
xorl %ebx, %ebx
movq (%r15,%rax,8), %r14
testq %r14, %r14
je 0x12a1e
movl 0x28(%r14), %eax
leal -0x2(%rax), %ecx
cmpl $0xe, %ecx
ja 0x12931
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
incl %ebx
jmp 0x129e9
cmpl $0x13, %eax
jne 0x12a04
addl $0x2, %ebx
jmp 0x129e9
movl 0x34(%r14), %eax
addl $0x3, %eax
cmpl $0x6, %eax
ja 0x129e7
leaq 0xf34f(%rip), %rcx      # 0x21ca8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
leal 0x3(%rbx), %ecx
jmp 0x129ae
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
xorl %ecx, %ecx
cmpl $0x21, %eax
setl %cl
addl %ecx, %ebx
jmp 0x129e9
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
leal 0x2(%rbx), %ecx
cmpl $0x32, %eax
jmp 0x129b1
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
leal -0x3(%rbx), %ecx
cmpl $0x19, %eax
cmovgel %ebx, %ecx
movl %ecx, %ebx
jmp 0x129e9
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
xorl %ecx, %ecx
cmpl $0x32, %eax
setl %cl
subl %ecx, %ebx
jmp 0x129e9
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
leal -0x2(%rbx), %ecx
cmpl $0x32, %eax
cmovgel %ebx, %ecx
movl %ecx, %ebx
decl %ebx
testb $0x1, %r13b
je 0x12a04
movl $0x20, %esi
movq %r14, %rdi
callq 0x9531
testb %al, %al
je 0x12a09
decl %ebx
jmp 0x12a1b
xorl %r13d, %r13d
jmp 0x12a1e
movl $0x1, %esi
movq %r14, %rdi
callq 0x9531
movzbl %al, %eax
addl %eax, %ebx
movb $0x1, %r13b
movl $0x1, %eax
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x12908
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/rings.c
// Function: ring_num
char * ring_num(struct object *what)
{
	static char number[5];

	number[0] = '\0';
	if (o_on(what,ISKNOW) || o_on(what,ISPOST)) {
		if (magring(what)) {	/* only rings with numbers */
			number[0] = ' ';
			strcpy(&number[1], num(what->o_ac, 0));
		}
	}
	return number;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0x2046a(%rip)     # 0x32eb8
movl $0x2, %esi
callq 0x9531
testb %al, %al
jne 0x12a6d
movl $0x4, %esi
movq %rbx, %rdi
callq 0x9531
testb %al, %al
je 0x12a9f
movl 0x28(%rbx), %eax
cmpl $0x19, %eax
ja 0x12a9f
movl $0x30025a3, %ecx        # imm = 0x30025A3
btl %eax, %ecx
jae 0x12a9f
movb $0x20, 0x20432(%rip)    # 0x32eb8
movl 0x34(%rbx), %edi
xorl %esi, %esi
callq 0x1cc59
leaq 0x20422(%rip), %rdi     # 0x32eb9
movq %rax, %rsi
callq 0x60e0
leaq 0x20412(%rip), %rax     # 0x32eb8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/rings.c
// Function: ringabil
void ringabil()
{
	struct object *rptr;
	int i;

	for(i = LEFT; i <= RIGHT; i++) {
		rptr = cur_ring[i];
		if (rptr != NULL) {
			switch(rptr->o_which) {
				case R_ADDSTR:
					chg_abil(STR,rptr->o_ac,FROMRING);
				when R_DEX: 
					chg_abil(DEX,rptr->o_ac,FROMRING);
				when R_KNOW:
					chg_abil(WIS,rptr->o_ac,FROMRING);
				when R_CONST:
					chg_abil(CON,rptr->o_ac,FROMRING);
			}
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movb $0x1, %bl
xorl %eax, %eax
leaq 0x1b286(%rip), %r14     # 0x2dd50
movq (%r14,%rax,8), %rax
testq %rax, %rax
je 0x12b0f
movl 0x28(%rax), %edi
cmpl $0x17, %edi
jg 0x12aec
cmpl $0x1, %edi
je 0x12b02
cmpl $0x5, %edi
jne 0x12b0f
movl $0x3, %edi
jmp 0x12b02
cmpl $0x18, %edi
je 0x12afd
cmpl $0x19, %edi
jne 0x12b0f
movl $0x2, %edi
jmp 0x12b02
movl $0x4, %edi
movl 0x34(%rax), %esi
movl $0x2, %edx
callq 0x11d8e
movl $0x1, %eax
testb $0x1, %bl
movl $0x0, %ebx
jne 0x12aca
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/rings.c
// Function: init_ring
void init_ring(struct object *what,bool fromwiz) // fromwiz == TRUE when wizard
{
	int much;

	switch (what->o_which) {
		case R_DIGEST:		/* -3 to +3 rings */
		case R_ADDSTR:
		case R_PROTECT:
		case R_ADDHIT:
		case R_ADDDAM:
		case R_DEX:
		case R_KNOW:
		case R_CONST:
			if (fromwiz) {
				much = getbless();		/* get wizards response */
			}
			else {						/* normal users */
				if (rnd(100) < 25)
					much = -rnd(3) - 1;
				else
					much = rnd(3) + 1;
			}
			what->o_ac = much;
			if (much < 0)
				setoflg(what,ISCURSED);
		when R_SPEED:
			what->o_ac = rnd(4) + 1;
		when R_AGGR:
		case R_DELUS:
		case R_HEAVY:
		case R_BLIND:
		case R_SLOW:
		case R_SAPEM:
		case R_TELEPORT:
			what->o_ac = 0;
			setoflg(what,ISCURSED);	
		when R_GIANT:
			what->o_ac = 25;		/* lots !! of STR */
		otherwise:
			what->o_ac = 1;
	}
	what->o_type = RING;
	what->o_weight = things[TYP_RING].mi_wght;
	what->o_typname = things[TYP_RING].mi_name;
	what->o_vol = itemvol(what);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x28(%rdi), %eax
cmpq $0x19, %rax
ja 0x12bda
leaq 0xf184(%rip), %rcx      # 0x21cc4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testb %sil, %sil
je 0x12b60
xorl %eax, %eax
callq 0x1d4c5
jmp 0x12b85
movl $0x0, 0x34(%rbx)
jmp 0x12b8c
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
movl %eax, %ebp
movl $0x3, %edi
xorl %eax, %eax
callq 0xc674
cmpl $0x18, %ebp
jg 0x12b83
notl %eax
jmp 0x12b85
incl %eax
movl %eax, 0x34(%rbx)
testl %eax, %eax
jns 0x12b99
movl $0x1, %esi
movq %rbx, %rdi
callq 0x9553
movl $0x3d, 0x20(%rbx)
leaq 0x19229(%rip), %rax     # 0x2bdd0
movl 0x5c(%rax), %ecx
movl %ecx, 0x40(%rbx)
movq 0x50(%rax), %rax
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
callq 0x978c
movl %eax, 0x44(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x4, %edi
xorl %eax, %eax
callq 0xc674
incl %eax
movl %eax, 0x34(%rbx)
jmp 0x12b99
movl $0x1, 0x34(%rbx)
jmp 0x12b99
movl $0x19, 0x34(%rbx)
jmp 0x12b99
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/rings.c
// Function: ringex
int ringex(int rtype)
{
	int howmuch = 0;

	if (isring(LEFT, rtype))
		howmuch += cur_ring[LEFT]->o_ac;
	if (isring(RIGHT, rtype))
		howmuch += cur_ring[RIGHT]->o_ac;
	return howmuch;
}

// Assembly:
leaq 0x1b15d(%rip), %rcx     # 0x2dd50
movq (%rcx), %rdx
xorl %eax, %eax
testq %rdx, %rdx
je 0x12c05
cmpl %edi, 0x28(%rdx)
jne 0x12c05
movl 0x34(%rdx), %eax
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
je 0x12c16
cmpl %edi, 0x28(%rcx)
jne 0x12c16
addl 0x34(%rcx), %eax
retq