#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 *, ...);
void fizzbuzz() {
  printf("fizzbuzz app\n");
  int i;
  for (i = 1; i < 100; i++) {
    if (i % 3 == 0 || i % 5 == 0) {
      if (i % 3 == 0)
        printf("Fizz");
      if (i % 5 == 0)
        printf("Buzz");
    } else
      printf("%d", i);
    printf(" ");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<fizzbuzz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    11d5 <fizzbuzz+0xc5>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     115f <fizzbuzz+0x4f>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a8 <fizzbuzz+0x98>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1181 <fizzbuzz+0x71>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a3 <fizzbuzz+0x93>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b9 <fizzbuzz+0xa9>
mov    -0x4(%rbp),%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <fizzbuzz+0x1d>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fizzbuzz>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
lea    0xeb0(%rip),%r14
lea    0xeae(%rip),%r15
lea    0xeac(%rip),%r12
jmp    117e <fizzbuzz+0x4e>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
je     11d0 <fizzbuzz+0xa0>
movzbl %bl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
lea    (%rcx,%rcx,4),%ecx
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%edx
mov    %ebx,%eax
sub    %edx,%eax
mov    %ebx,%ebp
sub    %ecx,%ebp
test   %al,%al
je     11aa <fizzbuzz+0x7a>
test   %bpl,%bpl
jne    1160 <fizzbuzz+0x30>
test   %al,%al
je     11b5 <fizzbuzz+0x85>
test   %bpl,%bpl
jne    116c <fizzbuzz+0x3c>
jmp    11c4 <fizzbuzz+0x94>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %bpl,%bpl
jne    116c <fizzbuzz+0x3c>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    116c <fizzbuzz+0x3c>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

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