// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x12c, 0x718(%rax)     # imm = 0x12C
jge 0x3a486
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x12c, 0x718(%rax)     # imm = 0x12C
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0xc8, 0x71c(%rax)
jge 0x3a4ac
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0xc8, 0x71c(%rax)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x64, 0x720(%rax)
jge 0x3a4cf
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x64, 0x720(%rax)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x64, 0x724(%rax)
jge 0x3a4f2
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x64, 0x724(%rax)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x12c, 0x728(%rax)     # imm = 0x12C
jge 0x3a518
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x12c, 0x728(%rax)     # imm = 0x12C
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x64, 0x72c(%rax)
jge 0x3a53b
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x64, 0x72c(%rax)
leaq 0x38922(%rip), %rdi     # 0x72e64
callq 0x18a90
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3a5d8
movq -0x18(%rbp), %rax
movq 0x488df(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x5c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
addl 0x318(%rax,%rcx,4), %edx
movl %edx, 0x318(%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl 0x318(%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x718(%rcx), %eax
jle 0x3a5d6
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x718(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, 0x318(%rax,%rcx,4)
jmp 0x3a5d8
leaq 0x3888d(%rip), %rdi     # 0x72e6c
callq 0x18a90
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3a675
movq -0x18(%rbp), %rax
movq 0x48842(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x5c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
addl 0x318(%rax,%rcx,4), %edx
movl %edx, 0x318(%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl 0x318(%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x71c(%rcx), %eax
jle 0x3a673
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x71c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, 0x318(%rax,%rcx,4)
jmp 0x3a675
leaq 0x384f7(%rip), %rdi     # 0x72b73
callq 0x18a90
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3a712
movq -0x18(%rbp), %rax
movq 0x487a5(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x5c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
addl 0x318(%rax,%rcx,4), %edx
movl %edx, 0x318(%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl 0x318(%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x728(%rcx), %eax
jle 0x3a710
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x728(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, 0x318(%rax,%rcx,4)
jmp 0x3a712
leaq 0x3875a(%rip), %rdi     # 0x72e73
callq 0x18a90
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3a7af
movq -0x18(%rbp), %rax
movq 0x48708(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x5c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
addl 0x318(%rax,%rcx,4), %edx
movl %edx, 0x318(%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl 0x318(%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x724(%rcx), %eax
jle 0x3a7ad
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x724(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, 0x318(%rax,%rcx,4)
jmp 0x3a7af
leaq 0x386c6(%rip), %rdi     # 0x72e7c
callq 0x18a90
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3a84c
movq -0x18(%rbp), %rax
movq 0x4866b(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x5c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
addl 0x318(%rax,%rcx,4), %edx
movl %edx, 0x318(%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl 0x318(%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x720(%rcx), %eax
jle 0x3a84a
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x720(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, 0x318(%rax,%rcx,4)
jmp 0x3a84c
leaq 0x38631(%rip), %rdi     # 0x72e84
callq 0x18a90
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x3a8e9
movq -0x18(%rbp), %rax
movq 0x485ce(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0x5c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
addl 0x318(%rax,%rcx,4), %edx
movl %edx, 0x318(%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl 0x318(%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x72c(%rcx), %eax
jle 0x3a8e7
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x72c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, 0x318(%rax,%rcx,4)
jmp 0x3a8e9
movq -0x8(%rbp), %rax
movl 0x140(%rax), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
jne 0x3a931
movq 0x485bc(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3a918
jp 0x3a918
jmp 0x3a931
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x330(%rax), %rax
cvtsi2ssl 0x5c(%rax), %xmm0
callq 0x19750
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)