#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 argc, const char *argv[]) {
  for (int i = 1; i <= 100; i++) {
    if (!(i % 15)) {
      printf("fizzbuzz\n");
    } else if (!(i % 3)) {
      printf("fizz\n");
    } else if (!(i % 5)) {
      printf("buzz\n");
    } else {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     11da <main+0xca>
mov    -0x14(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115e <main+0x4e>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c7 <main+0xb7>
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1185 <main+0x75>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c2 <main+0xb2>
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ac <main+0x9c>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bd <main+0xad>
mov    -0x14(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c2 <main+0xb2>
jmp    11c7 <main+0xb7>
jmp    11cc <main+0xbc>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
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    0xecf(%rip),%r14
lea    0xed1(%rip),%r15
lea    0xec5(%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   $0x89,%eax,%ecx
shr    $0xb,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
sub    %edx,%ecx
add    %al,%cl
je     1150 <main+0x30>
imul   $0xab,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %bl,%cl
je     11b0 <main+0x90>
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
add    %bl,%al
je     11b5 <main+0x95>
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1158 <main+0x38>
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"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %34, %2
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 100
br i1 %9, label %10, label %37
10: ; preds = %7
%11 = load i32, i32* %6
%12 = srem i32 %11, 15
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %33
16: ; preds = %10
%17 = load i32, i32* %6
%18 = srem i32 %17, 3
%19 = icmp ne i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %32
22: ; preds = %16
%23 = load i32, i32* %6
%24 = srem i32 %23, 5
%25 = icmp ne i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %31
28: ; preds = %22
%29 = load i32, i32* %6
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %26
br label %32
32: ; preds = %31, %20
br label %33
33: ; preds = %32, %14
br label %34
34: ; preds = %33
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %7
37: ; preds = %7
ret i32 0
}

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