// File: /workspace/github_c_makefile_star2_O3/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 %rdx, %r15
movq 0x110(%rdi), %rdx
cmpq %rsi, %rdx
je 0x40cf1
movq %rsi, %r14
movq %rdi, %rbx
testq %rcx, %rcx
je 0x40b7a
testb $0x4, 0x10(%rcx)
jne 0x40cfb
cmpq $0x0, 0x58(%rdx)
je 0x40b99
leaq 0x4(%rbx), %rsi
movq %rdx, %rdi
movl $0x2, %edx
callq 0x18ef0
movq 0x110(%rbx), %rdx
cmpl $0x0, 0x27c(%r14)
je 0x40bd2
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), %rdx
movss 0x126ca(%rip), %xmm0    # 0x532a4
movss 0x1506a(%rip), %xmm1    # 0x55c4c
movq %rbx, %rdi
movq %rdx, %rsi
movq %r14, %rdx
movl $0xd, %ecx
callq 0x180c0
movq 0x27a04(%rip), %r12     # 0x68600
movq 0x20(%r12), %r15
leaq 0x18a62(%rip), %rdi     # 0x5966a
callq *0x48(%r12)
movss 0x12313(%rip), %xmm0    # 0x52f28
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 0x12fe4(%rip), %xmm0    # 0x53c30
movq %r15, %rdi
movq %r15, %rdx
callq 0x19760
movl %r13d, 0x1c8(%rbx)
movq %r13, 0x1c0(%rbx)
leaq 0x18a13(%rip), %rdi     # 0x5967f
callq *0x40(%r12)
movl %eax, 0x28(%rbx)
movl %r13d, 0x38(%rbx)
movl %r13d, 0x4c(%rbx)
andb $-0x21, 0x41(%rbx)
movq 0x278d9(%rip), %rax     # 0x68560
movq %rax, 0x210(%rbx)
movq 0x2810b(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
addss 0x125ee(%rip), %xmm0    # 0x53290
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 0x19a50