#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fb(int x) {
  if (x % 15 == 0)
    printf("%d: FizzBuzz", x);
  else if (x % 5 == 0)
    printf("%d: Fizz", x);
  else if (x % 3 == 0)
    printf("%d: Buzz", x);
  else
    printf("%d:", x);
}


x86 assembly (clang, -O0):
<fb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <fb+0x33>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    11ac <fb+0x9c>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116b <fb+0x5b>
mov    -0x4(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    11a7 <fb+0x97>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1193 <fb+0x83>
mov    -0x4(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <fb+0x92>
mov    -0x4(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
jmp    11a7 <fb+0x97>
jmp    11ac <fb+0x9c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb>:
mov    %edi,%esi
imul   $0xeeeeeeef,%edi,%eax
add    $0x8888888,%eax
cmp    $0x11111111,%eax
jb     115d <fb+0x4d>
imul   $0xcccccccd,%esi,%eax
add    $0x19999999,%eax
cmp    $0x33333333,%eax
jb     1169 <fb+0x59>
imul   $0xaaaaaaab,%esi,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
lea    0xec9(%rip),%rax
lea    0xecb(%rip),%rdi
cmovb  %rax,%rdi
jmp    1030 <printf@plt>
lea    0xe9c(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xe9d(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%d: FizzBuzz\00"
@.str.1 = [9 x i8] c"%d: Fizz\00"
@.str.2 = [9 x i8] c"%d: Buzz\00"
@.str.3 = [4 x i8] c"%d:\00"
define void @fb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 15
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %28
9: ; preds = %1
%10 = load i32, i32* %2
%11 = srem i32 %10, 5
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %27
16: ; preds = %9
%17 = load i32, i32* %2
%18 = srem i32 %17, 3
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %26
23: ; preds = %16
%24 = load i32, i32* %2
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %23, %20
br label %27
27: ; preds = %26, %13
br label %28
28: ; preds = %27, %6
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d: FizzBuzz\00"
@.str.1 = [9 x i8] c"%d: Fizz\00"
@.str.2 = [9 x i8] c"%d: Buzz\00"
@.str.3 = [4 x i8] c"%d:\00"
define void @fb(i32 %0) {
%2 = srem i32 %0, 15
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 5
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = srem i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
br label %11
11: ; preds = %7, %4, %1
%12 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %4 ], [ %10, %7 ]
%13 = tail call i32 @printf(i8* %12, i32 %0)
ret void
}