// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_utils.c
// Function: G_UseTargets
void G_UseTargets (edict_t *ent, edict_t *activator)
{
	edict_t		*t;

//
// check for a delay
//
	if (ent->delay)
	{
	// create a temp object to fire at a later time
		t = G_Spawn();
		t->classname = "DelayedUse";
		t->nextthink = level.time + ent->delay;
		t->think = Think_Delay;
		t->activator = activator;
		if (!activator)
			gi.dprintf ("Think_Delay with no activator\n");
		t->message = ent->message;
		t->target = ent->target;
		t->killtarget = ent->killtarget;
		return;
	}
	
	
//
// print the message
//
	if ((ent->message) && !(activator->svflags & SVF_MONSTER))
	{
		gi.centerprintf (activator, "%s", ent->message);
		if (ent->noise_index)
			gi.sound (activator, CHAN_AUTO, ent->noise_index, 1, ATTN_NORM, 0);
		else
			gi.sound (activator, CHAN_AUTO, gi.soundindex ("misc/talk1.wav"), 1, ATTN_NORM, 0);
	}

//
// kill killtargets
//
	if (ent->killtarget)
	{
		t = NULL;
		while ((t = G_Find (t, FOFS(targetname), ent->killtarget)) != NULL)
		{
			G_FreeEdict (t);
			if (!ent->inuse)
			{
				gi.dprintf("entity was removed while using killtargets\n");
				return;
			}
		}
	}

//
// fire targets
//
	if (ent->target)
	{
		t = NULL;
		while ((t = G_Find (t, FOFS(targetname), ent->target)) != NULL)
		{
			// doors fire area portals in a specific way
			if (!Q_stricmp(t->classname, "func_areaportal") &&
				(!Q_stricmp(ent->classname, "func_door") || !Q_stricmp(ent->classname, "func_door_rotating")))
				continue;

			if (t == ent)
			{
				gi.dprintf ("WARNING: Entity used itself.\n");
			}
			else
			{
				if (t->use)
					t->use (t, ent, activator);
			}
			if (!ent->inuse)
			{
				gi.dprintf("entity was removed while using targets\n");
				return;
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movss 0x2fc(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x5064b
jp 0x5064b
jmp 0x5070c
callq 0x19950
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
leaq 0x25b16(%rip), %rcx     # 0x76175
movq %rcx, 0x138(%rax)
movq 0x32733(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x2fc(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x200(%rax)
movq -0x18(%rbp), %rax
movq 0x3235b(%rip), %rcx     # 0x829f0
movq %rcx, 0x210(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x2b0(%rax)
cmpq $0x0, -0x10(%rbp)
jne 0x506c5
leaq 0x25ac7(%rip), %rdi     # 0x76180
movq 0x31f40(%rip), %rcx     # 0x82600
movb $0x0, %al
callq *0x8(%rcx)
movq -0x8(%rbp), %rax
movq 0x130(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x130(%rax)
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x150(%rax)
movq -0x8(%rbp), %rax
movq 0x160(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x160(%rax)
jmp 0x50953
movq -0x8(%rbp), %rax
cmpq $0x0, 0x130(%rax)
je 0x507d9
movq -0x10(%rbp), %rax
movl 0xc8(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x507d9
movq 0x31ec5(%rip), %rax     # 0x82600
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x130(%rax), %rdx
leaq 0x1f248(%rip), %rsi     # 0x6f99d
movb $0x0, %al
callq *%rcx
movq -0x8(%rbp), %rax
cmpl $0x0, 0x2e8(%rax)
je 0x50793
movq 0x31e93(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl 0x2e8(%rcx), %edx
xorl %esi, %esi
movss 0x1f763(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
jmp 0x507d7
movq 0x31e66(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0x22476(%rip), %rdi     # 0x72c27
movq 0x31e48(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x28(%rbp), %rdi
movl %eax, %edx
movq -0x20(%rbp), %rax
xorl %esi, %esi
movss 0x1f71d(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
jmp 0x507d9
movq -0x8(%rbp), %rax
cmpq $0x0, 0x160(%rax)
je 0x50846
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x160(%rax), %rdx
xorl %eax, %eax
addq $0x158, %rax            # imm = 0x158
movl %eax, %esi
callq 0x19660
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x50844
movq -0x18(%rbp), %rdi
callq 0x19cd0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x50842
leaq 0x2596e(%rip), %rdi     # 0x7619f
movq 0x31dc8(%rip), %rcx     # 0x82600
movb $0x0, %al
callq *0x8(%rcx)
jmp 0x50953
jmp 0x507ef
jmp 0x50846
movq -0x8(%rbp), %rax
cmpq $0x0, 0x150(%rax)
je 0x50953
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rdx
xorl %eax, %eax
addq $0x158, %rax            # imm = 0x158
movl %eax, %esi
callq 0x19660
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x50951
movq -0x18(%rbp), %rax
movq 0x138(%rax), %rdi
leaq 0x2235c(%rip), %rsi     # 0x72bfa
callq 0x186f0
cmpl $0x0, %eax
jne 0x508e5
movq -0x8(%rbp), %rax
movq 0x138(%rax), %rdi
leaq 0x22350(%rip), %rsi     # 0x72c0a
callq 0x186f0
cmpl $0x0, %eax
je 0x508e0
movq -0x8(%rbp), %rax
movq 0x138(%rax), %rdi
leaq 0x2233e(%rip), %rsi     # 0x72c14
callq 0x186f0
cmpl $0x0, %eax
jne 0x508e5
jmp 0x50860
movq -0x18(%rbp), %rax
cmpq -0x8(%rbp), %rax
jne 0x50904
leaq 0x258d5(%rip), %rdi     # 0x761cb
movq 0x31d03(%rip), %rcx     # 0x82600
movb $0x0, %al
callq *0x8(%rcx)
jmp 0x5092d
movq -0x18(%rbp), %rax
cmpq $0x0, 0x228(%rax)
je 0x5092b
movq -0x18(%rbp), %rax
movq 0x228(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq *%rax
jmp 0x5092d
movq -0x8(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x5094c
leaq 0x258ab(%rip), %rdi     # 0x761e9
movq 0x31cbb(%rip), %rcx     # 0x82600
movb $0x0, %al
callq *0x8(%rcx)
jmp 0x50953
jmp 0x50860
jmp 0x50953
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)