#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 argc, char **argv) {
  int max = 50;
  int i;
  for (i = 1; i < max; i++) {
    if (i % 3 == 0 && i % 5 == 0)
      printf("Fizz Buzz\n");
    else if (i % 3 == 0)
      printf("Fizz\n");
    else if (i % 5 == 0)
      printf("Buzz\n");
    else
      printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x32,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11f7 <main+0xe7>
mov    -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117b <main+0x6b>
mov    -0x18(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117b <main+0x6b>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <main+0xd4>
mov    -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a2 <main+0x92>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11df <main+0xcf>
mov    -0x18(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c9 <main+0xb9>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11da <main+0xca>
mov    -0x18(%rbp),%esi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11df <main+0xcf>
jmp    11e4 <main+0xd4>
jmp    11e9 <main+0xd9>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x1,%ebx
lea    0xed4(%rip),%r14
lea    0xec8(%rip),%r15
lea    0xecb(%rip),%r12
lea    0xeb6(%rip),%r13
jmp    1160 <main+0x40>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
cmp    $0x32,%ebx
je     11ba <main+0x9a>
movzbl %bl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
lea    (%rcx,%rcx,4),%edx
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
movzbl %al,%ecx
add    %ebx,%ecx
mov    %ebx,%eax
sub    %edx,%eax
mov    %ecx,%edx
or     %al,%dl
je     1150 <main+0x30>
test   %cl,%cl
je     11b0 <main+0x90>
test   %al,%al
je     11b5 <main+0x95>
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1158 <main+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
jmp    1153 <main+0x33>
mov    %r12,%rdi
jmp    1153 <main+0x33>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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