Oops: 0x00000001000015af <fizzbuzz+47>: cmp edx,0x0
^^^It does a cmp+setz, which isn't a branch (and I believe is constant-time). An x86 branch would be cmp+jne or something similar.
Do you mind sharing the python as well?
Sure! It's ripped + modified from a project I'm working on, so it's a little messy:
Here's a fizzbuzz(char*, int) function that can accept any number up to 99999999, and will put the correct FizzBuzz result into the provided buffer (either the printed number, "Fizz ", " Buzz", or "FizzBuzz"). As promised, it's loop-free, and as a bonus it should be constant-time as well:
Assembly: http://pastebin.com/EnJEuxnp compiled from this C: http://pastebin.com/PCQQQ2cn [edit] generated from this Python: http://pastebin.com/ijr3thE2
Pastebinned since it's about 700 assembly instructions.
Unrolling the loop and printing to the screen are left as exercises...