// File: /workspace/github_c_makefile_star2_O3/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 0x21f2f(%rip), %rax     # 0x2d8a3
cmpb $0x0, (%rax)
jne 0xbc82
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, (%rax)
xorl %eax, %eax
callq 0x9560
leaq 0x223c7(%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 0x25011(%rip), %rsi     # 0x309e0
movq (%rsi), %rsi
testq %rsi, %rsi
je 0xb9e7
movswl (%rsi), %edi
movl %edi, 0x4(%rsp)
movswl 0x2(%rsi), %esi
movl %esi, (%rsp)
jmp 0xb9f6
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
addl %ecx, %r15d
addl %edx, %r12d
cmpl $0x64, 0x34(%rax)
jl 0xba10
movb $0x33, %al
movb %al, 0x21997(%rip)      # 0x2d3a1
movb %al, 0x21995(%rip)      # 0x2d3a5
leaq 0x22249(%rip), %rbp     # 0x2dc60
leaq 0x222da(%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 0x26fce(%rip), %r14     # 0x32a10
leaq 0x15086(%rip), %rsi     # 0x20acf
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 0x15061(%rip), %rsi     # 0x20adf
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 0x1503c(%rip), %rsi     # 0x20af1
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
movl 0xc(%rbp), %r8d
movl 0x1c(%rbp), %edx
leaq 0x22222(%rip), %rax     # 0x2dcf8
cmpl 0xc(%rax), %r8d
cmovll %ebx, %r13d
leaq 0x1501e(%rip), %rsi     # 0x20b03
movl %r13d, %ecx
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
leaq 0x15013(%rip), %rsi     # 0x20b15
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x64f0
leaq 0x24eca(%rip), %rbx     # 0x309e0
movq (%rbx), %rdi
movq 0x1e490(%rip), %r12     # 0x29fb0
movl (%r12), %esi
decl %esi
xorl %edx, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0xbb46
movq (%rbx), %rdi
leaq 0x26ed4(%rip), %rsi     # 0x32a10
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
leaq 0x1e7a3(%rip), %rax     # 0x2a2f0
movl (%rax), %edx
leaq 0x21d16(%rip), %rax     # 0x2d86c
movl (%rax), %ecx
leaq 0x14fc8(%rip), %rsi     # 0x20b27
movq %r14, %rdi
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq (%rax,%r14), %rdi
leaq 0x221e4(%rip), %r15     # 0x2dd60
movq (%r15), %rax
movl 0x30(%rax), %edx
movl 0x34(%rax), %ecx
leaq 0x21814(%rip), %rsi     # 0x2d3a0
xorl %eax, %eax
callq 0x64f0
movq %r14, %rdi
callq 0x6170
leaq 0x21cb6(%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 0x14f76(%rip), %rsi     # 0x20b42
xorl %eax, %eax
callq 0x64f0
leaq 0x21c9a(%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 0x14f56(%rip), %rsi     # 0x20b5a
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 0xbc3b
movq (%rbx), %rdi
leaq 0x26ddf(%rip), %rsi     # 0x32a10
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
movq (%rbx), %rdi
leaq 0x21c4b(%rip), %rax     # 0x2d890
movslq (%rax), %rax
leaq 0x21731(%rip), %rcx     # 0x2d380
movq (%rcx,%rax,8), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6550
movq (%rbx), %rdi
callq 0x64a0
movq (%rbx), %rdi
movl 0x4(%rsp), %esi
movl (%rsp), %edx
callq 0x6490
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq