// File: lotuskip[P]yuxtapa/server/game.cpp
// Function: Game::next_map(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Game::next_map(const string &loadmap)
{
	// "fast-kill" all players and record playing times:
	for(list<Player>::iterator it = cur_players.begin();
		it != cur_players.end(); ++it)
	{
		if(it->is_alive())
		{
			it->cl_props.hp = it->doing_a_chore = 0;
			it->poisoner = cur_players.end();
			it->stats_i->time_played[it->cl] += time(NULL)
				- it->last_switched_cl;
		}
		else if(it->team == T_SPEC)
			it->stats_i->time_specced += time(NULL) - it->last_switched_cl;
		time(&(it->last_switched_cl));
		send_full_state_refresh(it);
	}
	// Clear EVERYTHING: (the rest of EVERYTHING is cleared in do_placement)
	axn_indicators.clear();
	event_set.clear();
	reg_sounds.clear();
	voices.clear();
	fball_centers.clear();

	construct_team_msgs(cur_players.end());
	send_team_upds(cur_players.end());

	write_player_stats();

	// ready for next map generation:
	if(loadmap.empty())
		init_phase = IPH_GEN_MAP;
	else if(!curmap->load_from_file(loadmap))
	{
		Network::to_chat("Could not load map by name \'" + loadmap + "\'!");
		init_phase = IPH_GEN_MAP;
	}
	else // no need to generate map!
	{
		Network::to_chat("Loaded map \'" + loadmap + "\'.");
		init_phase = IPH_GENERALS;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
leaq 0x59efa(%rip), %rdi     # 0x90230
callq 0x1b360
movq %rax, -0x10(%rbp)
leaq 0x59eea(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x1b100
testb $0x1, %al
jne 0x36365
jmp 0x364ee
leaq -0x10(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
callq 0x21cd0
testb $0x1, %al
jne 0x3637f
jmp 0x36445
leaq -0x10(%rbp), %rdi
callq 0x1b050
movb $0x0, 0x132(%rax)
leaq -0x10(%rbp), %rdi
callq 0x1b050
movb $0x0, 0x143(%rax)
leaq 0x59e8a(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1b050
movq -0x20(%rbp), %rcx
movq %rcx, 0x150(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x54c0
movq %rax, -0xf0(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1b050
movq %rax, %rcx
movq -0xf0(%rbp), %rax
subq 0xb8(%rcx), %rax
movq %rax, -0xe8(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
addq $0x80, %rdi
callq 0x1b390
movq %rax, -0xe0(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1b050
movq -0xe8(%rbp), %rdx
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movl 0xb0(%rcx), %ecx
addq 0xb0(%rax,%rcx,8), %rdx
movq %rdx, 0xb0(%rax,%rcx,8)
jmp 0x364b7
leaq -0x10(%rbp), %rdi
callq 0x1b050
cmpl $0x2, 0xac(%rax)
jne 0x364b5
xorl %eax, %eax
movl %eax, %edi
callq 0x54c0
movq %rax, -0x100(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1b050
movq %rax, %rcx
movq -0x100(%rbp), %rax
subq 0xb8(%rcx), %rax
movq %rax, -0xf8(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
addq $0x80, %rdi
callq 0x1b390
movq -0xf8(%rbp), %rcx
addq 0xa8(%rax), %rcx
movq %rcx, 0xa8(%rax)
jmp 0x364b7
leaq -0x10(%rbp), %rdi
callq 0x1b050
movq %rax, %rdi
addq $0xb8, %rdi
callq 0x54c0
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x36720
leaq -0x10(%rbp), %rdi
callq 0x1b3c0
jmp 0x3633f
leaq 0x5cbab(%rip), %rdi     # 0x930a0
callq 0x3c880
leaq 0x5cc47(%rip), %rdi     # 0x93148
callq 0x3c8a0
leaq 0x5cbc3(%rip), %rdi     # 0x930d0
callq 0x3c8c0
leaq 0x5cbe7(%rip), %rdi     # 0x93100
callq 0x3c8e0
leaq 0x5cc0b(%rip), %rdi     # 0x93130
callq 0x3c900
leaq 0x59cff(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x18a20
movq -0x30(%rbp), %rdi
callq 0x367a0
leaq 0x59cd9(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x18a20
movq -0x40(%rbp), %rdi
callq 0x36ce0
callq 0x22930
movq -0x8(%rbp), %rdi
callq 0x58d0
testb $0x1, %al
jne 0x3658a
jmp 0x36599
movl $0x0, 0x5b84c(%rip)     # 0x91de0
jmp 0x36705
movq 0x5b838(%rip), %rdi     # 0x91dd8
movq -0x8(%rbp), %rsi
callq 0x2c560
testb $0x1, %al
jne 0x36657
movq -0x8(%rbp), %rdx
leaq 0x2dabb(%rip), %rsi     # 0x64077
leaq -0x88(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x1f390
movq -0x108(%rbp), %rsi
leaq 0x36173(%rip), %rdx     # 0x6c750
leaq -0x68(%rbp), %rdi
callq 0x18a40
jmp 0x365e8
leaq -0x68(%rbp), %rdi
callq 0x1acd0
jmp 0x365f3
leaq -0x68(%rbp), %rdi
callq 0x5a48
leaq -0x88(%rbp), %rdi
callq 0x5a48
movl $0x0, 0x5b7ce(%rip)     # 0x91de0
jmp 0x36703
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x36646
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5a48
leaq -0x88(%rbp), %rdi
callq 0x5a48
jmp 0x3670e
movq -0x8(%rbp), %rdx
leaq 0x2da32(%rip), %rsi     # 0x64094
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x1f390
movq -0x110(%rbp), %rsi
leaq 0x2afa5(%rip), %rdx     # 0x61628
leaq -0xb8(%rbp), %rdi
callq 0x18a40
jmp 0x36691
leaq -0xb8(%rbp), %rdi
callq 0x1acd0
jmp 0x3669f
leaq -0xb8(%rbp), %rdi
callq 0x5a48
leaq -0xd8(%rbp), %rdi
callq 0x5a48
movl $0x1, 0x5b71f(%rip)     # 0x91de0
jmp 0x36703
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x366f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x5a48
leaq -0xd8(%rbp), %rdi
callq 0x5a48
jmp 0x3670e
jmp 0x36705
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x5920
nopw (%rax,%rax)