int main() {
  char *fizzbuzz[] = {"%d\n", "fizz\n", "buzz\n", "fizzbuzz\n"};
  int i;
  for (i = 1; i <= 100; ++i)
    printf((!(i % 3) + !(i % 5) * 2)[fizzbuzz], i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cd7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cd4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cd1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x34(%rbp)
cmpl   $0x64,-0x34(%rbp)
jg     11b8 <main+0xa8>
mov    -0x34(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    -0x38(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
shl    $0x1,%ecx
add    %ecx,%eax
cltq
mov    -0x30(%rbp,%rax,8),%rdi
mov    -0x34(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1152 <main+0x42>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xef4(%rip),%r14
movzbl %bl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
imul   $0xab,%eax,%edx
shr    $0x9,%edx
lea    (%rdx,%rdx,2),%edx
neg    %edx
xor    %esi,%esi
add    %al,%dl
sete   %sil
xor    %edx,%edx
add    %al,%cl
sete   %dl
lea    (%rsi,%rdx,2),%rax
movslq (%r14,%rax,4),%rdi
add    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"fizz\0A\00"
@.str.2 = [6 x i8] c"buzz\0A\00"
@.str.3 = [10 x i8] c"fizzbuzz\0A\00"
@__const.main.fizzbuzz = [4 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i32 0, i32 0)]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8*]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x i8*]* %2 to i8*
store i32 1, i32* %3
br label %5
5: ; preds = %26, %0
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 100
br i1 %7, label %8, label %29
8: ; preds = %5
%9 = load i32, i32* %3
%10 = srem i32 %9, 3
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = load i32, i32* %3
%15 = srem i32 %14, 5
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = mul nsw i32 %18, 2
%20 = add nsw i32 %13, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 %21
%23 = load i8*, i8** %22
%24 = load i32, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* %23, i32 %24)
br label %26
26: ; preds = %8
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %5
29: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"fizz\0A\00"
@.str.2 = [6 x i8] c"buzz\0A\00"
@.str.3 = [10 x i8] c"fizzbuzz\0A\00"
@reltable.main = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %14, %1 ]
%3 = trunc i32 %2 to i8
%4 = urem i8 %3, 3
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i64
%7 = urem i8 %3, 5
%8 = icmp eq i8 %7, 0
%9 = select i1 %8, i64 2, i64 0
%10 = or i64 %9, %6
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.main to i8*), i64 %11)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %12, i32 %2)
%14 = add nuw nsw i32 %2, 1
%15 = icmp eq i32 %14, 101
br i1 %15, label %16, label %1
16: ; preds = %1
ret i32 0
}