// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_trigger.c
// Function: trigger_key_use
void trigger_key_use (edict_t *self, edict_t *other, edict_t *activator)
{
	int			index;

	if (!self->item)
		return;
	if (!activator->client)
		return;

	index = ITEM_INDEX(self->item);
	if (!activator->client->pers.inventory[index])
	{
		if (level.time < self->touch_debounce_time)
			return;
		self->touch_debounce_time = level.time + 5.0;
		gi.centerprintf (activator, "You need the %s", self->item->pickup_name);
		gi.sound (activator, CHAN_AUTO, gi.soundindex ("misc/keytry.wav"), 1, ATTN_NORM, 0);
		return;
	}

	gi.sound (activator, CHAN_AUTO, gi.soundindex ("misc/keyuse.wav"), 1, ATTN_NORM, 0);
	if (coop->value)
	{
		int		player;
		edict_t	*ent;

		if (strcmp(self->item->classname, "key_power_cube") == 0)
		{
			int	cube;

			for (cube = 0; cube < 8; cube++)
				if (activator->client->pers.power_cubes & (1 << cube))
					break;
			for (player = 1; player <= game.maxclients; player++)
			{
				ent = &g_edicts[player];
				if (!ent->inuse)
					continue;
				if (!ent->client)
					continue;
				if (ent->client->pers.power_cubes & (1 << cube))
				{
					ent->client->pers.inventory[index]--;
					ent->client->pers.power_cubes &= ~(1 << cube);
				}
			}
		}
		else
		{
			for (player = 1; player <= game.maxclients; player++)
			{
				ent = &g_edicts[player];
				if (!ent->inuse)
					continue;
				if (!ent->client)
					continue;
				ent->client->pers.inventory[index] = 0;
			}
		}
	}
	else
	{
		activator->client->pers.inventory[index]--;
	}

	G_UseTargets (self, activator);

	self->use = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x330(%rax)
jne 0x4f2e7
jmp 0x4f627
movq -0x18(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x4f2f7
jmp 0x4f627
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
movq 0x33b37(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
cmpl $0x0, 0x318(%rax,%rcx,4)
jne 0x4f3f3
movq 0x33a66(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm1
movq -0x8(%rbp), %rax
movss 0x240(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x4f355
jmp 0x4f627
movq 0x33a44(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x23823(%rip), %xmm1    # 0x72b90
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x240(%rax)
movq 0x33278(%rip), %rax     # 0x82600
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
movq 0x50(%rax), %rdx
leaq 0x26c5f(%rip), %rsi     # 0x76005
movb $0x0, %al
callq *%rcx
movq 0x3324f(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x26c4d(%rip), %rdi     # 0x76015
movq 0x33231(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x40(%rbp), %rdi
movl %eax, %edx
movq -0x38(%rbp), %rax
xorl %esi, %esi
movss 0x20b06(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
jmp 0x4f627
movq 0x33206(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq 0x26c14(%rip), %rdi     # 0x76025
movq 0x331e8(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x50(%rbp), %rdi
movl %eax, %edx
movq -0x48(%rbp), %rax
xorl %esi, %esi
movss 0x20abd(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
movq 0x33b22(%rip), %rax     # 0x82f60
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x4f455
jp 0x4f455
jmp 0x4f5ee
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
movq (%rax), %rdi
leaq 0x23a43(%rip), %rsi     # 0x72ead
callq 0x18bf0
cmpl $0x0, %eax
jne 0x4f57a
movl $0x0, -0x2c(%rbp)
cmpl $0x8, -0x2c(%rbp)
jge 0x4f4b5
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x740(%rax), %eax
movl -0x2c(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x4f4a8
jmp 0x4f4b5
jmp 0x4f4aa
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4f47f
movl $0x1, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq 0x3387a(%rip), %rcx     # 0x82d40
cmpl 0x610(%rcx), %eax
jg 0x4f578
movq 0x3307f(%rip), %rax     # 0x82558
movq (%rax), %rax
movslq -0x20(%rbp), %rcx
imulq $0x4a8, %rcx, %rcx      # imm = 0x4A8
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x4f4fa
jmp 0x4f56a
movq -0x28(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x4f507
jmp 0x4f56a
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x740(%rax), %eax
movl -0x2c(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x4f568
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl 0x318(%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, 0x318(%rax,%rcx,4)
movl -0x2c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, %ecx
xorl $-0x1, %ecx
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
andl 0x740(%rax), %ecx
movl %ecx, 0x740(%rax)
jmp 0x4f56a
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4f4bc
jmp 0x4f5ec
movl $0x1, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq 0x337b5(%rip), %rcx     # 0x82d40
cmpl 0x610(%rcx), %eax
jg 0x4f5ea
movq 0x32fbe(%rip), %rax     # 0x82558
movq (%rax), %rax
movslq -0x20(%rbp), %rcx
imulq $0x4a8, %rcx, %rcx      # imm = 0x4A8
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jne 0x4f5bb
jmp 0x4f5df
movq -0x28(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x4f5c8
jmp 0x4f5df
movq -0x28(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl $0x0, 0x318(%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4f581
jmp 0x4f5ec
jmp 0x4f60b
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl 0x318(%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, 0x318(%rax,%rcx,4)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x19b50
movq -0x8(%rbp), %rax
movq $0x0, 0x228(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)