#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 *, ...);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  int n = (int)strtol(argv[1], NULL, 10);
  for (int i = 1; i <= n; i++) {
    if (i % 3 == 0 && i % 5 == 0) {
      printf("FizzBuzz\n");
    } else if (i % 3 == 0) {
      printf("Fizz\n");
    } else if (i % 5 == 0) {
      printf("Buzz\n");
    } else {
      printf("%d\n", i);
    }
  }
}


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1219 <main+0xf9>
mov    -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119d <main+0x7d>
mov    -0x18(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119d <main+0x7d>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1206 <main+0xe6>
mov    -0x18(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c4 <main+0xa4>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1201 <main+0xe1>
mov    -0x18(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11eb <main+0xcb>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fc <main+0xdc>
mov    -0x18(%rbp),%esi
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1201 <main+0xe1>
jmp    1206 <main+0xe6>
jmp    120b <main+0xeb>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1156 <main+0x36>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,%rbx
test   %ebx,%ebx
jle    1202 <main+0xd2>
mov    $0x1,%r12d
mov    $0xaaaaaaab,%r15d
mov    $0xcccccccd,%r13d
lea    0xe9a(%rip),%r14
xor    %ebp,%ebp
jmp    1190 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%r12d
cmp    %ebp,%ebx
je     1202 <main+0xd2>
mov    %ebp,%edx
mov    %r12d,%eax
mov    %rax,%rcx
imul   %r15,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,2),%ecx
imul   %r13,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%esi
neg    %ecx
lea    (%rdx,%rcx,1),%eax
add    $0x1,%eax
neg    %esi
lea    (%rdx,%rsi,1),%ecx
add    $0x1,%ecx
lea    0x1(%rdx),%ebp
mov    %eax,%edx
or     %ecx,%edx
je     1180 <main+0x50>
test   %eax,%eax
je     11f0 <main+0xc0>
test   %ecx,%ecx
je     11f9 <main+0xc9>
lea    0xe2a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1188 <main+0x58>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe0d(%rip),%rdi
jmp    1183 <main+0x53>
lea    0xe0d(%rip),%rdi
jmp    1183 <main+0x53>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"FizzBuzz\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
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @strtol(i8* %10, i32* null, i32 10)
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
store i32 1, i32* %7
br label %13
13: ; preds = %45, %2
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %48
17: ; preds = %13
%18 = load i32, i32* %7
%19 = srem i32 %18, 3
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i32, i32* %7
%23 = srem i32 %22, 5
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %44
27: ; preds = %21, %17
%28 = load i32, i32* %7
%29 = srem i32 %28, 3
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %43
33: ; preds = %27
%34 = load i32, i32* %7
%35 = srem i32 %34, 5
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %42
39: ; preds = %33
%40 = load i32, i32* %7
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %39, %37
br label %43
43: ; preds = %42, %31
br label %44
44: ; preds = %43, %25
br label %45
45: ; preds = %44
%46 = load i32, i32* %7
%47 = add nsw i32 %46, 1
store i32 %47, i32* %7
br label %13
48: ; preds = %13
%49 = load i32, i32* %3
ret i32 %49
}

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 = [9 x i8] c"FizzBuzz\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtol(i8* nocapture %4, i32* null, i32 10)
%6 = trunc i64 %5 to i32
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %27, %2
ret i32 0
9: ; preds = %2, %27
%10 = phi i32 [ %28, %27 ], [ 1, %2 ]
%11 = urem i32 %10, 3
%12 = urem i32 %10, 5
%13 = icmp eq i32 %12, 0
%14 = or i32 %11, %12
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.5, i64 0, i64 0))
br label %27
18: ; preds = %9
%19 = icmp eq i32 %11, 0
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.4, i64 0, i64 0))
br label %27
22: ; preds = %18
br i1 %13, label %23, label %25
23: ; preds = %22
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %27
25: ; preds = %22
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %10)
br label %27
27: ; preds = %16, %23, %25, %20
%28 = add nuw i32 %10, 1
%29 = icmp eq i32 %10, %6
br i1 %29, label %8, label %9
}