// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Pickup_Pack
qboolean Pickup_Pack (edict_t *ent, edict_t *other)
{
	gitem_t	*item;
	int		index;

	if (other->client->pers.max_bullets < 300)
		other->client->pers.max_bullets = 300;
	if (other->client->pers.max_shells < 200)
		other->client->pers.max_shells = 200;
	if (other->client->pers.max_rockets < 100)
		other->client->pers.max_rockets = 100;
	if (other->client->pers.max_grenades < 100)
		other->client->pers.max_grenades = 100;
	if (other->client->pers.max_cells < 300)
		other->client->pers.max_cells = 300;
	if (other->client->pers.max_slugs < 100)
		other->client->pers.max_slugs = 100;

	item = FindItem("Bullets");
	if (item)
	{
		index = ITEM_INDEX(item);
		other->client->pers.inventory[index] += item->quantity;
		if (other->client->pers.inventory[index] > other->client->pers.max_bullets)
			other->client->pers.inventory[index] = other->client->pers.max_bullets;
	}

	item = FindItem("Shells");
	if (item)
	{
		index = ITEM_INDEX(item);
		other->client->pers.inventory[index] += item->quantity;
		if (other->client->pers.inventory[index] > other->client->pers.max_shells)
			other->client->pers.inventory[index] = other->client->pers.max_shells;
	}

	item = FindItem("Cells");
	if (item)
	{
		index = ITEM_INDEX(item);
		other->client->pers.inventory[index] += item->quantity;
		if (other->client->pers.inventory[index] > other->client->pers.max_cells)
			other->client->pers.inventory[index] = other->client->pers.max_cells;
	}

	item = FindItem("Grenades");
	if (item)
	{
		index = ITEM_INDEX(item);
		other->client->pers.inventory[index] += item->quantity;
		if (other->client->pers.inventory[index] > other->client->pers.max_grenades)
			other->client->pers.inventory[index] = other->client->pers.max_grenades;
	}

	item = FindItem("Rockets");
	if (item)
	{
		index = ITEM_INDEX(item);
		other->client->pers.inventory[index] += item->quantity;
		if (other->client->pers.inventory[index] > other->client->pers.max_rockets)
			other->client->pers.inventory[index] = other->client->pers.max_rockets;
	}

	item = FindItem("Slugs");
	if (item)
	{
		index = ITEM_INDEX(item);
		other->client->pers.inventory[index] += item->quantity;
		if (other->client->pers.inventory[index] > other->client->pers.max_slugs)
			other->client->pers.inventory[index] = other->client->pers.max_slugs;
	}

	if (!(ent->spawnflags & DROPPED_ITEM) && (deathmatch->value))
		SetRespawn (ent, ent->item->quantity);

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x58(%rsi), %rax
cmpl $0x12b, 0x718(%rax)     # imm = 0x12B
jg 0x2fff0
movl $0x12c, 0x718(%rax)     # imm = 0x12C
cmpl $0xc7, 0x71c(%rax)
jg 0x30006
movl $0xc8, 0x71c(%rax)
cmpl $0x63, 0x720(%rax)
jg 0x30019
movl $0x64, 0x720(%rax)
cmpl $0x63, 0x724(%rax)
jg 0x3002c
movl $0x64, 0x724(%rax)
cmpl $0x12b, 0x728(%rax)     # imm = 0x12B
jg 0x30042
movl $0x12c, 0x728(%rax)     # imm = 0x12C
cmpl $0x63, 0x72c(%rax)
jg 0x30055
movl $0x64, 0x72c(%rax)
leaq 0x25f74(%rip), %rdi     # 0x55fd0
callq 0x189e0
testq %rax, %rax
je 0x300a4
movq %rax, %rcx
subq 0x38dd0(%rip), %rcx     # 0x68e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %ecx # imm = 0xF0F0F0F1
movq 0x58(%r14), %rdx
movslq %ecx, %rcx
movl 0x318(%rdx,%rcx,4), %esi
addl 0x5c(%rax), %esi
movl %esi, 0x318(%rdx,%rcx,4)
movl 0x718(%rdx), %eax
cmpl %eax, %esi
cmovgel %eax, %esi
movl %esi, 0x318(%rdx,%rcx,4)
leaq 0x25f2d(%rip), %rdi     # 0x55fd8
callq 0x189e0
testq %rax, %rax
je 0x300f3
movq %rax, %rcx
subq 0x38d81(%rip), %rcx     # 0x68e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %ecx # imm = 0xF0F0F0F1
movq 0x58(%r14), %rdx
movslq %ecx, %rcx
movl 0x318(%rdx,%rcx,4), %esi
addl 0x5c(%rax), %esi
movl %esi, 0x318(%rdx,%rcx,4)
movl 0x71c(%rdx), %eax
cmpl %eax, %esi
cmovgel %eax, %esi
movl %esi, 0x318(%rdx,%rcx,4)
leaq 0x25b41(%rip), %rdi     # 0x55c3b
callq 0x189e0
testq %rax, %rax
je 0x30142
movq %rax, %rcx
subq 0x38d32(%rip), %rcx     # 0x68e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %ecx # imm = 0xF0F0F0F1
movq 0x58(%r14), %rdx
movslq %ecx, %rcx
movl 0x318(%rdx,%rcx,4), %esi
addl 0x5c(%rax), %esi
movl %esi, 0x318(%rdx,%rcx,4)
movl 0x728(%rdx), %eax
cmpl %eax, %esi
cmovgel %eax, %esi
movl %esi, 0x318(%rdx,%rcx,4)
leaq 0x25e96(%rip), %rdi     # 0x55fdf
callq 0x189e0
testq %rax, %rax
je 0x30191
movq %rax, %rcx
subq 0x38ce3(%rip), %rcx     # 0x68e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %ecx # imm = 0xF0F0F0F1
movq 0x58(%r14), %rdx
movslq %ecx, %rcx
movl 0x318(%rdx,%rcx,4), %esi
addl 0x5c(%rax), %esi
movl %esi, 0x318(%rdx,%rcx,4)
movl 0x724(%rdx), %eax
cmpl %eax, %esi
cmovgel %eax, %esi
movl %esi, 0x318(%rdx,%rcx,4)
leaq 0x25e50(%rip), %rdi     # 0x55fe8
callq 0x189e0
testq %rax, %rax
je 0x301e0
movq %rax, %rcx
subq 0x38c94(%rip), %rcx     # 0x68e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %ecx # imm = 0xF0F0F0F1
movq 0x58(%r14), %rdx
movslq %ecx, %rcx
movl 0x318(%rdx,%rcx,4), %esi
addl 0x5c(%rax), %esi
movl %esi, 0x318(%rdx,%rcx,4)
movl 0x720(%rdx), %eax
cmpl %eax, %esi
cmovgel %eax, %esi
movl %esi, 0x318(%rdx,%rcx,4)
leaq 0x25e09(%rip), %rdi     # 0x55ff0
callq 0x189e0
testq %rax, %rax
je 0x3022f
movq %rax, %rcx
subq 0x38c45(%rip), %rcx     # 0x68e40
shrq $0x3, %rcx
imull $0xf0f0f0f1, %ecx, %ecx # imm = 0xF0F0F0F1
movq 0x58(%r14), %rdx
movslq %ecx, %rcx
movl 0x318(%rdx,%rcx,4), %esi
addl 0x5c(%rax), %esi
movl %esi, 0x318(%rdx,%rcx,4)
movl 0x72c(%rdx), %eax
cmpl %eax, %esi
cmovgel %eax, %esi
movl %esi, 0x318(%rdx,%rcx,4)
testb $0x1, 0x142(%rbx)
jne 0x302ad
movq 0x38c81(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x30251
jnp 0x302ad
movq 0x330(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2ssl 0x5c(%rax), %xmm0
orl $0x80000000, 0x11c(%rbx) # imm = 0x80000000
orb $0x1, 0xc8(%rbx)
movl $0x0, 0x108(%rbx)
movq 0x38b1e(%rip), %rax     # 0x68da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%rbx)
movq 0x38aba(%rip), %rax     # 0x68d50
movq %rax, 0x210(%rbx)
movq 0x3835c(%rip), %rax     # 0x68600
movq %rbx, %rdi
callq *0x90(%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq