// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_weapon.c
// Function: bfg_explode
void bfg_explode (edict_t *self)
{
	edict_t	*ent;
	float	points;
	vec3_t	v;
	float	dist;

	if (self->s.frame == 0)
	{
		// the BFG effect
		ent = NULL;
		while ((ent = findradius(ent, self->s.origin, self->dmg_radius)) != NULL)
		{
			if (!ent->takedamage)
				continue;
			if (ent == self->owner)
				continue;
			if (!CanDamage (ent, self))
				continue;
			if (!CanDamage (ent, self->owner))
				continue;

			VectorAdd (ent->mins, ent->maxs, v);
			VectorMA (ent->s.origin, 0.5, v, v);
			VectorSubtract (self->s.origin, v, v);
			dist = VectorLength(v);
			points = self->radius_dmg * (1.0 - sqrt(dist/self->dmg_radius));
			if (ent == self->owner)
				points = points * 0.5;

			gi.WriteByte (svc_temp_entity);
			gi.WriteByte (TE_BFG_EXPLOSION);
			gi.WritePosition (ent->s.origin);
			gi.multicast (ent->s.origin, MULTICAST_PHS);
			T_Damage (ent, self, self->owner, self->velocity, ent->s.origin, vec3_origin, (int)points, 0, DAMAGE_ENERGY, MOD_BFG_EFFECT);
		}
	}

	self->nextthink = level.time + FRAMETIME;
	self->s.frame++;
	if (self->s.frame == 5)
		self->think = G_FreeEdict;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x53ed9
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x4, %rsi
movq -0x8(%rbp), %rax
movss 0x288(%rax), %xmm0
callq 0x19ae0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x53ed7
movq -0x10(%rbp), %rax
cmpl $0x0, 0x27c(%rax)
jne 0x53cac
jmp 0x53c72
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x53cbf
jmp 0x53c72
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x189d0
cmpl $0x0, %eax
jne 0x53cd3
jmp 0x53c72
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rsi
callq 0x189d0
cmpl $0x0, %eax
jne 0x53cee
jmp 0x53c72
movq -0x10(%rbp), %rax
movss 0xcc(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0xd8(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movss 0xd0(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0xdc(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movss 0xd4(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0xe0(%rax), %xmm0
movss %xmm0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
leaq -0x20(%rbp), %rsi
leaq -0x20(%rbp), %rdx
movss 0x1edf3(%rip), %xmm0    # 0x72b50
callq 0x199c0
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
subss -0x20(%rbp), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
subss -0x1c(%rbp), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
subss -0x18(%rbp), %xmm0
movss %xmm0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x24(%rbp)
movq -0x8(%rbp), %rax
cvtsi2sdl 0x284(%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movss -0x24(%rbp), %xmm0
movq -0x8(%rbp), %rax
divss 0x288(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x19aa0
movaps %xmm0, %xmm2
movsd -0x30(%rbp), %xmm0
movsd 0x1c15c(%rip), %xmm1    # 0x6ff40
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x53e24
movss -0x14(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1d611(%rip), %xmm1    # 0x71428
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movl $0x3, %edi
movq 0x2e7d0(%rip), %rax     # 0x82600
callq *0xc8(%rax)
movl $0x14, %edi
movq 0x2e7be(%rip), %rax     # 0x82600
callq *0xc8(%rax)
movq 0x2e7b1(%rip), %rax     # 0x82600
movq 0xf0(%rax), %rax
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
callq *%rax
movq 0x2e799(%rip), %rax     # 0x82600
movq 0xb0(%rax), %rax
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
movl $0x1, %esi
callq *%rax
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x110(%rax), %rdx
movq -0x8(%rbp), %rcx
addq $0x1c0, %rcx            # imm = 0x1C0
movq -0x10(%rbp), %r8
addq $0x4, %r8
cvttss2si -0x14(%rbp), %eax
movq 0x2e8b9(%rip), %r9      # 0x82768
xorl %r10d, %r10d
movl %eax, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x4, 0x10(%rsp)
movl $0xe, 0x18(%rsp)
callq 0x192c0
jmp 0x53c72
jmp 0x53ed9
movss 0x1c3b3(%rip), %xmm0    # 0x70294
movq 0x2eeb8(%rip), %rax     # 0x82da0
addss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x200(%rax)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movq -0x8(%rbp), %rax
cmpl $0x5, 0x38(%rax)
jne 0x53f22
movq -0x8(%rbp), %rax
movq 0x2e515(%rip), %rcx     # 0x82430
movq %rcx, 0x210(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)