changed assembly code to ugly inline assembly included, can't be helped