#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() {
  for (int 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("\n");
  }
}


x86 assembly (clang, -O0):
<fizzbuzz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     11c7 <fizzbuzz+0xb7>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1151 <fizzbuzz+0x41>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119a <fizzbuzz+0x8a>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1173 <fizzbuzz+0x63>
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    1195 <fizzbuzz+0x85>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ab <fizzbuzz+0x9b>
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    111f <fizzbuzz+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fizzbuzz>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%ebx
lea    0xecc(%rip),%r14
lea    0xeca(%rip),%r15
lea    0xec8(%rip),%r12
jmp    116e <fizzbuzz+0x4e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
je     11c0 <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     119a <fizzbuzz+0x7a>
test   %bpl,%bpl
jne    1150 <fizzbuzz+0x30>
test   %al,%al
je     11a5 <fizzbuzz+0x85>
test   %bpl,%bpl
jne    115c <fizzbuzz+0x3c>
jmp    11b4 <fizzbuzz+0x94>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %bpl,%bpl
jne    115c <fizzbuzz+0x3c>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    115c <fizzbuzz+0x3c>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"Fizz\00"
@.str.1 = [5 x i8] c"Buzz\00"
@.str.2 = [3 x i8] c"%d\00"
define void @fizzbuzz() {
br label %2
1: ; preds = %18
ret void
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, 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.1, 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.2, i64 0, i64 0), i32 %3)
br label %18
18: ; preds = %13, %14, %16
%19 = tail call i32 @putchar(i32 10)
%20 = add nuw nsw i32 %3, 1
%21 = icmp eq i32 %20, 101
br i1 %21, label %1, label %2
}