#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() {
  for (int i = 1; i <= 100; i++) {
    if (i % 5) {
      if (i % 3) {
        printf("%d\n", i);
      } else {
        printf("Fizz\n");
      }
    } else {
      printf("FizzBuzz\n" + i * i % 3 * 4);
    }
  }
  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     11ba <main+0xaa>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1181 <main+0x71>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116e <main+0x5e>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117c <main+0x6c>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <main+0x97>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%edx
movslq %edx,%rax
lea    0xe6d(%rip),%rdi
add    %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ac <main+0x9c>
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   %r12
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r12
lea    0xed3(%rip),%r14
lea    0xebe(%rip),%r15
jmp    117e <main+0x5e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%eax
imul   %eax,%eax
movzwl %ax,%ecx
imul   $0xaaab,%ecx,%ecx
shr    $0x11,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
and    $0x3fff,%eax
lea    (%r12,%rax,4),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
je     11ca <main+0xaa>
movzbl %bl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %al,%cl
je     1150 <main+0x30>
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
add    %bl,%al
je     11c0 <main+0xa0>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1176 <main+0x56>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    1176 <main+0x56>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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