Use clz instead of inline assembly. Init vars directly instead of using dedicated functions