LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xfb7d
cmpq $0x0, (%r14)
je 0xfb9a
leaq 0x20f0e(%rip), %r13     # 0x309d8
movq (%r13), %rdi
callq 0x6120
movb $0x61, %al
movq %r14, (%rsp)
xorl %r15d, %r15d
testq %r14, %r14
je 0xfb58
movq 0x10(%r14), %rdi
movq (%r13), %r12
movsbl %al, %ebp
xorl %esi, %esi
callq 0x1908c
movq %r12, %rdi
leaq 0xfa81(%rip), %rsi      # 0x1f57e
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x64f0
leal 0x1(%r15), %r12d
movq 0x1a4ac(%rip), %rax     # 0x29fc0
movl (%rax), %eax
addl $-0x2, %eax
movq (%r14), %rbx
cmpl %eax, %r15d
jl 0xfb49
testq %rbx, %rbx
je 0xfb47
movq (%r13), %rdi
leaq 0x1a7ed(%rip), %rsi     # 0x2a31e
callq 0xb76d
movq (%r13), %rdi
callq 0x6120
movq (%r14), %rbx
xorl %r12d, %r12d
jmp 0xfb49
xorl %ebx, %ebx
movl %ebp, %edi
callq 0xb7e0
movq %rbx, %r14
movl %r12d, %r15d
jmp 0xfadc
movq (%r13), %rdi
leaq 0x1a79d(%rip), %rsi     # 0x2a300
callq 0xb76d
leaq 0x20e61(%rip), %rax     # 0x309d0
movq (%rax), %rdi
callq 0xb7b6
movq (%rsp), %r14
jmp 0xfbb6
testl %esi, %esi
leaq 0xf9cf(%rip), %rax      # 0x1f555
leaq 0xf9d6(%rip), %rdi      # 0x1f563
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0xb178
jmp 0xfbb6
movq 0x10(%r14), %rdi
xorl %esi, %esi
callq 0x1908c
leaq 0xf9cc(%rip), %rdi      # 0x1f578
movq %rax, %rsi
xorl %eax, %eax
callq 0xb178
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_O2/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 0x1dcc1(%rip), %rax     # 0x2d893
movb $0x0, (%rax)
leal -0x29(%rdi), %eax
cmpl $0x6, %eax
jbe 0xfbfc
leal -0x3a(%rdi), %eax
cmpl $0x23, %eax
ja 0xfbf5
movabsq $0x800000029, %rcx      # imm = 0x800000029
btq %rax, %rcx
jb 0xfc0c
cmpl $0x21, %edi
je 0xfc0c
jmp 0xfc15
leaq 0xf8a1(%rip), %rcx      # 0x1f4a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %edi, %edi
xorl %esi, %esi
jmp 0xf7ac
leaq 0xf96b(%rip), %rdi      # 0x1f587
xorl %eax, %eax
jmp 0xb178
xorl %eax, %eax
jmp 0x19885
// File: /workspace/github_c_makefile_star2_O2/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 0x1e01b(%rip), %r14     # 0x2dc50
movq 0x68(%r14), %rax
testq %rax, %rax
je 0xfc70
cmpq $0x0, (%rax)
je 0xfc80
leaq 0xf974(%rip), %rdi      # 0x1f5bf
xorl %eax, %eax
callq 0xb178
leaq 0x1dc07(%rip), %rax     # 0x2d860
andl $0x0, (%rax)
xorl %eax, %eax
callq 0xb447
cmpb $0x1b, %al
jne 0xfc9e
leaq 0x11d1b(%rip), %rdi     # 0x21989
jmp 0xfc77
leaq 0xf92a(%rip), %rdi      # 0x1f5a1
xorl %eax, %eax
callq 0xb178
jmp 0xfcfe
movq 0x10(%rax), %rdi
xorl %esi, %esi
callq 0x1908c
leaq 0xf8e6(%rip), %rdi      # 0x1f578
movq %rax, %rsi
xorl %eax, %eax
callq 0xb178
jmp 0xfcfe
movl %eax, %ebx
movq 0x68(%r14), %r14
movb $0x61, %al
testq %r14, %r14
je 0xfcbc
cmpb %bl, %al
je 0xfcdd
movq (%r14), %r14
movsbl %al, %edi
callq 0xb7e0
jmp 0xfca6
leal -0x1(%rax), %ecx
cmpb $0x41, %al
movzbl %cl, %eax
pushq $0x7a
popq %rcx
cmovnel %eax, %ecx
movsbl %cl, %esi
leaq 0xf8f2(%rip), %rdi      # 0x1f5c6
xorl %eax, %eax
callq 0xb178
jmp 0xfcfe
movsbl %bl, %ebx
movq 0x10(%r14), %rdi
xorl %esi, %esi
callq 0x1908c
leaq 0xd379(%rip), %rdi      # 0x1d06b
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb178
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r14
movq %r14, %rdi
callq 0x100da
movl 0x24(%r14), %eax
cmpl $0x2, %eax
jl 0x100b1
decl %eax
movl %eax, 0x24(%r14)
jmp 0x100cc
leaq 0x1db98(%rip), %rdi     # 0x2dc50
addq $0x68, %rdi
movq %rbx, %rsi
callq 0xb7f4
movq %rbx, %rdi
callq 0xb857
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9378
// File: /workspace/github_c_makefile_star2_O2/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 0x1d75f(%rip), %rax     # 0x2d840
cmpq %rdi, (%rax)
je 0x10110
leaq 0x1d75b(%rip), %rax     # 0x2d848
cmpq %rdi, (%rax)
je 0x10110
leaq 0x1dc47(%rip), %rax     # 0x2dd40
cmpq %rdi, (%rax)
je 0x10110
leaq 0x1dc3b(%rip), %rax     # 0x2dd40
cmpq %rdi, 0x8(%rax)
je 0x1010c
retq
addq $0x8, %rax
andq $0x0, (%rax)
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rbx
movq 0x198b6(%rip), %r12     # 0x29fa0
movq 0x19847(%rip), %r13     # 0x29f38
leaq 0x202d8(%rip), %r15     # 0x309d0
movq 0x198c1(%rip), %rax     # 0x29fc0
movl (%rax), %eax
addl $-0x3, %eax
cmpl %eax, %ebx
jge 0x10769
xorl %ebp, %ebp
cmpl (%r12), %ebp
jge 0x10765
movq (%r13), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0x10761
movq (%r13), %rdi
callq 0x6320
cmpl $0x2b, %eax
ja 0x10761
movl %eax, %r14d
movl %eax, %eax
movabsq $0x84800000000, %rcx    # imm = 0x84800000000
btq %rax, %rcx
jae 0x10761
movq (%r15), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0x10761
movq (%r15), %rdi
movl %r14d, %esi
callq 0x64a0
incl %ebp
jmp 0x1070a
incl %ebx
jmp 0x106f8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1c731(%rip), %rax     # 0x2d893
movb $0x0, (%rax)
leaq 0x1cbe4(%rip), %rax     # 0x2dd50
movq (%rax), %rax
testl %esi, %esi
je 0x11176
addl %edi, 0x34(%rax)
addl %edi, 0x30(%rax)
jle 0x1117d
popq %rbx
retq
leaq 0xe07c(%rip), %rdi      # 0x1f200
xorl %eax, %eax
callq 0xb178
movsbl %bl, %edi
popq %rbx
jmp 0x11fd0
// File: /workspace/github_c_makefile_star2_O2/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 0x111f4
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ecx
movl %esi, %ebx
movl %edi, %ebp
cmpl $0x1, %edx
jne 0x111cc
leaq 0x1ca92(%rip), %rdx     # 0x2dc50
pushq $0x1
popq %rcx
movl %ebp, %edi
movl %ebx, %esi
callq 0x111f7
xorl %ecx, %ecx
leaq 0x1ca7d(%rip), %rdx     # 0x2dc50
addq $0x10, %rdx
movl %ebp, %edi
movl %ebx, %esi
callq 0x111f7
xorl %eax, %eax
callq 0x9378
xorl %edi, %edi
callq 0x963f
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1cae3(%rip), %rdx     # 0x2dce8
leaq 0x10(%rdx), %r14
cmpl $0x1, %ecx
cmoveq %rdx, %r14
leal -0x1(%rdi), %r8d
cmpl $0x3, %r8d
ja 0x112e3
leaq 0x1cb2b(%rip), %rax     # 0x2dd50
movq (%rax), %rax
leaq 0xe859(%rip), %r9       # 0x1fa88
movslq (%r9,%r8,4), %r8
addq %r9, %r8
jmpq *%r8
pushq $0x18
jmp 0x1129e
xorl %edi, %edi
cmpl $0x1, %ecx
setne %dil
addq $0xc, %rbx
shll $0x4, %edi
leaq (%rdx,%rdi), %r14
addq $0xc, %r14
addq $0xc, %rax
pushq $0x5
jmp 0x1129b
xorl %edi, %edi
cmpl $0x1, %ecx
setne %dil
addq $0x8, %rbx
shll $0x4, %edi
leaq (%rdx,%rdi), %r14
addq $0x8, %r14
addq $0x8, %rax
pushq $0x18
jmp 0x1129b
xorl %edi, %edi
cmpl $0x1, %ecx
setne %dil
addq $0x4, %rbx
shll $0x4, %edi
leaq (%rdx,%rdi), %r14
addq $0x4, %r14
addq $0x4, %rax
pushq $0x19
popq %rdi
pushq $0x12
popq %rbp
movl (%rbx), %edx
addl %esi, %edx
movl %edx, (%rbx)
testl %esi, %esi
js 0x112c9
cmpl $0x1, %ecx
je 0x112b7
callq 0x11f5d
addl %eax, %ebp
movl (%rbx), %edx
cmpl %ebp, %edx
jle 0x112bf
movl %ebp, (%rbx)
movl %ebp, %edx
cmpl (%r14), %edx
jle 0x112e3
movl %edx, (%r14)
jmp 0x112e3
cmpl $0x2, %edx
jg 0x112d7
movl $0x3, (%rbx)
pushq $0x3
popq %rdx
testl %ecx, %ecx
jne 0x112e3
movl (%rax), %eax
cmpl %eax, %edx
jge 0x112e3
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x932c
testb %al, %al
je 0x11331
leaq 0xe886(%rip), %rdi      # 0x1fb88
xorl %eax, %eax
callq 0xb178
pushq $0x8
popq %rdi
xorl %eax, %eax
callq 0xc004
leaq 0x1c936(%rip), %rcx     # 0x2dc50
addl %eax, 0x88(%rcx)
andb $0x7f, 0x79(%rcx)
leaq -0x85d7(%rip), %rdi     # 0x8d54
popq %rbx
jmp 0x8aaf
leaq 0x1c918(%rip), %rax     # 0x2dc50
orb $-0x80, 0x79(%rax)
testb %bl, %bl
je 0x11347
pushq $0xa
popq %rdi
movl %edi, %esi
jmp 0x1134d
pushq $0x28
popq %rdi
pushq $0x14
popq %rsi
callq 0xc025
leaq -0x8605(%rip), %rdi     # 0x8d54
pushq $0x1
popq %rsi
movl %eax, %edx
popq %rbx
jmp 0x8a46
// File: /workspace/github_c_makefile_star2_O2/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 0x1140b
addl $-0x15, %eax
movl %eax, %ebx
jmp 0x11425
cmpl $0x18, %eax
jne 0x11414
pushq $0x3
jmp 0x11424
cmpl $0x14, %eax
jle 0x1141d
pushq $0x2
jmp 0x11424
cmpl $0x10, %eax
jle 0x1143e
pushq $0x1
popq %rbx
leaq 0x1c924(%rip), %rax     # 0x2dd50
cmpq %rdi, (%rax)
jne 0x1143a
xorl %eax, %eax
callq 0x96e3
addl %eax, %ebx
movl %ebx, %eax
popq %rbx
retq
xorl %ebx, %ebx
cmpl $0x7, %eax
jg 0x11425
cmpl $0x5, %eax
jle 0x1144e
pushq $-0x1
jmp 0x11424
xorl %ebx, %ebx
cmpl $0x4, %eax
setge %bl
addl $-0x3, %ebx
jmp 0x11425
// File: /workspace/github_c_makefile_star2_O2/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), %eax
cmpl $0x19, %eax
jl 0x11468
addl $-0x12, %eax
jmp 0x1149a
cmpl $0x18, %eax
je 0x11476
cmpl $0x17, %eax
jne 0x1147a
pushq $0x5
jmp 0x11499
pushq $0x6
jmp 0x11499
cmpl $0x14, %eax
jle 0x11483
pushq $0x4
jmp 0x11499
cmpl $0x12, %eax
jle 0x1148c
pushq $0x3
jmp 0x11499
jne 0x11492
pushq $0x2
jmp 0x11499
cmpl $0xf, %eax
jle 0x114c6
pushq $0x1
popq %rax
leaq 0x1c8af(%rip), %rcx     # 0x2dd50
cmpq %rdi, (%rcx)
je 0x114a7
retq
leaq 0x1c3d2(%rip), %rcx     # 0x2d880
movl (%rcx), %ecx
xorl %edx, %edx
cmpl $0x2, %ecx
sete %dl
negl %edx
cmpl $0x3, %ecx
pushq $-0x2
popq %rcx
cmovnel %edx, %ecx
addl %ecx, %eax
retq
xorl %ecx, %ecx
cmpl $0x7, %eax
setl %cl
negl %ecx
movl %ecx, %eax
jmp 0x1149a
// File: /workspace/github_c_makefile_star2_O2/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 0x1c84d(%rip), %r15     # 0x2dd50
movq (%r15), %rdi
movl 0x28(%rdi), %r14d
callq 0x113d6
addl %eax, %r14d
movl %r14d, %edi
movl %ebp, %esi
callq 0xc025
movq (%r15), %rcx
addl 0x30(%rcx), %eax
movl %eax, 0x30(%rcx)
movl 0x34(%rcx), %edx
testl %ebx, %ebx
je 0x11531
incl %edx
movl %edx, 0x34(%rcx)
cmpl %edx, %eax
jle 0x11538
movl %edx, 0x30(%rcx)
leaq 0x1c354(%rip), %rax     # 0x2d893
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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, %ebp
xorb $0x1, %bpl
leaq 0x1f114(%rip), %r14     # 0x309d8
leaq 0xe530(%rip), %r12      # 0x1fdfb
leaq 0xe516(%rip), %rdi      # 0x1fde8
xorl %eax, %eax
callq 0xb267
testb %bl, %bl
je 0x118eb
leaq 0x18aac(%rip), %rdi     # 0x2a390
xorl %eax, %eax
callq 0xb267
leaq 0xecd8(%rip), %rdi      # 0x205ca
xorl %eax, %eax
callq 0xb267
xorl %eax, %eax
callq 0xb2ef
xorl %eax, %eax
callq 0xb447
movsbl %al, %r13d
callq 0x6590
movq %rax, %r15
movq (%rax), %rax
movsbq %r13b, %rcx
testb $0x1, 0x1(%rax,%rcx,2)
je 0x1192c
movl %r13d, %edi
callq 0x6300
movl %eax, %r13d
cmpl $0x2a, %r13d
setne %al
orb %bpl, %al
jne 0x119ed
movq (%r14), %rdi
callq 0x6120
leaq 0x1c3f5(%rip), %rax     # 0x2dd40
movq (%rax), %rdi
movq %r12, %rdx
testq %rdi, %rdi
je 0x11961
pushq $0x1
popq %rsi
callq 0x1908c
movq %rax, %rdx
movq (%r14), %rdi
leaq 0xe495(%rip), %rsi      # 0x1fe00
xorl %eax, %eax
callq 0x64f0
leaq 0x1c3c7(%rip), %rax     # 0x2dd40
movq 0x8(%rax), %rdi
movq %r12, %rdx
testq %rdi, %rdi
je 0x11990
pushq $0x1
popq %rsi
callq 0x1908c
movq %rax, %rdx
movq (%r14), %rdi
leaq 0xe46f(%rip), %rsi      # 0x1fe09
xorl %eax, %eax
callq 0x64f0
movq (%r14), %rdi
leaq 0xe467(%rip), %rsi      # 0x1fe12
xorl %eax, %eax
callq 0x64f0
movq (%r14), %rdi
callq 0x6200
xorl %eax, %eax
callq 0xb447
movsbl %al, %r13d
movq (%r15), %rax
movsbq %r13b, %rcx
testb $0x1, 0x1(%rax,%rcx,2)
je 0x119de
movl %r13d, %edi
callq 0x6300
movl %eax, %r13d
leaq 0x1efeb(%rip), %rax     # 0x309d0
movq (%rax), %rdi
callq 0xb7b6
cmpl $0x6c, %r13d
je 0x11a1c
cmpl $0x1b, %r13d
je 0x11a1c
cmpl $0x72, %r13d
je 0x11a1c
leaq 0x1be5a(%rip), %rax     # 0x2d860
andl $0x0, (%rax)
leaq 0xe412(%rip), %rdi      # 0x1fe22
xorl %eax, %eax
callq 0xb178
jmp 0x118cb
cmpl $0x6c, %r13d
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1c303(%rip), %r14     # 0x2dd40
movq (%r14), %rax
movq 0x8(%r14), %rbx
testq %rax, %rax
je 0x11a78
testq %rbx, %rbx
movq %rax, %rbx
je 0x11a7d
pushq $0x1
popq %rdi
callq 0x118aa
testb %al, %al
jne 0x11ad7
movq (%r14), %rbx
leaq 0x1bdf9(%rip), %rax     # 0x2d860
andl $0x0, (%rax)
testq %rbx, %rbx
jne 0x11a87
leaq 0xe34a(%rip), %rdi      # 0x1fdc0
jmp 0x11ad0
testq %rbx, %rbx
je 0x11ac9
leaq 0x1bddc(%rip), %rax     # 0x2d860
andl $0x0, (%rax)
movq %rbx, %rdi
callq 0x19ba9
testb %al, %al
je 0x11ad7
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1908c
leaq 0xe334(%rip), %rdi      # 0x1fdd9
movq %rax, %rsi
xorl %eax, %eax
callq 0xb178
leaq 0x1bddd(%rip), %rax     # 0x2d893
movb $0x0, (%rax)
callq 0x11c70
leaq 0x1bdbf(%rip), %rcx     # 0x2d884
movl %eax, (%rcx)
jmp 0x11ad7
leaq 0xe2d2(%rip), %rdi      # 0x1fda2
xorl %eax, %eax
callq 0xb178
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x11b1a
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x934a
testb %al, %al
je 0x11b17
leaq 0x1c23b(%rip), %rax     # 0x2dd40
xorl %ecx, %ecx
cmpq %rbx, (%rax)
setne %cl
andq $0x0, (%rax,%rcx,8)
jmp 0x11bed
movl 0x34(%rbx), %eax
testl %eax, %eax
js 0x11b34
leaq 0x1c21b(%rip), %rax     # 0x2dd40
xorl %ecx, %ecx
cmpq %rbx, (%rax)
setne %cl
andq $0x0, (%rax,%rcx,8)
jmp 0x11b5b
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x934a
leaq 0x1c1fa(%rip), %rcx     # 0x2dd40
xorl %edx, %edx
cmpq %rbx, (%rcx)
setne %dl
andq $0x0, (%rcx,%rdx,8)
testb %al, %al
jne 0x11bed
movl 0x28(%rbx), %eax
decl %eax
cmpl $0x18, %eax
ja 0x11bed
leaq 0xe098(%rip), %rcx      # 0x1fc08
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %esi, %esi
subl 0x34(%rbx), %esi
pushq $0x1
jmp 0x11c61
xorl %esi, %esi
subl 0x34(%rbx), %esi
pushq $0x3
jmp 0x11c61
leaq 0x1c0b8(%rip), %rax     # 0x2dc50
andb $-0x41, 0x79(%rax)
jmp 0x11bed
leaq 0x1c0ab(%rip), %r14     # 0x2dc50
andb $-0x11, 0x79(%r14)
leaq -0x8e9e(%rip), %rdi     # 0x8d13
callq 0x8aaf
leaq 0x50(%r14), %rdi
callq 0xe29f
leaq 0x1ee0a(%rip), %rbx     # 0x309d0
movq (%rbx), %rdi
movl 0x50(%r14), %edx
movl 0x54(%r14), %esi
callq 0x6470
cmpl $-0x1, %eax
je 0x11bed
movq (%rbx), %rdi
pushq $0x40
popq %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x64a0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1c154(%rip), %rax     # 0x2dd50
movq (%rax), %rax
movups (%rax), %xmm0
movups %xmm0, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11e3d
leaq -0x8cc7(%rip), %rdi     # 0x8f52
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8aaf
leaq -0x8ed8(%rip), %rdi     # 0x8d54
callq 0x8aaf
xorl %edi, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8d54
xorl %edi, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8d21
xorl %esi, %esi
subl 0x34(%rbx), %esi
pushq $0x2
jmp 0x11c61
xorl %esi, %esi
subl 0x34(%rbx), %esi
pushq $0x4
popq %rdi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x111a5
// File: /workspace/github_c_makefile_star2_O2/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, %bl
leaq 0x1c0bc(%rip), %r13     # 0x2dd40
leaq 0xdfe1(%rip), %r14      # 0x1fc6c
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpq $0x2, %rbp
je 0x11db7
movq (%r13,%rbp,8), %r12
testq %r12, %r12
je 0x11daf
movl 0x28(%r12), %eax
leal -0x2(%rax), %ecx
cmpl $0xe, %ecx
ja 0x11cc6
movslq (%r14,%rcx,4), %rax
addq %r14, %rax
jmpq *%rax
incl %r15d
jmp 0x11d7f
cmpl $0x13, %eax
jne 0x11d98
addl $0x2, %r15d
jmp 0x11d7f
movl 0x34(%r12), %eax
addl $0x3, %eax
cmpl $0x6, %eax
ja 0x11d7c
leaq 0xdfb8(%rip), %rcx      # 0x1fca8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x64
popq %rdi
xorl %eax, %eax
callq 0xc004
leal 0x3(%r15), %ecx
jmp 0x11d41
pushq $0x64
popq %rdi
xorl %eax, %eax
callq 0xc004
xorl %ecx, %ecx
cmpl $0x21, %eax
setl %cl
addl %ecx, %r15d
jmp 0x11d7f
pushq $0x64
popq %rdi
xorl %eax, %eax
callq 0xc004
leal 0x2(%r15), %ecx
cmpl $0x32, %eax
jmp 0x11d44
pushq $0x64
popq %rdi
xorl %eax, %eax
callq 0xc004
leal -0x3(%r15), %ecx
cmpl $0x19, %eax
cmovgel %r15d, %ecx
movl %ecx, %r15d
jmp 0x11d7f
pushq $0x64
popq %rdi
xorl %eax, %eax
callq 0xc004
xorl %ecx, %ecx
cmpl $0x32, %eax
setl %cl
subl %ecx, %r15d
jmp 0x11d7f
pushq $0x64
popq %rdi
xorl %eax, %eax
callq 0xc004
leal -0x2(%r15), %ecx
cmpl $0x32, %eax
cmovgel %r15d, %ecx
movl %ecx, %r15d
decl %r15d
testb $0x1, %bl
je 0x11d98
movq %r12, %rdi
pushq $0x20
popq %rsi
callq 0x934a
testb %al, %al
je 0x11d9c
decl %r15d
jmp 0x11dad
xorl %ebx, %ebx
jmp 0x11daf
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0x934a
movzbl %al, %eax
addl %eax, %r15d
movb $0x1, %bl
incq %rbp
jmp 0x11c90
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x210d4(%rip)     # 0x32ea8
pushq $0x2
popq %rsi
callq 0x934a
testb %al, %al
jne 0x11def
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x934a
testb %al, %al
je 0x11e21
movl 0x28(%rbx), %eax
cmpl $0x19, %eax
ja 0x11e21
movl $0x30025a3, %ecx        # imm = 0x30025A3
btl %eax, %ecx
jae 0x11e21
movb $0x20, 0x210a0(%rip)    # 0x32ea8
movl 0x34(%rbx), %edi
xorl %esi, %esi
callq 0x1b0b2
leaq 0x21090(%rip), %rdi     # 0x32ea9
movq %rax, %rsi
callq 0x60e0
leaq 0x21080(%rip), %rax     # 0x32ea8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %r14d, %r14d
leaq 0x1bef1(%rip), %r15     # 0x2dd40
pushq $0x2
popq %rbx
pushq $0x3
popq %rbp
pushq $0x4
popq %r12
cmpq $0x2, %r14
je 0x11e99
movq (%r15,%r14,8), %rax
testq %rax, %rax
je 0x11e94
movl 0x28(%rax), %edi
cmpl $0x1, %edi
je 0x11e8a
cmpl $0x5, %edi
je 0x11e83
cmpl $0x18, %edi
je 0x11e87
cmpl $0x19, %edi
jne 0x11e94
movl %ebx, %edi
jmp 0x11e8a
movl %ebp, %edi
jmp 0x11e8a
movl %r12d, %edi
movl 0x34(%rax), %esi
movl %ebx, %edx
callq 0x111a5
incq %r14
jmp 0x11e59
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x11f4b
leaq 0xde08(%rip), %rcx      # 0x1fcc4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
testb %sil, %sil
je 0x11ed9
xorl %eax, %eax
callq 0x1b8e2
jmp 0x11efa
andl $0x0, 0x34(%rbx)
jmp 0x11f01
pushq $0x64
popq %rdi
xorl %eax, %eax
callq 0xc004
movl %eax, %ebp
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0xc004
cmpl $0x18, %ebp
jg 0x11ef8
notl %eax
jmp 0x11efa
incl %eax
movl %eax, 0x34(%rbx)
testl %eax, %eax
jns 0x11f0c
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x936c
movl $0x3d, 0x20(%rbx)
leaq 0x19ea6(%rip), %rax     # 0x2bdc0
movl 0x5c(%rax), %ecx
movl %ecx, 0x40(%rbx)
movq 0x50(%rax), %rax
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
callq 0x953d
movl %eax, 0x44(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0xc004
incl %eax
movl %eax, 0x34(%rbx)
jmp 0x11f0c
movl $0x1, 0x34(%rbx)
jmp 0x11f0c
movl $0x19, 0x34(%rbx)
jmp 0x11f0c
// File: /workspace/github_c_makefile_star2_O2/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 0x1bddc(%rip), %rcx     # 0x2dd40
movq (%rcx), %rdx
xorl %eax, %eax
testq %rdx, %rdx
je 0x11f76
cmpl %edi, 0x28(%rdx)
jne 0x11f76
movl 0x34(%rdx), %eax
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
je 0x11f87
cmpl %edi, 0x28(%rcx)
jne 0x11f87
addl 0x34(%rcx), %eax
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/rip.c
// Function: showpack
void showpack(bool winner,char *howso)
{
	char *iname;
	int cnt, worth, ch;
	struct linked_list *item;
	struct object *obj;

	idenpack();
	cnt = 1;
	clear();
	if (winner)
		mvaddstr(0, 0, "   Worth  Item");
	else
		mvprintw(0, 0, "Contents of your pack %s:\n",howso);
	ch = 'a';
	for (item = pack; item != NULL; item = next(item)) {
		obj = OBJPTR(item);
		iname = inv_name(obj, FALSE);
		if (winner) {
			worth = get_worth(obj);
			worth *= obj->o_count;
			mvprintw(cnt, 0, "  %6d  %s",worth,iname);
			purse += worth;
		}
		else {
			mvprintw(cnt, 0, "%c) %s\n",ch,iname);
			ch = npch(ch);
		}
		if (++cnt >= LINES - 2 && next(item) != NULL) {
			cnt = 1;
			mvaddstr(LINES - 1, 0, morestr);
			refresh();
			wait_for(stdscr, ' ');
			clear();
		}
	}
	mvprintw(cnt + 1,0,"--- %d  Gold Pieces ---",oldpurse);
	refresh();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %r12d
xorl %eax, %eax
callq 0x1006d
movq 0x1784a(%rip), %rbx     # 0x29f38
movq (%rbx), %rdi
callq 0x6120
testl %r12d, %r12d
je 0x12720
movq (%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0x12735
movq (%rbx), %rdi
leaq 0xdaf1(%rip), %rsi      # 0x20207
pushq $-0x1
popq %rdx
callq 0x6530
jmp 0x12735
leaq 0xdaef(%rip), %rdx      # 0x20216
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x62b0
leaq 0x1b514(%rip), %rbx     # 0x2dc50
addq $0x68, %rbx
pushq $0x1
popq %r13
pushq $0x61
popq %rax
movl %eax, 0x4(%rsp)
movq 0x1786e(%rip), %r15     # 0x29fc0
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x1284e
movq 0x10(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x1908c
movq %rax, %rbp
testb %r12b, %r12b
je 0x127b6
movq %r14, %rdi
callq 0x1a1b0
movl %r12d, %r15d
movl %eax, %r12d
imull 0x24(%r14), %r12d
movl %r13d, %edi
xorl %esi, %esi
leaq 0xda9e(%rip), %rdx      # 0x20231
movl %r12d, %ecx
movq %rbp, %r8
xorl %eax, %eax
callq 0x62b0
leaq 0x1b0b5(%rip), %rax     # 0x2d85c
addl %r12d, (%rax)
movl %r15d, %r12d
movq 0x1780c(%rip), %r15     # 0x29fc0
jmp 0x127e4
movl %r13d, %edi
xorl %esi, %esi
leaq 0xda79(%rip), %rdx      # 0x2023b
movl 0x4(%rsp), %r14d
movl %r14d, %ecx
movq %rbp, %r8
xorl %eax, %eax
callq 0x62b0
movsbl %r14b, %edi
callq 0xb7e0
movsbl %al, %eax
movl %eax, 0x4(%rsp)
incl %r13d
movl (%r15), %esi
leal -0x2(%rsi), %eax
cmpl %eax, %r13d
jl 0x12752
cmpq $0x0, (%rbx)
je 0x12752
movq 0x17731(%rip), %r14     # 0x29f38
movq (%r14), %rdi
decl %esi
xorl %edx, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0x1282a
movq (%r14), %rdi
leaq 0x17afc(%rip), %rsi     # 0x2a31e
pushq $-0x1
popq %rdx
callq 0x6530
movq (%r14), %rdi
callq 0x6200
movq (%r14), %rdi
pushq $0x20
popq %rsi
callq 0xb399
movq (%r14), %rdi
callq 0x6120
pushq $0x1
popq %r13
jmp 0x12752
incl %r13d
movl 0x20659(%rip), %ecx     # 0x32eb0
leaq 0xd9e5(%rip), %rdx      # 0x20243
movl %r13d, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x62b0
movq 0x176c7(%rip), %rax     # 0x29f38
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6200
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/rip.c
// Function: total_winner
void total_winner()
{
	clear();
addstr("                                                               \n");
addstr("  @   @               @   @           @          @@@  @     @  \n");
addstr("  @   @               @@ @@           @           @   @     @  \n");
addstr("  @   @  @@@  @   @   @ @ @  @@@   @@@@  @@@      @  @@@    @  \n");
addstr("   @@@@ @   @ @   @   @   @     @ @   @ @   @     @   @     @  \n");
addstr("      @ @   @ @   @   @   @  @@@@ @   @ @@@@@     @   @     @  \n");
addstr("  @   @ @   @ @  @@   @   @ @   @ @   @ @         @   @  @     \n");
addstr("   @@@   @@@   @@ @   @   @  @@@@  @@@@  @@@     @@@   @@   @  \n");
addstr("                                                               \n");
addstr("     Congratulations, you have made it to the light of day!    \n");
addstr("\nYou have joined the elite ranks of those who have escaped the\n");
addstr("Dungeons of Doom alive.  You journey home and sell all your loot at\n");
addstr("a great profit and are admitted to the fighters guild.\n");

	mvaddstr(LINES - 1, 0,spacemsg);
	refresh();
	wait_for(stdscr, ' ');
	clear();
	oldpurse = purse;
	showpack(TRUE, NULL);
	score(purse, WINNER, 0);
	byebye(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x174a6(%rip), %r15     # 0x29f38
movq (%r15), %rdi
callq 0x6120
movq (%r15), %rdi
leaq 0xd45d(%rip), %r14      # 0x1ff01
pushq $-0x1
popq %rbx
movq %r14, %rsi
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd487(%rip), %rsi      # 0x1ff42
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd4b7(%rip), %rsi      # 0x1ff83
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd4e7(%rip), %rsi      # 0x1ffc4
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd517(%rip), %rsi      # 0x20005
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd547(%rip), %rsi      # 0x20046
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd577(%rip), %rsi      # 0x20087
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd5a7(%rip), %rsi      # 0x200c8
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd5ca(%rip), %rsi      # 0x20109
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd5fa(%rip), %rsi      # 0x2014a
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd629(%rip), %rsi      # 0x2018a
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
leaq 0xd65d(%rip), %rsi      # 0x201cf
movl %ebx, %edx
callq 0x6530
movq (%r15), %rdi
movq 0x1743d(%rip), %rax     # 0x29fc0
movl (%rax), %esi
decl %esi
xorl %edx, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0x12ba5
movq (%r15), %rdi
leaq 0x17763(%rip), %rsi     # 0x2a300
pushq $-0x1
popq %rdx
callq 0x6530
movq (%r15), %rdi
callq 0x6200
movq (%r15), %rdi
pushq $0x20
popq %rsi
callq 0xb399
movq (%r15), %rdi
callq 0x6120
leaq 0x1ac95(%rip), %rbx     # 0x2d85c
movl (%rbx), %eax
movl %eax, 0x202e1(%rip)     # 0x32eb0
pushq $0x1
popq %rdi
xorl %esi, %esi
callq 0x126cf
movl (%rbx), %edi
pushq $0x2
popq %rsi
xorl %edx, %edx
callq 0x1222b
xorl %edi, %edi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xbfec
nop
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/rooms.c
// Function: rnd_pos
struct coord *rnd_pos(struct room *rp)
{
	int y, x, i;
	static struct coord spot;

	i = 0;
	do {
		x = rp->r_pos.x + rnd(rp->r_max.x - 2) + 1;
		y = rp->r_pos.y + rnd(rp->r_max.y - 2) + 1;
		i += 1;
	} while(winat(y, x) != FLOOR && i < 1000);
	spot.x = x;
	spot.y = y;
	return &spot;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
movl (%rbx), %r14d
movl 0x8(%rbx), %edi
addl $-0x2, %edi
xorl %eax, %eax
callq 0xc004
leal (%r14,%rax), %ebp
incl %ebp
movl 0x4(%rbx), %r14d
movl 0xc(%rbx), %edi
addl $-0x2, %edi
xorl %eax, %eax
callq 0xc004
addl %eax, %r14d
incl %r14d
movl %r14d, %edi
movl %ebp, %esi
callq 0x92ab
cmpb $0x2e, %al
je 0x13166
leal 0x1(%r15), %eax
cmpl $0x3e7, %r15d           # imm = 0x3E7
movl %eax, %r15d
jb 0x1311b
movl %ebp, 0x2026c(%rip)     # 0x333d8
leaq 0x20265(%rip), %rax     # 0x333d8
movl %r14d, 0x20262(%rip)    # 0x333dc
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/save.c
// Function: save_game
int save_game()
{
	FILE *savef;
	int c;
	char buf[LINLEN];

	mpos = 0;
	if (file_name[0] != '\0') {
		msg("Save file (%s)? ", file_name);
		do {
			c = wgetch(cw);
			if(c == ESCAPE) {
				msg("");
				return FALSE;
			}
		} while (c != 'n' && c != 'y');
		mpos = 0;
		if (c == 'y')
			goto gotfile;
	}
	msg("File name: ");
	mpos = 0;
	buf[0] = '\0';
	if (get_str(buf, cw) == QUIT) {
		msg("");
		return FALSE;
	}
	msg("");
	strcpy(file_name, buf);
gotfile:
	c = dosave();		/* try to save this game */
	if (c == FALSE)
		msg("Could not save game to file %s", file_name);
	return c;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
leaq 0x1a61c(%rip), %r14     # 0x2d860
andl $0x0, (%r14)
leaq 0x1ad71(%rip), %rax     # 0x2dfc0
cmpb $0x0, (%rax)
je 0x132a2
leaq 0xd361(%rip), %rdi      # 0x205bc
leaq 0x1ad5e(%rip), %rsi     # 0x2dfc0
xorl %eax, %eax
callq 0xb178
leaq 0x1d760(%rip), %rbx     # 0x309d0
movq (%rbx), %rdi
callq 0x6110
cmpl $0x79, %eax
je 0x13299
cmpl $0x6e, %eax
je 0x13299
cmpl $0x1b, %eax
jne 0x13270
leaq 0xe6fb(%rip), %rdi      # 0x21989
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xb178
jmp 0x13314
andl $0x0, (%r14)
cmpl $0x79, %eax
je 0x132ef
leaq 0xd324(%rip), %rdi      # 0x205cd
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xb178
andl $0x0, (%r14)
movq %rsp, %rdi
movb $0x0, (%rdi)
leaq 0x1d70d(%rip), %rax     # 0x309d0
movq (%rax), %rsi
callq 0xf37e
movl %eax, %ebp
leaq 0xe6b5(%rip), %rdi      # 0x21989
xorl %eax, %eax
callq 0xb178
cmpl $0x1, %ebp
je 0x13314
leaq 0x1acd9(%rip), %rdi     # 0x2dfc0
movq %rsp, %rsi
callq 0x60e0
callq 0x1339e
testb %al, %al
je 0x132fd
pushq $0x1
popq %rbx
jmp 0x13314
leaq 0xd2d5(%rip), %rdi      # 0x205d9
leaq 0x1acb5(%rip), %rsi     # 0x2dfc0
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xb178
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/save.c
// Function: game_err
void game_err(int a)
{
	int ok;

	ok = dosave();			/* try to save this game */
	clear();
	refresh();
	endwin();

	printf("\nInternal error !!!\n\nYour game was ");
	if (ok)
		printf("saved.");
	else
		printf("NOT saveable.");

	fflush(stdout);

#ifdef SIGIOT
	signal(SIGIOT, SIG_DFL);	/* allow core dump signal */
#endif

	abort();			/* cause core dump */
	byebye(3);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x1339e
movl %eax, %ebx
movq 0x16bf6(%rip), %r14     # 0x29f38
movq (%r14), %rdi
callq 0x6120
movq (%r14), %rdi
callq 0x6200
callq 0x6510
leaq 0xd29a(%rip), %rdi      # 0x205f8
xorl %eax, %eax
callq 0x61c0
leaq 0xd2b0(%rip), %rax      # 0x2061c
leaq 0xd2b0(%rip), %rdi      # 0x20623
testb %bl, %bl
cmovneq %rax, %rdi
xorl %eax, %eax
callq 0x61c0
movq 0x16b79(%rip), %rax     # 0x29f00
movq (%rax), %rdi
callq 0x6340
pushq $0x6
popq %rdi
xorl %esi, %esi
callq 0x6270
callq 0x6090
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/save.c
// Function: dosave
bool dosave()
{
	FILE *savef;

	ignore();
	setuid(playuid);
	setgid(playgid);
	umask(022);

	if (file_name[0] != '\0') {
		if ((savef = fopen(file_name,"w")) != NULL)
		{
			save_file(savef);
			return TRUE;
		}
	}
	return FALSE;
}

// Assembly:
pushq %rax
callq 0x13210
leaq 0x1aaa5(%rip), %rax     # 0x2de50
movl (%rax), %edi
callq 0x6500
leaq 0x1aa9b(%rip), %rax     # 0x2de54
movl (%rax), %edi
callq 0x63f0
pushq $0x12
popq %rdi
callq 0x6290
leaq 0x1abf1(%rip), %rax     # 0x2dfc0
cmpb $0x0, (%rax)
je 0x133f8
leaq 0x1abe5(%rip), %rdi     # 0x2dfc0
leaq 0xac70(%rip), %rsi      # 0x1e052
callq 0x6440
testq %rax, %rax
je 0x133f8
movq %rax, %rdi
callq 0x133fc
movb $0x1, %al
jmp 0x133fa
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/save.c
// Function: save_file
void save_file(FILE *savef)
{
	int fnum;
	int slines = LINES;
	int scols = COLS;

#ifdef __DJGPP__                      /* st_ino w/ DJGPP under WinXP broken */
        _djstat_flags |= _STAT_INODE; /* so turn off computing it for now   */
#endif

	/*
	 * force allocation of the buffer now so that inodes, etc
	 * can be checked when restoring saved games.
	 */
	fnum = fileno(savef);
	fstat(fnum, &sbuf);
	write(fnum, "RDK", 4);
	lseek(fnum, 0L, 0);
	encwrite(version,strlen(version)+1,savef);
	encwrite(&sbuf.st_ino,sizeof(sbuf.st_ino),savef);
	encwrite(&sbuf.st_dev,sizeof(sbuf.st_dev),savef);
	encwrite(&sbuf.st_ctime,sizeof(sbuf.st_ctime),savef);
	encwrite(&sbuf.st_mtime,sizeof(sbuf.st_mtime),savef);
	encwrite(&slines,sizeof(slines),savef);
	encwrite(&scols,sizeof(scols),savef);
	msg("");
	rs_save_file(savef);
	close(fnum);
	signal(SIGINT, byebye);
	signal(SIGQUIT, byebye);
	wclear(cw);
	draw(cw);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x16baf(%rip), %rax     # 0x29fc0
movl (%rax), %eax
leaq 0x4(%rsp), %r15
movl %eax, (%r15)
movq 0x16b7e(%rip), %rax     # 0x29fa0
movl (%rax), %eax
movq %rsp, %r14
movl %eax, (%r14)
callq 0x62e0
movl %eax, %ebp
leaq 0x1ffa8(%rip), %r12     # 0x333e0
movl %eax, %edi
movq %r12, %rsi
callq 0x6550
leaq 0xd1e8(%rip), %rsi      # 0x20631
pushq $0x4
popq %rdx
movl %ebp, %edi
callq 0x6100
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x61d0
leaq 0x1a13b(%rip), %r13     # 0x2d5a0
movq %r13, %rdi
callq 0x6170
leal 0x1(%rax), %esi
movq %r13, %rdi
movq %rbx, %rdx
callq 0x1467c
leaq 0x1ff66(%rip), %rdi     # 0x333e8
pushq $0x8
popq %r13
movl %r13d, %esi
movq %rbx, %rdx
callq 0x1467c
movq %r12, %rdi
movl %r13d, %esi
movq %rbx, %rdx
callq 0x1467c
leaq 0x1ffa2(%rip), %rdi     # 0x33448
movl %r13d, %esi
movq %rbx, %rdx
callq 0x1467c
leaq 0x1ff80(%rip), %rdi     # 0x33438
movl %r13d, %esi
movq %rbx, %rdx
callq 0x1467c
pushq $0x4
popq %r12
movq %r15, %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq 0x1467c
movq %r14, %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq 0x1467c
leaq 0xe49f(%rip), %rdi      # 0x21989
xorl %eax, %eax
callq 0xb178
movq %rbx, %rdi
callq 0x172ce
movl %ebp, %edi
callq 0x6220
leaq -0x751b(%rip), %rbx     # 0xbfec
pushq $0x2
popq %rdi
movq %rbx, %rsi
callq 0x6270
pushq $0x3
popq %rdi
movq %rbx, %rsi
callq 0x6270
leaq 0x1d4ac(%rip), %rbx     # 0x309d0
movq (%rbx), %rdi
callq 0x6120
movq (%rbx), %rdi
callq 0x6200
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: encwrite
void encwrite(void *starta,unsigned int size,FILE *outf)
{
    char *ep;
    char *start = starta;

    ep = encstr;

    while (size--)
    {
        putc(*start++ ^ *ep++, outf);
        if (*ep == '\0')
            ep = encstr;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, %r15d
leaq 0x18e39(%rip), %r12     # 0x2d4d0
xorl %r13d, %r13d
movq %r12, %rbp
cmpl %r13d, %r15d
je 0x146cb
movb (%rbp), %al
xorb (%r14,%r13), %al
movsbl %al, %edi
movq %rbx, %rsi
callq 0x6250
cmpb $0x0, 0x1(%rbp)
movq %r12, %rax
je 0x146c3
incq %rbp
movq %rbp, %rax
incq %r13
movq %rax, %rbp
jmp 0x1469d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: encread
int encread(void *starta,unsigned int size,int inf)
{
    char *ep;
    int read_size;
    char *start = starta;

    if ((read_size = read(inf, start, size)) == -1 || read_size == 0)
        return read_size;

    ep = encstr;

    while (size--)
    {
        *start++ ^= *ep++;
        if (*ep == '\0')
            ep = encstr;
    }
    return read_size;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %r14d
movl %edx, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x6230
leal 0x1(%rax), %ecx
cmpl $0x2, %ecx
jae 0x14701
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x18dc8(%rip), %rcx     # 0x2d4d0
xorl %edx, %edx
movq %rcx, %rsi
cmpl %edx, %r14d
je 0x146f9
movb (%rsi), %dil
xorb %dil, (%rbx,%rdx)
cmpb $0x0, 0x1(%rsi)
movq %rcx, %rdi
je 0x14728
incq %rsi
movq %rsi, %rdi
incq %rdx
movq %rdi, %rsi
jmp 0x1470d
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write
int rs_write(FILE *savef, void *ptr, int size)
{
    if (!write_error)
        encwrite(ptr,size,savef);

    if (0)
        write_error = TRUE;
        
    assert(write_error == 0);

    return(WRITESTAT);
}

// Assembly:
pushq %rax
cmpl $0x0, 0x1ecf6(%rip)     # 0x33474
jne 0x1479e
movq %rdi, %rax
movq %rsi, %rdi
movl %edx, %esi
movq %rax, %rdx
callq 0x1467c
cmpl $0x0, 0x1ecdd(%rip)     # 0x33474
jne 0x1479e
pushq $0x1
popq %rax
popq %rcx
retq
leaq 0xc54b(%rip), %rdi      # 0x20cf0
leaq 0xc555(%rip), %rsi      # 0x20d01
leaq 0xc556(%rip), %rcx      # 0x20d09
movl $0xb7, %edx
callq 0x61e0
// File: /workspace/github_c_makefile_star2_O2/ajpaulson[P]srogue11/state.c
// Function: rs_write_int
int rs_write_int(FILE *savef, int c)
{
    unsigned char bytes[4];
    unsigned char *buf = (unsigned char *) &c;

    if (big_endian)
    {
        bytes[3] = buf[0];
        bytes[2] = buf[1];
        bytes[1] = buf[2];
        bytes[0] = buf[3];
        buf = bytes;
    }
    
    rs_write(savef, buf, 4);

    return(WRITESTAT);
}

// Assembly:
pushq %rax
movl %esi, (%rsp)
cmpl $0x0, 0x1ec74(%rip)     # 0x33480
je 0x1481b
movl %esi, %eax
bswapl %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
jmp 0x1481e
movq %rsp, %rsi
pushq $0x4
popq %rdx
callq 0x14776
xorl %eax, %eax
cmpl $0x0, 0x1ec45(%rip)     # 0x33474
sete %al
popq %rcx
retq