// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_combat.c
// Function: CanDamage
qboolean CanDamage (edict_t *targ, edict_t *inflictor)
{
	vec3_t	dest;
	trace_t	trace;

// bmodels need special checking because their origin is 0,0,0
	if (targ->movetype == MOVETYPE_PUSH)
	{
		VectorAdd (targ->absmin, targ->absmax, dest);
		VectorScale (dest, 0.5, dest);
		trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
		if (trace.fraction == 1.0)
			return true;
		if (trace.ent == targ)
			return true;
		return false;
	}
	
	trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, targ->s.origin, inflictor, MASK_SOLID);
	if (trace.fraction == 1.0)
		return true;

	VectorCopy (targ->s.origin, dest);
	dest[0] += 15.0;
	dest[1] += 15.0;
	trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
	if (trace.fraction == 1.0)
		return true;

	VectorCopy (targ->s.origin, dest);
	dest[0] += 15.0;
	dest[1] -= 15.0;
	trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
	if (trace.fraction == 1.0)
		return true;

	VectorCopy (targ->s.origin, dest);
	dest[0] -= 15.0;
	dest[1] += 15.0;
	trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
	if (trace.fraction == 1.0)
		return true;

	VectorCopy (targ->s.origin, dest);
	dest[0] -= 15.0;
	dest[1] -= 15.0;
	trace = gi.trace (inflictor->s.origin, vec3_origin, vec3_origin, dest, inflictor, MASK_SOLID);
	if (trace.fraction == 1.0)
		return true;


	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x2, 0x118(%rdi)
jne 0x2b460
movss 0xe4(%r14), %xmm0
addss 0xf0(%r14), %xmm0
leaq 0x14(%rsp), %r15
movss %xmm0, (%r15)
movss 0xe8(%r14), %xmm0
addss 0xf4(%r14), %xmm0
movss %xmm0, 0x4(%r15)
movss 0xec(%r14), %xmm0
addss 0xf8(%r14), %xmm0
movss %xmm0, 0x8(%r15)
movss 0x2a003(%rip), %xmm0    # 0x55404
movq %r15, %rdi
movq %r15, %rsi
callq 0x189d0
movq 0x3e1ed(%rip), %rax     # 0x69600
leaq 0x4(%rbx), %rsi
movl $0x3, (%rsp)
movq 0x3e343(%rip), %rcx     # 0x69768
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %rcx, %rdx
movq %r15, %r8
movq %rbx, %r9
callq *0x60(%rax)
movss 0x8(%r12), %xmm0
movb $0x1, %bpl
ucomiss 0x28ade(%rip), %xmm0    # 0x53f28
jne 0x2b452
jnp 0x2b697
cmpq %r14, 0x60(%rsp)
sete %bpl
jmp 0x2b697
movq 0x3e199(%rip), %r13     # 0x69600
leaq 0x4(%rbx), %r15
leaq 0x4(%r14), %r8
movl $0x3, (%rsp)
movq 0x3e2eb(%rip), %rcx     # 0x69768
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %rcx, %rdx
movq %rbx, %r9
callq *0x60(%r13)
movss 0x8(%r12), %xmm0
movb $0x1, %bpl
ucomiss 0x28a85(%rip), %xmm0    # 0x53f28
jne 0x2b4ab
jnp 0x2b697
movss 0x4(%r14), %xmm0
leaq 0x14(%rsp), %r8
movss %xmm0, (%r8)
movss 0x8(%r14), %xmm1
movss %xmm1, 0x4(%r8)
movss 0xc(%r14), %xmm2
movss %xmm2, 0x8(%r8)
movss 0x28f69(%rip), %xmm2    # 0x54444
addss %xmm2, %xmm0
movss %xmm0, (%r8)
addss %xmm2, %xmm1
movss %xmm1, 0x4(%r8)
movl $0x3, (%rsp)
movq 0x3e26c(%rip), %rcx     # 0x69768
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %rcx, %rdx
movq %rbx, %r9
callq *0x60(%r13)
movss 0x8(%r12), %xmm0
ucomiss 0x28a09(%rip), %xmm0    # 0x53f28
jne 0x2b527
jnp 0x2b697
movss 0x4(%r14), %xmm0
leaq 0x14(%rsp), %r8
movss %xmm0, (%r8)
movss 0x8(%r14), %xmm1
movss %xmm1, 0x4(%r8)
movss 0xc(%r14), %xmm2
movss %xmm2, 0x8(%r8)
addss 0x28eed(%rip), %xmm0    # 0x54444
movss %xmm0, (%r8)
addss 0x28edc(%rip), %xmm1    # 0x54440
movss %xmm1, 0x4(%r8)
movl $0x3, (%rsp)
movq 0x3e1f0(%rip), %rcx     # 0x69768
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %rcx, %rdx
movq %rbx, %r9
callq *0x60(%r13)
movss 0x8(%r12), %xmm0
ucomiss 0x2898d(%rip), %xmm0    # 0x53f28
jne 0x2b5a3
jnp 0x2b697
movss 0x4(%r14), %xmm0
leaq 0x14(%rsp), %r8
movss %xmm0, (%r8)
movss 0x8(%r14), %xmm1
movss %xmm1, 0x4(%r8)
movss 0xc(%r14), %xmm2
movss %xmm2, 0x8(%r8)
addss 0x28e6d(%rip), %xmm0    # 0x54440
movss %xmm0, (%r8)
addss 0x28e64(%rip), %xmm1    # 0x54444
movss %xmm1, 0x4(%r8)
movl $0x3, (%rsp)
movq 0x3e174(%rip), %rcx     # 0x69768
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %rcx, %rdx
movq %rbx, %r9
callq *0x60(%r13)
movss 0x8(%r12), %xmm0
ucomiss 0x28911(%rip), %xmm0    # 0x53f28
jne 0x2b61b
jnp 0x2b697
movss 0x4(%r14), %xmm0
leaq 0x14(%rsp), %r8
movss %xmm0, (%r8)
movss 0x8(%r14), %xmm1
movss %xmm1, 0x4(%r8)
movss 0xc(%r14), %xmm2
movss %xmm2, 0x8(%r8)
movss 0x28df5(%rip), %xmm2    # 0x54440
addss %xmm2, %xmm0
movss %xmm0, (%r8)
addss %xmm2, %xmm1
movss %xmm1, 0x4(%r8)
movl $0x3, (%rsp)
movq 0x3e0fc(%rip), %rcx     # 0x69768
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %rcx, %rdx
movq %rbx, %r9
callq *0x60(%r13)
movss 0x2889f(%rip), %xmm0    # 0x53f28
cmpeqss 0x8(%r14), %xmm0
movd %xmm0, %ebp
andl $0x1, %ebp
movzbl %bpl, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq