#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 main(void) {
  for (int i = 1; i <= 100; ++i) {
    int modThree = i % 3;
    int modFive = i % 5;
    if (!modThree && !modFive) {
      printf("fizzbuzz");
    } else if (!modThree) {
      printf("fizz");
    } else if (!modFive) {
      printf("buzz");
    } else {
      printf("%d", i);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     11e4 <main+0xd4>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1173 <main+0x63>
cmpl   $0x0,-0x10(%rbp)
jne    1173 <main+0x63>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c8 <main+0xb8>
cmpl   $0x0,-0xc(%rbp)
jne    1190 <main+0x80>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c3 <main+0xb3>
cmpl   $0x0,-0x10(%rbp)
jne    11ad <main+0x9d>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11be <main+0xae>
mov    -0x8(%rbp),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c3 <main+0xb3>
jmp    11c8 <main+0xb8>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x1,%ebx
lea    0xecb(%rip),%r14
lea    0xecd(%rip),%r15
lea    0xec1(%rip),%r12
lea    0xec4(%rip),%r13
jmp    116c <main+0x4c>
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
je     11ba <main+0x9a>
movzbl %bl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
lea    (%rcx,%rcx,4),%edx
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
movzbl %al,%ecx
add    %ebx,%ecx
mov    %ebx,%eax
sub    %edx,%eax
mov    %ecx,%edx
or     %al,%dl
je     1150 <main+0x30>
test   %cl,%cl
je     11b0 <main+0x90>
test   %al,%al
je     11b5 <main+0x95>
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    115a <main+0x3a>
xchg   %ax,%ax
mov    %r15,%rdi
jmp    1153 <main+0x33>
mov    %r12,%rdi
jmp    1153 <main+0x33>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"fizzbuzz\00"
@.str.1 = [5 x i8] c"fizz\00"
@.str.2 = [5 x i8] c"buzz\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
br label %2
1: ; preds = %21
ret i32 0
2: ; preds = %0, %21
%3 = phi i32 [ 1, %0 ], [ %23, %21 ]
%4 = trunc i32 %3 to i8
%5 = urem i8 %4, 3
%6 = urem i8 %4, 5
%7 = icmp eq i8 %6, 0
%8 = or i8 %5, %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %21
12: ; preds = %2
%13 = icmp eq i8 %5, 0
br i1 %13, label %14, label %16
14: ; preds = %12
%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 %21
16: ; preds = %12
br i1 %7, 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 %21
19: ; preds = %16
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
br label %21
21: ; preds = %14, %19, %17, %10
%22 = tail call i32 @putchar(i32 10)
%23 = add nuw nsw i32 %3, 1
%24 = icmp eq i32 %23, 101
br i1 %24, label %1, label %2
}