// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_weapon.c
// Function: bfg_touch
void bfg_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
	if (other == self->owner)
		return;

	if (surf && (surf->flags & SURF_SKY))
	{
		G_FreeEdict (self);
		return;
	}

	if (self->owner->client)
		PlayerNoise(self->owner, self->s.origin, PNOISE_IMPACT);

	// core explosion - prevents firing it into the wall/floor
	if (other->takedamage)
		T_Damage (other, self, self->owner, self->velocity, self->s.origin, plane->normal, 200, 0, 0, MOD_BFG_BLAST);
	T_RadiusDamage(self, self->owner, 200, other, 100, MOD_BFG_BLAST);

	gi.sound (self, CHAN_VOICE, gi.soundindex ("weapons/bfg__x1b.wav"), 1, ATTN_NORM, 0);
	self->solid = SOLID_NOT;
	self->touch = NULL;
	VectorMA (self->s.origin, -1 * FRAMETIME, self->velocity, self->s.origin);
	VectorClear (self->velocity);
	self->s.modelindex = gi.modelindex ("sprites/s_bfg3.sp2");
	self->s.frame = 0;
	self->s.sound = 0;
	self->s.effects &= ~EF_ANIM_ALLFAST;
	self->think = bfg_explode;
	self->nextthink = level.time + FRAMETIME;
	self->enemy = other;

	gi.WriteByte (svc_temp_entity);
	gi.WriteByte (TE_BFG_BIGEXPLOSION);
	gi.WritePosition (self->s.origin);
	gi.multicast (self->s.origin, MULTICAST_PVS);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x110(%rdi), %rdi
cmpq %rsi, %rdi
je 0x415dd
movq %rdx, %r15
movq %rsi, %r14
testq %rcx, %rcx
je 0x4146c
testb $0x4, 0x10(%rcx)
jne 0x415e7
cmpq $0x0, 0x58(%rdi)
je 0x41481
leaq 0x4(%rbx), %rsi
movl $0x2, %edx
callq 0x18ef0
cmpl $0x0, 0x27c(%r14)
je 0x414ba
movq 0x110(%rbx), %rdx
leaq 0x1c0(%rbx), %rcx
leaq 0x4(%rbx), %r8
xorl %eax, %eax
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %r9
pushq $0xd
pushq %rax
pushq %rax
pushq $0xc8
callq 0x190f0
addq $0x20, %rsp
movq 0x110(%rbx), %rsi
movss 0x12ddb(%rip), %xmm0    # 0x542a4
movss 0x159f3(%rip), %xmm1    # 0x56ec4
movq %rbx, %rdi
movq %r14, %rdx
movl $0xd, %ecx
callq 0x180c0
movq 0x28118(%rip), %r12     # 0x69600
movq 0x20(%r12), %r15
leaq 0x18f4e(%rip), %rdi     # 0x5a442
callq *0x48(%r12)
movss 0x12a27(%rip), %xmm0    # 0x53f28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x2, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r15
xorl %r13d, %r13d
movl %r13d, 0x108(%rbx)
movq %r13, 0x220(%rbx)
leaq 0x4(%rbx), %r15
leaq 0x1c0(%rbx), %rsi
movss 0x136c8(%rip), %xmm0    # 0x54c00
movq %r15, %rdi
movq %r15, %rdx
callq 0x19770
movl %r13d, 0x1c8(%rbx)
movq %r13, 0x1c0(%rbx)
leaq 0x18eff(%rip), %rdi     # 0x5a457
callq *0x40(%r12)
movl %eax, 0x28(%rbx)
movl %r13d, 0x38(%rbx)
movl %r13d, 0x4c(%rbx)
andb $-0x21, 0x41(%rbx)
movq 0x27fed(%rip), %rax     # 0x69560
movq %rax, 0x210(%rbx)
movq 0x2881f(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x12d02(%rip), %xmm0    # 0x54290
movss %xmm0, 0x200(%rbx)
movq %r14, 0x2a0(%rbx)
movl $0x3, %edi
callq *0xc8(%r12)
movl $0x15, %edi
callq *0xc8(%r12)
movq %r15, %rdi
callq *0xf0(%r12)
movq 0xb0(%r12), %rax
movq %r15, %rdi
movl $0x2, %esi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmpq *%rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x19a60