// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Touch_Item
void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf)
{
	qboolean	taken;

	if (Match_InCountdown())
		return;

	if (!other->client)
		return;
	if (other->health < 1)
		return;		// dead people can't pickup
	if (!ent->item->pickup)
		return;		// not a grabbable item?

	taken = ent->item->pickup(ent, other);

	if (taken)
	{
		// flash the screen
		other->client->bonus_alpha = 0.25;	

		// show icon and name on status bar
		other->client->ps.stats[STAT_PICKUP_ICON] = gi.imageindex(ent->item->icon);
		other->client->ps.stats[STAT_PICKUP_STRING] = CS_ITEMS+ITEM_INDEX(ent->item);
		other->client->pickup_msg_time = level.time + 3.0;

		// change selected item
		if (ent->item->use)
			other->client->pers.selected_item = other->client->ps.stats[STAT_SELECTED_ITEM] = ITEM_INDEX(ent->item);

		if (ent->item->pickup == Pickup_Health)
		{
			if (ent->count == 2)
				gi.sound(other, CHAN_ITEM, gi.soundindex("items/s_health.wav"), 1, ATTN_NORM, 0);
			else if (ent->count == 10)
				gi.sound(other, CHAN_ITEM, gi.soundindex("items/n_health.wav"), 1, ATTN_NORM, 0);
			else if (ent->count == 25)
				gi.sound(other, CHAN_ITEM, gi.soundindex("items/l_health.wav"), 1, ATTN_NORM, 0);
			else // (ent->count == 100)
				gi.sound(other, CHAN_ITEM, gi.soundindex("items/m_health.wav"), 1, ATTN_NORM, 0);
		}
		else if (ent->item->pickup_sound)
		{
			gi.sound(other, CHAN_ITEM, gi.soundindex(ent->item->pickup_sound), 1, ATTN_NORM, 0);
		}
	}

	if (!(ent->spawnflags & ITEM_TARGETS_USED))
	{
		G_UseTargets (ent, other);
		ent->spawnflags |= ITEM_TARGETS_USED;
	}

	if (!taken)
		return;

	if (!((coop->value) &&  (ent->item->flags & IT_STAY_COOP)) || (ent->spawnflags & (DROPPED_ITEM | DROPPED_PLAYER_ITEM)))
	{
		if (ent->flags & FL_RESPAWN)
			ent->flags &= ~FL_RESPAWN;
		else
			G_FreeEdict (ent);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x0, %al
callq 0x19590
cmpl $0x0, %eax
je 0x3bfcc
jmp 0x3c3bd
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x3bfdc
jmp 0x3c3bd
movq -0x10(%rbp), %rax
cmpl $0x1, 0x254(%rax)
jge 0x3bfee
jmp 0x3c3bd
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
cmpq $0x0, 0x8(%rax)
jne 0x3c005
jmp 0x3c3bd
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x3c302
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movss 0x34459(%rip), %xmm0    # 0x70494
movss %xmm0, 0xeac(%rax)
movq 0x465b6(%rip), %rax     # 0x82600
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x330(%rcx), %rcx
movq 0x48(%rcx), %rdi
callq *%rax
movw %ax, %cx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movw %cx, 0x86(%rax)
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
movq 0x46dbd(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
addq $0x420, %rax            # imm = 0x420
movw %ax, %cx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movw %cx, 0x88(%rax)
movq 0x46cf1(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x34b68(%rip), %xmm1    # 0x70c28
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0xf24(%rax)
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x3c129
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
movq 0x46d44(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
movw %ax, 0x90(%rcx)
movswl %ax, %ecx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl %ecx, 0x314(%rax)
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
movq 0x46d3d(%rip), %rcx     # 0x82e78
cmpq %rcx, 0x8(%rax)
jne 0x3c29a
movq -0x8(%rbp), %rax
cmpl $0x2, 0x290(%rax)
jne 0x3c19e
movq 0x464a7(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x36d82(%rip), %rdi     # 0x72ef2
movq 0x46489(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x38(%rbp), %rdi
movl %eax, %edx
movq -0x30(%rbp), %rax
movl $0x3, %esi
movss 0x33d5b(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
jmp 0x3c298
movq -0x8(%rbp), %rax
cmpl $0xa, 0x290(%rax)
jne 0x3c1f7
movq 0x4644e(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq 0x36d3c(%rip), %rdi     # 0x72f05
movq 0x46430(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x48(%rbp), %rdi
movl %eax, %edx
movq -0x40(%rbp), %rax
movl $0x3, %esi
movss 0x33d02(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
jmp 0x3c296
movq -0x8(%rbp), %rax
cmpl $0x19, 0x290(%rax)
jne 0x3c24d
movq 0x463f5(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0x36cf6(%rip), %rdi     # 0x72f18
movq 0x463d7(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x58(%rbp), %rdi
movl %eax, %edx
movq -0x50(%rbp), %rax
movl $0x3, %esi
movss 0x33ca9(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
jmp 0x3c294
movq 0x463ac(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq 0x37ca8(%rip), %rdi     # 0x73f13
movq 0x4638e(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x68(%rbp), %rdi
movl %eax, %edx
movq -0x60(%rbp), %rax
movl $0x3, %esi
movss 0x33c60(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
jmp 0x3c296
jmp 0x3c298
jmp 0x3c300
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
cmpq $0x0, 0x28(%rax)
je 0x3c2fe
movq 0x4634d(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq 0x46336(%rip), %rax     # 0x82600
movq 0x48(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x330(%rcx), %rcx
movq 0x28(%rcx), %rdi
callq *%rax
movq -0x78(%rbp), %rdi
movl %eax, %edx
movq -0x70(%rbp), %rax
movl $0x3, %esi
movss 0x33bf6(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
jmp 0x3c300
jmp 0x3c302
movq -0x8(%rbp), %rax
movl 0x140(%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
jne 0x3c339
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x19b50
movq -0x8(%rbp), %rax
movl 0x140(%rax), %ecx
orl $0x40000, %ecx          # imm = 0x40000
movl %ecx, 0x140(%rax)
cmpl $0x0, -0x24(%rbp)
jne 0x3c341
jmp 0x3c3bd
movq 0x46c18(%rip), %rax     # 0x82f60
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3c35c
jp 0x3c35c
jmp 0x3c386
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
movl 0x68(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x3c386
movq -0x8(%rbp), %rax
movl 0x140(%rax), %eax
andl $0x30000, %eax          # imm = 0x30000
cmpl $0x0, %eax
je 0x3c3bd
movq -0x8(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
je 0x3c3b2
movq -0x8(%rbp), %rax
movl 0x11c(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, 0x11c(%rax)
jmp 0x3c3bb
movq -0x8(%rbp), %rdi
callq 0x19cd0
jmp 0x3c3bd
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)