// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_weapon.c
// Function: Weapon_HyperBlaster_Fire
void Weapon_HyperBlaster_Fire (edict_t *ent)
{
	float	rotation;
	vec3_t	offset;
	int		effect;
	int		damage;

	ent->client->weapon_sound = gi.soundindex("weapons/hyprbl1a.wav");

	if (!(ent->client->buttons & BUTTON_ATTACK))
	{
		ent->client->ps.gunframe++;
	}
	else
	{
		if (! ent->client->pers.inventory[ent->client->ammo_index] )
		{
			if (level.time >= ent->pain_debounce_time)
			{
				gi.sound(ent, CHAN_VOICE, gi.soundindex("weapons/noammo.wav"), 1, ATTN_NORM, 0);
				ent->pain_debounce_time = level.time + 1;
			}
			NoAmmoWeaponChange (ent);
		}
		else
		{
			rotation = (ent->client->ps.gunframe - 5.0) * 2.0 * M_PI / 6.0;
			offset[0] = -4 * sin(rotation);
			offset[1] = 0;
			offset[2] = 4 * cos(rotation);

			if ((ent->client->ps.gunframe == 6) || (ent->client->ps.gunframe == 9))
				effect = EF_HYPERBLASTER;
			else
				effect = 0;
			if (deathmatch->value)
				damage = 15;
			else
				damage = 20;

#ifdef WEAP_BALANCE_OK	
			if ((int)ctfflags->value & CTF_WEAP_BALANCE) //surt, a little less damage
				damage = 12; //these things come out pretty fast
#endif

			Blaster_Fire (ent, offset, damage, true, effect);
			if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
				ent->client->pers.inventory[ent->client->ammo_index]--;

			ent->client->anim_priority = ANIM_ATTACK;
			if (ent->client->ps.pmove.pm_flags & PMF_DUCKED)
			{
				ent->s.frame = FRAME_crattak1 - 1;
				ent->client->anim_end = FRAME_crattak9;
			}
			else
			{
				ent->s.frame = FRAME_attack1 - 1;
				ent->client->anim_end = FRAME_attack8;
			}
		}

		ent->client->ps.gunframe++;
		if (ent->client->ps.gunframe == 12 && ent->client->pers.inventory[ent->client->ammo_index])
			ent->client->ps.gunframe = 6;
	}

	if (ent->client->ps.gunframe == 12)
	{
		gi.sound(ent, CHAN_AUTO, gi.soundindex("weapons/hyprbd1a.wav"), 1, ATTN_NORM, 0);
		ent->client->weapon_sound = 0;
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xf84f(%rip), %rdi      # 0x77ac2
movq 0x1a386(%rip), %rax     # 0x82600
callq *0x48(%rax)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl %ecx, 0xf20(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xe3c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x682b9
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x5c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5c(%rax)
jmp 0x6856c
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movslq 0xe38(%rcx), %rcx
cmpl $0x0, 0x318(%rax,%rcx,4)
jne 0x6836c
movq 0x1aabb(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
ucomiss 0x244(%rax), %xmm0
jb 0x6835e
movq 0x1a302(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x89da(%rip), %rdi      # 0x70cef
movq 0x1a2e4(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x30(%rbp), %rdi
movl %eax, %edx
movq -0x28(%rbp), %rax
movl $0x2, %esi
movss 0x7bb6(%rip), %xmm1     # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
movss 0x7ba6(%rip), %xmm0     # 0x6feec
movq 0x1aa53(%rip), %rax     # 0x82da0
addss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x244(%rax)
movq -0x8(%rbp), %rdi
callq 0x194b0
jmp 0x6851b
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cvtsi2sdl 0x5c(%rax), %xmm0
movsd 0xa80f(%rip), %xmm1     # 0x72b90
subsd %xmm1, %xmm0
movsd 0xa80b(%rip), %xmm1     # 0x72b98
mulsd %xmm1, %xmm0
movsd 0xdd7f(%rip), %xmm1     # 0x76118
mulsd %xmm1, %xmm0
movsd 0xf6cb(%rip), %xmm1     # 0x77a70
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0xc(%rbp)
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x19770
movaps %xmm0, %xmm1
movsd 0xf69d(%rip), %xmm0     # 0x77a68
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x18a40
movaps %xmm0, %xmm1
movsd 0xf667(%rip), %xmm0     # 0x77a60
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x6, 0x5c(%rax)
je 0x68422
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x9, 0x5c(%rax)
jne 0x6842b
movl $0x40, -0x1c(%rbp)
jmp 0x68432
movl $0x0, -0x1c(%rbp)
movq 0x1aa87(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x6844d
jp 0x6844d
jmp 0x68456
movl $0xf, -0x20(%rbp)
jmp 0x6845d
movl $0x14, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
movl -0x1c(%rbp), %r8d
movl $0x1, %ecx
callq 0x19c00
movq 0x1a19b(%rip), %rax     # 0x82618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x684b7
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movslq 0xe38(%rcx), %rcx
movl 0x318(%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, 0x318(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x4, 0xef8(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movzbl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x684fc
movq -0x8(%rbp), %rax
movl $0x9f, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0xa8, 0xef4(%rax)
jmp 0x68519
movq -0x8(%rbp), %rax
movl $0x2d, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x35, 0xef4(%rax)
jmp 0x6851b
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x5c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x5c(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0xc, 0x5c(%rax)
jne 0x6856a
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movslq 0xe38(%rcx), %rcx
cmpl $0x0, 0x318(%rax,%rcx,4)
je 0x6856a
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x6, 0x5c(%rax)
jmp 0x6856c
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0xc, 0x5c(%rax)
jne 0x685d0
movq 0x1a07f(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0xf53f(%rip), %rdi      # 0x77ad7
movq 0x1a061(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x40(%rbp), %rdi
movl %eax, %edx
movq -0x38(%rbp), %rax
xorl %esi, %esi
movss 0x7936(%rip), %xmm1     # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x0, 0xf20(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)