// File: /workspace/github_c_makefile_star2_O2/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 0x22424(%rip), %rax     # 0x2d893
cmpb $0x0, (%rax)
jne 0xb734
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movb $0x1, (%rax)
xorl %eax, %eax
callq 0x9378
leaq 0x228b9(%rip), %rax     # 0x2dd50
movq (%rax), %rsi
movl 0x38(%rsi), %ecx
movl 0x3c(%rsi), %eax
pushq $0xa
popq %rdi
cltd
idivl %edi
movl %eax, 0x14(%rsp)
movl %ecx, %eax
cltd
idivl %edi
movl %eax, 0x10(%rsp)
leaq 0x25516(%rip), %rbp     # 0x309d0
movq (%rbp), %rax
testq %rax, %rax
je 0xb4d0
movswl (%rax), %ecx
movl %ecx, 0xc(%rsp)
movswl 0x2(%rax), %eax
jmp 0xb4d7
pushq $-0x1
popq %rax
movl %eax, 0xc(%rsp)
movl %eax, 0x8(%rsp)
cmpl $0x64, 0x34(%rsi)
jl 0xb4ef
movb $0x33, %al
movb %al, 0x21ea8(%rip)      # 0x2d391
movb %al, 0x21ea6(%rip)      # 0x2d395
leaq 0x2275a(%rip), %rbx     # 0x2dc50
leaq 0x227eb(%rip), %r15     # 0x2dce8
movl (%rbx), %r8d
movl 0x10(%rbx), %edx
cmpl (%r15), %r8d
pushq $0x2a
popq %r12
pushq $0x20
popq %r13
movl %r13d, %ecx
cmovll %r12d, %ecx
leaq 0x274e4(%rip), %r14     # 0x32a00
leaq 0x135ac(%rip), %rsi     # 0x1eacf
movq %r14, %rdi
xorl %eax, %eax
callq 0x64d0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
movl 0x4(%rbx), %r8d
cmpl 0x4(%r15), %r8d
movl 0x14(%rbx), %edx
movl %r13d, %ecx
cmovll %r12d, %ecx
leaq 0x1358d(%rip), %rsi     # 0x1eadf
xorl %eax, %eax
callq 0x64d0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
movl 0x8(%rbx), %r8d
cmpl 0x8(%r15), %r8d
movl 0x18(%rbx), %edx
movl %r13d, %ecx
cmovll %r12d, %ecx
leaq 0x13573(%rip), %rsi     # 0x1eaf1
xorl %eax, %eax
callq 0x64d0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
movl 0xc(%rbx), %r8d
movl 0x1c(%rbx), %edx
cmpl 0xc(%r15), %r8d
cmovll %r12d, %r13d
leaq 0x1355c(%rip), %rsi     # 0x1eb03
movl %r13d, %ecx
xorl %eax, %eax
callq 0x64d0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
leaq 0x13551(%rip), %rsi     # 0x1eb15
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
xorl %eax, %eax
callq 0x64d0
movq (%rbp), %rdi
movq 0x1e9e2(%rip), %r12     # 0x29fc0
movl (%r12), %esi
decl %esi
xorl %edx, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0xb603
movq (%rbp), %rdi
leaq 0x27405(%rip), %rsi     # 0x32a00
pushq $-0x1
popq %rdx
callq 0x6530
leaq 0x1ecd6(%rip), %rax     # 0x2a2e0
movl (%rax), %edx
leaq 0x22249(%rip), %rax     # 0x2d85c
movl (%rax), %ecx
leaq 0x1350b(%rip), %rsi     # 0x1eb27
movq %r14, %rdi
xorl %eax, %eax
callq 0x64d0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
leaq 0x22717(%rip), %rbx     # 0x2dd50
movq (%rbx), %rax
movl 0x30(%rax), %edx
movl 0x34(%rax), %ecx
leaq 0x21d47(%rip), %rsi     # 0x2d390
xorl %eax, %eax
callq 0x64d0
movq %r14, %rdi
callq 0x6170
leaq 0x221e9(%rip), %rcx     # 0x2d848
movq (%rcx), %rcx
movq (%rbx), %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 0x134b9(%rip), %rsi     # 0x1eb42
xorl %eax, %eax
callq 0x64d0
leaq 0x221cd(%rip), %rax     # 0x2d864
movl (%rax), %eax
pushq $0x24
popq %rcx
cltd
idivl %ecx
movl %eax, %r15d
movq %r14, %rdi
callq 0x6170
addq %rax, %r14
leaq 0x134a6(%rip), %rsi     # 0x1eb5a
movq %r14, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x64d0
movq (%rbp), %rdi
movl (%r12), %esi
addl $-0x2, %esi
xorl %edx, %edx
callq 0x6470
cmpl $-0x1, %eax
je 0xb6eb
movq (%rbp), %rdi
leaq 0x2731d(%rip), %rsi     # 0x32a00
pushq $-0x1
popq %rdx
callq 0x6530
movq (%rbp), %rdi
leaq 0x2218a(%rip), %rax     # 0x2d880
movslq (%rax), %rax
leaq 0x21c70(%rip), %rcx     # 0x2d370
movq (%rcx,%rax,8), %rsi
pushq $-0x1
popq %rdx
callq 0x6530
movq (%rbp), %rdi
callq 0x6480
movq (%rbp), %rdi
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
callq 0x6470
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq