// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_hud.c
// Function: BeginIntermission
void BeginIntermission (edict_t *targ)
{
	int		i, n;
	edict_t	*ent, *client;

	if (level.intermissiontime)
		return;		// already activated

	MvpDisp = 1;

    // LM_JORM -- Proclaim a victory!
    Victory();
    // END LM_JORM

	game.autosaved = false;

	// respawn any dead clients
	//bat
	//Too Many overflows!!!!!
	//for (i=0 ; i<maxclients->value ; i++)
	//{
	//	client = g_edicts + 1 + i;
	//	if (!client->inuse)
	//		continue;
	//	if (client->health <= 0)
	//	respawn(client);
	//}

	level.intermissiontime = level.time;
	level.changemap = targ->map;


	if (strstr(level.changemap, "*"))
	{
		if (coop->value)
		{
			for (i=0 ; i<maxclients->value ; i++)
			{
				client = g_edicts + 1 + i;
				if (!client->inuse)
					continue;
				// strip players of all keys between units
				for (n = 0; n < MAX_ITEMS; n++)
				{
					if (itemlist[n].flags & IT_KEY)
						client->client->pers.inventory[n] = 0;
				}
			}
		}
	}
	else
	{
		if (!deathmatch->value)
		{
			level.exitintermission = 1;		// go immediately to the next level
			return;
		}
	}

	level.exitintermission = 0;

	// find an intermission spot
	ent = G_Find (NULL, FOFS(classname), "info_player_intermission");
	if (!ent)
	{	// the map creator forgot to put in an intermission point...
		ent = G_Find (NULL, FOFS(classname), "info_player_start");
		if (!ent)
			ent = G_Find (NULL, FOFS(classname), "info_player_deathmatch");
	}
	else
	{	// chose one of four spots
		i = rand() & 3;
		while (i--)
		{
			ent = G_Find (ent, FOFS(classname), "info_player_intermission");
			if (!ent)	// wrap around the list
				ent = G_Find (ent, FOFS(classname), "info_player_intermission");
		}
	}

	VectorCopy (ent->s.origin, level.intermission_origin);
	VectorCopy (ent->s.angles, level.intermission_angle);


	// move all clients to the intermission point
	for (i=0 ; i<maxclients->value ; i++)
	{
		client = g_edicts + 1 + i;
		if (!client->inuse)
			continue;
		MoveClientToIntermission (client);
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq 0x2368d(%rip), %rax     # 0x82da0
movss 0xc8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5f727
jp 0x5f727
jmp 0x5f72c
jmp 0x5fa84
movq 0x23075(%rip), %rax     # 0x827a8
movl $0x1, (%rax)
movb $0x0, %al
callq 0x19760
movq 0x235f9(%rip), %rax     # 0x82d40
movl $0x0, 0x620(%rax)
movq 0x23648(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq 0x2363c(%rip), %rax     # 0x82da0
movss %xmm0, 0xc8(%rax)
movq -0x8(%rbp), %rax
movq 0x270(%rax), %rcx
movq 0x23622(%rip), %rax     # 0x82da0
movq %rcx, 0xd0(%rax)
movq 0x23614(%rip), %rax     # 0x82da0
movq 0xd0(%rax), %rdi
leaq 0x17d13(%rip), %rsi     # 0x774ad
callq 0x19bf0
cmpq $0x0, %rax
je 0x5f881
movq 0x237b0(%rip), %rax     # 0x82f60
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5f7c7
jp 0x5f7c7
jmp 0x5f87f
movl $0x0, -0xc(%rbp)
cvtsi2ssl -0xc(%rbp), %xmm1
movq 0x22d56(%rip), %rax     # 0x82530
movq (%rax), %rax
movss 0x20(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x5f87d
movq 0x22d66(%rip), %rax     # 0x82558
movq (%rax), %rax
addq $0x4a8, %rax            # imm = 0x4A8
movslq -0xc(%rbp), %rcx
imulq $0x4a8, %rcx, %rcx      # imm = 0x4A8
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x5f819
jmp 0x5f86f
movl $0x0, -0x10(%rbp)
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
jge 0x5f86d
movslq -0x10(%rbp), %rcx
movq 0x2360c(%rip), %rax     # 0x82e40
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl 0x68(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x5f860
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x10(%rbp), %rcx
movl $0x0, 0x318(%rax,%rcx,4)
jmp 0x5f862
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x5f820
jmp 0x5f86f
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x5f7ce
jmp 0x5f87f
jmp 0x5f8b2
movq 0x23638(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5f8b0
jp 0x5f8b0
movq 0x234ff(%rip), %rax     # 0x82da0
movl $0x1, 0xd8(%rax)
jmp 0x5fa84
jmp 0x5f8b2
movq 0x234e7(%rip), %rax     # 0x82da0
movl $0x0, 0xd8(%rax)
xorl %eax, %eax
movl %eax, %edi
movq %rdi, %rax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x155ac(%rip), %rdx     # 0x74e85
callq 0x19660
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5f930
xorl %eax, %eax
movl %eax, %edi
movq %rdi, %rax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x10c3a(%rip), %rdx     # 0x70539
callq 0x19660
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5f92e
xorl %eax, %eax
movl %eax, %edi
movq %rdi, %rax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x10bfd(%rip), %rdx     # 0x70522
callq 0x19660
movq %rax, -0x18(%rbp)
jmp 0x5f992
callq 0x19c80
andl $0x3, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0xc(%rbp)
cmpl $0x0, %eax
je 0x5f990
movq -0x18(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x15525(%rip), %rdx     # 0x74e85
callq 0x19660
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5f98e
movq -0x18(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x15500(%rip), %rdx     # 0x74e85
callq 0x19660
movq %rax, -0x18(%rbp)
jmp 0x5f93b
jmp 0x5f992
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
movq 0x233fe(%rip), %rax     # 0x82da0
movss %xmm0, 0xdc(%rax)
movq -0x18(%rbp), %rax
movss 0x8(%rax), %xmm0
movq 0x233e6(%rip), %rax     # 0x82da0
movss %xmm0, 0xe0(%rax)
movq -0x18(%rbp), %rax
movss 0xc(%rax), %xmm0
movq 0x233ce(%rip), %rax     # 0x82da0
movss %xmm0, 0xe4(%rax)
movq -0x18(%rbp), %rax
movss 0x10(%rax), %xmm0
movq 0x233b6(%rip), %rax     # 0x82da0
movss %xmm0, 0xe8(%rax)
movq -0x18(%rbp), %rax
movss 0x14(%rax), %xmm0
movq 0x2339e(%rip), %rax     # 0x82da0
movss %xmm0, 0xec(%rax)
movq -0x18(%rbp), %rax
movss 0x18(%rax), %xmm0
movq 0x23386(%rip), %rax     # 0x82da0
movss %xmm0, 0xf0(%rax)
movl $0x0, -0xc(%rbp)
cvtsi2ssl -0xc(%rbp), %xmm1
movq 0x22afb(%rip), %rax     # 0x82530
movq (%rax), %rax
movss 0x20(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x5fa84
movq 0x22b0f(%rip), %rax     # 0x82558
movq (%rax), %rax
addq $0x4a8, %rax            # imm = 0x4A8
movslq -0xc(%rbp), %rcx
imulq $0x4a8, %rcx, %rcx      # imm = 0x4A8
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x5fa70
jmp 0x5fa79
movq -0x20(%rbp), %rdi
callq 0x192b0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x5fa29
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)