How can optimize the above condition ladder using thumb instructions. i replace the abs() library function by substraction.