#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*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void fizzbuzz(int n) {
  if (n % 3 == 0 || n % 5 == 0) {
    if (n % 3 == 0) {
      fputs("Fizz", stdout);
    }
    if (n % 5 == 0) {
      fputs("Buzz", stdout);
    }
  } else {
    printf("%d", n);
  }
  fputc('\n', stdout);
  return;
}


x86 assembly (clang, -O0):
<fizzbuzz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1163 <fizzbuzz+0x33>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ba <fizzbuzz+0x8a>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118c <fizzbuzz+0x5c>
mov    0x2e62(%rip),%rax
mov    (%rax),%esi
lea    0xe79(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b5 <fizzbuzz+0x85>
mov    0x2e39(%rip),%rax
mov    (%rax),%esi
lea    0xe55(%rip),%rdi
call   1040 <fputs@plt>
jmp    11c9 <fizzbuzz+0x99>
mov    -0x4(%rbp),%esi
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e10(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1050 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fizzbuzz>:
push   %rbx
mov    %edi,%esi
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x21,%rdx
add    %edi,%edx
lea    (%rdx,%rdx,4),%edx
mov    %eax,%ebx
sub    %edx,%ebx
sub    %ecx,%eax
je     117e <fizzbuzz+0x4e>
test   %ebx,%ebx
je     117e <fizzbuzz+0x4e>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <fizzbuzz+0x56>
test   %eax,%eax
je     119a <fizzbuzz+0x6a>
test   %ebx,%ebx
je     11b3 <fizzbuzz+0x83>
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
pop    %rbx
jmp    1050 <fputc@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%esi
lea    0xe56(%rip),%rdi
call   1040 <fputs@plt>
test   %ebx,%ebx
jne    1186 <fizzbuzz+0x56>
mov    0x2e26(%rip),%rax
mov    (%rax),%esi
lea    0xe42(%rip),%rdi
call   1040 <fputs@plt>
jmp    1186 <fizzbuzz+0x56>

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

LLVM IR (-O2):
@.str = [5 x i8] c"Fizz\00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"Buzz\00"
@.str.2 = [3 x i8] c"%d\00"
define void @fizzbuzz(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 5
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %15
7: ; preds = %1
br i1 %3, label %8, label %11
8: ; preds = %7
%9 = load i32, i32* @stdout
%10 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %7
br i1 %5, label %12, label %17
12: ; preds = %11
%13 = load i32, i32* @stdout
%14 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %17
15: ; preds = %1
%16 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %17
17: ; preds = %11, %12, %15
%18 = load i32, i32* @stdout
%19 = tail call i32 @fputc(i8 signext 10, i32 %18)
ret void
}