#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 /*<<< orphan*/ puts(char *);
void fizzBuzz(int n) {
  for (int i = 1; i <= n; ++i) {
    if (i % 3 && i % 5) {
      printf("%d", i);
    } else {
      if (i % 3 == 0)
        printf("Fizz");
      if (i % 5 == 0)
        printf("Buzz");
    }
    puts("");
  }
}


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     11df <fizzBuzz+0xbf>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     117c <fizzBuzz+0x5c>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     117c <fizzBuzz+0x5c>
mov    -0x8(%rbp),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11c5 <fizzBuzz+0xa5>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119e <fizzBuzz+0x7e>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c0 <fizzBuzz+0xa0>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11c5 <fizzBuzz+0xa5>
lea    0xe36(%rip),%rdi
call   1030 <puts@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    11ea <fizzBuzz+0xca>
mov    %edi,%r14d
neg    %r14d
mov    $0x1,%ebx
mov    $0xaaaaaaab,%ebp
mov    $0xcccccccd,%r15d
lea    0xeb0(%rip),%r13
jmp    1189 <fizzBuzz+0x69>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %ebx,%esi
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     11ea <fizzBuzz+0xca>
mov    %ebx,%eax
mov    %rax,%rcx
imul   %rbp,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,2),%ecx
imul   %r15,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%edx
neg    %ecx
lea    (%rbx,%rcx,1),%eax
add    $0x1,%eax
neg    %edx
lea    (%rbx,%rdx,1),%r12d
add    $0x1,%r12d
cmp    $0x1,%eax
je     11c1 <fizzBuzz+0xa1>
cmp    $0x1,%r12d
jne    1160 <fizzBuzz+0x40>
cmp    $0x1,%eax
jne    11d4 <fizzBuzz+0xb4>
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%r12d
jne    116c <fizzBuzz+0x4c>
lea    0xe27(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    116c <fizzBuzz+0x4c>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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