// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/m_move.c
// Function: M_CheckBottom
qboolean M_CheckBottom (edict_t *ent)
{
	vec3_t	mins, maxs, start, stop;
	trace_t	trace;
	int		x, y;
	float	mid, bottom;
	
	VectorAdd (ent->s.origin, ent->mins, mins);
	VectorAdd (ent->s.origin, ent->maxs, maxs);

// if all of the points under the corners are solid world, don't bother
// with the tougher checks
// the corners must be within 16 of the midpoint
	start[2] = mins[2] - 1;
	for	(x=0 ; x<=1 ; x++)
		for	(y=0 ; y<=1 ; y++)
		{
			start[0] = x ? maxs[0] : mins[0];
			start[1] = y ? maxs[1] : mins[1];
			if (gi.pointcontents (start) != CONTENTS_SOLID)
				goto realcheck;
		}

	c_yes++;
	return true;		// we got out easy

realcheck:
	c_no++;
//
// check it for real...
//
	start[2] = mins[2];
	
// the midpoint must be within 16 of the bottom
	start[0] = stop[0] = (mins[0] + maxs[0])*0.5f;
	start[1] = stop[1] = (mins[1] + maxs[1])*0.5f;
	stop[2] = start[2] - 2*STEPSIZE;
	trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);

	if (trace.fraction == 1.0)
		return false;
	mid = bottom = trace.endpos[2];
	
// the corners must be within 16 of the midpoint	
	for	(x=0 ; x<=1 ; x++)
		for	(y=0 ; y<=1 ; y++)
		{
			start[0] = stop[0] = x ? maxs[0] : mins[0];
			start[1] = stop[1] = y ? maxs[1] : mins[1];
			
			trace = gi.trace (start, vec3_origin, vec3_origin, stop, ent, MASK_MONSTERSOLID);
			
			if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
				bottom = trace.endpos[2];
			if (trace.fraction == 1.0 || mid - trace.endpos[2] > STEPSIZE)
				return false;
		}

	c_yes++;
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0xcc(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0xd0(%rax), %xmm0
movss %xmm0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0xd4(%rax), %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0xd8(%rax), %xmm0
movss %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0xdc(%rax), %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
addss 0xe0(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x14(%rbp), %xmm0
movss 0x1b344(%rip), %xmm1    # 0x6feec
subss %xmm1, %xmm0
movss %xmm0, -0x2c(%rbp)
movl $0x0, -0x8c(%rbp)
cmpl $0x1, -0x8c(%rbp)
jg 0x54c87
movl $0x0, -0x90(%rbp)
cmpl $0x1, -0x90(%rbp)
jg 0x54c71
cmpl $0x0, -0x8c(%rbp)
je 0x54bf7
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x12c(%rbp)
jmp 0x54c04
movss -0x1c(%rbp), %xmm0
movss %xmm0, -0x12c(%rbp)
movss -0x12c(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
cmpl $0x0, -0x90(%rbp)
je 0x54c29
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x130(%rbp)
jmp 0x54c36
movss -0x18(%rbp), %xmm0
movss %xmm0, -0x130(%rbp)
movss -0x130(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
movq 0x2d9b6(%rip), %rax     # 0x82600
movq 0x68(%rax), %rax
leaq -0x34(%rbp), %rdi
callq *%rax
cmpl $0x1, %eax
je 0x54c5b
jmp 0x54ca8
jmp 0x54c5d
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x54bd2
jmp 0x54c73
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x54bbb
movq 0x2da02(%rip), %rax     # 0x82690
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x2d9f6(%rip), %rax     # 0x82690
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x54f41
movq 0x2d7e1(%rip), %rax     # 0x82490
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x2d7d5(%rip), %rax     # 0x82490
movl %ecx, (%rax)
movss -0x14(%rbp), %xmm0
movss %xmm0, -0x2c(%rbp)
movss -0x1c(%rbp), %xmm0
addss -0x28(%rbp), %xmm0
movss 0x1de77(%rip), %xmm1    # 0x72b50
mulss %xmm1, %xmm0
movss %xmm0, -0x40(%rbp)
movss %xmm0, -0x34(%rbp)
movss -0x18(%rbp), %xmm0
addss -0x24(%rbp), %xmm0
movss 0x1de57(%rip), %xmm1    # 0x72b50
mulss %xmm1, %xmm0
movss %xmm0, -0x3c(%rbp)
movss %xmm0, -0x30(%rbp)
movss -0x2c(%rbp), %xmm0
movss 0x216c4(%rip), %xmm1    # 0x763d8
subss %xmm1, %xmm0
movss %xmm0, -0x38(%rbp)
movq 0x2d8dc(%rip), %rax     # 0x82600
movq 0x60(%rax), %rax
leaq -0x34(%rbp), %rsi
leaq -0x40(%rbp), %r8
movq -0x10(%rbp), %r9
leaq -0xe0(%rbp), %rdi
movq 0x2da26(%rip), %rcx     # 0x82768
movq %rcx, %rdx
movl $0x2020003, (%rsp)      # imm = 0x2020003
callq *%rax
leaq -0x88(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
movl $0x48, %edx
callq 0x18dc0
movss -0x80(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1b1c9(%rip), %xmm1    # 0x6ff40
ucomisd %xmm1, %xmm0
jne 0x54d8b
jp 0x54d8b
movl $0x0, -0x4(%rbp)
jmp 0x54f41
movss -0x74(%rbp), %xmm0
movss %xmm0, -0x98(%rbp)
movss %xmm0, -0x94(%rbp)
movl $0x0, -0x8c(%rbp)
cmpl $0x1, -0x8c(%rbp)
jg 0x54f25
movl $0x0, -0x90(%rbp)
cmpl $0x1, -0x90(%rbp)
jg 0x54f0f
cmpl $0x0, -0x8c(%rbp)
je 0x54de6
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x134(%rbp)
jmp 0x54df3
movss -0x1c(%rbp), %xmm0
movss %xmm0, -0x134(%rbp)
movss -0x134(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movss %xmm0, -0x34(%rbp)
cmpl $0x0, -0x90(%rbp)
je 0x54e1d
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x138(%rbp)
jmp 0x54e2a
movss -0x18(%rbp), %xmm0
movss %xmm0, -0x138(%rbp)
movss -0x138(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movss %xmm0, -0x30(%rbp)
movq 0x2d7bd(%rip), %rax     # 0x82600
movq 0x60(%rax), %rax
leaq -0x34(%rbp), %rsi
leaq -0x40(%rbp), %r8
movq -0x10(%rbp), %r9
leaq -0x128(%rbp), %rdi
movq 0x2d907(%rip), %rcx     # 0x82768
movq %rcx, %rdx
movl $0x2020003, (%rsp)      # imm = 0x2020003
callq *%rax
leaq -0x88(%rbp), %rdi
leaq -0x128(%rbp), %rsi
movl $0x48, %edx
callq 0x18dc0
movss -0x80(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1b0aa(%rip), %xmm1    # 0x6ff40
ucomisd %xmm1, %xmm0
jne 0x54ea0
jp 0x54ea0
jmp 0x54ebb
movss -0x74(%rbp), %xmm0
ucomiss -0x98(%rbp), %xmm0
jbe 0x54ebb
movss -0x74(%rbp), %xmm0
movss %xmm0, -0x98(%rbp)
movss -0x80(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1b074(%rip), %xmm1    # 0x6ff40
ucomisd %xmm1, %xmm0
jne 0x54ed6
jp 0x54ed6
jmp 0x54ef0
movss -0x94(%rbp), %xmm0
subss -0x74(%rbp), %xmm0
movss 0x214f1(%rip), %xmm1    # 0x763dc
ucomiss %xmm1, %xmm0
jbe 0x54ef9
movl $0x0, -0x4(%rbp)
jmp 0x54f41
jmp 0x54efb
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x54dc1
jmp 0x54f11
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x54daa
movq 0x2d764(%rip), %rax     # 0x82690
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x2d758(%rip), %rax     # 0x82690
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopl (%rax)