.globl npot .type npot, @function # First parameter = value to elevate to the next power of two # Return value = the given value elevated to the NPoT npot: xor %rax, %rax bsr %rdi, %rcx jz npot_end movq $1, %rax shl %cl, %rax cmp %rax, %rdi je npot_end shl $1, %rax npot_end: ret