LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/encumb.c
// Function: updpack
void updpack()
{
	int topcarry, curcarry;

	him->s_carry = totalenc();			/* get total encumb */
	curcarry = packweight();			/* get pack weight */
	topcarry = him->s_carry / 5;		/* 20% of total carry */
	if (curcarry > 4 * topcarry) {
		if (rnd(100) < 80)
			foodlev = 3;				/* > 80% of pack */
	}
	else if (curcarry > 3 * topcarry) {
		if (rnd(100) < 60)
			foodlev = 2;				/* > 60% of pack */
	}
	else
		foodlev = 1;					/* <= 60% of pack */
	him->s_pack = curcarry;				/* update pack weight */
	packvol = pack_vol();				/* update pack volume */
	nochange = FALSE;					/* also change display */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x9857
leaq 0x247f0(%rip), %r14     # 0x2dd60
movq (%r14), %rcx
movl %eax, 0x3c(%rcx)
callq 0x9629
movl %eax, %ebx
movq (%r14), %rax
movslq 0x3c(%rax), %rax
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x21, %rax
addl %ecx, %eax
leal (,%rax,4), %ecx
cmpl %ecx, %ebx
jle 0x95bb
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
movl $0x3, %ecx
cmpl $0x50, %eax
jl 0x95dd
jmp 0x95e6
leal (%rax,%rax,2), %eax
movl $0x1, %ecx
cmpl %eax, %ebx
jle 0x95dd
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
movl $0x2, %ecx
cmpl $0x3b, %eax
jg 0x95e6
leaq 0x20d24(%rip), %rax     # 0x2a308
movl %ecx, (%rax)
movq (%r14), %rax
movl %ebx, 0x38(%rax)
leaq 0x2466d(%rip), %rax     # 0x2dc60
movq 0x68(%rax), %r14
xorl %ebx, %ebx
testq %r14, %r14
je 0x960e
movq 0x10(%r14), %rdi
callq 0x978c
addl %eax, %ebx
movq (%r14), %r14
jmp 0x95f9
leaq 0x2425f(%rip), %rax     # 0x2d874
movl %ebx, (%rax)
leaq 0x24285(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/encumb.c
// Function: packweight
int packweight()
{
	struct object *obj;
	struct linked_list *pc;
	int weight, i;

	weight = 0;
	for (pc = pack ; pc != NULL ; pc = next(pc)) {
		obj = OBJPTR(pc);
		weight += itemweight(obj) * obj->o_count;
	}
	if (weight < 0)		/* in case of amulet */
		 weight = 0;
	for (i = LEFT; i <= RIGHT; i += 1) {
		obj = cur_ring[i];
		if (obj != NULL) {
			if (obj->o_type == R_HEAVY && o_off(obj, ISBLESS))
				weight += weight / 4;
		}
	}
	return weight;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x24628(%rip), %rax     # 0x2dc60
movq 0x68(%rax), %r12
xorl %r15d, %r15d
movl $0x0, %ebx
testq %r12, %r12
je 0x9668
xorl %ebx, %ebx
movq 0x10(%r12), %r14
movq %r14, %rdi
callq 0x96b8
imull 0x24(%r14), %eax
addl %eax, %ebx
movq (%r12), %r12
testq %r12, %r12
jne 0x964b
testl %ebx, %ebx
cmovlel %r15d, %ebx
movb $0x1, %bpl
leaq 0x246d8(%rip), %r14     # 0x2dd50
movq (%r14,%r15,8), %rdi
testq %rdi, %rdi
je 0x969c
cmpl $0x15, 0x20(%rdi)
jne 0x969c
movl $0x20, %esi
callq 0x9540
testb %al, %al
je 0x969c
movl %ebx, %eax
shrl $0x2, %eax
addl %eax, %ebx
movl $0x1, %r15d
testb $0x1, %bpl
movl $0x0, %ebp
jne 0x9678
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/encumb.c
// Function: itemweight
int itemweight(struct object *wh)
{
	int weight;

	weight = wh->o_weight;		/* get base weight */
	switch (wh->o_type) {
		case ARMOR:
			if ((armors[wh->o_which].a_class - wh->o_ac) > 0)
				weight /= 2;
		when WEAPON:
			if ((wh->o_hplus + wh->o_dplus) > 0)
				weight /= 2;
	}
	if (o_on(wh,ISCURSED))
		weight += weight / 5;	/* 20% more for cursed */
	if (o_on(wh, ISBLESS))
		weight -= weight / 5;	/* 20% less for blessed */
	return weight;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x20(%rdi), %eax
movl 0x40(%rdi), %ebx
cmpl $0x29, %eax
je 0x96e9
cmpl $0x5d, %eax
jne 0x96fe
movslq 0x28(%r14), %rax
leaq (%rax,%rax,2), %rax
leaq 0x22832(%rip), %rcx     # 0x2bf10
movl (%rcx,%rax,4), %eax
cmpl 0x34(%r14), %eax
jg 0x96f3
jmp 0x96fe
movl 0x30(%r14), %eax
addl 0x2c(%r14), %eax
jle 0x96fe
movl %ebx, %eax
shrl $0x1f, %eax
addl %ebx, %eax
sarl %eax
movl %eax, %ebx
movl $0x1, %esi
movq %r14, %rdi
callq 0x9531
testb %al, %al
je 0x9728
movslq %ebx, %rbx
imulq $0x66666667, %rbx, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x21, %rax
addl %ecx, %eax
addl %eax, %ebx
movl $0x20, %esi
movq %r14, %rdi
callq 0x9531
testb %al, %al
je 0x9752
movslq %ebx, %rbx
imulq $-0x66666667, %rbx, %rax # imm = 0x99999999
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x21, %rax
addl %ecx, %eax
addl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/encumb.c
// Function: pack_vol
int pack_vol()
{
	struct object *obj;
	struct linked_list *pc;
	int volume;

	volume = 0;
	for (pc = pack ; pc != NULL ; pc = next(pc)) {
		obj = OBJPTR(pc);
		volume += itemvol(obj);
	}
	return volume;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x244f9(%rip), %rax     # 0x2dc60
movq 0x68(%rax), %r14
xorl %ebx, %ebx
testq %r14, %r14
je 0x9782
movq 0x10(%r14), %rdi
callq 0x978c
addl %eax, %ebx
movq (%r14), %r14
jmp 0x976d
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/encumb.c
// Function: itemvol
int itemvol(struct object *wh)
{
	int volume, what, extra;

	extra = 0;
	what = getindex(wh->o_type);
	switch (wh->o_type) {
		case ARMOR:		extra = armors[wh->o_which].a_vol;
		when WEAPON:	extra = weaps[wh->o_which].w_vol;
		when STICK:		if (strcmp(ws_stuff[wh->o_which].ws_type,"staff") == 0)
							extra = V_WS_STAFF;
						else
							extra = V_WS_WAND;
	}
	volume = thnginfo[what].mf_vol + extra;
	volume *= wh->o_count;
	return volume;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movsbl 0x20(%rdi), %edi
callq 0xc9eb
movl %eax, %ebp
movl 0x20(%rbx), %ecx
cmpl $0x29, %ecx
je 0x97f6
cmpl $0x2f, %ecx
je 0x97c6
xorl %eax, %eax
cmpl $0x5d, %ecx
jne 0x9809
movslq 0x28(%rbx), %rax
leaq (%rax,%rax,2), %rax
leaq 0x22750(%rip), %rcx     # 0x2bf10
movl 0x8(%rcx,%rax,4), %eax
jmp 0x9809
movslq 0x28(%rbx), %rax
leaq (%rax,%rax,2), %rax
leaq 0x26f9b(%rip), %rcx     # 0x30770
movq (%rcx,%rax,8), %rdi
leaq 0x1665f(%rip), %rsi     # 0x1fe3f
callq 0x6250
testl %eax, %eax
movl $0xc8, %ecx
movl $0x6e, %eax
cmovel %ecx, %eax
jmp 0x9809
movslq 0x28(%rbx), %rax
shlq $0x5, %rax
leaq 0x228bb(%rip), %rcx     # 0x2c0c0
movl 0x18(%rcx,%rax), %eax
movslq %ebp, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x23159(%rip), %rdx     # 0x2c970
addl 0x4(%rdx,%rcx,8), %eax
imull 0x24(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/encumb.c
// Function: totalenc
int totalenc()
{
	int wtotal;

	wtotal = NORMENCB + playenc();
	switch(hungry_state) {
		case F_OKAY:
		case F_HUNGRY:	;						/* no change */
		when F_WEAK:	wtotal -= wtotal / 10;	/* 10% off weak */
		when F_FAINT:	wtotal /= 2;			/* 50% off faint */
	}
	return wtotal;
}

// Assembly:
pushq %rax
callq 0x9826
addl $0x5dc, %eax            # imm = 0x5DC
leaq 0x24027(%rip), %rcx     # 0x2d890
movl (%rcx), %ecx
cmpl $0x3, %ecx
je 0x9885
cmpl $0x2, %ecx
jne 0x9887
movzwl %ax, %ecx
imull $0xcccd, %ecx, %ecx     # imm = 0xCCCD
shrl $0x13, %ecx
subl %ecx, %eax
jmp 0x9887
shrl %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/encumb.c
// Function: wghtchk
int wghtchk(int fromfuse)
{
	int dropchk, err = TRUE;
	char ch;

	inwhgt = TRUE;
	if (him->s_pack > him->s_carry) {
		ch = player.t_oldch;
		extinguish(wghtchk);
		if ((ch != FLOOR && ch != PASSAGE) || isfight) {
			fuse(wghtchk, TRUE, 1);
			inwhgt = FALSE;
			return 0;
		}
		msg("Your pack is too heavy for you.");
		do {
			dropchk = drop(NULL);
			if (dropchk == SOMTHERE)
				err = FALSE;
			else if (dropchk == FALSE) {
				mpos = 0;
				msg("You must drop something");
			}
			if (dropchk == TRUE)
				err = FALSE;
		} while(err);
	}
	inwhgt = FALSE;
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x24006(%rip), %r14     # 0x2d89b
movb $0x1, (%r14)
leaq 0x244c0(%rip), %rax     # 0x2dd60
movq (%rax), %rax
movl 0x38(%rax), %ecx
cmpl 0x3c(%rax), %ecx
jle 0x98f1
leaq 0x243ae(%rip), %rax     # 0x2dc60
movzbl 0x8f(%rax), %ebx
leaq -0x37(%rip), %rdi       # 0x9889
callq 0x8c14
cmpl $0x2e, %ebx
je 0x98cf
cmpl $0x23, %ebx
jne 0x98db
leaq 0x23fc2(%rip), %rax     # 0x2d898
cmpb $0x1, (%rax)
jne 0x98fd
leaq -0x59(%rip), %rdi       # 0x9889
movl $0x1, %esi
movl $0x1, %edx
callq 0x8ba7
movb $0x0, (%r14)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x15e9d(%rip), %rdi     # 0x1f7a1
xorl %eax, %eax
callq 0xb620
xorl %edi, %edi
callq 0x1b33b
testb %al, %al
jne 0x98f1
leaq 0x23f53(%rip), %r15     # 0x2d870
leaq 0x15e9d(%rip), %rbx     # 0x1f7c1
movl $0x0, (%r15)
movq %rbx, %rdi
xorl %eax, %eax
callq 0xb620
xorl %edi, %edi
callq 0x1b33b
testb %al, %al
je 0x9924
jmp 0x98f1
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/fight.c
// Function: prname
char *prname(char *who,bool upper)
{
static char tbuf[LINLEN];

	*tbuf = '\0';
	if (who == 0)
		strcpy(tbuf, "you"); 
	else if (pl_on(ISBLIND))
		strcpy(tbuf, "it");
	else {
		strcpy(tbuf, "the ");
		strcat(tbuf, who);
	}
	if (upper)
		*tbuf = toupper(*tbuf);
	return tbuf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movb $0x0, 0x234ee(%rip)     # 0x2d7f0
testq %rdi, %rdi
je 0xa32a
movq %rdi, %r14
movl $0x1, %edi
callq 0x9513
testb %al, %al
je 0xa336
movb $0x0, 0x234d3(%rip)     # 0x2d7f2
movw $0x7469, 0x234c8(%rip)  # imm = 0x7469
jmp 0xa356
movl $0x756f79, 0x234bc(%rip) # imm = 0x756F79
jmp 0xa356
movb $0x0, 0x234b7(%rip)     # 0x2d7f4
movl $0x20656874, 0x234a9(%rip) # imm = 0x20656874
leaq 0x234a2(%rip), %rdi     # 0x2d7f0
movq %r14, %rsi
callq 0x64d0
testb %bl, %bl
je 0xa373
callq 0x6030
movq (%rax), %rax
movsbq 0x23486(%rip), %rcx     # 0x2d7f0
movb (%rax,%rcx,4), %al
movb %al, 0x2347d(%rip)      # 0x2d7f0
leaq 0x23476(%rip), %rax     # 0x2d7f0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/fight.c
// Function: remove_monster
void remove_monster(struct coord *mp,struct linked_list *item)
{
	char what;

	mvwaddch(mw, mp->y, mp->x, ' ');
	if (pl_on(ISBLIND))
		what = ' ';							/* if blind, then a blank */
	else
		what = (THINGPTR(item))->t_oldch;	/* normal char */
	mvwaddch(cw, mp->y, mp->x, what);
	detach(mlist, item);
	discard(item);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x25c03(%rip), %r15     # 0x309f0
movq (%r15), %rdi
movl (%r14), %edx
movl 0x4(%r14), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0xae0e
movq (%r15), %rdi
movl $0x20, %esi
callq 0x64c0
movl $0x1, %edi
callq 0x9513
movl $0x20, %ebp
testb %al, %al
jne 0xae2c
movq 0x10(%rbx), %rax
movsbl 0x8f(%rax), %ebp
leaq 0x25bad(%rip), %r15     # 0x309e0
movq (%r15), %rdi
movl (%r14), %edx
movl 0x4(%r14), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0xae51
movq (%r15), %rdi
movl %ebp, %esi
callq 0x64c0
leaq 0x229e8(%rip), %rdi     # 0x2d840
movq %rbx, %rsi
callq 0xbd4c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xbdda
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/fight.c
// Function: check_level
void check_level()
{
	int lev, add, dif;

	for (lev = 0; e_levels[lev] != 0; lev++)
	if (e_levels[lev] > him->s_exp)
		break;
	lev += 1;
	if (lev > him->s_lvl) {
		dif = lev - him->s_lvl;
		add = roll(dif, 10) + (dif * getpcon(him));
		him->s_maxhp += add;
		if ((him->s_hpt += add) > him->s_maxhp)
			him->s_hpt = him->s_maxhp;
		msg("Welcome to level %d", lev);
	}
	him->s_lvl = lev;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x21b7d(%rip), %rdx     # 0x2ca30
movq (%rdx), %rsi
leaq 0x22ea3(%rip), %r15     # 0x2dd60
movq (%r15), %rax
testq %rsi, %rsi
je 0xaedf
movq 0x20(%rax), %rdi
xorl %ecx, %ecx
cmpq %rdi, %rsi
jg 0xaee1
movq 0x8(%rdx,%rcx,8), %rsi
incq %rcx
testq %rsi, %rsi
jne 0xaecb
jmp 0xaee1
xorl %ecx, %ecx
leal 0x1(%rcx), %ebx
movl 0x28(%rax), %edx
cmpl %edx, %ecx
jl 0xaf35
movl %ebx, %ebp
subl %edx, %ebp
movl %ebp, %edi
movl $0xa, %esi
callq 0xc695
movl %eax, %r14d
movq (%r15), %rdi
callq 0x11fe4
imull %ebp, %eax
addl %r14d, %eax
movq (%r15), %rcx
movl 0x34(%rcx), %edx
addl %eax, %edx
movl %edx, 0x34(%rcx)
addl 0x30(%rcx), %eax
cmpl %edx, %eax
cmovgel %edx, %eax
movl %eax, 0x30(%rcx)
leaq 0x14b79(%rip), %rdi     # 0x1faa2
movl %ebx, %esi
xorl %eax, %eax
callq 0xb620
movq (%r15), %rax
movl %ebx, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/init.c
// Function: init_things
void init_things()
{
	struct magic_item *mi;
	
	/*
	 * init general things
	 */
	for (mi = &things[1]; mi < &things[NUMTHINGS]; mi++)
		mi->mi_prob += (mi-1)->mi_prob;
	badcheck("things", things);
	/*
	 * init armor things
	 */
	for (mi = &a_magic[1]; mi < &a_magic[MAXARMORS]; mi++)
		mi->mi_prob += (mi-1)->mi_prob;
	badcheck("armor", a_magic);
	/*
	 * init weapon stuff
	 */
	for (mi = &w_magic[1]; mi < &w_magic[MAXWEAPONS]; mi++)
		mi->mi_prob += (mi-1)->mi_prob;
	badcheck("weapon", w_magic);
}

// Assembly:
pushq %rax
leaq 0x20db8(%rip), %rax     # 0x2bdd0
leaq 0x10(%rax), %rcx
subq $-0x80, %rax
movl -0x8(%rcx), %edx
addl %edx, 0x8(%rcx)
addq $0x10, %rcx
cmpq %rax, %rcx
jb 0xb020
leaq 0x15a16(%rip), %rdi     # 0x20a4c
leaq 0x20d93(%rip), %rsi     # 0x2bdd0
callq 0xb0b5
leaq 0x20e17(%rip), %rax     # 0x2be60
addq $0x10, %rax
movl $0xa0, %ecx
addq 0x1ef37(%rip), %rcx     # 0x29f90
movl -0x8(%rax), %edx
addl %edx, 0x8(%rax)
addq $0x10, %rax
cmpq %rcx, %rax
jb 0xb059
leaq 0x14f8b(%rip), %rdi     # 0x1fffa
leaq 0x20dea(%rip), %rsi     # 0x2be60
callq 0xb0b5
leaq 0x20f0e(%rip), %rax     # 0x2bf90
addq $0x10, %rax
movl $0x120, %ecx            # imm = 0x120
addq 0x1ee8e(%rip), %rcx     # 0x29f20
movl -0x8(%rax), %edx
addl %edx, 0x8(%rax)
addq $0x10, %rax
cmpq %rcx, %rax
jb 0xb092
leaq 0x14e3e(%rip), %rdi     # 0x1fee6
leaq 0x20ee1(%rip), %rsi     # 0x2bf90
popq %rax
jmp 0xb0b5
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/init.c
// Function: badcheck
int badcheck(char *name,struct magic_item *magic)
{
	struct magic_item *mg;

	for (mg = magic; mg->mi_name != NULL; mg++)
		;
	if ((mg - 1)->mi_prob == 1000)
		return 0;
	printf("\nBad percentages for %s:\n", name);
	for (mg = magic; mg->mi_name != NULL; mg++)
		printf("%4d%% %s\n", mg->mi_prob, mg->mi_name);
	printf("%s", retstr);
	fflush(stdout);
	while (getchar() != '\n')
		continue;
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %rsi
movq %rbx, %rax
cmpq $0x0, (%rax)
leaq 0x10(%rax), %rax
jne 0xb0c2
cmpl $0x3e8, -0x18(%rax)     # imm = 0x3E8
je 0xb13d
leaq 0x15994(%rip), %rdi     # 0x20a70
xorl %eax, %eax
callq 0x61c0
movq (%rbx), %rdx
testq %rdx, %rdx
je 0xb10f
addq $0x10, %rbx
leaq 0x15994(%rip), %r14     # 0x20a8a
movl -0x8(%rbx), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x61c0
movq (%rbx), %rdx
addq $0x10, %rbx
testq %rdx, %rdx
jne 0xb0f6
leaq 0x144d2(%rip), %rdi     # 0x1f5e8
leaq 0x1f223(%rip), %rsi     # 0x2a340
xorl %eax, %eax
callq 0x61c0
movq 0x1edd5(%rip), %rax     # 0x29f00
movq (%rax), %rdi
callq 0x6350
callq 0x6270
cmpl $0xa, %eax
jne 0xb133
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/init.c
// Function: init_colors
void init_colors()
{
	int i, j;
	char *str;
	bool used[NCOLORS];

	for (i = 0; i < NCOLORS; i++)
		used[i] = FALSE;
	for (i = 0; i < MAXPOTIONS; i++) {
		do {
			j = rnd(NCOLORS);
		} until (!used[j]);
		used[j] = TRUE;
		p_colors[i] = rainbow[j];
		p_know[i] = FALSE;
		p_guess[i] = NULL;
		if (i > 0)
			p_magic[i].mi_prob += p_magic[i-1].mi_prob;
	}
	badcheck("potions", p_magic);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
leaq 0x219b8(%rip), %rbx     # 0x2cb20
leaq 0x25481(%rip), %r14     # 0x305f0
leaq 0x2528a(%rip), %r15     # 0x30400
leaq 0x25013(%rip), %r12     # 0x30190
leaq 0x2132c(%rip), %r13     # 0x2c4b0
xorl %ebp, %ebp
movl $0x20, %edi
xorl %eax, %eax
callq 0xc674
cltq
cmpb $0x0, (%rsp,%rax)
jne 0xb186
movb $0x1, (%rsp,%rax)
movq (%rbx,%rax,8), %rax
movq %rax, (%r14,%rbp,8)
movb $0x0, (%r15,%rbp)
movq $0x0, (%r12,%rbp,8)
testq %rbp, %rbp
je 0xb1c9
movq %rbp, %rax
shlq $0x4, %rax
movl -0x8(%r13,%rax), %ecx
addl %ecx, 0x8(%r13,%rax)
incq %rbp
cmpq $0x15, %rbp
jne 0xb186
leaq 0x1587a(%rip), %rdi     # 0x20a53
leaq 0x212d0(%rip), %rsi     # 0x2c4b0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb0b5
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/init.c
// Function: init_names
void init_names()
{
	int nsyl;
	char *cp, *sp;
	int i, nwords;

	for (i = 0; i < MAXSCROLLS; i++) {
		cp = prbuf;
		nwords = rnd(3)+1;
		while(nwords--)	{
			nsyl = rnd(3)+2;
			while(nsyl--) {
				sp = sylls[rnd(NSYLS)];
				while(*sp)
					*cp++ = *sp++;
			}
			*cp++ = ' ';
		}
		*--cp = '\0';
		s_names[i] = new(strlen(prbuf)+1);
		s_know[i] = FALSE;
		s_guess[i] = NULL;
		strcpy(s_names[i], prbuf);
		if (i > 0)
			s_magic[i].mi_prob += s_magic[i-1].mi_prob;
	}
	badcheck("scrolls", s_magic);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x22c8b(%rip), %r15     # 0x2de90
leaq 0x21a14(%rip), %r12     # 0x2cc20
xorl %r13d, %r13d
movl $0x3, %edi
xorl %eax, %eax
callq 0xc674
movq %r15, %rbx
cmpl $-0x1, %eax
je 0xb279
movl %eax, %ebp
movq %r15, %rbx
movl $0x3, %edi
xorl %eax, %eax
callq 0xc674
cmpl $-0x2, %eax
je 0xb26e
movl %eax, %r14d
incl %r14d
movl $0x9f, %edi
xorl %eax, %eax
callq 0xc674
cltq
movq (%r12,%rax,8), %rax
movb (%rax), %cl
testb %cl, %cl
je 0xb268
incq %rax
movb %cl, (%rbx)
incq %rbx
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0xb25a
subl $0x1, %r14d
jae 0xb23f
movb $0x20, (%rbx)
incq %rbx
subl $0x1, %ebp
jae 0xb228
xorl %r14d, %r14d
movb %r14b, -0x1(%rbx)
movq %r15, %rdi
callq 0x6170
leal 0x1(%rax), %edi
callq 0xbe2a
leaq 0x25289(%rip), %rcx     # 0x30520
movq %rax, (%rcx,%r13,8)
leaq 0x2513e(%rip), %rcx     # 0x303e0
movb %r14b, (%rcx,%r13)
leaq 0x24e13(%rip), %rcx     # 0x300c0
movq $0x0, (%rcx,%r13,8)
movq %rax, %rdi
movq %r15, %rsi
callq 0x60e0
testq %r13, %r13
je 0xb2db
movq %r13, %rax
shlq $0x4, %rax
leaq 0x2102d(%rip), %rdx     # 0x2c300
movl -0x8(%rdx,%rax), %ecx
addl %ecx, 0x8(%rdx,%rax)
incq %r13
cmpq $0x1a, %r13
jne 0xb20f
leaq 0x1576c(%rip), %rdi     # 0x20a5b
leaq 0x2100a(%rip), %rsi     # 0x2c300
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb0b5
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/init.c
// Function: init_stones
void init_stones()
{
	int i, j;
	char *str;
	bool used[NSTONES];

	for (i = 0; i < NSTONES; i++)
		used[i] = FALSE;

	for (i = 0; i < MAXRINGS; i++) {
		do {
			j = rnd(NSTONES);
		} until (!used[j]);
		used[j] = TRUE;
		r_stones[i] = stones[j];
		r_know[i] = FALSE;
		r_guess[i] = NULL;
		if (i > 0)
			r_magic[i].mi_prob += r_magic[i-1].mi_prob;
	}
	badcheck("rings", r_magic);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x0, 0x1f(%rsp)
leaq 0x21dee(%rip), %rbx     # 0x2d120
leaq 0x25367(%rip), %r14     # 0x306a0
leaq 0x250e0(%rip), %r15     # 0x30420
leaq 0x24ef9(%rip), %r12     # 0x30240
leaq 0x212c2(%rip), %r13     # 0x2c610
xorl %ebp, %ebp
movl $0x23, %edi
xorl %eax, %eax
callq 0xc674
cltq
cmpb $0x0, (%rsp,%rax)
jne 0xb350
movb $0x1, (%rsp,%rax)
movq (%rbx,%rax,8), %rax
movq %rax, (%r14,%rbp,8)
movb $0x0, (%r15,%rbp)
movq $0x0, (%r12,%rbp,8)
testq %rbp, %rbp
je 0xb393
movq %rbp, %rax
shlq $0x4, %rax
movl -0x8(%r13,%rax), %ecx
addl %ecx, 0x8(%r13,%rax)
incq %rbp
cmpq $0x1a, %rbp
jne 0xb350
leaq 0x156c0(%rip), %rdi     # 0x20a63
leaq 0x21266(%rip), %rsi     # 0x2c610
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb0b5
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/init.c
// Function: init_materials
void init_materials()
{
	int i, j;
	char *str;
	struct rod *rd;
	bool metused[NMETAL], woodused[NWOOD];

	for (i = 0; i < NWOOD; i++)
		woodused[i] = FALSE;
	for (i = 0; i < NMETAL; i++)
		metused[i] = FALSE;

	for (i = 0; i < MAXSTICKS; i++) {
		rd = &ws_stuff[i];
		for (;;)  {
			if (rnd(100) > 50) {
				j = rnd(NMETAL);
				if (!metused[j]) {
					str = metal[j];
					rd->ws_type = "wand";
					rd->ws_vol = V_WS_WAND;
					rd->ws_wght = W_WS_WAND;
					metused[j] = TRUE;
					break;
				}
			}
			else {
				j = rnd(NWOOD);
				if (!woodused[j]) {
					str = wood[j];
					rd->ws_type = "staff";
					rd->ws_vol = V_WS_STAFF;
					rd->ws_wght = W_WS_WAND;
					woodused[j] = TRUE;
					break;
				}
			}
		} 
		ws_stuff[i].ws_made = str;
		ws_know[i] = FALSE;
		ws_guess[i] = NULL;
		if (i > 0)
			ws_magic[i].mi_prob += ws_magic[i-1].mi_prob;
	}
	badcheck("sticks", ws_magic);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorl %eax, %eax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %rax, (%rsp)
movq %rax, 0x7(%rsp)
leaq 0x25386(%rip), %rbx     # 0x30770
leaq 0x2504f(%rip), %r12     # 0x30440
leaq 0x24f18(%rip), %r13     # 0x30310
leaq 0x213c1(%rip), %rbp     # 0x2c7c0
xorl %r14d, %r14d
leaq (%r14,%r14,2), %r15
shlq $0x3, %r15
addq %rbx, %r15
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
cmpl $0x33, %eax
jl 0xb435
movl $0xf, %edi
xorl %eax, %eax
callq 0xc674
movslq %eax, %rcx
cmpb $0x0, (%rsp,%rcx)
jne 0xb40d
jmp 0xb46c
movl $0x18, %edi
xorl %eax, %eax
callq 0xc674
movslq %eax, %rcx
cmpb $0x0, 0x10(%rsp,%rcx)
jne 0xb40d
leaq (%rsp,%rcx), %rax
addq $0x10, %rax
leaq 0x21de6(%rip), %rdx     # 0x2d240
leaq (%rdx,%rcx,8), %rcx
movl $0xc8, %edx
leaq 0x149d5(%rip), %rsi     # 0x1fe3f
jmp 0xb487
leaq (%rsp,%rcx), %rax
leaq 0x21e89(%rip), %rdx     # 0x2d300
leaq (%rdx,%rcx,8), %rcx
movl $0x6e, %edx
leaq 0x14db6(%rip), %rsi     # 0x2023d
movq (%rcx), %rcx
movq %rsi, (%r15)
movl %edx, 0x10(%r15)
movl $0x3c, 0x14(%r15)
movb $0x1, (%rax)
movq %rcx, 0x8(%r15)
movb $0x0, (%r12,%r14)
movq $0x0, (%r13,%r14,8)
testq %r14, %r14
je 0xb4c2
movq %r14, %rax
shlq $0x4, %rax
movl -0x8(%rbp,%rax), %ecx
addl %ecx, 0x8(%rbp,%rax)
incq %r14
cmpq $0x1a, %r14
jne 0xb402
leaq 0x15593(%rip), %rdi     # 0x20a69
leaq 0x212e3(%rip), %rsi     # 0x2c7c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb0b5
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/init.c
// Function: init_player
void init_player()
{
	player.t_nomove = 0;
	player.t_nocmd = 0;
	him = &player.t_stats;
	him->s_lvl = 1;
	him->s_exp = 0L;
	him->s_maxhp = him->s_hpt = pinit();		/* hit points */
	him->s_re.a_str = pinit();		/* strength */
	him->s_re.a_dex = pinit();		/* dexterity */
	him->s_re.a_wis = pinit();		/* wisdom */
	him->s_re.a_con = pinit();		/* constitution */
	him->s_ef = him->s_re;			/* effective = real */
	strcpy(him->s_dmg, "1d4");
	him->s_arm = NORMAC;
	him->s_carry = totalenc();
	him->s_pack = 0;
	pack = NULL;				/* empty pack so far */
	max_stats = *him;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x22764(%rip), %rbx     # 0x2dc60
xorl %r14d, %r14d
movq %r14, 0x84(%rbx)
leaq 0x22853(%rip), %r15     # 0x2dd60
movq %rbx, (%r15)
movl $0x1, 0x28(%rbx)
movq %r14, 0x20(%rbx)
callq 0xb5a2
movq (%r15), %rcx
movl %eax, 0x30(%rcx)
movl %eax, 0x34(%rcx)
callq 0xb5a2
movq (%r15), %rcx
movl %eax, (%rcx)
callq 0xb5a2
movq (%r15), %rcx
movl %eax, 0x4(%rcx)
callq 0xb5a2
movq (%r15), %rcx
movl %eax, 0x8(%rcx)
callq 0xb5a2
movq (%r15), %rcx
movl %eax, 0xc(%rcx)
movq (%rcx), %rax
movq %rax, 0x10(%rcx)
movl 0x8(%rcx), %eax
movl %eax, 0x18(%rcx)
movl 0xc(%rcx), %eax
movl %eax, 0x1c(%rcx)
movl $0x346431, 0x40(%rcx)   # imm = 0x346431
movl $0xa, 0x2c(%rcx)
xorl %eax, %eax
callq 0x9857
movq (%r15), %rsi
movl %eax, 0x3c(%rsi)
movl $0x0, 0x38(%rsi)
movq %r14, 0x68(%rbx)
leaq 0x22764(%rip), %rdi     # 0x2dcf8
movl $0xa, %ecx
rep  movsq (%rsi), %es:(%rdi)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/init.c
// Function: pinit
int pinit()
{
	int best[4];
	int i, min, minind, dicetot;

	for (i = 0 ; i < 4 ; i++)
		best[i] = roll(1,6);	/* populate array */
	min = best[0];				/* assume that 1st entry */
	minind = 0;					/* is the lowest */
	for (i = 1 ; i < 4 ; i++) {	/* find the lowest */
		if (best[i] < min) {	/* if < minimum then update */
			min = best[i];
			minind = i;			/* point to lowest value */
		}
	}
	dicetot = 0;				/* start with nothing */
	for (i = 0 ; i < 4 ; i++) {
		if (i != minind)		/* if not minimum, then add it */
			dicetot += best[i];
	}
	return(dicetot);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
xorl %ebx, %ebx
movl $0x1, %edi
movl $0x6, %esi
callq 0xc695
movl %eax, (%rsp,%rbx,4)
incq %rbx
cmpq $0x4, %rbx
jne 0xb5a9
xorl %eax, %eax
movl $0x1, %ecx
movl (%rsp), %edx
movl (%rsp,%rcx,4), %esi
cmpl %edx, %esi
cmovll %esi, %edx
cmovll %ecx, %eax
incq %rcx
cmpq $0x4, %rcx
jne 0xb5ce
movl %eax, %ecx
xorl %edx, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
je 0xb5f0
addl (%rsp,%rdx,4), %eax
incq %rdx
cmpq $0x4, %rdx
jne 0xb5e8
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/init.c
// Function: init_everything
void init_everything()
{
	init_player();			/* Roll up the rogue */
	init_things();			/* Set up probabilities */
	init_names();			/* Set up names of scrolls */
	init_colors();			/* Set up colors of potions */
	init_stones();			/* Set up stones in rings */
	init_materials();		/* Set up materials of wands */
}

// Assembly:
pushq %rax
callq 0xb4f0
callq 0xb010
callq 0xb1f3
callq 0xb147
callq 0xb309
popq %rax
jmp 0xb3bd
nop
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/io.c
// Function: msg
int msg(char *fmt, ...)
{
	va_list ap;
	/*
	 * if the string is "", just clear the line
	 */
	if (*fmt == '\0') {
		wmove(cw, 0, 0);
		wclrtoeol(cw);
		mpos = 0;
		return 0;
	}
	/*
	 * otherwise add to the message and flush it out
	 */
	va_start(ap, fmt);
	doadd(fmt, ap);
	va_end(ap);
	endmsg();
  return 0;
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xb67c
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpb $0x0, (%rdi)
je 0xb6d7
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movslq 0x27350(%rip), %rdi     # 0x32a00
leaq 0x25349(%rip), %rbx     # 0x30a00
addq %rbx, %rdi
movq %r10, %rsi
callq 0x6400
movq %rbx, %rdi
callq 0x6170
movl %eax, 0x27330(%rip)     # 0x32a00
callq 0xb7e6
jmp 0xb6ff
leaq 0x25302(%rip), %rbx     # 0x309e0
movq (%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6490
movq (%rbx), %rdi
callq 0x64a0
leaq 0x22177(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
xorl %eax, %eax
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/io.c
// Function: endmsg
void endmsg()
{
	strcpy(huh, msgbuf);
	if (mpos > 0) {
		wmove(cw, 0, mpos);
		waddstr(cw, morestr);
		draw(cw);
		wait_for(cw, ' ');
	}
	mvwaddstr(cw, 0, 0, msgbuf);
	wclrtoeol(cw);
	mpos = newpos;
	newpos = 0;
	draw(cw);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x2278f(%rip), %rdi     # 0x2df80
leaq 0x25208(%rip), %rsi     # 0x30a00
callq 0x60e0
leaq 0x2206c(%rip), %r14     # 0x2d870
movl (%r14), %edx
testl %edx, %edx
jle 0xb848
leaq 0x251ce(%rip), %rbx     # 0x309e0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x6490
movq (%rbx), %rdi
leaq 0x1eb08(%rip), %rsi     # 0x2a32e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
movq (%rbx), %rdi
callq 0x6200
movq (%rbx), %rbx
movq %rbx, %rdi
callq 0x6110
cmpl $0x20, %eax
jne 0xb83b
leaq 0x25191(%rip), %rbx     # 0x309e0
movq (%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0xb874
movq (%rbx), %rdi
leaq 0x25196(%rip), %rsi     # 0x30a00
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
movq (%rbx), %rdi
callq 0x64a0
movl 0x2717e(%rip), %eax     # 0x32a00
movl %eax, (%r14)
movl $0x0, 0x27171(%rip)     # 0x32a00
movq (%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6200
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/list.c
// Function: detach
void _detach(struct linked_list **list,struct linked_list *item)
{
	if (*list == item)
		*list = next(item);
	if (prev(item) != NULL)
		item->l_prev->l_next = next(item);
	if (next(item) != NULL)
		item->l_next->l_prev = prev(item);
	item->l_next = NULL;
	item->l_prev = NULL;
}

// Assembly:
movq (%rsi), %rax
cmpq %rsi, (%rdi)
jne 0xbd57
movq %rax, (%rdi)
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0xbd63
movq %rax, (%rcx)
testq %rax, %rax
je 0xbd6c
movq %rcx, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/list.c
// Function: free_list
void _free_list(struct linked_list **ptr)
{
	struct linked_list *item;

	while (*ptr != NULL) {
		item = *ptr;
		*ptr = next(item);
		discard(item);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0xbdd4
movq %rdi, %rbx
leaq 0x21ac7(%rip), %r15     # 0x2d878
movq (%r14), %rax
movq %rax, (%rbx)
addl $-0x2, (%r15)
movq 0x10(%r14), %rdi
callq 0x6050
movq %r14, %rdi
callq 0x6050
movq (%rbx), %r14
testq %r14, %r14
jne 0xbdb1
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/list.c
// Function: new_item
struct linked_list *new_item(int size)
{
	struct linked_list *item;

	item = (struct linked_list *) new(sizeof *item);
	item->l_data = new(size);
	item->l_next = item->l_prev = NULL;
	return item;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl $0x18, %edi
callq 0xbe2a
movq %rax, %r14
movl %ebx, %edi
callq 0xbe2a
movq %rax, 0x10(%r14)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/list.c
// Function: new
char *new(int size)
{
	char *space = ALLOC(size);

	if (space == NULL) {
		sprintf(prbuf,"Rogue ran out of memory.");
		fatal(prbuf);
	}
	total++;
	return space;
}

// Assembly:
pushq %rbx
movl %edi, %edi
callq 0x6340
movq %rax, %rbx
testq %rax, %rax
jne 0xbe5b
movups 0x14d61(%rip), %xmm0    # 0x20ba2
leaq 0x22048(%rip), %rdi     # 0x2de90
movups %xmm0, 0x9(%rdi)
movups 0x14d46(%rip), %xmm0    # 0x20b99
movups %xmm0, (%rdi)
callq 0xc60c
leaq 0x21a16(%rip), %rax     # 0x2d878
incl (%rax)
movq %rbx, %rax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/main.c
// Function: fatal
void fatal(char *s)
{
	clear();
	refresh();
	endwin();
	fprintf(stderr,"%s\n\r",s);
	fflush(stderr);
	byebye(2);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1d916(%rip), %r14     # 0x29f30
movq (%r14), %rdi
callq 0x6120
movq (%r14), %rdi
callq 0x6200
callq 0x6530
movq 0x1d9c2(%rip), %r14     # 0x29ff8
movq (%r14), %rdi
leaq 0x157c4(%rip), %rsi     # 0x21e04
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6290
movq (%r14), %rdi
callq 0x6350
movl $0x2, %edi
callq 0xc65c
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/main.c
// Function: rnd
int rnd(int range)
{
	int wh;

	if (range == 0)
		wh = 0;
	else {
		wh = lrand48() % range;
		wh &= 0x7FFFFFFF;
	}
	return wh;
}

// Assembly:
testl %edi, %edi
je 0xc692
pushq %rbx
movl %edi, %ebx
callq 0x6380
movslq %ebx, %rcx
cqto
idivq %rcx
movq %rdx, %rax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/main.c
// Function: roll
int roll(int number,int sides)
{
	int dtotal = 0;

	while(number-- > 0)
		dtotal += rnd(sides)+1;
	return dtotal;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testl %edi, %edi
jle 0xc6d5
movl %esi, %ebx
movl %edi, %ebp
movslq %esi, %r15
incl %ebp
xorl %r14d, %r14d
testl %ebx, %ebx
je 0xc6c4
callq 0x6380
cqto
idivq %r15
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
incl %edx
jmp 0xc6c9
movl $0x1, %edx
addl %edx, %r14d
decl %ebp
cmpl $0x1, %ebp
ja 0xc6ac
jmp 0xc6d8
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/main.c
// Function: setup
void setup()
{
	signal(SIGHUP, auto_save);
	signal(SIGINT, auto_save);
	signal(SIGQUIT,  byebye);
	signal(SIGILL, game_err);
	signal(SIGTRAP, game_err);
#ifdef SIGIOT
	signal(SIGIOT, game_err);
#endif
#ifdef SIGEMT
	signal(SIGEMT, game_err);
#endif
	signal(SIGFPE, game_err);
#ifdef SIGBUS
	signal(SIGBUS, game_err);
#endif
	signal(SIGSEGV, game_err);
#ifdef SIGSYS
	signal(SIGSYS, game_err);
#endif
	signal(SIGPIPE, game_err);
	signal(SIGTERM, game_err);

	cbreak();
	noecho();
}

// Assembly:
pushq %rbx
leaq 0x7a38(%rip), %rbx      # 0x14126
movl $0x1, %edi
movq %rbx, %rsi
callq 0x6280
movl $0x2, %edi
movq %rbx, %rsi
callq 0x6280
leaq -0xb3(%rip), %rsi       # 0xc65c
movl $0x3, %edi
callq 0x6280
leaq 0x7a19(%rip), %rbx      # 0x14139
movl $0x4, %edi
movq %rbx, %rsi
callq 0x6280
movl $0x5, %edi
movq %rbx, %rsi
callq 0x6280
movl $0x6, %edi
movq %rbx, %rsi
callq 0x6280
movl $0x8, %edi
movq %rbx, %rsi
callq 0x6280
movl $0x7, %edi
movq %rbx, %rsi
callq 0x6280
movl $0xb, %edi
movq %rbx, %rsi
callq 0x6280
movl $0x1f, %edi
movq %rbx, %rsi
callq 0x6280
movl $0xd, %edi
movq %rbx, %rsi
callq 0x6280
movl $0xf, %edi
movq %rbx, %rsi
callq 0x6280
callq 0x6320
popq %rbx
jmp 0x6180
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/main.c
// Function: playit
void playit()
{
	char *opts;

	tcgetattr(0,&terminal);


	/* parse environment declaration of options */

	if ((opts = getenv("ROGUEOPTS")) != NULL)
		parse_opts(opts);

	player.t_oldpos = hero;
	oldrp = roomin(&hero);
	nochange = FALSE;
	while (playing)
		command();		/* Command execution */
	endit(0);
}

// Assembly:
pushq %rbx
leaq 0x262b8(%rip), %rsi     # 0x32a60
xorl %edi, %edi
callq 0x6430
leaq 0x14447(%rip), %rdi     # 0x20bfd
callq 0x6040
testq %rax, %rax
je 0xc7c8
movq %rax, %rdi
callq 0x1003f
leaq 0x21491(%rip), %rax     # 0x2dc60
leaq 0x50(%rax), %rdi
movq 0x50(%rax), %rcx
movq %rcx, 0x58(%rax)
callq 0x701c
leaq 0x21471(%rip), %rcx     # 0x2dc58
movq %rax, (%rcx)
leaq 0x210b2(%rip), %rax     # 0x2d8a3
movb $0x0, (%rax)
leaq 0x1db11(%rip), %rbx     # 0x2a30c
cmpb $0x1, (%rbx)
jne 0xc80c
xorl %eax, %eax
callq 0x7524
cmpb $0x0, (%rbx)
jne 0xc800
leaq 0x14488(%rip), %rdi     # 0x20c9b
callq 0xc60c
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/main.c
// Function: roguehome
char *roguehome()
{
    static char path[1024];
    char *end,*home;

    if ( (home = getenv("ROGUEHOME")) != NULL)
    {
        if (*home)
        {
            strncpy(path, home, PATH_MAX - 20);

            end = &path[strlen(path)-1];


            while( (end >= path) && ((*end == '/') || (*end == '\\')))
                *end-- = '\0';

            if (directory_exists(path))
                return(path);
        }
    }

    if (directory_exists("/var/games/roguelike"))
        return("/var/games/roguelike");
    if (directory_exists("/var/lib/roguelike"))
        return("/var/lib/roguelike");
    if (directory_exists("/var/roguelike"))
        return("/var/roguelike");
    if (directory_exists("/usr/games/lib"))
        return("/usr/games/lib");
    if (directory_exists("/games/roguelik"))
        return("/games/roguelik");

    return(NULL);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
leaq 0x14460(%rip), %rdi     # 0x20cd5
callq 0x6040
testq %rax, %rax
je 0xc8e6
cmpb $0x0, (%rax)
je 0xc8e6
leaq 0x26215(%rip), %rbx     # 0x32aa0
movl $0xfec, %edx            # imm = 0xFEC
movq %rbx, %rdi
movq %rax, %rsi
callq 0x60b0
movq %rbx, %rdi
callq 0x6170
decq %rax
js 0xc8c3
addq %rbx, %rax
movzbl (%rax), %ecx
cmpl $0x5c, %ecx
je 0xc8b8
cmpl $0x2f, %ecx
jne 0xc8c3
movb $0x0, (%rax)
decq %rax
cmpq %rbx, %rax
jae 0xc8ab
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x62b0
testl %eax, %eax
jne 0xc8e6
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rsp), %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0xc9aa
leaq 0x143f2(%rip), %rbx     # 0x20cdf
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x62b0
movl $0xf000, %ebp           # imm = 0xF000
testl %eax, %eax
jne 0xc912
movl 0x18(%rsp), %eax
andl %ebp, %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0xc9aa
leaq 0x143db(%rip), %rbx     # 0x20cf4
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x62b0
testl %eax, %eax
jne 0xc934
andl 0x18(%rsp), %ebp
cmpl $0x4000, %ebp           # imm = 0x4000
je 0xc9aa
leaq 0x143cc(%rip), %rbx     # 0x20d07
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x62b0
movl $0xf000, %ebp           # imm = 0xF000
testl %eax, %eax
jne 0xc95c
movl 0x18(%rsp), %eax
andl %ebp, %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0xc9aa
leaq 0x143b3(%rip), %rbx     # 0x20d16
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x62b0
testl %eax, %eax
jne 0xc97e
andl 0x18(%rsp), %ebp
cmpl $0x4000, %ebp           # imm = 0x4000
je 0xc9aa
leaq 0x143a0(%rip), %r14     # 0x20d25
movq %rsp, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x62b0
movl 0x18(%rbx), %ecx
andl $0xf000, %ecx           # imm = 0xF000
xorl $0x4000, %ecx           # imm = 0x4000
xorl %ebx, %ebx
orl %eax, %ecx
cmoveq %r14, %rbx
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/misc.c
// Function: waste_time
int waste_time()
{
	if (inwhgt)		/* if from wghtchk, then done */
	     return 0;
	do_daemons(BEFORE);
	do_daemons(AFTER);
	do_fuses();
  return 0;
}

// Assembly:
leaq 0x20ed8(%rip), %rax     # 0x2d89b
cmpb $0x0, (%rax)
jne 0xc9e8
pushq %rax
movl $0x1, %edi
callq 0x8b48
movl $0x2, %edi
callq 0x8b48
xorl %eax, %eax
callq 0x8c6e
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/misc.c
// Function: getindex
int getindex(char what)
{
	int index = -1;

	switch (what) {
		case POTION:	index = TYP_POTION;
		when SCROLL:	index = TYP_SCROLL;
		when FOOD:		index = TYP_FOOD;
		when RING:		index = TYP_RING;
		when AMULET:	index = TYP_AMULET;
		when ARMOR:		index = TYP_ARMOR;
		when WEAPON:	index = TYP_WEAPON;
		when STICK:		index = TYP_STICK;
	}
	return index;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x39, %edi
jg 0xca0a
cmpl $0x2b, %edi
jg 0xca1f
cmpl $0x21, %edi
je 0xca3f
cmpl $0x29, %edi
jne 0xca4d
movl $0x3, %eax
retq
cmpl $0x3e, %edi
jg 0xca2f
cmpl $0x3a, %edi
je 0xca42
cmpl $0x3d, %edi
jne 0xca4d
movl $0x5, %eax
retq
cmpl $0x2c, %edi
je 0xca48
cmpl $0x2f, %edi
jne 0xca4d
movl $0x6, %eax
retq
cmpl $0x3f, %edi
je 0xca4e
cmpl $0x5d, %edi
jne 0xca4d
movl $0x4, %eax
retq
xorl %eax, %eax
retq
movl $0x2, %eax
retq
movl $0x7, %eax
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/misc.c
// Function: tr_name
char *tr_name(char ch)
{
	char *s;

	switch (ch) {
		case TRAPDOOR:
			s = "A trapdoor.";
		when BEARTRAP:
			s = "A beartrap.";
		when SLEEPTRAP:
			s = "A sleeping gas trap.";
		when ARROWTRAP:
			s = "An arrow trap.";
		when TELTRAP:
			s = "A teleport trap.";
		when DARTTRAP:
			s = "A dart trap.";
		when POOL:
			s = "A magic pool.";
		when POST:
			s = "A trading post.";
		when MAZETRAP:
			s = "A maze trap.";
	otherwise:
		s = "A bottomless pit.";		/* shouldn't get here */
	}
	return s;
}

// Assembly:
cmpl $0x5d, %edi
jle 0xca75
cmpl $0x7a, %edi
jle 0xca9e
cmpl $0x7b, %edi
je 0xcac0
cmpl $0x7e, %edi
je 0xcad0
cmpl $0x7d, %edi
jne 0xcad8
leaq 0x14480(%rip), %rax     # 0x20ef4
retq
cmpl $0x3d, %edi
jg 0xca8c
cmpl $0x22, %edi
je 0xcab0
cmpl $0x24, %edi
jne 0xcad8
leaq 0x14475(%rip), %rax     # 0x20f00
retq
cmpl $0x3e, %edi
je 0xcab8
cmpl $0x5c, %edi
jne 0xcad8
leaq 0x144c3(%rip), %rax     # 0x20f60
retq
cmpl $0x5e, %edi
je 0xcac8
cmpl $0x60, %edi
jne 0xcad8
leaq 0x14486(%rip), %rax     # 0x20f35
retq
leaq 0x1448b(%rip), %rax     # 0x20f42
retq
leaq 0x14429(%rip), %rax     # 0x20ee8
retq
leaq 0x1444e(%rip), %rax     # 0x20f15
retq
leaq 0x14481(%rip), %rax     # 0x20f50
retq
leaq 0x1444d(%rip), %rax     # 0x20f24
retq
leaq 0x1448e(%rip), %rax     # 0x20f6d
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/misc.c
// Function: eat
int eat()
{
	struct linked_list *item;
	struct object *obj;
	int goodfood, cursed;

	if ((item = get_item("eat", FOOD)) == NULL)
		return 0;
	obj = OBJPTR(item);
	if (obj->o_type != FOOD) {
		msg("That's Inedible!");
		after = FALSE;
		return 0;
	}
	cursed = 1;
	if (o_on(obj, ISCURSED))
		cursed += 1;
	else if (o_on(obj, ISBLESS))
		cursed -= 1;
	if (obj->o_which == FRUITFOOD) {
		msg("My, that was a yummy %s.", fruit);
		goodfood = 100;
	}
	else {
		if (rnd(100) > 80 || o_on(obj, ISCURSED)) {
			msg("Yuk, this food tastes like ARA.");
			goodfood = 300;
			him->s_exp += 1;
			check_level();
		}
		else {
			msg("Yum, that tasted good.");
			goodfood = 200;
		}
	}
	goodfood *= cursed;
	if ((food_left += HUNGERTIME + rnd(400) - goodfood) > STOMACHSIZE)
		food_left = STOMACHSIZE;
	hungry_state = F_OKAY;
	updpack();					/* update pack */
	if (obj == cur_weapon)
		cur_weapon = NULL;
	del_pack(item);		/* get rid of the food */
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x13e4d(%rip), %rdi     # 0x20f7f
movl $0x3a, %esi
callq 0x10749
testq %rax, %rax
je 0xd27b
movq %rax, %rbx
movq 0x10(%rax), %r14
cmpl $0x3a, 0x20(%r14)
jne 0xd19f
movl $0x1, %esi
movq %r14, %rdi
callq 0x9531
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
testb %al, %al
jne 0xd17b
movl $0x20, %esi
movq %r14, %rdi
callq 0x9531
movzbl %al, %ebp
decl %ebp
cmpl $0x1, 0x28(%r14)
jne 0xd1bc
leaq 0x13e0b(%rip), %rdi     # 0x20f94
leaq 0x20da0(%rip), %rsi     # 0x2df30
xorl %eax, %eax
callq 0xb620
movl $0x64, %r15d
jmp 0xd21d
leaq 0x13ddd(%rip), %rdi     # 0x20f83
xorl %eax, %eax
callq 0xb620
leaq 0x1d159(%rip), %rax     # 0x2a30d
movb $0x0, (%rax)
jmp 0xd27b
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
cmpl $0x50, %eax
jg 0xd1de
movl $0x1, %esi
movq %r14, %rdi
callq 0x9531
testb %al, %al
je 0xd209
leaq 0x13dc8(%rip), %rdi     # 0x20fad
xorl %eax, %eax
callq 0xb620
leaq 0x20b6d(%rip), %rax     # 0x2dd60
movq (%rax), %rax
incq 0x20(%rax)
xorl %eax, %eax
callq 0xaea5
movl $0x12c, %r15d           # imm = 0x12C
jmp 0xd21d
leaq 0x13dbd(%rip), %rdi     # 0x20fcd
xorl %eax, %eax
callq 0xb620
movl $0xc8, %r15d
imull %ebp, %r15d
movl $0x190, %edi            # imm = 0x190
xorl %eax, %eax
callq 0xc674
addl %r15d, %eax
leaq 0x1d0c9(%rip), %rcx     # 0x2a300
movl (%rcx), %edx
addl %edx, %eax
addl $0x514, %eax            # imm = 0x514
movl $0x7d0, %edx            # imm = 0x7D0
cmpl %edx, %eax
cmovll %eax, %edx
movl %edx, (%rcx)
leaq 0x2063d(%rip), %rax     # 0x2d890
movl $0x0, (%rax)
xorl %eax, %eax
callq 0x9560
leaq 0x205e9(%rip), %rax     # 0x2d850
cmpq (%rax), %r14
jne 0xd273
movq $0x0, (%rax)
movq %rbx, %rdi
callq 0x10b63
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/misc.c
// Function: is_current
bool is_current(struct object *obj)
{
	if (obj == NULL)
		return FALSE;
	if (obj == cur_armor || obj == cur_weapon || obj == cur_ring[LEFT]
	  || obj == cur_ring[RIGHT]) {
		msg("Already in use.");
		return TRUE;
	}
	return FALSE;
}

// Assembly:
testq %rdi, %rdi
je 0xd32d
leaq 0x2054e(%rip), %rax     # 0x2d858
cmpq %rdi, (%rax)
je 0xd330
leaq 0x2053a(%rip), %rax     # 0x2d850
cmpq %rdi, (%rax)
je 0xd330
leaq 0x20a2e(%rip), %rax     # 0x2dd50
cmpq %rdi, (%rax)
je 0xd330
cmpq %rdi, 0x8(%rax)
je 0xd330
xorl %eax, %eax
retq
pushq %rax
leaq 0x13cac(%rip), %rdi     # 0x20fe4
xorl %eax, %eax
callq 0xb620
movb $0x1, %al
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/misc.c
// Function: initfood
void initfood(struct object *what)
{
	what->o_type = FOOD;
	what->o_group = NORMFOOD;
	if (rnd(100) < 15)
		what->o_group = FRUITFOOD;
	what->o_which = what->o_group;
	what->o_count = 1 + extras();
	what->o_flags = ISKNOW;
	what->o_weight = things[TYP_FOOD].mi_wght;
	what->o_typname = things[TYP_FOOD].mi_name;
	what->o_hplus = what->o_dplus = 0;
	what->o_vol = itemvol(what);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x3a, 0x20(%rdi)
movl $0x0, 0x3c(%rdi)
movl $0x64, %edi
xorl %eax, %eax
callq 0xc674
cmpl $0xf, %eax
jge 0xd4b6
movl $0x1, 0x3c(%rbx)
movl $0x1, %eax
jmp 0xd4b9
movl 0x3c(%rbx), %eax
movl %eax, 0x28(%rbx)
xorl %eax, %eax
callq 0x1b9ec
incl %eax
movl %eax, 0x24(%rbx)
movl $0x2, 0x38(%rbx)
leaq 0x1e8fa(%rip), %rax     # 0x2bdd0
movl 0x2c(%rax), %ecx
movl %ecx, 0x40(%rbx)
movq 0x20(%rax), %rax
movq %rax, 0x18(%rbx)
movq $0x0, 0x2c(%rbx)
movq %rbx, %rdi
callq 0x978c
movl %eax, 0x44(%rbx)
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/monsters.c
// Function: rnd_mon
int rnd_mon(bool wander,bool baddie)
/* baddie == TRUE when from a polymorph stick */
{
	int i, ok, cnt;

	cnt = 0;
	if (levcount == 0)			/* if only asmodeus possible */
		return(MAXMONS);
	if (baddie) {
		while (1) {
			i = rnd(MAXMONS);					/* pick ANY monster */
			if (monsters[i].m_lev.l_lev < 0)	/* skip genocided ones */
				continue;
			return i;
		}
	}
	ok = FALSE;
	do {
		/*
		 * get a random monster from this range
		 */
		i = rnd(levcount);
		/*
		 * Only create a wandering monster if we want one
		 * (or the count is exceeded)
		 */
		if (!wander || mtlev[i]->m_lev.d_wand || ++cnt > 500)
			ok = TRUE;
	} while(!ok);
	return (midx(mtlev[i]->m_show));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x20355(%rip), %r14     # 0x2d860
cmpl $0x0, (%r14)
je 0xd539
testb %sil, %sil
je 0xd54a
leaq 0x1cea3(%rip), %rbx     # 0x2a3c0
movl $0x34, %edi
xorl %eax, %eax
callq 0xc674
movslq %eax, %rcx
imulq $0x70, %rcx, %rcx
cmpl $0x0, 0xc(%rbx,%rcx)
js 0xd51d
jmp 0xd53e
movl $0x34, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl %edi, %ebx
leaq 0x22f2d(%rip), %r15     # 0x30480
xorl %r12d, %r12d
movl (%r14), %edi
xorl %eax, %eax
callq 0xc674
cltq
movq (%r15,%rax,8), %rax
testb %bl, %bl
je 0xd581
cmpb $0x0, 0x14(%rax)
jne 0xd581
leal 0x1(%r12), %ecx
cmpl $0x1f4, %r12d           # imm = 0x1F4
movl %ecx, %r12d
jb 0xd556
movsbl 0x8(%rax), %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xd595
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/monsters.c
// Function: lev_mon
void lev_mon()
{
	int i;
	struct monster *mm;

	levcount = 0;
	for (i = 0; i < MAXMONS; i++) {
		mm = &monsters[i];
		if (mm->m_lev.h_lev >= level && mm->m_lev.l_lev <= level) {
			mtlev[levcount] = mm;
			if (++levcount >= MONRANGE)
				break;
		}
	}
	if (levcount == 0)					/* if no monsters are possible */
		mtlev[0] = &monsters[MAXMONS];	/* then asmodeus 'A' */
}

// Assembly:
leaq 0x20294(%rip), %rcx     # 0x2d860
movl $0x0, (%rcx)
leaq 0x1cd17(%rip), %rax     # 0x2a2f0
movl (%rax), %edx
xorl %esi, %esi
leaq 0x1cddc(%rip), %rdi     # 0x2a3c0
leaq 0x22e95(%rip), %rax     # 0x30480
xorl %r8d, %r8d
cmpl %edx, 0x10(%rdi,%rsi)
jl 0xd612
cmpl %edx, 0xc(%rdi,%rsi)
jg 0xd612
leaq (%rdi,%rsi), %r9
movslq %r8d, %r10
movq %r9, (%rax,%r10,8)
leal 0x1(%r10), %r8d
movl %r8d, (%rcx)
cmpl $0x12, %r10d
jg 0xd624
addq $0x70, %rsi
cmpq $0x16c0, %rsi           # imm = 0x16C0
jne 0xd5ee
testl %r8d, %r8d
je 0xd625
retq
movl $0x16c0, %ecx           # imm = 0x16C0
addq 0x1c9b7(%rip), %rcx     # 0x29fe8
movq %rcx, (%rax)
retq