// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: NoAmmoWeaponChange
void NoAmmoWeaponChange (edict_t *ent)
{
	if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("slugs"))]
		&&  ent->client->pers.inventory[ITEM_INDEX(FindItem("railgun"))] )
	{
		ent->client->newweapon = FindItem ("railgun");
		return;
	}
	if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("cells"))]
		&&  ent->client->pers.inventory[ITEM_INDEX(FindItem("hyperblaster"))] )
	{
		ent->client->newweapon = FindItem ("hyperblaster");
		return;
	}
	if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("bullets"))]
		&&  ent->client->pers.inventory[ITEM_INDEX(FindItem("chaingun"))] )
	{
		ent->client->newweapon = FindItem ("chaingun");
		return;
	}
	if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("bullets"))]
		&&  ent->client->pers.inventory[ITEM_INDEX(FindItem("machinegun"))] )
	{
		ent->client->newweapon = FindItem ("machinegun");
		return;
	}
	if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("shells"))] > 1
		&&  ent->client->pers.inventory[ITEM_INDEX(FindItem("super shotgun"))] )
	{
		ent->client->newweapon = FindItem ("super shotgun");
		return;
	}
	if ( ent->client->pers.inventory[ITEM_INDEX(FindItem("shells"))]
		&&  ent->client->pers.inventory[ITEM_INDEX(FindItem("shotgun"))] )
	{
		ent->client->newweapon = FindItem ("shotgun");
		return;
	}
	ent->client->newweapon = FindItem ("blaster");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0xd2d8(%rip), %rdi      # 0x73a07
callq 0x18a90
movq 0x1c705(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x667b9
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x18(%rbp)
leaq 0x106c9(%rip), %rdi     # 0x76e35
callq 0x18a90
movq 0x1c6c8(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x18(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x667b9
leaq 0x10698(%rip), %rdi     # 0x76e35
callq 0x18a90
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0xe50(%rax)
jmp 0x66ae5
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x20(%rbp)
leaq 0xd1bf(%rip), %rdi      # 0x7398b
callq 0x18a90
movq 0x1c668(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x66856
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x28(%rbp)
leaq 0x1060e(%rip), %rdi     # 0x76e17
callq 0x18a90
movq 0x1c62b(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x66856
leaq 0x105dd(%rip), %rdi     # 0x76e17
callq 0x18a90
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0xe50(%rax)
jmp 0x66ae5
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x30(%rbp)
leaq 0xd0e5(%rip), %rdi      # 0x7394e
callq 0x18a90
movq 0x1c5cb(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x668f3
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x38(%rbp)
leaq 0x1050a(%rip), %rdi     # 0x76db0
callq 0x18a90
movq 0x1c58e(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x668f3
leaq 0x104d9(%rip), %rdi     # 0x76db0
callq 0x18a90
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0xe50(%rax)
jmp 0x66ae5
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x40(%rbp)
leaq 0xd048(%rip), %rdi      # 0x7394e
callq 0x18a90
movq 0x1c52e(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x66990
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x48(%rbp)
leaq 0x1044c(%rip), %rdi     # 0x76d8f
callq 0x18a90
movq 0x1c4f1(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x66990
leaq 0x1041b(%rip), %rdi     # 0x76d8f
callq 0x18a90
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0xe50(%rax)
jmp 0x66ae5
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x50(%rbp)
leaq 0xcf6b(%rip), %rdi      # 0x7390e
callq 0x18a90
movq 0x1c491(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpl $0x1, 0x318(%rax,%rcx,4)
jle 0x66a2d
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x58(%rbp)
leaq 0x10389(%rip), %rdi     # 0x76d69
callq 0x18a90
movq 0x1c454(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x66a2d
leaq 0x10358(%rip), %rdi     # 0x76d69
callq 0x18a90
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0xe50(%rax)
jmp 0x66ae5
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x60(%rbp)
leaq 0xcece(%rip), %rdi      # 0x7390e
callq 0x18a90
movq 0x1c3f4(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x66ac7
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x68(%rbp)
leaq 0x102f2(%rip), %rdi     # 0x76d6f
callq 0x18a90
movq 0x1c3b7(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x66ac7
leaq 0x102c1(%rip), %rdi     # 0x76d6f
callq 0x18a90
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0xe50(%rax)
jmp 0x66ae5
leaq 0x10260(%rip), %rdi     # 0x76d2e
callq 0x18a90
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0xe50(%rax)
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)