#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) {
  printf("FIZZBUZZ exercise, from 1 to %d :\n\n", 100);
  for (int i = 1; i < 100; i++) {
    if (i % 15 == 0) {
      printf("fizzbuzz\n");
    } else if (i % 5 == 0) {
      printf("buzz\n");
    } else if (i % 3 == 0) {
      printf("fizz\n");
    } else {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    11e6 <main+0xd6>
mov    -0x8(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116a <main+0x5a>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d3 <main+0xc3>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1191 <main+0x81>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ce <main+0xbe>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b8 <main+0xa8>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c9 <main+0xb9>
mov    -0x8(%rbp),%esi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ce <main+0xbe>
jmp    11d3 <main+0xc3>
jmp    11d8 <main+0xc8>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x29>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xed0(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
lea    0xee5(%rip),%r14
lea    0xee2(%rip),%r15
lea    0xed2(%rip),%r12
lea    0xec7(%rip),%r13
jmp    1170 <main+0x50>
nop
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
je     11ca <main+0xaa>
movzbl %bl,%eax
imul   $0x89,%eax,%ecx
shr    $0xb,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
sub    %edx,%ecx
add    %al,%cl
je     1160 <main+0x40>
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %bl,%cl
je     11c0 <main+0xa0>
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
add    %bl,%al
je     11c5 <main+0xa5>
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1168 <main+0x48>
nopl   0x0(%rax)
mov    %r15,%rdi
jmp    1163 <main+0x43>
mov    %r12,%rdi
jmp    1163 <main+0x43>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [36 x i8] c"FIZZBUZZ exercise, from 1 to %d :\0A\0A\00"
@.str.1 = [10 x i8] c"fizzbuzz\0A\00"
@.str.2 = [6 x i8] c"buzz\0A\00"
@.str.3 = [6 x i8] c"fizz\0A\00"
@.str.4 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 100)
store i32 1, i32* %2
br label %4
4: ; preds = %31, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %34
7: ; preds = %4
%8 = load i32, i32* %2
%9 = srem i32 %8, 15
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %30
13: ; preds = %7
%14 = load i32, i32* %2
%15 = srem i32 %14, 5
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %29
19: ; preds = %13
%20 = load i32, i32* %2
%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 ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %28
25: ; preds = %19
%26 = load i32, i32* %2
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %25, %23
br label %29
29: ; preds = %28, %17
br label %30
30: ; preds = %29, %11
br label %31
31: ; preds = %30
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %4
34: ; preds = %4
ret i32 0
}

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