#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*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int sscanf(char *, char *, int *);
int main(int argc, char **argv) {
  int n = 0;
  if (argc != 2 || sscanf(argv[1], "%d", &n) != 1 || n < 1) {
    puts("Usage: fizzbuzz <count>");
    exit(1);
  }
  if (n != 1) {
    sprintf(argv[1], "%d", n - 1);
    main(2, argv);
  }
  if (n % 15 == 0) {
    puts("Fizzbuzz");
  } else if (n % 5 == 0) {
    puts("Buzz");
  } else if (n % 3 == 0) {
    puts("Fizz");
  } else {
    printf("%d\n", n);
  }
}


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   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11b2 <main+0x52>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6a(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    11b2 <main+0x52>
cmpl   $0x1,-0x14(%rbp)
jge    11c8 <main+0x68>
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
cmpl   $0x1,-0x14(%rbp)
je     11fa <main+0x9a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
lea    0xe19(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1060 <main@plt>
mov    -0x14(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    121f <main+0xbf>
lea    0xe06(%rip),%rdi
call   1030 <puts@plt>
jmp    1282 <main+0x122>
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1244 <main+0xe4>
lea    0xdea(%rip),%rdi
call   1030 <puts@plt>
jmp    127d <main+0x11d>
mov    -0x14(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1269 <main+0x109>
lea    0xdca(%rip),%rdi
call   1030 <puts@plt>
jmp    1278 <main+0x118>
mov    -0x14(%rbp),%esi
lea    0xdbb(%rip),%rdi
call   1040 <printf@plt>
jmp    127d <main+0x11d>
jmp    1282 <main+0x122>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
cmp    $0x2,%edi
jne    123b <main+0xdb>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe7c(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    123b <main+0xdb>
mov    0xc(%rsp),%edx
test   %edx,%edx
jle    123b <main+0xdb>
mov    $0x1,%esi
cmp    $0x1,%edx
jne    11bb <main+0x5b>
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
jmp    1233 <main+0xd3>
mov    0x8(%rbx),%rdi
add    $0xffffffff,%edx
lea    0xe37(%rip),%rsi
call   1070 <sprintf@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1060 <main@plt>
mov    0xc(%rsp),%esi
imul   $0xeeeeeeef,%esi,%eax
add    $0x8888888,%eax
cmp    $0x11111110,%eax
jbe    121e <main+0xbe>
imul   $0xcccccccd,%esi,%eax
add    $0x19999999,%eax
cmp    $0x33333332,%eax
jbe    1227 <main+0xc7>
imul   $0xaaaaaaab,%esi,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555554,%eax
ja     11ad <main+0x4d>
lea    0xe0d(%rip),%rdi
jmp    122e <main+0xce>
lea    0xdf6(%rip),%rdi
jmp    122e <main+0xce>
lea    0xdf6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xdc1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"Usage: fizzbuzz <count>\00"
@.str.2 = [9 x i8] c"Fizzbuzz\00"
@.str.3 = [5 x i8] c"Buzz\00"
@.str.4 = [5 x i8] c"Fizz\00"
@.str.5 = [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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %18, label %9
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%14 = icmp ne i32 %13, 1
br i1 %14, label %18, label %15
15: ; preds = %9
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %15, %9, %2
%19 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %15
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %33
24: ; preds = %21
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = load i32, i32* %6
%29 = sub nsw i32 %28, 1
%30 = call i32 @sprintf(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = load i8**, i8*** %5
%32 = call i32 @main(i32 2, i8** %31)
br label %33
33: ; preds = %24, %21
%34 = load i32, i32* %6
%35 = srem i32 %34, 15
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %56
39: ; preds = %33
%40 = load i32, i32* %6
%41 = srem i32 %40, 5
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %55
45: ; preds = %39
%46 = load i32, i32* %6
%47 = srem i32 %46, 3
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %54
51: ; preds = %45
%52 = load i32, i32* %6
%53 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %51, %49
br label %55
55: ; preds = %54, %43
br label %56
56: ; preds = %55, %37
%57 = load i32, i32* %3
ret i32 %57
}

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