// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: SelectSpawnPoint
void	SelectSpawnPoint (edict_t *ent, vec3_t origin, vec3_t angles)
{
	edict_t	*spot = NULL;
	
	// CTF CODE -- LM_JORM
	if (ent->client->resp.enterframe == level.framenum) // Just entered
		spot = SelectTeamSpawnPoint (ent);
	
	if (!spot)
		spot = SelectAnySpawnPoint (ent);
	
	if (!spot)
		spot = SelectDeathmatchSpawnPoint ();
	
	if (!spot)
		spot = SelectCoopSpawnPoint (ent);
	
	if (!spot)
		spot = G_Find (spot, FOFS(classname), "info_flag_red");
	if (!spot)
		spot = G_Find (spot, FOFS(classname), "info_flag_blue");
	
	// END CTF CODE -- LM_JORM
	
	// find a single player start spot
	if (!spot)
	{
		while ((spot = G_Find (spot, FOFS(classname), "info_player_start")) != NULL)
		{
			if (!game.spawnpoint[0] && !spot->targetname)
				break;

			if (!game.spawnpoint[0] || !spot->targetname)
				continue;

			if (Q_stricmp(game.spawnpoint, spot->targetname) == 0)
				break;
		}

		if (!spot)
		{
			if (!game.spawnpoint[0])
			{	// there wasn't a spawnpoint without a target, so use any
				spot = G_Find (spot, FOFS(classname), "info_player_start");
			}
			if (!spot) 
			{
				gi.error("Couldn't find spawn point %s\n", game.spawnpoint);
				return;
			}
		}
	}

	VectorCopy (spot->s.origin, origin);
	origin[2] += 9;
	VectorCopy (spot->s.angles, angles);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xdf0(%rax), %eax
movq 0x29bdf(%rip), %rcx     # 0x82da0
cmpl (%rcx), %eax
jne 0x591d2
movq -0x8(%rbp), %rdi
callq 0x194f0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x591e6
movq -0x8(%rbp), %rdi
callq 0x180b0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x591f6
callq 0x19bd0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5920a
movq -0x8(%rbp), %rdi
callq 0x19980
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5922f
movq -0x20(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x16d22(%rip), %rdx     # 0x6ff48
callq 0x19660
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x59254
movq -0x20(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x16d0b(%rip), %rdx     # 0x6ff56
callq 0x19660
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x59355
jmp 0x59261
movq -0x20(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x172c3(%rip), %rdx     # 0x70539
callq 0x19660
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x592ef
movq 0x29ab4(%rip), %rax     # 0x82d40
cmpb $0x0, 0x410(%rax)
jne 0x592a5
movq -0x20(%rbp), %rax
cmpq $0x0, 0x158(%rax)
jne 0x592a5
jmp 0x592ef
movq 0x29a94(%rip), %rax     # 0x82d40
cmpb $0x0, 0x410(%rax)
je 0x592c3
movq -0x20(%rbp), %rax
cmpq $0x0, 0x158(%rax)
jne 0x592c5
jmp 0x59261
movq -0x20(%rbp), %rax
movq 0x158(%rax), %rsi
movq 0x29a69(%rip), %rdi     # 0x82d40
addq $0x410, %rdi            # imm = 0x410
callq 0x186f0
cmpl $0x0, %eax
jne 0x592ea
jmp 0x592ef
jmp 0x59261
cmpq $0x0, -0x20(%rbp)
jne 0x59353
movq 0x29a43(%rip), %rax     # 0x82d40
cmpb $0x0, 0x410(%rax)
jne 0x59324
movq -0x20(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x1721e(%rip), %rdx     # 0x70539
callq 0x19660
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x59351
leaq 0x1dd03(%rip), %rdi     # 0x77035
movq 0x29a07(%rip), %rsi     # 0x82d40
addq $0x410, %rsi            # imm = 0x410
movq 0x292b9(%rip), %rcx     # 0x82600
movb $0x0, %al
callq *0x38(%rcx)
jmp 0x593d5
jmp 0x59353
jmp 0x59355
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, (%rax)
movq -0x20(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x20(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rax
movss 0x1d07e(%rip), %xmm0    # 0x76414
addss 0x8(%rax), %xmm0
movss %xmm0, 0x8(%rax)
movq -0x20(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, (%rax)
movq -0x20(%rbp), %rax
movss 0x14(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x20(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)