#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, char *, char *);
int main(void) {
  int i;
  for (i = 1; i <= 100; i++) {
    printf("%d - %s%s\n", i, (i % 3 ? "" : "fizz "), (i % 5 ? "" : "buzz"));
  }
  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     1197 <main+0x87>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
lea    0xec6(%rip),%rax
lea    0xebe(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
mov    -0x10(%rbp),%rdx
lea    0xea2(%rip),%rcx
lea    0xe94(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%rcx
lea    0xe7c(%rip),%rdi
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   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x1,%ebx
lea    0xee6(%rip),%r15
lea    0xede(%rip),%r12
lea    0xede(%rip),%r13
lea    0xec6(%rip),%r14
jmp    1152 <main+0x42>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
je     1188 <main+0x78>
movzbl %bl,%ecx
imul   $0xcd,%ecx,%eax
shr    $0xa,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
imul   $0xab,%ecx,%edx
shr    $0x9,%edx
lea    (%rdx,%rdx,2),%esi
neg    %esi
mov    %r15,%rdx
add    %sil,%cl
je     117c <main+0x6c>
mov    %r12,%rdx
mov    %r13,%rcx
add    %bl,%al
je     1140 <main+0x30>
mov    %r12,%rcx
jmp    1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d - %s%s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"fizz \00"
@.str.3 = [5 x i8] c"buzz\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 = %19, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %22
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = srem i32 %8, 3
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%13 = load i32, i32* %2
%14 = srem i32 %13, 5
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %12, i8* %17)
br label %19
19: ; preds = %6
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %3
22: ; preds = %3
ret i32 0
}

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