aco: Extract LDS alignment calculation to a separate function.