main(i) {
  for (; i < 101;
       printf("%i\r%s%s\n", i++, i % 3 ? "" : "Fizz", i % 5 ? "" : "Buzz"))
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
cmpl   $0x65,-0x8(%rbp)
jge    1199 <main+0x89>
jmp    1131 <main+0x21>
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
lea    0xebb(%rip),%rax
lea    0xeb3(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
mov    -0x10(%rbp),%rdx
lea    0xe96(%rip),%rcx
lea    0xe89(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%rcx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1122 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x64,%edi
jg     1186 <main+0x76>
mov    %edi,%esi
lea    0xee3(%rip),%r14
lea    0xedb(%rip),%r15
lea    0xeda(%rip),%r12
lea    0xec5(%rip),%rbx
jmp    1151 <main+0x41>
nopl   (%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%esi
cmp    $0x65,%ebp
je     1186 <main+0x76>
lea    0x1(%rsi),%ebp
imul   $0xaaaaaaab,%ebp,%eax
add    $0x2aaaaaaa,%eax
mov    %r14,%rdx
cmp    $0x55555555,%eax
jb     116c <main+0x5c>
mov    %r15,%rdx
imul   $0xcccccccd,%ebp,%eax
add    $0x19999999,%eax
mov    %r12,%rcx
cmp    $0x33333333,%eax
jb     1140 <main+0x30>
mov    %r15,%rcx
jmp    1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%i\0D%s%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"Fizz\00"
@.str.3 = [5 x i8] c"Buzz\00"
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 101
br i1 %6, label %7, label %22
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = srem i32 %11, 3
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%16 = load i32, i32* %3
%17 = srem i32 %16, 5
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %15, i8* %20)
br label %4
22: ; preds = %4
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@.str = [9 x i8] c"%i\0D%s%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"Fizz\00"
@.str.3 = [5 x i8] c"Buzz\00"
define i32 @main(i32 %0) {
%2 = icmp slt i32 %0, 101
br i1 %2, label %3, label %14
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, 1
%6 = srem i32 %5, 3
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%9 = srem i32 %5, 5
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %8, i8* %11)
%13 = icmp eq i32 %5, 101
br i1 %13, label %14, label %3
14: ; preds = %3, %1
ret i32 0
}