#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 */
scalar_t__ is_in(int, int);
int /*<<< orphan*/ printf(char *, ...);
void fizzbuzz(int num) {
  int i;
  for (i = 1; i <= num; i++) {
    int ok = 0;
    if (i % 3 == 0 || is_in(3, i)) {
      printf("Fizz");
      ok = 1;
    }
    if (i % 5 == 0 || is_in(5, i)) {
      printf("Buzz");
      ok = 1;
    }
    if (!ok) {
      printf("%d", i);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<fizzbuzz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11fc <fizzbuzz+0xdc>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1170 <fizzbuzz+0x50>
mov    -0x8(%rbp),%esi
mov    $0x3,%edi
call   1040 <is_in@plt>
cmp    $0x0,%rax
je     1185 <fizzbuzz+0x65>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b0 <fizzbuzz+0x90>
mov    -0x8(%rbp),%esi
mov    $0x5,%edi
call   1040 <is_in@plt>
cmp    $0x0,%rax
je     11c5 <fizzbuzz+0xa5>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    11e0 <fizzbuzz+0xc0>
mov    -0x8(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <fizzbuzz+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fizzbuzz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    121e <fizzbuzz+0xee>
mov    %edi,%r14d
neg    %r14d
mov    $0x1,%ebx
mov    $0xaaaaaaab,%ebp
mov    $0xcccccccd,%r13d
jmp    118f <fizzbuzz+0x5f>
nopl   0x0(%rax,%rax,1)
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
je     121e <fizzbuzz+0xee>
mov    %ebx,%eax
mov    %rax,%rcx
imul   %rbp,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,2),%ecx
imul   %r13,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%eax
mov    $0x1,%r15d
sub    %eax,%r15d
cmp    %ecx,%ebx
je     11c8 <fizzbuzz+0x98>
mov    $0x3,%edi
mov    %ebx,%esi
call   1050 <is_in@plt>
test   %rax,%rax
je     1219 <fizzbuzz+0xe9>
xor    %r12d,%r12d
lea    0xe2e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebx,%r15d
cmp    $0x1,%r15d
je     1160 <fizzbuzz+0x30>
mov    $0x5,%edi
mov    %ebx,%esi
call   1050 <is_in@plt>
test   %rax,%rax
jne    1160 <fizzbuzz+0x30>
test   %r12b,%r12b
je     116e <fizzbuzz+0x3e>
lea    0xdff(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    116e <fizzbuzz+0x3e>
mov    $0x1,%r12b
jmp    11d9 <fizzbuzz+0xa9>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Fizz\00"
@.str.1 = [5 x i8] c"Buzz\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @fizzbuzz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %37, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %40
9: ; preds = %5
store i32 0, i32* %4
%10 = load i32, i32* %3
%11 = srem i32 %10, 3
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = call i64 @is_in(i32 3, i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13, %9
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %4
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %3
%21 = srem i32 %20, 5
%22 = icmp eq i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i32, i32* %3
%25 = call i64 @is_in(i32 5, i32 %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23, %19
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %4
br label %29
29: ; preds = %27, %23
%30 = load i32, i32* %4
%31 = icmp ne i32 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = load i32, i32* %3
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32, %29
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %5
40: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Fizz\00"
@.str.1 = [5 x i8] c"Buzz\00"
@.str.2 = [3 x i8] c"%d\00"
define void @fizzbuzz(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %28, label %3
3: ; preds = %1, %24
%4 = phi i32 [ %26, %24 ], [ 1, %1 ]
%5 = urem i32 %4, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i64 @is_in(i32 3, i32 %4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7, %3
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = phi i1 [ false, %10 ], [ true, %7 ]
%14 = urem i32 %4, 5
%15 = icmp eq i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %12
%17 = tail call i64 @is_in(i32 5, i32 %4)
%18 = icmp eq i64 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %12, %16
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %24
21: ; preds = %16
br i1 %13, label %22, label %24
22: ; preds = %21
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %4)
br label %24
24: ; preds = %19, %22, %21
%25 = tail call i32 @putchar(i32 10)
%26 = add nuw i32 %4, 1
%27 = icmp eq i32 %4, %0
br i1 %27, label %28, label %3
28: ; preds = %24, %1
ret void
}