// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x110(%rdi), %rax
cmpq %rsi, %rax
je 0x3d6b7
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
testq %rcx, %rcx
je 0x3d54a
testb $0x4, 0x10(%rcx)
jne 0x3d6c0
cmpq $0x0, 0x58(%rax)
je 0x3d567
leaq 0x4(%rbx), %rsi
pushq $0x2
popq %rdx
movq %rax, %rdi
callq 0x19010
movq 0x110(%rbx), %rax
cmpl $0x0, 0x27c(%r14)
je 0x3d5a3
leaq 0x1c0(%rbx), %rcx
leaq 0x4(%rbx), %r8
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r15, %r9
pushq $0xd
pushq $0x0
pushq $0x0
pushq $0xc8
callq 0x19260
addq $0x20, %rsp
movq 0x110(%rbx), %rax
movss 0x11cf9(%rip), %xmm0    # 0x4f2a4
movss 0x14679(%rip), %xmm1    # 0x51c2c
pushq $0xd
popq %rcx
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x180c0
movq 0x29035(%rip), %r12     # 0x66600
movq 0x20(%r12), %r15
leaq 0x18073(%rip), %rdi     # 0x5564a
callq *0x48(%r12)
pushq $0x2
popq %rbp
movss 0x11941(%rip), %xmm0    # 0x4ef28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %ebp, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r15
andl $0x0, 0x108(%rbx)
andq $0x0, 0x220(%rbx)
leaq 0x4(%rbx), %r15
leaq 0x1c0(%rbx), %rsi
movss 0x12617(%rip), %xmm0    # 0x4fc30
movq %r15, %rdi
movq %r15, %rdx
callq 0x19940
andl $0x0, 0x1c8(%rbx)
andq $0x0, 0x1c0(%rbx)
leaq 0x18025(%rip), %rdi     # 0x5565f
callq *0x40(%r12)
movl %eax, 0x28(%rbx)
andl $0x0, 0x38(%rbx)
andl $0x0, 0x4c(%rbx)
andb $-0x21, 0x41(%rbx)
movq 0x28f0b(%rip), %rax     # 0x66560
movq %rax, 0x210(%rbx)
movq 0x2973d(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
addss 0x11c20(%rip), %xmm0    # 0x4f290
movss %xmm0, 0x200(%rbx)
movq %r14, 0x2a0(%rbx)
pushq $0x3
popq %rdi
callq *0xc8(%r12)
pushq $0x15
popq %rdi
callq *0xc8(%r12)
movq %r15, %rdi
callq *0xf0(%r12)
movq 0xb0(%r12), %rax
movq %r15, %rdi
movl %ebp, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x19c50