// File: lotuskip[P]yuxtapa/server/players.cpp
// Function: init_known_players(bool)
void init_known_players(const bool nopurge)
{
	string fname = Config::get_config_dir() + playerfilename;
	ifstream file(fname.c_str(), ios_base::binary);
	if(!file)
	{
		to_log("Could not read player data; file missing or not readable.");
		return;
	}

	short numpl;
	file.read(reinterpret_cast<char*>(&numpl), sizeof(short));
	if(numpl != STAT_VERSION)
	{
		to_log("Wrong statistics version in player data! All statistics will be cleared!");
		return;
	}

	file.read(reinterpret_cast<char*>(&numpl), sizeof(short));
	if(numpl < 0 || numpl > MAX_STORED_PLAYERS)
	{
		to_log("Player datafile is corrupt! Ignoring the data!");
		return;
	}
	if(!nopurge)
		to_log("Player data contains " + lex_cast(numpl)
			+ " entries;");
	PlayerStats tmpstats;
	short sh; char ch;
	tmpstats.password[PASSW_LEN] = '\0';
	int tooold;
	if(nopurge)
		tooold = 0;
	else // statpurge is hours, tooold seconds:
		tooold = 60*60*Config::int_settings[Config::IS_STATPURGE];
	while(numpl--)
	{
		file.read(reinterpret_cast<char*>(&tmpstats.ID), sizeof(short));
		file.read(tmpstats.password, PASSW_LEN);
		file.read(reinterpret_cast<char*>(tmpstats.kills), MAX_WAY_TO_KILL*sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.deaths), sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.tks), sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.healing_recvd), sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.total_time), sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.time_specced), sizeof(long));
		file.read(reinterpret_cast<char*>(tmpstats.time_played), NO_CLASS*sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.arch_hits), sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.arch_shots), sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.cm_hits), sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.cm_shots), sizeof(long));
		file.read(reinterpret_cast<char*>(&tmpstats.ad_lvl), sizeof(e_AdminLvl));
		file.read(reinterpret_cast<char*>(&tmpstats.last_seen), sizeof(time_t));
		tmpstats.last_known_as.clear();
		for(file.read(reinterpret_cast<char *>(&sh), sizeof(short)); sh > 0; --sh)
		{
			file.read(reinterpret_cast<char *>(&ch), sizeof(char));
			tmpstats.last_known_as += ch;
		}
		if(!tooold || tmpstats.ad_lvl > AL_REG || (time(NULL) - tmpstats.last_seen) < tooold)
			known_players.push_back(tmpstats);
	}
	if(!nopurge)
		to_log(lex_cast(known_players.size()) + " entries accepted.");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4d0, %rsp            # imm = 0x4D0
movb %dil, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
callq 0x1ef50
movq %rax, %rsi
leaq 0x6e0f6(%rip), %rdx     # 0x90058
leaq -0x28(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x24cb0
movq -0x4a8(%rbp), %rdi
callq 0x5200
movq %rax, %rsi
leaq -0x230(%rbp), %rdi
movl $0x4, %edx
callq 0x5970
jmp 0x21f94
movq -0x230(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x230(%rbp,%rax), %rdi
callq 0x5250
movb %al, -0x4a9(%rbp)
jmp 0x21fb4
movb -0x4a9(%rbp), %al
testb $0x1, %al
jne 0x21fc3
jmp 0x22098
leaq -0x261(%rbp), %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x5930
movq -0x4b8(%rbp), %rdx
leaq 0x3f845(%rip), %rsi     # 0x61829
leaq -0x260(%rbp), %rdi
callq 0x18880
jmp 0x21ff2
leaq -0x260(%rbp), %rdi
callq 0x28d70
jmp 0x22000
leaq -0x260(%rbp), %rdi
callq 0x5a48
leaq -0x261(%rbp), %rdi
callq 0x5590
movl $0x1, -0x268(%rbp)
jmp 0x226b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x226e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x226dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x22087
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x5a48
leaq -0x261(%rbp), %rdi
callq 0x5590
jmp 0x226dc
leaq -0x230(%rbp), %rdi
leaq -0x26a(%rbp), %rsi
movl $0x2, %edx
callq 0x56c0
jmp 0x220b2
movswl -0x26a(%rbp), %eax
cmpl $-0x1, %eax
je 0x22169
leaq -0x291(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x5930
movq -0x4c0(%rbp), %rdx
leaq 0x3f780(%rip), %rsi     # 0x61863
leaq -0x290(%rbp), %rdi
callq 0x18880
jmp 0x220f1
leaq -0x290(%rbp), %rdi
callq 0x28d70
jmp 0x220ff
leaq -0x290(%rbp), %rdi
callq 0x5a48
leaq -0x291(%rbp), %rdi
callq 0x5590
movl $0x1, -0x268(%rbp)
jmp 0x226b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x22158
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x5a48
leaq -0x291(%rbp), %rdi
callq 0x5590
jmp 0x226dc
leaq -0x230(%rbp), %rdi
leaq -0x26a(%rbp), %rsi
movl $0x2, %edx
callq 0x56c0
jmp 0x22183
movswl -0x26a(%rbp), %eax
cmpl $0x0, %eax
jl 0x221a1
movswl -0x26a(%rbp), %eax
cmpl $0x2710, %eax           # imm = 0x2710
jle 0x22248
leaq -0x2b9(%rbp), %rdi
movq %rdi, -0x4c8(%rbp)
callq 0x5930
movq -0x4c8(%rbp), %rdx
leaq 0x3f6ea(%rip), %rsi     # 0x618ac
leaq -0x2b8(%rbp), %rdi
callq 0x18880
jmp 0x221d0
leaq -0x2b8(%rbp), %rdi
callq 0x28d70
jmp 0x221de
leaq -0x2b8(%rbp), %rdi
callq 0x5a48
leaq -0x2b9(%rbp), %rdi
callq 0x5590
movl $0x1, -0x268(%rbp)
jmp 0x226b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x22237
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0x5a48
leaq -0x2b9(%rbp), %rdi
callq 0x5590
jmp 0x226dc
testb $0x1, -0x1(%rbp)
jne 0x22336
movswl -0x26a(%rbp), %esi
leaq -0x320(%rbp), %rdi
callq 0x609d0
jmp 0x22267
leaq 0x3f66d(%rip), %rsi     # 0x618db
leaq -0x300(%rbp), %rdi
leaq -0x320(%rbp), %rdx
callq 0x18a90
jmp 0x22283
leaq 0x3f667(%rip), %rdx     # 0x618f1
leaq -0x2e0(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x18a40
jmp 0x2229f
leaq -0x2e0(%rbp), %rdi
callq 0x28d70
jmp 0x222ad
leaq -0x2e0(%rbp), %rdi
callq 0x5a48
leaq -0x300(%rbp), %rdi
callq 0x5a48
leaq -0x320(%rbp), %rdi
callq 0x5a48
jmp 0x22336
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x22325
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x22319
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x5a48
leaq -0x300(%rbp), %rdi
callq 0x5a48
leaq -0x320(%rbp), %rdi
callq 0x5a48
jmp 0x226dc
leaq -0x458(%rbp), %rdi
callq 0x21ae0
jmp 0x22344
movb $0x0, -0x44e(%rbp)
testb $0x1, -0x1(%rbp)
je 0x2235d
movl $0x0, -0x460(%rbp)
jmp 0x22371
leaq 0x6d6ac(%rip), %rax     # 0x8fa10
imull $0xe10, 0x24(%rax), %eax # imm = 0xE10
movl %eax, -0x460(%rbp)
jmp 0x22373
movw -0x26a(%rbp), %ax
movw %ax, %cx
addw $-0x1, %cx
movw %cx, -0x26a(%rbp)
cmpw $0x0, %ax
je 0x225f2
leaq -0x230(%rbp), %rdi
leaq -0x458(%rbp), %rsi
movl $0x2, %edx
callq 0x56c0
jmp 0x223ac
leaq -0x456(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x223c6
leaq -0x420(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x58, %edx
callq 0x56c0
jmp 0x223e0
leaq -0x428(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x223fa
leaq -0x3c8(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x22414
leaq -0x3c0(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x2242e
leaq -0x3b8(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x22448
leaq -0x3b0(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x22462
leaq -0x3a8(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x58, %edx
callq 0x56c0
jmp 0x2247c
leaq -0x350(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x22496
leaq -0x348(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x224b0
leaq -0x340(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x224ca
leaq -0x338(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x224e4
leaq -0x328(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x4, %edx
callq 0x56c0
jmp 0x224fe
leaq -0x330(%rbp), %rsi
leaq -0x230(%rbp), %rdi
movl $0x8, %edx
callq 0x56c0
jmp 0x22518
leaq -0x448(%rbp), %rdi
callq 0x5730
leaq -0x230(%rbp), %rdi
leaq -0x45a(%rbp), %rsi
movl $0x2, %edx
callq 0x56c0
jmp 0x2253e
jmp 0x22540
movswl -0x45a(%rbp), %eax
cmpl $0x0, %eax
jle 0x225a8
leaq -0x230(%rbp), %rdi
leaq -0x45b(%rbp), %rsi
movl $0x1, %edx
callq 0x56c0
jmp 0x22566
movsbl -0x45b(%rbp), %esi
leaq -0x448(%rbp), %rdi
callq 0x5310
jmp 0x2257b
jmp 0x2257d
movw -0x45a(%rbp), %ax
addw $-0x1, %ax
movw %ax, -0x45a(%rbp)
jmp 0x22540
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x226d0
cmpl $0x0, -0x460(%rbp)
je 0x225d6
cmpl $0x1, -0x328(%rbp)
jg 0x225d6
xorl %eax, %eax
movl %eax, %edi
callq 0x54c0
subq -0x330(%rbp), %rax
movslq -0x460(%rbp), %rcx
cmpq %rcx, %rax
jge 0x225ed
leaq 0x6dc3b(%rip), %rdi     # 0x90218
leaq -0x458(%rbp), %rsi
callq 0x24d30
jmp 0x225eb
jmp 0x225ed
jmp 0x22373
testb $0x1, -0x1(%rbp)
jne 0x2269c
leaq 0x6dc15(%rip), %rdi     # 0x90218
callq 0x24d70
movl %eax, %esi
leaq -0x4a0(%rbp), %rdi
callq 0x609d0
jmp 0x22618
leaq 0x3f2dc(%rip), %rdx     # 0x618fb
leaq -0x480(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x18a40
jmp 0x22634
leaq -0x480(%rbp), %rdi
callq 0x28d70
jmp 0x22642
leaq -0x480(%rbp), %rdi
callq 0x5a48
leaq -0x4a0(%rbp), %rdi
callq 0x5a48
jmp 0x2269c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0x2268e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x480(%rbp), %rdi
callq 0x5a48
leaq -0x4a0(%rbp), %rdi
callq 0x5a48
jmp 0x226d0
leaq -0x458(%rbp), %rdi
callq 0x24da0
movl $0x0, -0x268(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x5170
leaq -0x28(%rbp), %rdi
callq 0x5a48
addq $0x4d0, %rsp            # imm = 0x4D0
popq %rbp
retq
leaq -0x458(%rbp), %rdi
callq 0x24da0
leaq -0x230(%rbp), %rdi
callq 0x5170
leaq -0x28(%rbp), %rdi
callq 0x5a48
movq -0x238(%rbp), %rdi
callq 0x5920
nopl (%rax)