// File: /workspace/github_c_makefile_star2_O1/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 0x30541
movl $0x12c, 0x718(%rax)     # imm = 0x12C
cmpl $0xc7, 0x71c(%rax)
jg 0x30557
movl $0xc8, 0x71c(%rax)
cmpl $0x63, 0x720(%rax)
jg 0x3056a
movl $0x64, 0x720(%rax)
cmpl $0x63, 0x724(%rax)
jg 0x3057d
movl $0x64, 0x724(%rax)
cmpl $0x12b, 0x728(%rax)     # imm = 0x12B
jg 0x30593
movl $0x12c, 0x728(%rax)     # imm = 0x12C
cmpl $0x63, 0x72c(%rax)
jg 0x305a6
movl $0x64, 0x72c(%rax)
leaq 0x2692f(%rip), %rdi     # 0x56edc
callq 0x189e0
testq %rax, %rax
je 0x305f5
movq %rax, %rcx
subq 0x3987f(%rip), %rcx     # 0x69e40
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 0x268e8(%rip), %rdi     # 0x56ee4
callq 0x189e0
testq %rax, %rax
je 0x30644
movq %rax, %rcx
subq 0x39830(%rip), %rcx     # 0x69e40
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 0x26598(%rip), %rdi     # 0x56be3
callq 0x189e0
testq %rax, %rax
je 0x30693
movq %rax, %rcx
subq 0x397e1(%rip), %rcx     # 0x69e40
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 0x26851(%rip), %rdi     # 0x56eeb
callq 0x189e0
testq %rax, %rax
je 0x306e2
movq %rax, %rcx
subq 0x39792(%rip), %rcx     # 0x69e40
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 0x2680b(%rip), %rdi     # 0x56ef4
callq 0x189e0
testq %rax, %rax
je 0x30731
movq %rax, %rcx
subq 0x39743(%rip), %rcx     # 0x69e40
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 0x267c4(%rip), %rdi     # 0x56efc
callq 0x189e0
testq %rax, %rax
je 0x30780
movq %rax, %rcx
subq 0x396f4(%rip), %rcx     # 0x69e40
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 0x307fe
movq 0x39730(%rip), %rax     # 0x69ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x307a2
jnp 0x307fe
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 0x395cd(%rip), %rax     # 0x69da0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x200(%rbx)
movq 0x39569(%rip), %rax     # 0x69d50
movq %rax, 0x210(%rbx)
movq 0x38e0b(%rip), %rax     # 0x69600
movq %rbx, %rdi
callq *0x90(%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq