// File: /workspace/github_c_makefile_star2_O1/ajpaulson[P]srogue11/io.c
// Function: status
int status(int fromfuse)
{
	int totwght, carwght;
	struct real *stef, *stre, *stmx;
	char *pb;
	int oy, ox, ch;
	static char buf[LINLEN];
	static char hwidth[] = { "%2d(%2d)" };

	/*
	 * If nothing has changed since the last time, then done
	 */
	if (nochange)
		return 0;
	nochange = TRUE;
	updpack();					/* get all weight info */
	stef = &player.t_stats.s_ef;
	stre = &player.t_stats.s_re;
	stmx = &max_stats.s_re;
	totwght = him->s_carry / 10;
	carwght = him->s_pack / 10;
	getyx(cw, oy, ox);
	if (him->s_maxhp >= 100) {
		hwidth[1] = '3';	/* if hit point >= 100	*/
		hwidth[5] = '3';	/* change %2d to %3d	*/
	}
	if (stre->a_str < stmx->a_str)
		ch = '*';
	else
		ch = ' ';
	sprintf(buf, "Str: %2d(%c%2d)", stef->a_str, ch, stre->a_str);
	pb = &buf[strlen(buf)];
	if (stre->a_dex < stmx->a_dex)
		ch = '*';
	else
		ch = ' ';
	sprintf(pb, "  Dex: %2d(%c%2d)", stef->a_dex, ch, stre->a_dex);
	pb = &buf[strlen(buf)];
	if (stre->a_wis < stmx->a_wis)
		ch = '*';
	else
		ch = ' ';
	sprintf(pb, "  Wis: %2d(%c%2d)", stef->a_wis, ch, stre->a_wis);
	pb = &buf[strlen(buf)];
	if (stre->a_con < stmx->a_con)
		ch = '*';
	else
		ch = ' ';
	sprintf(pb, "  Con: %2d(%c%2d)", stef->a_con, ch, stre->a_con);
	pb = &buf[strlen(buf)];
	sprintf(pb, "  Carry: %3d(%3d)", carwght, totwght);
	mvwaddstr(cw, LINES - 1, 0, buf);
	sprintf(buf, "Level: %d  Gold: %5d  Hp: ",level, purse);
	pb = &buf[strlen(buf)];
	sprintf(pb, hwidth, him->s_hpt, him->s_maxhp);
	pb = &buf[strlen(buf)];
	sprintf(pb,"  Ac: %-2d  Exp: %d/%ld",cur_armor == NULL ? him->s_arm :
	  cur_armor->o_ac, him->s_lvl, him->s_exp);
	carwght = (packvol * 100) / V_PACK;
	pb = &buf[strlen(buf)];
	sprintf(pb, "  Vol: %3d%%", carwght);
	mvwaddstr(cw, LINES - 2, 0, buf);
	waddstr(cw, hungstr[hungry_state]);
	wclrtoeol(cw);
	wmove(cw, oy, ox);
  return 0;
}

// Assembly:
leaq 0x21e7e(%rip), %rax     # 0x2d8a3
cmpb $0x0, (%rax)
jne 0xbd34
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, (%rax)
xorl %eax, %eax
callq 0x95e0
leaq 0x22316(%rip), %rax     # 0x2dd60
movq (%rax), %rax
movslq 0x3c(%rax), %rcx
imulq $0x66666667, %rcx, %r15 # imm = 0x66666667
movq %r15, %rcx
shrq $0x3f, %rcx
sarq $0x22, %r15
movslq 0x38(%rax), %rdx
imulq $0x66666667, %rdx, %r12 # imm = 0x66666667
movq %r12, %rdx
shrq $0x3f, %rdx
sarq $0x22, %r12
leaq 0x24f60(%rip), %rsi     # 0x309e0
movq (%rsi), %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0xba97
movswl (%rsi), %r8d
testq %rsi, %rsi
je 0xbaa0
movswl 0x2(%rsi), %edi
movl %r8d, (%rsp)
movl %edi, 0x4(%rsp)
addl %ecx, %r15d
addl %edx, %r12d
cmpl $0x64, 0x34(%rax)
jl 0xbac2
movb $0x33, %al
movb %al, 0x218e5(%rip)      # 0x2d3a1
movb %al, 0x218e3(%rip)      # 0x2d3a5
leaq 0x22197(%rip), %rbp     # 0x2dc60
leaq 0x22228(%rip), %rbx     # 0x2dcf8
movl (%rbp), %r8d
movl 0x10(%rbp), %edx
cmpl (%rbx), %r8d
movl $0x2a, %eax
movl $0x20, %r13d
movl $0x20, %ecx
cmovll %eax, %ecx
leaq 0x26f1c(%rip), %r14     # 0x32a10
leaq 0x14fb8(%rip), %rsi     # 0x20ab3
movq %r14, %rdi
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
movl 0x4(%rbp), %r8d
cmpl 0x4(%rbx), %r8d
movl 0x14(%rbp), %edx
movl $0x20, %ecx
movl $0x2a, %eax
cmovll %eax, %ecx
leaq 0x14f93(%rip), %rsi     # 0x20ac3
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
movl 0x8(%rbp), %r8d
cmpl 0x8(%rbx), %r8d
movl 0x18(%rbp), %edx
movl $0x20, %ecx
movl $0x2a, %eax
cmovll %eax, %ecx
movl $0x2a, %ebx
leaq 0x14f6e(%rip), %rsi     # 0x20ad5
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
movl 0xc(%rbp), %r8d
movl 0x1c(%rbp), %edx
leaq 0x22170(%rip), %rax     # 0x2dcf8
cmpl 0xc(%rax), %r8d
cmovll %ebx, %r13d
leaq 0x14f50(%rip), %rsi     # 0x20ae7
movl %r13d, %ecx
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
leaq 0x14f45(%rip), %rsi     # 0x20af9
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x64f0
leaq 0x24e18(%rip), %rbx     # 0x309e0
movq (%rbx), %rdi
movq 0x1e3de(%rip), %r12     # 0x29fb0
movl (%r12), %esi
decl %esi
xorl %edx, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0xbbf8
movq (%rbx), %rdi
leaq 0x26e22(%rip), %rsi     # 0x32a10
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
leaq 0x1e6f1(%rip), %rax     # 0x2a2f0
movl (%rax), %edx
leaq 0x21c64(%rip), %rax     # 0x2d86c
movl (%rax), %ecx
leaq 0x14efa(%rip), %rsi     # 0x20b0b
movq %r14, %rdi
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
leaq 0x22132(%rip), %r15     # 0x2dd60
movq (%r15), %rax
movl 0x30(%rax), %edx
movl 0x34(%rax), %ecx
leaq 0x21762(%rip), %rsi     # 0x2d3a0
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq 0x21c04(%rip), %rcx     # 0x2d858
movq (%rcx), %rcx
movq (%r15), %rsi
leaq 0x2c(%rsi), %rdx
leaq 0x34(%rcx), %r8
testq %rcx, %rcx
cmoveq %rdx, %r8
leaq (%rax,%r14), %rdi
movl (%r8), %edx
movl 0x28(%rsi), %ecx
movq 0x20(%rsi), %r8
leaq 0x14ea8(%rip), %rsi     # 0x20b26
xorl %eax, %eax
callq 0x64f0
leaq 0x21be8(%rip), %rax     # 0x2d874
movslq (%rax), %rax
imulq $0x38e38e39, %rax, %r15 # imm = 0x38E38E39
movq %r15, %rax
shrq $0x3f, %rax
sarq $0x23, %r15
addl %eax, %r15d
movq %r14, %rdi
callq 0x6170
addq %rax, %r14
leaq 0x14e88(%rip), %rsi     # 0x20b3e
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x64f0
movq (%rbx), %rdi
movl (%r12), %esi
addl $-0x2, %esi
xorl %edx, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0xbced
movq (%rbx), %rdi
leaq 0x26d2d(%rip), %rsi     # 0x32a10
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
movq (%rbx), %rdi
leaq 0x21b99(%rip), %rax     # 0x2d890
movslq (%rax), %rax
leaq 0x2167f(%rip), %rcx     # 0x2d380
movq (%rcx,%rax,8), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
movq (%rbx), %rdi
callq 0x64a0
movq (%rbx), %rdi
movl (%rsp), %esi
movl 0x4(%rsp), %edx
callq 0x6490
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq