// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: plat_CalcAcceleratedMove
void plat_CalcAcceleratedMove(moveinfo_t *moveinfo)
{
	float	accel_dist;
	float	decel_dist;

	moveinfo->move_speed = moveinfo->speed;

	if (moveinfo->remaining_distance < moveinfo->accel)
	{
		moveinfo->current_speed = moveinfo->remaining_distance;
		return;
	}

	accel_dist = AccelerationDistance (moveinfo->speed, moveinfo->accel);
	decel_dist = AccelerationDistance (moveinfo->speed, moveinfo->decel);

	if ((moveinfo->remaining_distance - accel_dist - decel_dist) < 0)
	{
		float	f;

		f = (moveinfo->accel + moveinfo->decel) / (moveinfo->accel * moveinfo->decel);
		moveinfo->move_speed = (-2 + sqrtf(4 - 4 * f * (-2 * moveinfo->remaining_distance))) / (2 * f);
		decel_dist = AccelerationDistance (moveinfo->move_speed, moveinfo->decel);
	}

	moveinfo->decel_distance = decel_dist;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movss 0x40(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x64(%rax)
movq -0x8(%rbp), %rax
movss 0x6c(%rax), %xmm1
movq -0x8(%rbp), %rax
movss 0x3c(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x33d8c
movq -0x8(%rbp), %rax
movss 0x6c(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x60(%rax)
jmp 0x33f03
movq -0x8(%rbp), %rax
movss 0x40(%rax), %xmm0
movq -0x8(%rbp), %rax
movss 0x40(%rax), %xmm1
movq -0x8(%rbp), %rax
divss 0x3c(%rax), %xmm1
movss 0x3c13d(%rip), %xmm2    # 0x6feec
addss %xmm2, %xmm1
mulss %xmm1, %xmm0
movss 0x3c129(%rip), %xmm1    # 0x6fee8
divss %xmm1, %xmm0
movss %xmm0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movss 0x40(%rax), %xmm0
movq -0x8(%rbp), %rax
movss 0x40(%rax), %xmm1
movq -0x8(%rbp), %rax
divss 0x44(%rax), %xmm1
movss 0x3c101(%rip), %xmm2    # 0x6feec
addss %xmm2, %xmm1
mulss %xmm1, %xmm0
movss 0x3c0ed(%rip), %xmm1    # 0x6fee8
divss %xmm1, %xmm0
movss %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movss 0x6c(%rax), %xmm1
subss -0xc(%rbp), %xmm1
subss -0x10(%rbp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x33ef5
movq -0x8(%rbp), %rax
movss 0x3c(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x44(%rax), %xmm0
movq -0x8(%rbp), %rax
movss 0x3c(%rax), %xmm1
movq -0x8(%rbp), %rax
mulss 0x44(%rax), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
movss 0x3c0b4(%rip), %xmm0    # 0x6ff0c
mulss -0x14(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss 0x3d5ab(%rip), %xmm1    # 0x71414
mulss 0x6c(%rax), %xmm1
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm1, %xmm0
movss 0x3c085(%rip), %xmm1    # 0x6ff0c
addss %xmm1, %xmm0
callq 0x19000
movaps %xmm0, %xmm1
movss 0x3d579(%rip), %xmm0    # 0x71414
addss %xmm1, %xmm0
movss 0x3c041(%rip), %xmm1    # 0x6fee8
mulss -0x14(%rbp), %xmm1
divss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x64(%rax)
movq -0x8(%rbp), %rax
movss 0x64(%rax), %xmm0
movq -0x8(%rbp), %rax
movss 0x64(%rax), %xmm1
movq -0x8(%rbp), %rax
divss 0x44(%rax), %xmm1
movss 0x3c010(%rip), %xmm2    # 0x6feec
addss %xmm2, %xmm1
mulss %xmm1, %xmm0
movss 0x3bffc(%rip), %xmm1    # 0x6fee8
divss %xmm1, %xmm0
movss %xmm0, -0x10(%rbp)
movss -0x10(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x70(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)