Skip to content

Instantly share code, notes, and snippets.

@snoopspy
Created March 5, 2015 16:37
Show Gist options
  • Save snoopspy/3789e9c9aec3dc35ee1d to your computer and use it in GitHub Desktop.
Save snoopspy/3789e9c9aec3dc35ee1d to your computer and use it in GitHub Desktop.
#include <iostream>
unsigned __attribute__ ((noinline)) f(unsigned a)
{
return a/9;
.cfi_startproc
movl %edi, %eax
movl $954437177, %edx
mull %edx
shrl %edx
movl %edx, %eax
ret
.cfi_endproc
}
int main()
{
unsigned a;
std::cin >> a;
unsigned b = f(a);
std::cout << b << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment