// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x20c82(%rip), %r15     # 0x69da0
movss 0xc8(%r15), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x493a3
jp 0x493a3
movq %rdi, %rbx
movq 0x20665(%rip), %rax     # 0x697a8
movl $0x1, (%rax)
xorl %eax, %eax
callq 0x19530
movq 0x20be9(%rip), %rax     # 0x69d40
movl $0x0, 0x620(%rax)
movss 0x4(%r15), %xmm0
movss %xmm0, 0xc8(%r15)
movq 0x270(%rbx), %rdi
movq %rdi, 0xd0(%r15)
movl $0x2a, %esi
callq 0x18730
testq %rax, %rax
je 0x49232
movq 0x20dc8(%rip), %rax     # 0x69f60
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x491ae
jnp 0x4924f
movq 0x2037b(%rip), %rax     # 0x69530
movq (%rax), %rax
movss 0x20(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x4924f
movq 0x2038b(%rip), %rcx     # 0x69558
movl $0x4a8, %eax            # imm = 0x4A8
addq (%rcx), %rax
xorl %ecx, %ecx
movq 0x20c62(%rip), %rdx     # 0x69e40
addq $0x68, %rdx
imulq $0x4a8, %rcx, %rsi      # imm = 0x4A8
cmpl $0x0, 0x60(%rax,%rsi)
je 0x49221
addq %rax, %rsi
movq %rdx, %rdi
xorl %r8d, %r8d
testb $0x10, (%rdi)
je 0x4920e
movq 0x58(%rsi), %r9
movl $0x0, 0x318(%r9,%r8,4)
incq %r8
addq $0x88, %rdi
cmpq $0x100, %r8             # imm = 0x100
jne 0x491f9
incq %rcx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
ucomiss %xmm1, %xmm0
ja 0x491e2
jmp 0x4924f
movq 0x20c87(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4924f
jnp 0x49398
movl $0x0, 0xd8(%r15)
leaq 0xfd10(%rip), %rdx      # 0x58f71
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
testq %rax, %rax
je 0x492b8
movq %rax, %rbx
callq 0x19a20
movl %eax, %ebp
andl $0x3, %ebp
je 0x492e9
leaq 0xfce9(%rip), %r14      # 0x58f71
movq %rbx, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x19430
movq %rax, %rbx
testq %rax, %rax
jne 0x492b2
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x19430
movq %rax, %rbx
decl %ebp
jne 0x49288
jmp 0x492e9
leaq 0xb26a(%rip), %rdx      # 0x54529
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
movq %rax, %rbx
testq %rax, %rax
jne 0x492e9
leaq 0xb238(%rip), %rdx      # 0x54512
xorl %edi, %edi
movl $0x138, %esi            # imm = 0x138
callq 0x19430
movq %rax, %rbx
movss 0x4(%rbx), %xmm0
movss %xmm0, 0xdc(%r15)
movss 0x8(%rbx), %xmm0
movss %xmm0, 0xe0(%r15)
movss 0xc(%rbx), %xmm0
movss %xmm0, 0xe4(%r15)
movss 0x10(%rbx), %xmm0
movss %xmm0, 0xe8(%r15)
movss 0x14(%rbx), %xmm0
movss %xmm0, 0xec(%r15)
movss 0x18(%rbx), %xmm0
movss %xmm0, 0xf0(%r15)
movq 0x201ec(%rip), %rbx     # 0x69530
movq (%rbx), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x493a3
movl $0x4a8, %r14d           # imm = 0x4A8
movl $0x1, %ebp
movq 0x201f2(%rip), %r15     # 0x69558
movq (%r15), %rdi
cmpl $0x0, 0x60(%rdi,%r14)
je 0x49379
addq %r14, %rdi
callq 0x190e0
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movq (%rbx), %rax
movss 0x20(%rax), %xmm1
addq $0x4a8, %r14            # imm = 0x4A8
incl %ebp
ucomiss %xmm0, %xmm1
ja 0x49366
jmp 0x493a3
movl $0x1, 0xd8(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq