#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 = 1;
  for (; i <= 100; i++) {
    printf("%d ", i);
    if (i % 3 == 0) {
      printf("FIZZ");
    }
    if (i % 5 == 0) {
      printf("BUZZ");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     11a1 <main+0x91>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1163 <main+0x53>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1185 <main+0x75>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xec9(%rip),%r14
lea    0xecb(%rip),%r12
jmp    1152 <main+0x32>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
je     11af <main+0x8f>
movzbl %bl,%ebp
imul   $0xcd,%ebp,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%r13d
neg    %r13d
imul   $0xab,%ebp,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%r15d
neg    %r15d
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %r15b,%bpl
je     1190 <main+0x70>
add    %bl,%r13b
jne    1140 <main+0x20>
jmp    11a3 <main+0x83>
nopl   (%rax)
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    %bl,%r13b
jne    1140 <main+0x20>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [5 x i8] c"FIZZ\00"
@.str.2 = [5 x i8] c"BUZZ\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %22, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %25
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = srem i32 %9, 3
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
%15 = load i32, i32* %2
%16 = srem i32 %15, 5
%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.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %3
25: ; preds = %3
ret i32 0
}

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