// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_stats.c
// Function: stats_output
void stats_output(edict_t *ent, stats_player_s *p_player)
{
	int total_encounters;
	char teambuf[MAX_INFO_STRING];
	char *conbuf;
	char outbuf[MAX_INFO_STRING];
	char tmpbuf[MAX_INFO_STRING];

	strcpy(teambuf,"");
	ctf_teamstring(teambuf, p_player->info.teamnum, CTF_TEAM_MATCHING);

	if (p_player->dropped)
		conbuf = "quit";
	else
		conbuf = "active";

	
	
	total_encounters = p_player->stats[STATS_FRAGS] + p_player->stats[STATS_DEATHS];

	strcpy(outbuf,"");


	Com_sprintf (tmpbuf, sizeof tmpbuf, "\n(%s) [%s] %s\n", teambuf, conbuf, p_player->info.name);
	strcat(outbuf,tmpbuf);

	sprintf (tmpbuf,
					"Score=%ld "
					"Frags=%ld "
					"Deaths=%ld "
					"Eff=%ld%%\n",
					p_player->stats[STATS_SCORE], p_player->stats[STATS_FRAGS], p_player->stats[STATS_DEATHS],
					total_encounters == 0 ? 0 : 100 * p_player->stats[STATS_FRAGS] / total_encounters);
	strcat(outbuf,tmpbuf);

	sprintf (tmpbuf, "Def Base=%ld Def Flag=%ld Def Carrier=%ld\nGot Flag=%ld Lost Flag=%ld Captures=%ld\n", 
				p_player->stats[STATS_DEFENSE_BASE],
				p_player->stats[STATS_DEFENSE_FLAG],
				p_player->stats[STATS_DEFENSE_CARRIER],
				p_player->stats[STATS_OFFENSE_FLAG],
				p_player->stats[STATS_OFFENSE_FLAGLOST],
				p_player->stats[STATS_CAPTURES]);
	strcat(outbuf,tmpbuf);

	sprintf (tmpbuf, "Kill Carrier=%ld Flag Returns=%ld Assists=%ld\nAverage Ping=%ld Samples=%ld\n",
					p_player->stats[STATS_OFFENSE_CARRIER],
					p_player->stats[STATS_RETURNS],
					p_player->stats[STATS_ASSISTS],
					p_player->stats[STATS_PING_TOTAL] / (p_player->stats[STATS_PING_SAMPLES] > 0 ? p_player->stats[STATS_PING_SAMPLES] : 1),
					p_player->stats[STATS_PING_SAMPLES]);
	strcat(outbuf,tmpbuf);
	ctf_SafePrint(ent, PRINT_HIGH, outbuf);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x6a0, %rsp            # imm = 0x6A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x220(%rbp), %rdi
leaq 0x478ff(%rip), %rsi     # 0x70f80
callq 0x182c0
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x204(%rax), %esi
movl $0xfffffff9, %edx       # imm = 0xFFFFFFF9
callq 0x18210
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x296ba
leaq 0x476f9(%rip), %rax     # 0x70daa
movq %rax, -0x228(%rbp)
jmp 0x296c8
leaq 0x45f42(%rip), %rax     # 0x6f603
movq %rax, -0x228(%rbp)
movq -0x10(%rbp), %rax
movq 0x230(%rax), %rax
movq -0x10(%rbp), %rcx
addq 0x238(%rcx), %rax
movl %eax, -0x14(%rbp)
leaq -0x430(%rbp), %rdi
leaq 0x47891(%rip), %rsi     # 0x70f80
callq 0x182c0
leaq -0x630(%rbp), %rdi
leaq -0x220(%rbp), %rcx
movq -0x228(%rbp), %r8
movq -0x10(%rbp), %r9
addq $0x4, %r9
movl $0x200, %esi            # imm = 0x200
leaq 0x47692(%rip), %rdx     # 0x70daf
movb $0x0, %al
callq 0x18f90
leaq -0x430(%rbp), %rdi
leaq -0x630(%rbp), %rsi
callq 0x19880
leaq -0x630(%rbp), %rax
movq %rax, -0x650(%rbp)
movq -0x10(%rbp), %rax
movq 0x220(%rax), %rax
movq %rax, -0x648(%rbp)
movq -0x10(%rbp), %rax
movq 0x230(%rax), %rax
movq %rax, -0x640(%rbp)
movq -0x10(%rbp), %rax
movq 0x238(%rax), %rax
movq %rax, -0x638(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x2978c
xorl %eax, %eax
movq %rax, -0x658(%rbp)
jmp 0x297a8
movq -0x10(%rbp), %rax
imulq $0x64, 0x230(%rax), %rax
movslq -0x14(%rbp), %rcx
cqto
idivq %rcx
movq %rax, -0x658(%rbp)
movq -0x638(%rbp), %r8
movq -0x640(%rbp), %rcx
movq -0x648(%rbp), %rdx
movq -0x650(%rbp), %rdi
movq -0x658(%rbp), %r9
leaq 0x475ec(%rip), %rsi     # 0x70dbe
movb $0x0, %al
callq 0x19940
leaq -0x430(%rbp), %rdi
leaq -0x630(%rbp), %rsi
callq 0x19880
leaq -0x630(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x248(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x240(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x250(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x268(%rax), %r9
movq -0x10(%rbp), %rax
movq 0x278(%rax), %r10
movq -0x10(%rbp), %rax
movq 0x228(%rax), %rax
leaq 0x475ac(%rip), %rsi     # 0x70de8
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x19940
leaq -0x430(%rbp), %rdi
leaq -0x630(%rbp), %rsi
callq 0x19880
leaq -0x630(%rbp), %rax
movq %rax, -0x680(%rbp)
movq -0x10(%rbp), %rax
movq 0x270(%rax), %rax
movq %rax, -0x678(%rbp)
movq -0x10(%rbp), %rax
movq 0x260(%rax), %rax
movq %rax, -0x670(%rbp)
movq -0x10(%rbp), %rax
movq 0x258(%rax), %rax
movq %rax, -0x668(%rbp)
movq -0x10(%rbp), %rax
movq 0x208(%rax), %rax
movq %rax, -0x660(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x210(%rax)
jle 0x298d7
movq -0x10(%rbp), %rax
movq 0x210(%rax), %rax
movq %rax, -0x688(%rbp)
jmp 0x298e5
movl $0x1, %eax
movq %rax, -0x688(%rbp)
jmp 0x298e5
movq -0x668(%rbp), %r8
movq -0x670(%rbp), %rcx
movq -0x680(%rbp), %rdi
movq -0x660(%rbp), %rax
movq -0x688(%rbp), %rsi
cqto
idivq %rsi
movq -0x678(%rbp), %rdx
movq %rax, %r9
movq -0x10(%rbp), %rax
movq 0x210(%rax), %rax
leaq 0x47512(%rip), %rsi     # 0x70e3b
movq %rax, (%rsp)
movb $0x0, %al
callq 0x19940
leaq -0x430(%rbp), %rdi
leaq -0x630(%rbp), %rsi
callq 0x19880
movq -0x8(%rbp), %rdi
leaq -0x430(%rbp), %rdx
movl $0x2, %esi
callq 0x18f20
addq $0x6a0, %rsp            # imm = 0x6A0
popq %rbp
retq
nopw %cs:(%rax,%rax)