#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() {
  int i;
  int fizz = 3;
  int buzz = 5;
  int nMax = 100;
  for (i = 1; i <= nMax; i++) {
    if (i % fizz == 0 && i % buzz == 0) {
      printf("FizzBuzz\n");
    } else if (i % fizz == 0) {
      printf("Fizz\n");
    } else if (i % buzz == 0) {
      printf("Buzz\n");
    } else {
      printf("%i\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11ee <main+0xde>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    117a <main+0x6a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    117a <main+0x6a>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xcb>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    119d <main+0x8d>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <main+0xc6>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11c0 <main+0xb0>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d1 <main+0xc1>
mov    -0x8(%rbp),%esi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <main+0xc6>
jmp    11db <main+0xcb>
jmp    11e0 <main+0xd0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x1,%ebx
lea    0xed4(%rip),%r14
lea    0xec8(%rip),%r15
lea    0xeca(%rip),%r12
lea    0xeb6(%rip),%r13
jmp    1160 <main+0x40>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@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    1158 <main+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
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 = [10 x i8] c"FizzBuzz\0A\00"
@.str.1 = [6 x i8] c"Fizz\0A\00"
@.str.2 = [6 x i8] c"Buzz\0A\00"
@.str.3 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %3
store i32 5, i32* %4
store i32 100, i32* %5
store i32 1, i32* %2
br label %6
6: ; preds = %42, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %5
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %45
10: ; preds = %6
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = srem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %10
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = srem i32 %16, %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %41
22: ; preds = %15, %10
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = srem i32 %23, %24
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %40
29: ; preds = %22
%30 = load i32, i32* %2
%31 = load i32, i32* %4
%32 = srem i32 %30, %31
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %39
36: ; preds = %29
%37 = load i32, i32* %2
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %36, %34
br label %40
40: ; preds = %39, %27
br label %41
41: ; preds = %40, %20
br label %42
42: ; preds = %41
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %6
45: ; preds = %6
ret i32 0
}

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