// File: /workspace/github_c_makefile_star2_O2/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 0x2d813
movl $0x12c, 0x718(%rax)     # imm = 0x12C
cmpl $0xc7, 0x71c(%rax)
jg 0x2d829
movl $0xc8, 0x71c(%rax)
cmpl $0x63, 0x720(%rax)
jg 0x2d83c
movl $0x64, 0x720(%rax)
cmpl $0x63, 0x724(%rax)
jg 0x2d84f
movl $0x64, 0x724(%rax)
cmpl $0x12b, 0x728(%rax)     # imm = 0x12B
jg 0x2d865
movl $0x12c, 0x728(%rax)     # imm = 0x12C
cmpl $0x63, 0x72c(%rax)
jg 0x2d878
movl $0x64, 0x72c(%rax)
leaq 0x24731(%rip), %rdi     # 0x51fb0
callq 0x18a80
testq %rax, %rax
je 0x2d8c6
movq %rax, %rcx
subq 0x395ad(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
movq 0x58(%r14), %rdx
cltq
movl 0x318(%rdx,%rax,4), %esi
addl 0x5c(%rcx), %esi
movl %esi, 0x318(%rdx,%rax,4)
movl 0x718(%rdx), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x318(%rdx,%rax,4)
leaq 0x246eb(%rip), %rdi     # 0x51fb8
callq 0x18a80
testq %rax, %rax
je 0x2d914
movq %rax, %rcx
subq 0x3955f(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
movq 0x58(%r14), %rdx
cltq
movl 0x318(%rdx,%rax,4), %esi
addl 0x5c(%rcx), %esi
movl %esi, 0x318(%rdx,%rax,4)
movl 0x71c(%rdx), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x318(%rdx,%rax,4)
leaq 0x24300(%rip), %rdi     # 0x51c1b
callq 0x18a80
testq %rax, %rax
je 0x2d962
movq %rax, %rcx
subq 0x39511(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
movq 0x58(%r14), %rdx
cltq
movl 0x318(%rdx,%rax,4), %esi
addl 0x5c(%rcx), %esi
movl %esi, 0x318(%rdx,%rax,4)
movl 0x728(%rdx), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x318(%rdx,%rax,4)
leaq 0x24656(%rip), %rdi     # 0x51fbf
callq 0x18a80
testq %rax, %rax
je 0x2d9b0
movq %rax, %rcx
subq 0x394c3(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
movq 0x58(%r14), %rdx
cltq
movl 0x318(%rdx,%rax,4), %esi
addl 0x5c(%rcx), %esi
movl %esi, 0x318(%rdx,%rax,4)
movl 0x724(%rdx), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x318(%rdx,%rax,4)
leaq 0x24611(%rip), %rdi     # 0x51fc8
callq 0x18a80
testq %rax, %rax
je 0x2d9fe
movq %rax, %rcx
subq 0x39475(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
movq 0x58(%r14), %rdx
cltq
movl 0x318(%rdx,%rax,4), %esi
addl 0x5c(%rcx), %esi
movl %esi, 0x318(%rdx,%rax,4)
movl 0x720(%rdx), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x318(%rdx,%rax,4)
leaq 0x245cb(%rip), %rdi     # 0x51fd0
callq 0x18a80
testq %rax, %rax
je 0x2da4c
movq %rax, %rcx
subq 0x39427(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
movq 0x58(%r14), %rdx
cltq
movl 0x318(%rdx,%rax,4), %esi
addl 0x5c(%rcx), %esi
movl %esi, 0x318(%rdx,%rax,4)
movl 0x72c(%rdx), %ecx
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x318(%rdx,%rax,4)
testb $0x1, 0x142(%rbx)
jne 0x2da82
movq 0x39464(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2da6e
jnp 0x2da82
movq 0x330(%rbx), %rax
cvtsi2ssl 0x5c(%rax), %xmm0
movq %rbx, %rdi
callq 0x196d0
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq